Packages a workflow that just happened into a reusable SKILL.md: reconstructs it from the session record, checks overlap with installed skills, gates on approval, then writes it following skill-authoring. Not for authoring a skill with no prior workflow; use skill-authoring.
Ships in workflow-capture. 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.
Turn a workflow that actually ran into a reusable skill. Capture the actual sequence: it reconstructs what happened from the visible session record, not from anyone's memory of it. Skip the ceremony when there is no prior workflow; a from-scratch skill is a SKILL.md written directly, following skill-authoring. skill-authoring also governs how every skill this workflow produces is written: description, body, and pruning rules live there, not here.
/skill workflow-capture [<what to distill>]
With arguments, the text names the workflow to distill; without, distill whichever workflow just ran in this session. Everything else in the request (the conversation so far) is the session record Phase 1 reconstructs from, not more arguments.
A live operator can answer Phase 2's interview and Phase 4's design gate for
real. Treat a real, answered ask_user reply as proof an operator is
present and continue asking one question per round. There is no operator in
a headless run without an --answers file: ask_user is not registered, so any call is refused as an
unregistered tool rather than answered. When that
is the run's condition, do not wait for a reply that cannot come: answer
every remaining interview question and the Phase 4 gate yourself as an
assumed-confirm monologue (state the question, give your best-grounded
answer or design choice, mark it assumed — confirm) and proceed straight
through to Phase 5, the same way as a live "looks fine, write it." A skill
file is a plain, reversible artifact under version control, not an
irreversible external action. Write it and say so in the final reply,
rather than stopping at the gate with nothing produced.
tasks sits outside this skill's tool surface (read, grep, find,
ls, context, write, ask_user) and any call is refused; the six
phases above are the plan, not a task list. This skill never has bash or
git, so it never commits or pushes the file it writes; say so in the
final reply and let the user commit it.
Before asking anything, list the concrete steps that visibly executed in this
session, in order: tools called, commands run, files touched, dispatches made,
skills activated. Cite the conversation record for each step. Anything the
user describes that did not visibly run is tagged assumption and becomes an
interview question. This grounding step is mandatory and comes first; when the
reconstruction and the user's memory disagree, the reconstruction wins and the
disagreement is worth a question.
Use ask_user with mode: "single_question", one question per round, bounded
rounds (default 8, max 12), following the plan-interview operating contract:
recommended answer first when options are natural, stop signals ("stop",
"enough", "later", cancel) respected immediately, answers translated into
compact decisions. Before the first question, read references/question-bank.md
and ask from it, roots before leaves.
Call context(scope="skills") with no name to list installed skills. Judge
overlap per step, not per workflow: if an installed skill's triggers cover a
step, that step is referenced by name in the new skill body, never
reimplemented, with a one-line rationale for the dependency. A different end
goal does not excuse reimplementing a covered step. Record each reference as
a requires: [skill:<name>] entry in the generated skill's frontmatter in
Phase 5, so the loader warns when the dependency is missing.
Present a compact design summary and wait for explicit approval. When drafting the summary, read references/design-summary.md for its format.
No skill file is written before the user approves. "Looks fine, but change X"
means revise and re-present. In a headless run with no operator (see
Arguments), treat the design as approved once it is internally consistent
with Phase 2's decisions, mark it assumed — confirm in your final reply,
and proceed to Phase 5. Do not stop the run with a presented-but-unwritten
design.
Write SKILL.md under draft-skills/<approved-name>/, outside protected active
skill and installed package roots. Follow skill-authoring's
frontmatter contract (a triggers-only third-person description) and
its pruning pass, and add requires: [skill:<name>] for every skill the
overlap check referenced. Do not try to load skill-authoring's own file mid-run
to check this: only one skill can be active at a time, and a second
context(scope="skills", name="skill-authoring") call is refused while this
skill is still pending. When writing the frontmatter or confirming it in
Phase 6, read references/frontmatter-contract.md. The proposed installation
scope defaults to project; suggest user
scope only when the user said the workflow crosses repositories. Creation here
produces a draft. The operator later reviews a portable package envelope and
installs through the hub; never write into an active skill store directly. Placeholders replace every
session-specific path, name, and value; distill the pattern, not the
incident. Keep the generated skill under 120 lines; reference instead of
inlining. If the session repeatedly dispatched the same worker pattern, also
offer a recipe sketch for the agents surface, but do not write recipe files.
Record one RED-GREEN scenario agreed with the user: the prompt, and the
observable behavior that distinguishes with-skill from without. pancode hub validate draft-skills/<approved-name>/SKILL.md needs bash, which is outside this skill's tool surface,
so never attempt it. Instead read the file back and confirm the frontmatter
contract from Phase 5 by eye (required keys present, allowed-tools entries
canonical lowercase, under the line budget), and say plainly that a real
pancode hub validate pass is still owed once bash is available.
Otherwise record the scenario in the skill body's example section as the
standing validation obligation. This skill has no bash/git, so it never
commits or pushes the file it writes; say so and let the user commit it.
When a phase's expected output is unclear, read references/worked-example.md. Before the final reply, read references/red-flags.md.
What SKILL.md sets; muted values are Claude Code's defaults
/workflow-capture:workflow-capturefrom workflow-capture
npx claudepluginhub panstudio/pancode --plugin workflow-capture