一键导入
tdk-constitution
Create or update the project constitution and constitution-owned project knowledge artifacts from interactive or provided principle inputs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update the project constitution and constitution-owned project knowledge artifacts from interactive or provided principle inputs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
Primary implementation skill. Execute phases from plan.md ## Phases table. Read plan.md as source of truth for status + dependency graph.
Execute the implementation planning workflow using the plan template to generate design artifacts.
Create spec.md from a feature or child-slice description, or replay --interview against existing spec.md. Supports --fast, memory, and an embedded quality gate.
Project-level architecture recommendation and brownfield recovery advisor. Writes architecture reports only; does not mutate layout or config.
Deprecated compatibility route for /tdk-workspace-layout-propose.
| name | tdk-constitution |
| description | Create or update the project constitution and constitution-owned project knowledge artifacts from interactive or provided principle inputs |
| metadata | {"version":"1.0.0"} |
If ANY script returns an error, you MUST:
DO NOT:
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Use an explicit project-init branch when the user passes --init or asks to initialize
project docs/knowledge. Accepted init input is either an inline brief or a markdown file
inside the workspace.
Shared base instructions:
.specify/_shared/skills/brainstorm.md
Mode: Embedded -- reasoning technique only. DO NOT call brainstorm.py. DO NOT create separate brainstorm files. Output goes directly into constitution.md.
When to trigger: When defining or updating architectural principles:
Technique per principle:
You are creating or updating the project constitution at .specify/memory/constitution.md.
In init mode, the constitution file is create-if-missing from the bundled bootstrap source
below. In update mode, load the existing constitution and amend it. Your job is to
(a) collect/derive concrete values, (b) fill the constitution precisely, and (c) propagate
approved amendments across dependent artifacts.
Note: This is a PROJECT-LEVEL document that applies to ALL features. It does NOT require a task ID.
When running /tdk-constitution --init <brief|file>:
.specify/memory/constitution.md is missing, create it from the bundled bootstrap
source in ### Constitution Bootstrap Source, then fill placeholders from project
context and accepted user deltas..specify/memory/ is missing or memory has no memory-index.md and memory.yaml,
bootstrap memory using the tdk-memory-init contract. Fresh init must leave these
files usable for later memory flows.tdk-memory-update only after
memory-index.md exists; never use it to create first-time memory.### Arc42 And Typed Memory Templates
under memory.path from .specify/.specify.json, falling back to .specify/memory:
arc42/01-introduction-and-goals.mdarc42/02-constraints.mdarc42/03-context-and-scope.mdarc42/04-solution-strategy.mdarc42/05-building-block-view.mdarc42/06-runtime-view.mdarc42/07-deployment-view.mdarc42/08-crosscutting-concepts.mdarc42/09-architecture-decisions.mdarc42/10-quality-requirements.mdarc42/11-risks-and-technical-debt.mdarc42/12-glossary.mddecisions/{decision-id}.mdrisks-and-debt/{risk-or-debt-id}.mdquality-requirements/{quality-attribute}.mdintegrations/{integration-name}.mdoperations/{runbook-name}-runbook.mdglossary/{term}.md### Legacy Root Project Docs Policy.
They are migration inputs or compatibility stubs, not canonical targets.Use this source only when .specify/memory/constitution.md is absent in init mode:
Load: templates/constitution.md.tpl
Use these repository templates when init mode creates or updates project knowledge
artifacts. Arc42 files are summary read-models (binding: false) and must link
to typed memory files for any binding claim.
| Template | Target under memory.path |
|---|---|
.specify/templates/memory/arc42-readme-template.md.tpl | arc42/README.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/01-introduction-and-goals.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/02-constraints.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/03-context-and-scope.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/04-solution-strategy.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/05-building-block-view.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/06-runtime-view.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/07-deployment-view.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/08-crosscutting-concepts.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/09-architecture-decisions.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/10-quality-requirements.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/11-risks-and-technical-debt.md |
.specify/templates/memory/arc42-summary-template.md.tpl | arc42/12-glossary.md |
.specify/templates/memory/decision-record-template.md.tpl | decisions/{decision-id}.md |
.specify/templates/memory/risk-debt-template.md.tpl | risks-and-debt/{risk-or-debt-id}.md |
.specify/templates/memory/quality-requirement-template.md.tpl | quality-requirements/{quality-attribute}.md |
.specify/templates/memory/glossary-template.md.tpl | glossary/{term}.md |
Creation/update rules:
project-docs templates are legacy compatibility inputs only; they are
not the canonical active render path.Legacy root memory files are:
project-overview-prd.mdproduct-context.mdsystem-architecture.mdproject-roadmap.mdPolicy: report + stub.
arc42/ and typed targets.Invoke tdk-load-project-context with require_feature_dir: false and require_prefix_validation: false (no task ID needed — project-level document).
Store: PROJECT_CONTEXT.
Follow this execution flow:
Load or create .specify/memory/constitution.md.
[ALL_CAPS_IDENTIFIER].
IMPORTANT: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.Collect/derive values for placeholders:
RATIFICATION_DATE is the original adoption date (if unknown ask or mark TODO), LAST_AMENDED_DATE is today if changes are made, otherwise keep previous.CONSTITUTION_VERSION must increment according to semantic versioning rules:
Draft the updated constitution content:
Consistency propagation checklist (convert prior checklist into active validations):
.specify/templates/plan-template.md.tpl and ensure any "Constitution Check" or rules align with updated principles..specify/templates/spec-template.md.tpl for scope/requirements alignment—update if constitution
adds/removes mandatory sections or constraints.
9-section format: Problem Statement, Scope Boundary, Impact Surface, Evaluated Approaches,
User Requirements & Testing, Functional Requirements, Success Criteria,
Risks & Mitigations, Unresolved Questions, + Clarifications..specify/templates/commands/*.md (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.README.md, docs/quickstart.md, or agent-specific guidance files if present). Treat them as human-facing context, not as authority over memory.memory.path or .specify/memory:
arc42/01-introduction-and-goals.md, arc42/02-constraints.md,
arc42/03-context-and-scope.md, arc42/04-solution-strategy.md,
arc42/05-building-block-view.md, arc42/06-runtime-view.md,
arc42/07-deployment-view.md, arc42/08-crosscutting-concepts.md,
arc42/09-architecture-decisions.md, arc42/10-quality-requirements.md,
arc42/11-risks-and-technical-debt.md, arc42/12-glossary.md, plus typed
files under decisions/, risks-and-debt/, quality-requirements/, and
glossary/ when evidence exists.Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
Validation before final output:
Write the completed constitution back to .specify/memory/constitution.md (overwrite).
If init rendered project knowledge artifacts, update only AUTO-GEN sections unless the
user explicitly confirms markerless conversion.
Output a final summary to the user with:
docs: amend constitution to vX.Y.Z (principle additions + governance update)).Formatting & Style Requirements:
If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
If critical info missing (e.g., ratification date truly unknown), insert TODO(<FIELD_NAME>): explanation and include in the Sync Impact Report under deferred items.
Do not route project init through public tdk-docs; project init is owned here.