---
name: close-the-loop
description: Process a call transcript into the full post-call loop. Files the transcript, drafts a personalized Gmail follow-up in the user's voice, logs commitments, appends a touchpoint to the contact's people file, and archives the source. The Gmail draft is NEVER auto-sent. Use when the user shares a transcript and wants the *whole* post-call workflow run, says "close the loop on this call", "process and draft followup for [person]", "wrap up the call with [person]".
effort-level: medium
invocation: explicit
argument-hint: "[transcript or person name]"
---

# Close the Loop

The full post-call orchestration. One input (a transcript), four artifacts, one drafted external action that stays human.

This skill is a *chain* on top of two existing skills:

- It starts where `capture-meeting` ends: transcript filed, commitments extracted, participants identified.
- It extends with the work `follow-up-draft` does: a personalized email built in the user's voice.
- It adds the multi-write fanout: people file touchpoint, commitments ledger append, transcript archive.

If the user only wants the capture half (no email drafted), route to `capture-meeting`.
If the user only wants the email half (capture already happened), route to `follow-up-draft`.
If they want the whole loop, this is the canonical skill.

## When to fire

Trigger phrases:

- "Close the loop on this call"
- "Process my call with [person] and draft the followup"
- "Wrap up the call with [person]"
- "I just got off a call with [person] — full workflow"
- A transcript dropped into a designated `transcripts-inbox/` folder when the user has the close-the-loop pattern configured

Do NOT fire for:

- General document processing (use `file-document` or `ingest-sources`)
- Pre-meeting prep (use `meeting-prep`)
- Generic email response with no meeting context (use `draft-reply`)

## The flow

| Step | Action | Touches |
|------|--------|---------|
| 1 | File raw transcript via `memory_file` | source preservation |
| 2 | Extract decisions, commitments (yours and theirs), unresolved questions | in-memory reasoning |
| 3 | Read `people/{contact}.md` for relationship context | files |
| 4 | Read recent Gmail history with the contact (tone calibration) | Gmail connector |
| 5 | Read `voice-followup.md` if it exists | files |
| 6 | Draft personalized email in Gmail Drafts | Gmail connector (DRAFT only, never send) |
| 7 | Append dated touchpoint to `people/{contact}.md` | files |
| 8 | Append commitments to `commitments.md` with deadlines | files |
| 9 | Move transcript from `transcripts-inbox/` to `archive/transcripts/{contact}/` | files |
| 10 | Report back: "Draft ready in Gmail. Logged N commitments. Touchpoint added to [contact]'s file." | chat |

## The human gate (non-negotiable)

The email **never sends automatically**. It lands in Gmail Drafts. The user opens, reviews, edits if needed, and hits Send themselves.

This is not a limitation. It is the design. External communication is always Human-Approved. See `claudia-principles.md` § 1 (Safety First).

If a future version of this skill ever auto-sends, that is a breaking change that requires an explicit logged decision.

## Processing steps

### 1. File the source (MANDATORY)

Same as `capture-meeting`. Call `memory_file` with:

- `filename`: `YYYY-MM-DD-[contact]-[topic].md`
- `source_type`: `transcript`
- `summary`: brief one-line summary
- `about`: `[contact-slug]`
- `content`: the full raw transcript

### 2. Extract via Document Processor

Dispatch the Document Processor agent (Haiku) with `extraction_type: "memory_operations"`. The agent returns commitments, decisions, and key topics as a structured operations array. Review for accuracy before storing.

### 3. Read relationship and voice context

In parallel:

- `people/{contact}.md` (if exists; if not, plan a touchpoint entry that will create the file)
- Recent Gmail thread with the contact (last 5 to 10 messages)
- `voice-followup.md` from the user's playground or context folder

If `voice-followup.md` does not exist, fall back to a neutral professional tone and flag to the user: "I drafted in a neutral voice. Create `voice-followup.md` to personalize."

### 4. Draft the email

Follow the structure from `voice-followup.md`. Default pattern when no voice file:

- Opening: reference the call directly. No "I wanted to circle back."
- Body beat 1: what *they* said that mattered (one or two sentences).
- Body beat 2: what *you* committed to, with dates.
- Closing: one clear next step with a specific date or window.
- Signoff: "Best," then first name. No "Warm regards." No em dashes.

Create the draft via the Gmail connector. Do NOT call any send tool. The draft must remain in Drafts.

### 5. The multi-write fanout

In sequence:

- `memory_batch` with the reviewed memory operations from step 2.
- Append to `people/{contact}.md` under the History section. Newest first. Date-stamped. Format: `### YYYY-MM-DD. [Topic].`
- Append to `commitments.md` under "Active: things I owe" and "Active: things others owe me". Include source attribution: `*(source: call YYYY-MM-DD)*`.
- Move the transcript file from `transcripts-inbox/` to `archive/transcripts/{contact-slug}/`.

### 6. Report

```
Draft ready in Gmail. Open Drafts to review and send.
Logged {N} commitments to commitments.md ({M} mine, {N-M} theirs).
Touchpoint added to people/{contact}.md.
Transcript archived to archive/transcripts/{contact-slug}/.
```

If anything failed (Gmail connector expired, person file write blocked, etc.), report the failure clearly and offer the recovery path. Do not silently proceed.

## Failure modes

| Failure | Recovery |
|---------|----------|
| Transcript has missing speaker labels | List commitments under "Active: unattributed" rather than guessing who owes what |
| No `people/{contact}.md` file exists | Offer to create one with what was learned. Do not auto-create silently. |
| `voice-followup.md` missing | Use neutral tone, flag the gap to the user |
| Gmail connector expired or disconnected | Skip the draft step, log everything else, instruct the user to reconnect Gmail and re-run from step 4 |
| Multiple contacts in the transcript | Ask the user which contact "owns" the followup before drafting. Do not draft to multiple recipients. |

## See also

- `capture-meeting` — the upstream half. Use when no email is needed.
- `follow-up-draft` — the downstream half. Use when capture already happened.
- `meeting-prep` — the inverse. Use before a call, not after.
- `commitment-detector` — proactive sibling. Fires on commitments mentioned in conversation, separate from this skill which processes formal transcripts.

## AIAC context

This is the anchor workflow for the AIAC Cowork course (`~/Downloads/Claude-Cowork-Course/`). Module 3 of the course walks members through building this exact skill from the constituent capture-meeting and follow-up-draft pieces. The course's `voice-followup.md` template is the recommended companion file.
