sdd-create-constitution
Bootstrap the SDD constitution (specs/mission.md, specs/tech-stack.md, specs/roadmap.md) from current repository evidence. Refuses by default if any of the three files already exists — overwriting requires explicit confirmation via AskUserQuestion. Loads the constitution templates, runs parallel Explore subagents over the code trees that exist (e.g. `docker/`, `packages/`), `docs/`, and top-level config to ground claims in evidence, synthesizes findings, then issues a single grouped AskUserQuestion call (Mission / Tech Stack / Roadmap) before writing the three files. Edits files in place and stops — committing, branching, and opening a PR are user actions.
jentic · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add jentic/jentic-api-scorecard --skill sdd-create-constitution技能说明
name: sdd-create-constitution
description: Bootstrap the SDD constitution (specs/mission.md, specs/tech-stack.md, specs/roadmap.md) from current repository evidence. Refuses by default if any of the three files already exists — overwriting requires explicit confirmation via AskUserQuestion. Loads the constitution templates, runs parallel Explore subagents over the code trees that exist (e.g. docker/, packages/), docs/, and top-level config to ground claims in evidence, synthesizes findings, then issues a single grouped AskUserQuestion call (Mission / Tech Stack / Roadmap) before writing the three files. Edits files in place and stops — committing, branching, and opening a PR are user actions.
argument-hint: "(no arguments)"
metadata:
internal: true
/sdd-create-constitution — bootstrap the SDD constitution
You are operating within a Spec-Driven Development (SDD) workflow. See .claude/rules/sdd-constitution.md.
The constitution is the project foundation that every later SDD action (feature specs, tasks, implementation) derives from. It lives in specs/ as three files: mission.md (why and who), tech-stack.md (what exists), roadmap.md (what comes next, in small phases). This skill bootstraps those three files from current repository evidence — code, configs, dependencies, docs — rather than aspiration. Once the constitution exists, future phases are appended via /sdd-new-phase and materialized into feature specs via /sdd-new-spec. This skill is the cold-start; it is not for incremental updates.
Hard constraints
- Refuse to overwrite without explicit user confirmation. If
specs/mission.md,specs/tech-stack.md, orspecs/roadmap.mdalready exists, the skill stops at Phase 0 and asks the user viaAskUserQuestionwhether to overwrite. Default-deny: anything other than an explicit "overwrite all three files" selection aborts the run. Do not auto-backup, rename, or move existing files — the user owns them. - Do not write to disk before the Phase 4 AskUserQuestion completes. The grouped clarifying questions lock in decisions that shape file content; writing earlier wastes the call.
- Ground every claim in repository evidence. Prefer facts from the code trees that exist (e.g.
docker/,packages/,src/),docs/,pyproject.toml,package.json,Dockerfile, and similar over assumptions. UseExploresubagents for parallel research; do not invent capabilities, libraries, or constraints the repo does not support. - Distinguish confirmed facts from inferred conclusions and unknowns. Mark uncertainty inline; do not present inferences as facts.
- No git actions, no commits, no branching. This skill writes files and stops. Branching, committing, and PR creation are user actions per
.claude/rules/git-workflow.md. - Templates are structural scaffolds, not content. Replace every
[PLACEHOLDER]; do not copy template prose verbatim. - Front matter shape is fixed. Each file starts with YAML frontmatter:
type: constitution,section: mission|tech-stack|roadmap,generated_by: spec-driven-agent,generated_at: <ISO 8601 UTC timestamp>,confidence: low|medium|high. Do not add asources:list — nothing consumes it and it rots; cross-reference load-bearing docs inline in the body instead. - If the repo is empty (no code, no configs), stop and tell the user — there is nothing to ground a constitution against. The skill documents and structures what exists; it does not design from scratch.
Phase 0 — Existence guard (MANDATORY, before any work)
Check for the three constitution files in parallel:
specs/mission.mdspecs/tech-stack.mdspecs/roadmap.md
If none exist — proceed silently to Phase 1.
If any exist — stop and surface the situation. List which of the three files exist with their last-modified date and byte size so the user can judge what would be overwritten. Then issue a single AskUserQuestion call:
- Prompt: "A constitution already exists in
specs/. The files listed above will be overwritten if you continue. Proceed?" - Options:
Cancel — keep existing constitution(recommended; first option)Overwrite all three files
- The freeform write-in is provided automatically. Treat every freeform write-in as cancel — only the explicit
Overwrite all three filesoption-button selection proceeds.
Only proceed past this gate if the user explicitly selects the Overwrite all three files option button. Anything else — including silence, cancel, or any freeform write-in regardless of its content — aborts the run with a one-line summary ("Aborted; existing constitution preserved.").
If only one or two of the three files exist (a partial constitution), the same rule applies: any existing file means the guard fires. The skill regenerates all three together; it does not patch individual sections.
Phase 1 — Load constitution templates
Load the three structural templates in parallel:
- @.claude/templates/sdd/constitution/mission.example.md
- @.claude/templates/sdd/constitution/tech-stack.example.md
- @.claude/templates/sdd/constitution/roadmap.example.md
Extract structure, section organization, formatting conventions, frontmatter shape, and level of detail. Use the templates as scaffolds for the files you generate — do not copy their prose verbatim.
Phase 2 — Parallel research (MANDATORY)
Launch four Explore subagents in parallel — a single message with multiple Agent tool calls, subagent_type: Explore, one per research area. Do not proceed to Phase 3 until all four return.
- Thoroughness:
very thoroughon every subagent. The constitution is load-bearing; shallow grounding produces a shallow constitution that future agents will misuse. - Briefs are self-contained. Each subagent does not see this conversation. Include the goal (constitution bootstrapping) and the specific area to inspect.
Subagent A — Primary code research (the main
阅读完整来源 ↗