一键导入
ctx-spec
Scaffold a feature spec from the project template. Use when planning a new feature, writing a design document, or when a task references a missing spec.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a feature spec from the project template. Use when planning a new feature, writing a design document, or when a task references a missing spec.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
EXPERIMENTAL (discardable). Hand a loose intent spec (.context/specs/intent-<slug>.md) off to spec-kit's /speckit-specify with a prose synopsis. Optional and graceful — warns and continues if spec-kit is not installed; the intent spec stands either way. Third step of the experimental chain.
EXPERIMENTAL (discardable). Stress-test a plan through adversarial interview, then write a debated brief to .context/briefs/<TS>-<slug>.md. First step of the experimental spec-kit delegation chain: /ctx-experimental-plan → /ctx-experimental-spec → /ctx-experimental-handoff.
EXPERIMENTAL (discardable). Turn a debated brief into a LOOSE intent spec at .context/specs/intent-<slug>.md — deliberately not pre-shaped into spec-kit's template. Second step of the experimental chain: /ctx-experimental-plan → /ctx-experimental-spec → /ctx-experimental-handoff.
Run a disciplined "dream" triage pass over the gitignored ideas/ folder — classify each idea against the codebase and specs, and emit gated, provenance-bearing disposition proposals into the dreams/ notebook for human review. NEVER writes canonical memory and NEVER acts on a proposal. Use when invoked headlessly by the scheduler (cron `claude -p`) or when the user says "run the dream" / "dream over my ideas". The human reviews via /ctx-serendipity.
The human review "garden walk" over ctx-dream proposals. Reads pending proposals from the dreams/ notebook and walks the human through accept / reject / amend / skip, one at a time, substance-forward. Mechanical dispositions apply instantly; generative ones (merge, promote) are done here by reading the full source. Use when the user says "serendipity round", "review my dreams", "walk the garden", or "what did the dream find?". The dream proposes; serendipity disposes.
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.
| name | ctx-spec |
| description | Scaffold a feature spec from the project template. Use when planning a new feature, writing a design document, or when a task references a missing spec. |
Scaffold a new spec from specs/tpl/spec-template.md and walk through
each section with the user to produce a complete design document.
The project's design-to-implementation pipeline is:
/ctx-brainstorm → /ctx-plan → /ctx-spec → /ctx-implement
(vague) (contested) (committed) (execution)
/ctx-spec is the third step. It consumes the debated brief
produced by /ctx-plan (via --brief <path>) or writes a fresh
spec interactively when no brief is needed. Specs are committed
artifacts under specs/; briefs are working state under
.context/briefs/ that the spec absorbs.
Do not invert the order. A spec without a settled bet ahead of
it is a wishlist; running /ctx-plan after /ctx-spec is fixing
the foundation while the building is up.
specs/X.md" and the file does not exist/ctx-brainstorm has produced a validated design that needs
a written artifact/ctx-plan has produced a debated brief that needs a
committed spec (use --brief <path>)/ctx-brainstorm first)/ctx-plan first; its output is the brief this skill consumes)/ctx-spec
/ctx-spec (session checkpointing)
/ctx-spec (rss feed generation)
/ctx-spec --brief ideas/003-editorial-pipeline-debated-brief.md
When invoked with --brief <path>, the skill treats the file at
<path> as the authoritative source and skips the fresh-template
Q&A. Two preconditions and an authority order govern the read:
Preconditions
/ctx-plan
session or a hand-written equivalent. A casual idea note is not
a brief.Authority order when the brief, recorded decisions, frozen docs, or your inference disagree:
docs/ (release notes, public CLI docs).context/DECISIONS.md<path>TBD in the spec so it stands out for review.Never invert this order. If the brief contradicts a frozen contract, surface the contradiction to the user; do not silently follow the brief.
Flow when --brief is set
specs/tpl/spec-template.md to get the section list.TBD rather than inventing.specs/{feature-name}.md and surface the
TBD entries for the user to fill in next.--brief is absent)If not provided as an argument, ask:
"What feature should this spec cover?"
Derive the filename: lowercase, hyphens, no spaces.
Target path: specs/{feature-name}.md
If the file already exists, warn and offer to review it instead.
Read specs/tpl/spec-template.md to get the current structure.
Work through each section one at a time. For each section:
Section order and prompts:
| Section | Prompt |
|---|---|
| Problem | "What user-visible problem does this solve? Why now?" |
| Approach | "High-level: how does this work? Where does it fit?" |
| Happy Path | "Walk me through what happens when everything goes right." |
| Edge Cases | "What could go wrong? Think: empty input, partial failure, duplicates, concurrency, missing deps." |
| Validation Rules | "What input constraints are enforced? Where?" |
| Error Handling | "For each error condition: what message does the user see? How do they recover?" |
| Interface | "CLI command? Skill? Both? What flags?" |
| Implementation | "Which files change? Key functions? Existing helpers to reuse?" |
| Configuration | "Any .ctxrc keys, env vars, or settings?" |
| Testing | "Unit, integration, edge case tests?" |
| Non-Goals | "What does this intentionally NOT do?" |
Spend extra time on Edge Cases and Error Handling. These are where specs earn their value. Push for at least 3 edge cases and their expected behaviors. Do not accept "none" without challenge.
After all sections, ask:
"Anything unresolved? If not, I'll remove the Open Questions section."
Write the completed spec to specs/{feature-name}.md.
"Want me to break this into tasks in TASKS.md?"
Not every spec needs every section. If a section clearly does not apply (e.g., no CLI for an internal refactor), the user can say "skip" and the section is omitted entirely: not left with placeholder text.
Before writing the file, verify:
... text remainsspecs/{feature-name}.md