spec-capture
Save what this chat session found out into the project's memory (specs/CONTEXT.md and context/AREA.md) when the work happened outside a spec, then refresh GitRisk. Use when the user says "capture this
Files1
View on GitHubSKILL.mdplugin/skills/spec-capture/SKILL.md
GitHubCapture
Chat investigations ("why does this fail?", "where is X computed?") hold verified findings, but checkpoint only saves context for spec work. This skill saves them to the project's memory with the same rules, only after the person says yes.
Project config (read first)
Load .spec-driven.yml: walk up from the current directory to the home folder, and the first one
found wins (a multi-repo config only applies inside the repos it lists). If none is found, check
~/.spec-driven/workspaces.json, which maps each multi-repo config to its repo paths. Use the
config whose repos contain the current directory. Its values beat anything you would detect or
assume. If {specs_dir}/team.yml exists, it holds the team's shared rules: read it first, and let
.spec-driven.yml override it. This skill uses layout, repos, specs_dir and risk.enabled.
No config? Stop. Say: "This project has no .spec-driven.yml; say 'run spec-setup' first."
The context rules are in references/context-template.md inside the installed spec-setup skill
folder. Read it before writing anything.
Step 1: Gather candidates from this session only
- Go back through this conversation: files read and what they showed, commands run and their output, tests, the conclusion reached, conventions or pitfalls found, where things live, and decisions the person stated.
- Run
git status --shortandgit diff --statin each configured repo, so you know which areas changed. - Never read other sessions' transcripts,
~/.claude/projects, or any other chat history.
Step 2: Keep only confirmed, lasting findings
- For each candidate, write down its evidence: a
path:lineyou read, output you saw, a test result, or "you told me". - Drop routine progress, guesses, hypotheses never checked, anything contradicted later in the session, one-off data values, and anything secret or personal (customer names, emails, keys).
- Keep what a future change in the same area needs: the cause of a bug and where the real fix belongs, conventions, off-limits areas, pitfalls, "X is computed in Y".
- List the tempting ones you dropped as Not saved (unconfirmed), each with the reason.
Step 3: Check scope
- Collect every path each finding names. Run
spec-driven-dev scope <paths...> --jsononce. - A finding with any path that is not
inis not written. List it under Not saved (outside configured repos) with the path and the reason. Paths inside{specs_dir}are out. - A finding with no path is kept only if it is about an area already in CONTEXT.md's Areas table.
- If the CLI is not installed, apply the same rule by hand from
.spec-driven.ymland say "scope checked by hand".
Step 4: Place each finding
- Read CONTEXT.md and only the
context/<area>.mdfiles the findings touch. - Pick the area by its Where paths. Add a new area only for a folder inside scope that holds a real area (not a single helper), and add its row to Areas.
- Skip anything already recorded.
- If a finding contradicts an existing entry, show both under Conflicts. Do not rewrite. The person decides.
- Tag each line
(YYYY-MM-DD, chat), or(YYYY-MM-DD, you told me)for the person's own statements. Add a short subject so it can be traced, for example(2026-11-20, chat: login 500 for stale client). - Keep the size limits (index 60 lines, area 150): merge duplicates and move superseded lines to
context/archive.md.
Step 5: Show and confirm
- Print a table: file, section, new line.
- Print the three lists: Not saved (unconfirmed), Not saved (outside configured repos), Conflicts.
- Ask "Save these? (yes / drop N / edit N)". Write nothing until the answer is yes.
- No CONTEXT.md? Print what would be saved, suggest
spec-setupto create the context, and stop. Do not create CONTEXT.md yourself.
Step 6: Write
Append each line at the end of its section exactly as shown. Do not reorder or reformat existing
lines. Never touch the block between <!-- risk:start --> and <!-- risk:end -->.
Step 7: Refresh GitRisk
- If
risk.enabledis on or absent, andspec-driven-devis on PATH, runspec-driven-dev risk(it scores only the configured repos) and quote its hotspot summary line. - Do this even when nothing was saved, if code changed in this session.
- Never stage
context/risk.md. - If risk is off or the CLI is missing, say so in one line.
Step 8: Report
Say what was saved (count per file), what was not and why, and the GitRisk line. End with: "Next: spec-checkpoint to commit (the context lives in {specs_dir}, which may be its own repo)." Never stage, commit or push.
Rules
- Use this session only.
- Save confirmed findings only.
- Write about configured repos and packages only.
- Write nothing before a yes.
- Never stage, commit or push.
- Never edit the risk block.
- No secrets or personal data.
- The code wins: report conflicts, never rewrite to match a guess.