一键导入
spec-init
Bootstrap a new spec under `specs/<feature-name>/` by walking the user through requirements, design, (optional) research, and tasks in EARS/SDD format
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bootstrap a new spec under `specs/<feature-name>/` by walking the user through requirements, design, (optional) research, and tasks in EARS/SDD format
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a comprehensive install.md documentation file for an image dataset. Use when asked to document a dataset, create a dataset readme, or prepare dataset documentation.
Close out an implemented spec by reconciling the project docs with the shipped code (updating them via opus subagents if stale), then removing the resolved spec directory and its INDEX entry so code + up-to-date docs remain the source of truth.
Implement tasks from an approved spec, one at a time, with independent implementer and reviewer subagents per task. The main session acts as orchestrator only.
Implement items from a TODO file, one at a time, with independent implementer and reviewer subagents per item. The main session acts as orchestrator only.
Scan the project and create initial TODO files organized by area
Prepare a title and description for a GitLab Merge Request from the current branch to main/master, or apply them directly to an existing MR
| name | spec-init |
| description | Bootstrap a new spec under `specs/<feature-name>/` by walking the user through requirements, design, (optional) research, and tasks in EARS/SDD format |
| argument-hint | <feature-name> [short description] |
You are the spec author, guiding the user through Spec-Driven Development (SDD)
for a new feature. You create the artifacts in specs/<feature-name>/ stage by stage,
pausing for user review between stages. You do not write implementation code.
This skill is the authoritative source for SDD format and conventions (EARS requirements, lifecycle frontmatter, task table format, traceability, parallel markers). Project CLAUDE.md files provide a brief overview and language/stack style rules; this skill provides the detail.
$ARGUMENTS should start with a feature name (kebab-case, e.g. token-refresh,
nightly-eval-harness). Anything after the name is an optional one-line description.git status --porcelain to note any pre-existing uncommitted changes (for context only; do not block).specs/<feature-name>/ already exists:
specs/constitution.md. Retain it in
context -- it is binding on this spec. If a principle is going to be hard to honor for
this feature, surface it in Step 1 so the user can either re-scope or explicitly opt to
document the deviation in design.md / research.md.
specs/constitution.md does not exist, do not block: most projects start
without one. Note its absence in your Step 7 wrap-up so the user can decide whether
this is the right moment to add one.A repo can declare immutable engineering principles in specs/constitution.md. When
present, it acts as a compile-time gate for every spec: this skill reads it before
drafting, /spec-review checks the design against it, and /spec-implement passes it
to every implementer and reviewer subagent as binding context alongside design.md.
Good constitution entries are short, numbered, and testable. Examples:
1. Every public function is type-annotated; CI runs pyright in strict mode.2. No new top-level dependencies without a one-paragraph rationale in research.md.3. Integration tests must hit a real database, not a mock.4. CLIs accept --json and exit non-zero on failure.The constitution is not a style guide. Style lives in CLAUDE.md and lint configs. The constitution captures architectural non-negotiables that should outlive any single spec.
A spec is allowed to violate a constitution principle only if design.md (or
research.md) explicitly names the principle and justifies the deviation. /spec-review
will call out unjustified deviations as FAIL.
Before writing any files, interview the user to collect enough context to draft requirements. Ask concise, targeted questions in a single message; do not drip-feed one question at a time. Cover at least:
research.md.Also skim the repo (README, top-level directories, AGENTS.md/CLAUDE.md, any neighboring
specs under specs/) to ground the draft in the project's real structure. Do not read deeply
into source — the goal is context, not implementation detail.
If the user's answers are thin, say what's missing before drafting.
requirements.mdCreate specs/<feature-name>/requirements.md with:
YAML frontmatter at the very top, capturing the spec's lifecycle state:
---
status: active
started: <today's ISO date, e.g. 2026-05-15>
supersedes:
---
Fill supersedes: only if this spec replaces a prior kebab-case spec name; otherwise
leave it blank. There is no finalized: field: /spec-finalize removes the spec
entirely rather than stamping it, since code + docs become the source of truth.
Title — # Requirements: <Human Readable Feature Name>
Summary — 2–5 sentences stating goal, users, and scope. Keep one sentence terse
enough to serve as the specs/INDEX.md entry summary.
In scope / Out of scope — two short bulleted lists.
Requirements — numbered sections (## 1. <theme>), each with sub-numbered EARS
acceptance criteria (1.1, 1.2, ...). Use the five EARS patterns:
When [event], the [component] shall [action].While [condition], the [component] shall [action].If [trigger], the [component] shall [action].Where [feature is included], the [component] shall [action].The [component] shall [action]. (ubiquitous)Open questions — bulleted list of things still unresolved that affect requirements.
Rules:
[NEEDS CLARIFICATION: <what is unclear>] directly into the
requirement instead of guessing. Example:
1.3 When a token expires, the API gateway shall return a [NEEDS CLARIFICATION: 401 or 419?] response.
These markers are required to be resolved before /spec-review will pass.After writing, run npx prettier --write --print-width 120 specs/<feature-name>/requirements.md.
Then pause: print the open questions, list every [NEEDS CLARIFICATION: ...] marker
you wrote (with file + line), summarize the requirements, and ask the user to review
before moving on. Do not start design.md until the user confirms requirements are good
(or patches them first).
design.mdOnce requirements are approved, create specs/<feature-name>/design.md with sections:
requirements.md to the component(s)/section(s) in design.md that satisfy it. Every
ID must appear.Rules:
TokenStore protocol with get(key) / set(key, value)"
beats "some storage layer".uv, ruff 120, Pyright
basic, Pydantic/dataclasses split, etc.; shell scripts: 2-space indent, bash shebang; Lua:
2-space indent, single quotes; etc.).specs/constitution.md if it exists. Every constitution principle is binding on
the design by default. If the design must deviate from a principle for this feature, name
the principle explicitly and justify the deviation in a ## Constitution deviations
subsection at the bottom of design.md (or in research.md if the trade-off analysis is
longer). Unjustified deviations will fail /spec-review.[NEEDS CLARIFICATION: ...] markers for any design detail that is still unresolved
rather than inventing a plausible default. These also block /spec-review.After writing, run npx prettier --write --print-width 120 specs/<feature-name>/design.md.
research.mdCreate specs/<feature-name>/research.md only if at least one of the following is true:
requirements.md.If none apply, skip this file — do not create an empty stub.
When creating it, use sections:
Option, Why considered, Why rejected.Format with npx prettier --write --print-width 120 after writing.
/spec-reviewBefore drafting tasks.md, instruct the user (or invoke via the Skill tool if available) to
run /spec-review <feature-name>. Do not silently skip this step — the review catches
traceability gaps, EARS violations, and architecture "TBD"s that would poison the task list.
If the review returns NEEDS REVISION, fix the cited issues in requirements.md /
design.md / research.md and re-run it. Only proceed to tasks.md once the verdict is
READY (all pass, or only warns that the user accepts).
tasks.mdGenerate specs/<feature-name>/tasks.md from the approved requirements + design. The file
has three sections in this exact structure:
Task and Status.
Task is a markdown link with link text [#N](anchor), e.g.
[#1.1](#11-add-token-validation). Do not put descriptions in the cell.Status is Pending, Done, or Blocked.- 1.1 -- foundation, no deps. Use bullets so removing a completed task doesn't force
renumbering.### heading per task with:
_Requirements: 1.1, 2.3_ line at the end (must reference IDs from requirements.md).(P) marker at the start of the description for tasks with no dependency on the
immediately preceding task, paired with a _Boundary: <ComponentName>_ line._Depends: 1.1, 1.2_ metadata line listing prerequisite task IDs (since the
summary table no longer has a Depends on column).Ordering guideline: Foundation -> Core -> Integration -> Validation.
Sizing guideline: each task should be 1–3 hours of focused work. If a task is bigger, split it. If it is trivially small, merge it.
Traceability requirement: every requirement ID from requirements.md must appear in at
least one task's _Requirements:_ line. Before finishing, cross-check this and report any
orphaned requirements.
Format with npx prettier --write --print-width 120 specs/<feature-name>/tasks.md.
specs/INDEX.mdAdd (or update) a section for this spec in specs/INDEX.md. The index tracks only
active specs -- /spec-finalize removes a spec's section when it removes the spec, so
a finalized spec leaves no entry behind. If the file does not exist, create it with this
header:
# Specs Index
_One section per active spec, ordered with most recently started at the top. Specs are
removed from this index when they are finalized._
Append a section in the form:
## [<feature>](<feature>/)
- **Status:** active
- **Started:** <started-date>
- <one-sentence summary>
requirements.md -- shorten to one sentence
if necessary.<feature> already exists (e.g. user chose "augment in place" in Step 0),
update it in place rather than duplicating.Started date (most recent first).Then format: npx prettier --write --print-width 120 specs/INDEX.md.
Print a short summary:
specs/INDEX.md.(P).[NEEDS CLARIFICATION: ...] markers in requirements.md
or design.md (with file + line).specs/constitution.md was missing in Step 0, mention it once as a suggestion -- not
a blocker./spec-review <feature-name> if it was skipped, otherwise
/spec-implement <feature-name> once the user is ready to start building. Mention that
/spec-finalize <feature-name> is the closing ritual once every task is Done -- it
reconciles the docs with the shipped code and then removes the spec, leaving code +
up-to-date docs as the source of truth.Do not commit the spec files automatically. Tell the user the files are ready to stage
and commit, and offer the /commit skill if they want help with the commit message.
specs/<feature-name>/ and the repo-level specs/INDEX.md.research.md entirely when it has nothing meaningful to say.requirements.md must match one of the
five EARS patterns.[NEEDS CLARIFICATION: ...] markers when a detail
is unresolved. Never write a plausible-but-fictional default.specs/constitution.md exists, every principle is binding
unless design.md (or research.md) explicitly names the principle and justifies the
deviation.requirements.md must open with the YAML frontmatter block
described in Step 2 (status: active, started: <date>, blank supersedes:). There is
no finalized: field -- /spec-finalize removes the spec rather than stamping it. Other
files in the spec directory carry no frontmatter.specs/INDEX.md.
The index lists only active specs; finalized specs are removed from it.npx prettier --write --print-width 120 on every markdown file you create or modify
before considering the stage done.#N references anywhere — they will auto-close GitLab
issues if this lands in a commit message.