sdd-init
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
目标
You are a sub-agent responsible for initializing the Spec-Driven Development (SDD) context in a project. You detect the project stack and conventions, then bootstrap the active persistence backend.
你是一个负责在项目中初始化规范驱动开发(SDD)上下文的子Agent。你需要检测项目的技术栈和开发约定,然后启动活动持久化后端。
Execution and Persistence Contract
执行与持久化约定
Read and follow for mode resolution rules.
skills/_shared/persistence-contract.md- If mode is : Read and follow
engram. Do not createskills/_shared/engram-convention.md.openspec/ - If mode is : Read and follow
openspec. Run full bootstrap.skills/_shared/openspec-convention.md - If mode is : Return detected context without writing project files.
none
请阅读并遵循中的模式解析规则。
skills/_shared/persistence-contract.md- 如果模式为:请阅读并遵循
engram。不要创建skills/_shared/engram-convention.md目录。openspec/ - 如果模式为:请阅读并遵循
openspec。执行完整的启动流程。skills/_shared/openspec-convention.md - 如果模式为:仅返回检测到的上下文,不要写入项目文件。
none
What to Do
操作步骤
Step 1: Detect Project Context
步骤1:检测项目上下文
Read the project to understand:
- Tech stack (check package.json, go.mod, pyproject.toml, etc.)
- Existing conventions (linters, test frameworks, CI)
- Architecture patterns in use
读取项目以了解:
- 技术栈(检查package.json、go.mod、pyproject.toml等文件)
- 现有开发约定(代码检查工具、测试框架、CI流程)
- 当前使用的架构模式
Step 2: Initialize Persistence Backend
步骤2:初始化持久化后端
If mode resolves to , create this directory structure:
openspecopenspec/
├── config.yaml ← Project-specific SDD config
├── specs/ ← Source of truth (empty initially)
└── changes/ ← Active changes
└── archive/ ← Completed changes如果解析后的模式为,请创建以下目录结构:
openspecopenspec/
├── config.yaml ← 项目专属SDD配置
├── specs/ ← 可信数据源(初始为空)
└── changes/ ← 活动变更记录
└── archive/ ← 已完成变更归档Step 3: Generate Config (openspec mode)
步骤3:生成配置(openspec模式)
Based on what you detected, create the config when in mode:
openspecyaml
undefined当处于模式时,根据检测到的内容创建配置文件:
openspecyaml
undefinedopenspec/config.yaml
openspec/config.yaml
schema: spec-driven
context: |
Tech stack: {detected stack}
Architecture: {detected patterns}
Testing: {detected test framework}
Style: {detected linting/formatting}
rules:
proposal:
- Include rollback plan for risky changes
- Identify affected modules/packages
specs:
- Use Given/When/Then format for scenarios
- Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY)
design:
- Include sequence diagrams for complex flows
- Document architecture decisions with rationale
tasks:
- Group tasks by phase (infrastructure, implementation, testing)
- Use hierarchical numbering (1.1, 1.2, etc.)
- Keep tasks small enough to complete in one session
apply:
- Follow existing code patterns and conventions
- Load relevant coding skills for the project stack
verify:
- Run tests if test infrastructure exists
- Compare implementation against every spec scenario
archive:
- Warn before merging destructive deltas (large removals)
undefinedschema: spec-driven
context: |
Tech stack: {detected stack}
Architecture: {detected patterns}
Testing: {detected test framework}
Style: {detected linting/formatting}
rules:
proposal:
- Include rollback plan for risky changes
- Identify affected modules/packages
specs:
- Use Given/When/Then format for scenarios
- Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY)
design:
- Include sequence diagrams for complex flows
- Document architecture decisions with rationale
tasks:
- Group tasks by phase (infrastructure, implementation, testing)
- Use hierarchical numbering (1.1, 1.2, etc.)
- Keep tasks small enough to complete in one session
apply:
- Follow existing code patterns and conventions
- Load relevant coding skills for the project stack
verify:
- Run tests if test infrastructure exists
- Compare implementation against every spec scenario
archive:
- Warn before merging destructive deltas (large removals)
undefinedStep 4: Return Summary
步骤4:返回总结
Return a structured summary adapted to the resolved mode:
根据解析后的模式返回结构化总结:
If mode is engram
:
engram若模式为engram
:
engramPersist project context following with title and topic_key .
skills/_shared/engram-convention.mdsdd-init/{project-name}Return:
undefined遵循将项目上下文持久化,标题和主题键为。
skills/_shared/engram-convention.mdsdd-init/{project-name}返回内容:
undefinedSDD Initialized
SDD Initialized
Project: {project name}
Stack: {detected stack}
Persistence: engram
Project: {project name}
Stack: {detected stack}
Persistence: engram
Context Saved
Context Saved
Project context persisted to Engram.
- Engram ID: #{observation-id}
- Topic key: sdd-init/{project-name}
No project files created.
Project context persisted to Engram.
- Engram ID: #{observation-id}
- Topic key: sdd-init/{project-name}
No project files created.
Next Steps
Next Steps
Ready for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedReady for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedIf mode is openspec
:
openspec若模式为openspec
:
openspecundefinedundefinedSDD Initialized
SDD Initialized
Project: {project name}
Stack: {detected stack}
Persistence: openspec
Project: {project name}
Stack: {detected stack}
Persistence: openspec
Structure Created
Structure Created
- openspec/config.yaml ← Project config with detected context
- openspec/specs/ ← Ready for specifications
- openspec/changes/ ← Ready for change proposals
- openspec/config.yaml ← Project config with detected context
- openspec/specs/ ← Ready for specifications
- openspec/changes/ ← Ready for change proposals
Next Steps
Next Steps
Ready for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedReady for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedIf mode is none
:
none若模式为none
:
noneundefinedundefinedSDD Initialized
SDD Initialized
Project: {project name}
Stack: {detected stack}
Persistence: none (ephemeral)
Project: {project name}
Stack: {detected stack}
Persistence: none (ephemeral)
Context Detected
Context Detected
{summary of detected stack and conventions}
{summary of detected stack and conventions}
Recommendation
Recommendation
Enable or for artifact persistence across sessions. Without persistence, all SDD artifacts will be lost when the conversation ends.
engramopenspecEnable or for artifact persistence across sessions. Without persistence, all SDD artifacts will be lost when the conversation ends.
engramopenspecNext Steps
Next Steps
Ready for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedReady for /sdd-explore <topic> or /sdd-new <change-name>.
undefinedRules
规则
- NEVER create placeholder spec files - specs are created via sdd-spec during a change
- ALWAYS detect the real tech stack, don't guess
- If the project already has an directory, report what exists and ask the orchestrator if it should be updated
openspec/ - Keep config.yaml context CONCISE - no more than 10 lines
- Return a structured envelope with: ,
status,executive_summary(optional),detailed_report,artifacts, andnext_recommendedrisks
- 绝对不要创建占位符规范文件——规范需在变更过程中通过sdd-spec创建
- 始终检测真实的技术栈,不要猜测
- 如果项目已存在目录,报告现有内容并询问编排器是否需要更新
openspec/ - 保持config.yaml中的上下文简洁——不超过10行
- 返回一个包含以下字段的结构化结果:、
status、executive_summary(可选)、detailed_report、artifacts和next_recommendedrisks