/sd0x-dev-flow:recap-docfrom sd0x-dev-flow
Generates a post-development recap document with file-level walkthrough, design intents, spec drift, blind spots, and anticipated questions. Use after AI implements a feature.
Ships in sd0x-dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
/recap-doc — Recap Document Generator| Scenario | Alternative |
|---|---|
| Interactive Q&A over an existing recap | /recap-ask |
| Full flow (detect + doc + Q&A) | /post-dev-recap wrapper |
| Technical share-out for other developers | /tech-brief |
| Single function explanation | /codex-explain |
| First-principles reasoning of an existing doc | /fp-brief |
/recap-doc --scope <json-path-or-inline> [--focus <str>] [--depth brief|normal|deep] [--output <path>]
| Flag | Default | Description |
|---|---|---|
--scope | required | Path to ScopeReport JSON or inline JSON string (from scripts/detect-scope.js) |
--focus | "" | Natural-language keyword to bias section emphasis (e.g. "auth middleware") |
--depth | normal | Output depth — affects top-N, section verbosity, and optional sections |
--output | auto | Output file path (see Save Behavior) |
sequenceDiagram
participant U as Caller (user or /post-dev-recap)
participant D as /recap-doc
participant S as scripts/detect-scope.js
participant T as tech-brief-style collection
participant CE as /codex-explain (Skill)
participant SR as scripts/security-redact.js
participant F as Output file
U->>D: /recap-doc --scope <json> [--depth]
D->>D: Phase 1: Load & validate ScopeReport
D->>T: Phase 2: Collect git evidence for scope.files (reuse tech-brief Stage 2)
D->>D: Phase 3: Cross-reference tech-spec (if feature_context.has_tech_spec)
D->>CE: Phase 4a: Explain top-N changed files
D->>D: Phase 4b: Synthesize sections + Blind Spots (Must) + Anticipated Questions
D->>SR: Phase 5a: Scan output for high/medium-confidence secrets
SR-->>D: Redacted or AbortError
D->>F: Phase 5b: Write briefing-recap-<date>.md
D-->>U: Emit output path + summary
--scope argument: accept file path, - for stdin, or inline JSON (detected by leading {).version === 1, source, files[], feature_context, fallback_trace.source === null or files.length === 0 → exit non-zero with message directing user to rerun scripts/detect-scope.js.scan_error gatescan_error gate. scan_error !== false ⇒ the source sets are unknown, not empty —
report it and take the ⚠️ Need Human exit rather than composing a recap from sources you could not enumerate. Gate on !== false, not
=== true: a {} payload from a shell fallback carries no such field at all, and a non-null key
is not evidence the sets are complete — scan_error rides alongside a resolved key.
This skill reaches the source sets through @skills/tech-brief/references/source-guide.md,
which it loads as its own Phase 2 strategy. Loading a reference is loading what it instructs:
there is no reading of that link under which the sets are described but not consumed, so the
gate is owed here exactly as it is in the skill that owns the file.
See references/source-guide.md for the full strategy. Summary:
git log --oneline -20 -- <path> per scope file (capped at top-N by depth)git diff --stat <base-ref>..HEAD -- <path> for magnitudeTop-N by depth: brief=5, normal=10, deep=15.
When scope.feature_context.has_tech_spec === true:
<docs_path>/2-tech-spec.mdSee references/prompt-template.md for the full prompt. Key behaviors:
/codex-explain (Skill tool call) with --lines scoped to changed hunks. Reuse, not reimplement — this satisfies NFR-5.references/output-template.md).「本輪未偵測到明顯盲點」+ 推論依據.normal/deep; omit at brief.scripts/security-redact.js and invoke redact(text) on the complete markdown output.AbortError is thrown → do not write; emit stderr with fingerprint and exit non-zero.fs.realpathSync on the first existing ancestor (must resolve inside repo root or <tmp>; no .. / external symlink).See the full matrix in references/output-template.md. Summary:
| Level | Top-N | §5 Blind Spots | §6 Anticipated Q | Code snippets |
|---|---|---|---|---|
| brief | 5 | Top-3 only | Omitted | No |
| normal | 10 | Full list | ≥ 3 | No |
| deep | 15 | Full list | ≥ 3 | Inline |
Recap output is ephemeral by default — written to the OS temp directory so the user's project tree stays clean. Callers that want the recap checked in must opt in with --output.
| Condition | Output Path |
|---|---|
Default (no --output) | <tmp>/sd0x-dev-flow-recap/briefing-recap-<YYYY-MM-DD>.md |
--output <path> provided | Explicit path; the canonical (realpath-resolved) target must lie inside either the repo root or <tmp>. Paths that escape both roots are rejected (see ## Path Security). |
Where <tmp> resolves in this order:
$TMPDIR environment variable (honoured on macOS by default).os.tmpdir() (portable fallback — in code this is require('os').tmpdir())./tmp as the final POSIX fallback.The directory <tmp>/sd0x-dev-flow-recap/ is created if missing. If the target file already exists the same day, append a numeric suffix: briefing-recap-2026-04-17-r2.md.
Permanent recap: when the user wants the recap stored with the feature docs (e.g. shareable post-mortem), invoke with --output docs/features/<key>/briefing-recap-<YYYY-MM-DD>.md explicitly.
| Rule | Implementation |
|---|---|
| Default-dir boundary | Default path is always under <tmp>/sd0x-dev-flow-recap/ (<tmp> resolved via $TMPDIR → os.tmpdir() → /tmp, see ## Save Behavior); the skill never writes under the repo without an explicit --output |
| Explicit-path allowlist | --output <path>: accept any absolute or repo-relative path whose canonical (realpath-resolved) target lies inside the repo root or <tmp>; reject .. segments that escape the resolved parent and external symlinks whose target lies outside both roots |
| Symlink check | Resolve the output path with fs.realpathSync on the first existing ancestor; reject if the resolved ancestor is neither inside the repo root (git rev-parse --show-toplevel) nor inside <tmp> |
| Secret redaction | scripts/security-redact.js — abort on high-confidence, mask medium |
| Input trust | ScopeReport JSON paths are validated before any fs read |
Target: NFR-2 — /recap-doc output generation ≤ 30s (excluding external LLM latency, measured from scope-load start to file-write complete). The Phase 4a per-file explanations should be dispatched in parallel batches to stay within budget.
See references/output-template.md for the canonical markdown template. High-level structure:
# Recap: <feature-key or "session">
> **Scope source**: ...
> **Detected at**: ...
> **Focus**: ...
> **Confidence**: ...
## 1. Overview
## 2. Changed Files (table with file:line references)
## 3. Design Decisions
## 4. Spec vs Implementation Drift (if has_tech_spec)
## 5. Blind Spots (FR-9 Must — any depth)
## 6. Anticipated Questions (normal/deep only)
## 7. Evidence (commit SHAs, file:line index)
/codex-explain invoked per top-N file (NFR-5 reuse — not reimplemented)security-redact.js invoked before write (NFR-7)fs.realpathSync) inside repo root or <tmp>; no ..; no external symlinkreferences/output-template.md — Recap doc structure + depth matrixreferences/source-guide.md — Phase 2 evidence collection (reuse tech-brief pattern)references/prompt-template.md — LLM synthesis prompt (obeys @rules/codex-invocation.md)@skills/tech-brief/references/source-guide.md — upstream pattern (read-only reference)@skills/codex-explain/SKILL.md — Phase 4a reuse targetscripts/detect-scope.js — ScopeReport v1 producer (T1)scripts/security-redact.js — Pre-write redaction (T1)scripts/config/doc-taxonomy.json L94-99 — briefing- ancillary patternInput: /recap-doc --scope /tmp/scope.json --depth normal
Action: Load scope → collect git evidence for top-10 files → /codex-explain per file → synthesize sections including Blind Spots + 3+ Anticipated Questions → security-redact → write to <tmp>/sd0x-dev-flow-recap/briefing-recap-2026-04-17.md (ephemeral default; user opts in to commit via --output)
Input: /recap-doc --scope '{"version":1,"source":"uncommitted",...}' --focus "auth" --depth brief
Action: Parse inline JSON → filter to auth-related files → top-5 only → §5 Blind Spots top-3 only → omit §6 → write to <tmp>/sd0x-dev-flow-recap/briefing-recap-<YYYY-MM-DD>.md
Input: /recap-doc --scope scope.json --depth deep --output docs/features/<key>/briefing-recap-2026-04-17.md
Action: Load scope → top-15 with inline code snippets → full §5/§6 → redact → realpath-resolve target (must be inside repo root OR <tmp>) → write. Paths that escape both roots are rejected.
What SKILL.md sets; muted values are Claude Code's defaults
102 skills in this plugin
/adrWrite an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as docs/features/<feature>/adr-<NNN>-<title>.md with a 3-digit zero-padded number. Handles the Superseded case: bidirectional linking when a new ADR replaces an old one. Use when: recording why an architectural approach was chosen, documenting a decision so it doesn't get re-litigated, marking a prior decision as superseded. Not for: feature-level technical design (use /tech-spec), task progress tracking (use /create-request), bulk backfill of historical decisions (a separate request — this skill writes one ADR at a time)./agentctl-setupInstall and set up the optional agentctl mod (task scope, refusal before execution, evidence that goes stale, model-free hand-over) — checks the environment, installs after approval, builds the first task line, optional deny rules, uninstall/architectureArchitecture design and documentation. Produces 3-architecture.md with component diagrams, data flow, integration points, and architecture decisions. Reads existing tech-spec as input. Use when: designing system architecture, documenting component interactions, creating architecture docs, producing 3-architecture.md. Not for: tech spec writing (use tech-spec), code implementation (use feature-dev), architecture consulting only (use codex-architect)./askContext-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code trace (use code-explore). Output: structured answer with source attribution./best-practicesIndustry best practices conformance audit with mandatory adversarial debate. Produces audit artifact: verdict (OK/WARN/FAIL) + gap roadmap + debate proof. Use when: auditing current implementation against industry standards, checking compliance with best practices, benchmarking implementation quality, verifying a codebase meets a standard. Not for: broad research/discovery without audit target (use /deep-research), code review (use /codex-review), architecture design (use /codex-architect)./bug-fixBug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev), understanding code (use code-explore). Output: fix + regression test + review gate.npx claudepluginhub sd0xdev/sd0x-harness --plugin sd0x-dev-flowOther plugins' skills for the same job