--- name: reflect description: Spawn three parallel review subagents over the active transcript, surface learnings, and route each to a concrete edit on an existing skill. Use when the user says reflect. disable-model-invocation: true --- # Reflect Mine the current conversation for durable learnings, then route them into skill edits. Invoke when the user says "reflect" or "/reflect". Skip when the conversation is trivial, off-topic, or already covered by an existing skill the parent followed correctly. One-offs are not learnings. ## 1. Locate the active transcript Before fanning out, find this conversation's transcript. Read only this workspace's history. Reading other projects' folders crosses workspace boundaries and exposes private chats from unrelated projects. - **In T3.** Call `orchestrator_capabilities`. Its `parentThreadId` is this thread's id. The transcript is that thread, read with `t3_thread_read`. - **Claude Code fallback.** List `~/.claude/projects//`, where `` is the workspace path with each `/` and `.` changed to `-`: ```bash ls -t ~/.claude/projects//*.jsonl 2>/dev/null | head -10 ``` For each candidate, find the first `"type":"user"` line. Take the file whose message matches the conversation's opening user prompt. Subagent transcripts sit in `/subagents/`. - **Codex lead.** Search `~/.codex/sessions/` the same way. If none matches, pass a tight digest of the session instead. See "Transcripts and history" in [`/docs/t3.md`](../../docs/t3.md). ## 2. Spawn three reviewers in parallel One message, three spawns, each with the tool `docs/t3.md` names for its seat's provider: native `Agent` with `subagent_type: "general-purpose"` for a Claude seat when the lead is Claude Code, `delegate_task` with `role: "review"` otherwise. Do not use `Explore`. Reviewers need MCP access to look up the tickets, chat threads, and observability traces the transcript references. The templates tell them not to edit files. Check `git status` afterward and revert anything they wrote. Each reviewer and the synthesizer name a role line. Use that line in `~/.config/pstack/models.md`, else the default in `/docs/models.md`. A `session` seat runs on the lead's own model. When a seat is unavailable, apply the fallback rule in `docs/models.md` and say which seat you substituted. Pick each subagent's effort for the job, per the Subagents section of the **poteto-mode** skill. | Lens | Role line | Default seat | Prompt template | |---|---|---|---| | Judgment | `reflect judgment, divergent, synthesizer` | `claudeAgent/claude-opus-5-5@xhigh` | `references/judgment-reviewer.md` | | Tooling | `reflect tooling` | `cursor/grok@xhigh` | `references/tooling-reviewer.md` | | Divergent | `reflect judgment, divergent, synthesizer` | `claudeAgent/claude-opus-5-5@xhigh` | `references/divergent-reviewer.md` | Pass each template verbatim, substituting the transcript (the T3 `threadId`, or the absolute jsonl path) or the digest where marked. A `delegate_task` child has no parent history, so the template plus that substitution is its whole brief. Keep every `taskId`. Reviewers return findings in their final response. ## 3. Synthesize One spawn on the `reflect judgment, divergent, synthesizer` line (default `claudeAgent/claude-opus-5-5@xhigh`), with the same tool choice and MCP access as the reviewers. It spot-verifies citations through MCP. Pass `references/synthesizer.md` verbatim, with each reviewer's full output inlined where marked. It returns an Accepted / Rejected / Backlog list. ## 4. Structural enforcement check Move any Accepted item that a lint rule, script, metadata flag, or runtime check would enforce more reliably to Backlog. See the **encode-lessons-in-structure** principle skill. ## 5. Apply Present the synthesizer's full Accepted / Rejected / Backlog output and wait for explicit approval before applying any Accepted edit. The user picks the subset and may redirect routings. Skill changes affect every future agent in the org. Do not auto-apply. File each Backlog item to your team's devex or backlog tracker without waiting. Only the Accepted list waits for approval. Skills live in two source repos. pstack skills are in `~/src/subhan-io/pstack/skills/`, a checkout of `subhan-io/pstack`. The user's own skills are in `~/src/subhan-io/skills/plugins/`, a checkout of `subhan-io/skills`. Never edit the installed copies under `~/.claude/plugins/` or `~/.codex/plugins/`, since the next update overwrites them. Edit the files in the repo that owns the routed skill. Leave every change uncommitted, and tell the user which repo each change sits in. Never commit or push. Follow each approved row's Routing exactly: - Trivial existing-skill edit (a one-line bullet, a tightened sentence, a stale fact corrected): the parent does it directly. - Substantive existing-skill edit (a new section, a new pattern table, more than ~10 lines): hand to the **writing-for-agents** skill and follow it. - `tune description: ` (the skill exists but didn't trigger when it should have): hand to **writing-for-agents** to rewrite the description. - `new skill via writing-for-agents: `: hand creation to **writing-for-agents**. Do not invent the shape ad hoc. If your environment ships a SKILL.md validator, run it on every touched skill before declaring done. ## 6. Summarize for the user Short list, no preamble: - Edits applied: ``. What changed, one line each. - New skills created: ``. One line each (rare). - Backlog filed to the devex tracker: `` (``). One line each. - Dropped: one line per rejected finding + reason from the synthesizer.