sdd-new-spec
Scaffold a feature spec for a roadmap phase and open it as a PR for human review. Reads specs/roadmap.md, lets the user pick a phase (or accepts one as argument), runs preflight checks, cuts a feature branch, writes specs/YYYY-MM-DD-<slug>/ (requirements.md, plan.md, validation.md — grounded in specs/mission.md and specs/tech-stack.md), commits, pushes, and opens a PR. Makes zero code changes — the PR is for review of the spec itself; implementation follows in a separate PR once the spec is approved. Groups clarifying questions (one per output file) via AskUserQuestion before any disk write.
jentic · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add jentic/jentic-api-scorecard --skill sdd-new-spec技能说明
name: sdd-new-spec description: Scaffold a feature spec for a roadmap phase and open it as a PR for human review. Reads specs/roadmap.md, lets the user pick a phase (or accepts one as argument), runs preflight checks, cuts a feature branch, writes specs/YYYY-MM-DD-/ (requirements.md, plan.md, validation.md — grounded in specs/mission.md and specs/tech-stack.md), commits, pushes, and opens a PR. Makes zero code changes — the PR is for review of the spec itself; implementation follows in a separate PR once the spec is approved. Groups clarifying questions (one per output file) via AskUserQuestion before any disk write. argument-hint: "[phase-number | "phase title fragment"] (optional)" metadata: internal: true
/sdd-new-spec — scaffold a feature spec for a roadmap phase
You are operating within a Spec-Driven Development (SDD) workflow. See .claude/rules/sdd-constitution.md.
The constitution (mission / tech-stack / roadmap) already exists in specs/. This skill takes one phase from specs/roadmap.md and turns it into a workable feature spec — a dated directory under specs/ with three files: requirements (what + why), plan (how), validation (done).
Inputs
Argument in $ARGUMENTS (optional):
- empty → list candidate phases and ask the user to pick
- integer (
1,7) → use that phase number directly - title fragment (
"local service routing") → case-insensitive match against phase titles; if ambiguous, list matches and ask
Hard constraints
- Spec-only — zero code changes. This skill never modifies any code tree,
docs/,CLAUDE.md, or any implementation/doc file outsidespecs/<date>-<slug>/. It does not run test suites or linters against code. The only files it touches are the three it scaffolds. The PR it opens is for review of the spec itself; the implementation that the spec describes happens in a follow-up PR. - Do not write to disk before the Phase 4 AskUserQuestion step completes. The grouped questions exist to lock in decisions that shape the files; writing early wastes the call.
- AskUserQuestion groups exactly three questions, one per output file (requirements, plan, validation). Issue them in a single call.
- Do not create a new roadmap phase. If the user wants one, tell them edits to
specs/roadmap.mdare a separate explicit action — this skill only materializes existing phases. - Ground every requirement and constraint in
specs/mission.md,specs/tech-stack.md, or the roadmap phase itself. Do not invent scope the sources do not support. - PR contains the spec, nothing else. Staged set must be exactly the three files under
specs/<date>-<slug>/before committing. If anything else appears, stop and surface it.
Phase 0 — Preflight
Run these checks in parallel. Stop with a clear message on any failure — do not auto-fix, do not stash, do not force.
git status --porcelainis empty (working tree clean)- Current branch is
main git fetch origin mainsucceeds; localmainis not behindorigin/main. If behind and fast-forwardable, offergit pull --ff-onlyand wait for user confirmation. If diverged, stop.gh auth statussucceeds — fail fast here ifghis not installed or not authenticated; Phase 8 depends on it.
Then load context in parallel:
- @specs/mission.md
- @specs/tech-stack.md
- @specs/roadmap.md
- @specs/lessons.md
- @.claude/rules/git-workflow.md
- @.claude/rules/conventional-commits.md
- @.claude/rules/karpathy-guidelines.md
After loading, scan specs/lessons.md for any lessons that apply to the phase being scaffolded. Carry the relevant ones into Phase 4 (use them to shape AskUserQuestion options where appropriate) and Phase 6 (apply them when writing requirements / plan / validation content). Mention in Phase 9 which lessons influenced this scaffold. The lessons file is operational, not load-bearing: a lesson that does not apply to this phase is fine to skip — do not force-fit guidance.
Phase 1 — Pick a roadmap phase
Parse phases from specs/roadmap.md — the ## Phase N — <title> blocks. Ignore the Later Phases (Not Yet Planned) section.
For each phase extract: number, title, **Goal:**, **Depends on:**, **Priority:**, and a completed flag set when the heading ends with ✅ (space + U+2705 checkmark). Active phases (no ✅) are the candidate pool; completed phases (✅) are skipped from selection but used to resolve Depends on: references.
Parsing **Depends on:** — the value is one or more comma-separated dependency references; trim each.
- A reference of the form
none(optionally followed by a parenthetical rationale, e.g.none (self-contained gate change)) means the phase has no dependency; produce an empty list and skip resolution. - For every other reference, strip any trailing
(<rationale>)parenthetical to recover the bare phase-title fragment, then resolve it case-insensitively against the headings parsed above via substring match (the fragment must appear inside one and only one heading). Substring matching handles short fragments likeBackend Unit Test Coveragecorrectly even when the canonical heading is longer; if a fragment matches more than one heading, surface the ambiguity and stop.
A phase is a candidate when it is active and every resolved dependency carries ✅ on its heading (i.e. that dependency has shipped per the lifecycle rule). Active phases with still-pending dependencies (resolved phases whose heading lacks ✅) are valid to pick but must be flagged. A reference that resolves to no phase at all — and is not the none form above — is a malformed roadmap; surface the mismatch and stop.
If $ARGUMENTS identifies exactly one phase, jump straight to showing that phase's full block and confirm with the user before continuing.
Otherwise present candidates as a compact list:
N. <title> — priority: <High|Medium|Low> — deps: <satisfied|pending: <names>>
goal: <one-line goal
阅读完整来源 ↗