بنقرة واحدة
sdd-init
Initialize AI-SDD workflow in the current project. Sets up CLAUDE.md and generates document templates.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Initialize AI-SDD workflow in the current project. Sets up CLAUDE.md and generates document templates.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Analyze and extract requirements from use case diagram. Use when extracting UR/FR/NFR from use cases or when called by generate-prd.
Check consistency between implementation code and design documents (design), detecting discrepancies
Generate quality assurance checklists from specifications and plans with structured IDs and categories
Analyze specifications and generate clarification questions to eliminate ambiguity before implementation
Define and manage non-negotiable project principles (Constitution) and verify synchronization with other documents
Automatically executed during document updates or before implementation to check consistency between PRD ↔ *_spec.md ↔ *_design.md. Detects missing requirement ID (UR/FR/NFR) references, data model mismatches, API definition discrepancies, terminology inconsistencies, and ensures traceability between documents.
| name | sdd-init |
| description | Initialize AI-SDD workflow in the current project. Sets up CLAUDE.md and generates document templates. |
| argument-hint | [--ci] |
| license | MIT |
| user-invocable | true |
| disable-model-invocation | true |
| agent | haiku |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
Initialize AI-SDD (AI-driven Specification-Driven Development) workflow in the current project.
CLAUDE.md${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.md (if not exist)${SDD_ROOT}/ directory (if not exist)Note: The detailed AI-SDD guide (directory structure, file naming, doc-link convention) lives in
.claude/rules/ai-sdd-instructions.md, a path-scoped rule that loads only when working under.sdd/. That file is created and version-synced automatically by the SessionStart hook (session-start.py), not by this command, so the always-loadedCLAUDE.mdstays minimal. It is a single English file (agent-facing guidance, not a human-facing document) regardless ofSDD_LANG.
$ARGUMENTS
| Argument | Required | Description |
|---|---|---|
--ci | - | CI/non-interactive mode. Auto-approves overwrites, skips user confirmations |
Read version from plugin's plugin.json.
plugin.json path (search in the following order and use the first file found):
$CLAUDE_PLUGIN_ROOT/.claude-plugin/plugin.json (Claude Code environment variable)plugins/sdd-workflow/.claude-plugin/plugin.json (from project root - for plugin development)Steps:
plugin.jsonversion field value (e.g., "2.3.0"){PLUGIN_VERSION} in subsequent processingImportant: The CLAUDE.md section title must include this version (e.g., ## AI-SDD Instructions (v2.3.0))
Before execution, read the AI-SDD principles document.
AI-SDD principles document path: ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/AI-SDD-PRINCIPLES.md
Note: ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/AI-SDD-PRINCIPLES.md is automatically updated at session start (via session-start hook). This command
does not need to manually copy it.
Understand AI-SDD principles.
This command initializes the project following AI-SDD principles.
Note: Configuration file management is handled by init-structure.py (Phase 1). The script automatically:
.sdd-config.json exists at project rootreferences/sdd_config_default.md for the exact
content.Note: The lang field determines the language for templates (en or ja).
Important: If you want to use custom directory names, create .sdd-config.json before running this command.
| Template | Source |
|---|---|
| Constitution | /constitution skill's templates/${SDD_LANG:-en}/constitution_template.md |
| PRD | /generate-prd skill's templates/${SDD_LANG:-en}/prd_template.md |
| Specification | /generate-spec skill's templates/${SDD_LANG:-en}/spec_template.md |
| Design Doc | /generate-spec skill's templates/${SDD_LANG:-en}/design_template.md |
Output templates are located under templates/${SDD_LANG:-en}/ within this skill directory.
The SDD_LANG environment variable determines the language (default: en).
Optimized 2-Phase Execution (reduces tool calls by 60-70%):
Execute ${CLAUDE_PLUGIN_ROOT}/skills/sdd-init/scripts/init-structure.py to perform static file operations.
What the script does:
Manage Configuration File:
.sdd-config.json existsEnsure Root Directory Exists:
mkdir -p "${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/"Copy Templates (if not exist):
/generate-prd skill)/generate-spec skill)/generate-spec skill)/constitution init to generate a customized versionCleanup:
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/UPDATE_REQUIRED.md if existsExport Environment Variables to $CLAUDE_ENV_FILE:
SDD_ROOT, SDD_LANG, SDD_*_DIR, SDD_*_PATHScript execution: python3 "${CLAUDE_PLUGIN_ROOT}/skills/sdd-init/scripts/init-structure.py"
Note: The script reads configuration from .sdd-config.json
and uses $CLAUDE_ENV_FILE to export variables for Claude's prompt context.
Execute ${CLAUDE_PLUGIN_ROOT}/skills/sdd-init/scripts/update-claude-md.py to automatically update CLAUDE.md.
What the script does:
plugin.jsontemplates/${SDD_LANG}/claude_md_template.md and replace {PLUGIN_VERSION}Script execution: python3 "${CLAUDE_PLUGIN_ROOT}/skills/sdd-init/scripts/update-claude-md.py"
Note: The script automatically detects the current state and performs the appropriate operation.
Read templates/${SDD_LANG:-en}/claude_md_template.md and add its content to CLAUDE.md.
Note: Replace {PLUGIN_VERSION} in the template with the plugin version obtained in prerequisites.
## AI-SDD Instructions (v2.2.0))${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/AI-SDD-PRINCIPLES.md if not existsRe-running /sdd-init on an existing project automatically handles version upgrades:
AI-SDD-PRINCIPLES.md if not existsDetection Method:
## AI-SDD Instructions section with older version${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/AI-SDD-PRINCIPLES.md doesn't existNote: After re-initialization, recommend /recommend-front-matter to add YAML front matter to existing documents that were created before v3.2.0.
Note: CONSTITUTION.md is NOT generated by /sdd-init. Use /constitution init instead.
A Project Constitution (CONSTITUTION.md) defines non-negotiable principles that form the foundation of all design decisions.
| Characteristic | Description |
|---|---|
| Non-negotiable | Not open to debate. Changes require careful consideration |
| Persistent | Consistently applied across the entire project |
| Hierarchical | Higher principles take precedence over lower ones |
| Verifiable | Can automatically verify spec/design compliance with principles |
Use /constitution init command to generate a customized CONSTITUTION.md:
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.mdDo NOT manually copy constitution_template.md - the template is meant to be customized for your specific project.
Use /constitution command to manage the constitution:
| Subcommand | Purpose |
|---|---|
init | Generate customized constitution file |
validate | Verify specs/designs comply with constitution |
add | Add new principles |
sync | Synchronize templates with constitution |
Note: Template generation is handled by init-structure.py (Phase 1).
All templates are copied from skill directories if they don't already exist.
| Template | Path | Purpose |
|---|---|---|
| Project Constitution | ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.md | Non-negotiable principles |
| PRD Template | ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/PRD_TEMPLATE.md | SysML-format requirements doc |
| Spec Template | ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/SPECIFICATION_TEMPLATE.md | Abstract system specification |
| Design Template | ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/DESIGN_DOC_TEMPLATE.md | Technical design document |
The shell script:
templates/${SDD_LANG:-en}/ directoryNote: Templates are copied as-is. For project-specific customization, users can manually edit templates after initialization.
After Phase 1 and Phase 2 complete:
.sdd-config.json exists${SDD_ROOT}/, recommend running /recommend-front-matter to add structured metadataNote: Both scripts output their results to stdout. Simply report what the scripts indicate.
Important: CONSTITUTION.md is NOT generated by /sdd-init. Remind users to run /constitution init if they need it.
Note: Cleanup is handled by init-structure.py (Phase 1).
The script automatically deletes ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/UPDATE_REQUIRED.md if it exists. This file is created by the session-start
hook when version mismatch is detected, and becomes unnecessary after initialization.
Use the templates/${SDD_LANG:-en}/init_output.md template for output formatting.