sdd-propose
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesdd-propose
sdd-propose
Creates a change proposal with clear intent, defined scope, and technical approach.
Triggers: , create proposal, define change, sdd proposal
/sdd-propose <change-name>创建具备明确意图、已定义范围和技术方案的变更提案。
触发方式:、create proposal、define change、sdd proposal
/sdd-propose <变更名称>Purpose
目的
The proposal defines the WHAT and WHY before entering into technical details. It is the scope contract of the change. Without an approved proposal, there are no specs or design.
提案会在深入技术细节前定义内容与原因,它是变更的范围契约。未经批准的提案无法生成规范或设计文档。
Process
流程
Skill Resolution
技能解析
When the orchestrator launches this sub-agent, it resolves the skill path using:
1. .claude/skills/sdd-propose/SKILL.md (project-local — highest priority)
2. ~/.claude/skills/sdd-propose/SKILL.md (global catalog — fallback)Project-local skills override the global catalog. See for the full algorithm.
docs/SKILL-RESOLUTION.md当编排器启动该子Agent时,它会通过以下路径解析技能:
1. .claude/skills/sdd-propose/SKILL.md (项目本地 — 优先级最高)
2. ~/.claude/skills/sdd-propose/SKILL.md (全局目录 — 备选)项目本地技能会覆盖全局目录。完整算法请参考。
docs/SKILL-RESOLUTION.mdStep 0a — Load project context
步骤0a — 加载项目上下文
Follow Section F (Project Context Load). Non-blocking.
skills/_shared/sdd-phase-common.md遵循的F部分(项目上下文加载)。此步骤为非阻塞式。
skills/_shared/sdd-phase-common.mdStep 0b — Domain context preload
步骤0b — 领域上下文预加载
This step is non-blocking: any failure (missing directory, unreadable file, no match) MUST produce at most an INFO-level note in the output. This step MUST NOT produce or on its own.
status: blockedstatus: failed-
List candidate files: list allfiles in
.md. Excludeai-context/features/and any file whose name begins with an underscore (_template.md). If the directory does not exist or is empty after exclusions, skip this step silently and proceed to Step 1._ -
Apply the filename-stem matching heuristic:
- Split the on hyphens (
<change-name>) to obtain stems.- - Discard any single-character stems.
- For each candidate file, compute its domain slug (filename without ).
.md - A match occurs when: the domain slug appears anywhere in OR any change-name stem appears anywhere in the domain slug (case-insensitive comparison).
<change-name>
- Split the
-
Load matching files: for each file that matches, read its full contents and treat them as enrichment context for proposal authoring. If multiple files match, load all of them. If a file cannot be read (e.g. permissions issue), log an INFO note and continue — do not block.
-
If no file matches: skip silently. Proceed to Step 1 without error or warning.
-
When files are loaded: note the loaded paths in the Step 6 output summary and include them in thelist (marked as read, not written).
artifacts
Algorithm reference:
stems = change_name.split("-").filter(s => s.length > 1)
for each feature_file in ai-context/features/ (excluding _ prefix files):
domain = feature_file.stem (filename without .md)
if domain in change_name OR any stem in domain -> matchExamples:
- change -> stems
add-payments-gateway-> matches[add, payments, gateway]features/payments.md - change -> stems
auth-token-refresh-> matches[auth, token, refresh]features/auth.md - change -> stems
improve-project-audit-> no match -> skip silently[improve, project, audit]
此步骤为非阻塞式:任何失败(目录缺失、文件不可读、无匹配项)最多只能在输出中生成一条INFO级别的提示。本步骤自身不得产生或状态。
status: blockedstatus: failed-
列出候选文件:列出目录下所有
ai-context/features/文件。排除.md以及所有以下划线(_template.md)开头的文件。若目录不存在或排除后为空,则静默跳过此步骤,直接进入步骤1。_ -
应用文件名主干匹配启发式算法:
- 将按连字符(
<变更名称>)拆分,得到若干主干。- - 丢弃所有单字符主干。
- 对每个候选文件,计算其领域标识(去掉的文件名)。
.md - 当以下任一情况发生时视为匹配:领域标识出现在的任意位置 OR 变更名称的任一主干出现在领域标识的任意位置(大小写不敏感比对)。
<变更名称>
- 将
-
加载匹配文件:对每个匹配的文件,读取其完整内容并将其作为提案撰写的增强上下文。若有多个文件匹配,则全部加载。若文件无法读取(如权限问题),记录一条INFO提示并继续处理 — 不得阻塞流程。
-
若无匹配文件:静默跳过。无错误或警告,直接进入步骤1。
-
若文件已加载:在步骤6的输出摘要中注明已加载的路径,并将其加入列表(标记为已读取,未写入)。
artifacts
算法参考:
stems = change_name.split("-").filter(s => s.length > 1)
for each feature_file in ai-context/features/ (excluding _ prefix files):
domain = feature_file.stem (filename without .md)
if domain in change_name OR any stem in domain -> match示例:
- 变更→ 主干
add-payments-gateway→ 匹配[add, payments, gateway]features/payments.md - 变更→ 主干
auth-token-refresh→ 匹配[auth, token, refresh]features/auth.md - 变更→ 主干
improve-project-audit→ 无匹配 → 静默跳过[improve, project, audit]
Step 0c — Spec context preload
步骤0c — 规范上下文预加载
Follow Section G (Spec Context Preload). Non-blocking.
skills/_shared/sdd-phase-common.md遵循的G部分(规范上下文预加载)。此步骤为非阻塞式。
skills/_shared/sdd-phase-common.mdStep 1 — Read prior context
步骤1 — 读取历史上下文
I load the exploration artifact from engram:
- →
mem_search(query: "sdd/{change-name}/explore")for full content.mem_get_observation(id) - If not found: skip — no prior exploration available.
If exists, I consult it for coherence.
ai-context/architecture.md我从engram中加载探索工件:
- →
mem_search(query: "sdd/{change-name}/explore")获取完整内容。mem_get_observation(id) - 若未找到:跳过 — 无可用的历史探索内容。
若存在,我会参考它以确保一致性。
ai-context/architecture.mdStep 2 — Understand the request in depth
步骤2 — 深入理解请求
If the request is ambiguous, I ask:
- What is the problem or need that motivates this change?
- Are there known constraints (performance, compatibility, etc.)?
- Are there parts that are explicitly OUT of scope?
若请求存在歧义,我会询问:
- 驱动此变更的问题或需求是什么?
- 是否存在已知约束(性能、兼容性等)?
- 是否有明确不包含在范围内的内容?
Step 3 — Write proposal
步骤3 — 撰写提案
Step 3a — Generate Supersedes section
步骤3a — 生成替代内容章节
Before writing the proposal, I scan for replacement/removal intent:
- Read the exploration artifact (if available) and check ,
## Branch Diff, and## Prior Attemptssections:## Contradiction Analysis- →
mem_search(query: "sdd/{change-name}/explore").mem_get_observation(id) - If not found: skip exploration input.
- Scan the user's description and any pre-seeded in the proposal for patterns: "remove X", "no longer X", "delete X", "replace X with Y".
## Context Notes - From the above, build the section:
## Supersedes- If nothing is being removed or replaced: state
"None — this is a purely additive change." - If removals or replacements are found: list each item under ,
### REMOVED, or### REPLACEDsubsections as appropriate.### CONTRADICTED
- If nothing is being removed or replaced: state
- Validation: if a Supersedes entry claims to "remove" something but describes adding, emit a warning and pause for user confirmation.
MUST_RESOLVE
在撰写提案前,我会扫描是否有替换/移除意图:
- 读取探索工件(若可用)并检查、
## Branch Diff和## Prior Attempts章节:## Contradiction Analysis- →
mem_search(query: "sdd/{change-name}/explore")。mem_get_observation(id) - 若未找到:跳过探索输入。
- 扫描用户描述以及提案中任何预填充的,查找如下模式:"remove X"、"no longer X"、"delete X"、"replace X with Y"。
## Context Notes - 根据上述内容构建章节:
## Supersedes- 若没有内容被移除或替换:声明
"无 — 此变更为纯新增内容。" - 若发现移除或替换内容:根据情况分别列出在、
### REMOVED或### REPLACED子章节下。### CONTRADICTED
- 若没有内容被移除或替换:声明
- 验证:若替代内容条目声称要"移除"某事物但描述的是新增操作,则发出警告并暂停以等待用户确认。
MUST_RESOLVE
Step 3b — Persist proposal
步骤3b — 持久化提案
I persist the proposal artifact to engram:
Call with , , , content = full proposal markdown. Do NOT write any file.
mem_savetopic_key: sdd/{change-name}/proposaltype: architectureproject: {project}If Engram MCP is not reachable: skip persistence. Return proposal content inline only.
Content format:
markdown
undefined我将提案工件持久化到engram:
调用,参数为、、,content = 完整的提案markdown内容。请勿写入任何文件。
mem_savetopic_key: sdd/{change-name}/proposaltype: architectureproject: {project}若无法连接到Engram MCP:跳过持久化。仅返回提案内容。
内容格式:
markdown
undefinedProposal: [change-name]
Proposal: [change-name]
Date: [YYYY-MM-DD]
Status: Draft
Date: [YYYY-MM-DD]
Status: Draft
Intent
Intent
[One clear sentence: what problem it solves or what need it covers]
[一句清晰的话:解决的问题或满足的需求]
Motivation
Motivation
[Why this is necessary now. Business or technical context.]
[为何现在需要实施此变更。业务或技术背景。]
Supersedes
Supersedes
[ALWAYS present — even if nothing is superseded. If purely additive: "None — this is a purely additive change."]
[必须存在 — 即使没有内容被替代。若为纯新增变更:"无 — 此变更为纯新增内容。"]
REMOVED (if applicable)
REMOVED(如有适用)
- [Feature or component name] () Reason: [why it is being removed]
path/to/file
- [功能或组件名称] () 原因:[移除的理由]
path/to/file
REPLACED (if applicable)
REPLACED(如有适用)
| Old | New | Reason |
|---|---|---|
| [old feature] | [new feature] | [why] |
| 旧内容 | 新内容 | 原因 |
|---|---|---|
| [旧功能] | [新功能] | [理由] |
CONTRADICTED (if applicable)
CONTRADICTED(如有适用)
- [Feature or behavior]: prior context says "[X]", this proposal says "[NOT X]" Resolution: [contract superseded / breaking change / deprecation period / stakeholder coordination required]
- [功能或行为]:历史上下文说明"[X]",本提案说明"[NOT X]" 解决方案:[契约被替代 / 破坏性变更 / 弃用周期 / 需要利益相关方协调]
Scope
Scope
Included
Included
- [deliverable 1]
- [deliverable 2]
- [deliverable 3]
- [可交付成果1]
- [可交付成果2]
- [可交付成果3]
Excluded (explicitly out of scope)
Excluded(明确排除在范围外)
- [what will NOT be done and why]
- [不会执行的内容及原因]
Proposed Approach
Proposed Approach
[High-level description of the technical solution.
Does not go into implementation detail — that is the design's job.
Explains the "how" at a conceptual level.]
[技术方案的高层描述。
不涉及实现细节 — 那是设计阶段的工作。
从概念层面解释"如何实现"。]
Affected Areas
Affected Areas
| Area/Module | Type of Change | Impact |
|---|---|---|
| [area] | New/Modified/Removed | Low/Medium/High |
| 领域/模块 | 变更类型 | 影响程度 |
|---|---|---|
| [领域] | 新增/修改/移除 | 低/中/高 |
Risks
Risks
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| [risk] | Low/Medium/High | Low/Medium/High | [how to mitigate] |
| 风险 | 发生概率 | 影响程度 | 缓解措施 |
|---|---|---|---|
| [风险] | 低/中/高 | 低/中/高 | [缓解方法] |
Rollback Plan
Rollback Plan
[How to revert if something goes wrong.
Must be concrete: which files, which commands, which steps.]
[若出现问题如何回滚。
必须具体:涉及哪些文件、哪些命令、哪些步骤。]
Dependencies
Dependencies
- [What must exist/be completed before starting]
- [Changes in other parts of the system that this requires]
- [启动前必须存在/完成的事项]
- [此变更所需的系统其他部分的变更]
Success Criteria
Success Criteria
- [measurable and verifiable criterion 1]
- [measurable and verifiable criterion 2]
- [measurable and verifiable criterion 3]
- [可衡量、可验证的标准1]
- [可衡量、可验证的标准2]
- [可衡量、可验证的标准3]
Effort Estimate
Effort Estimate
[Low (hours) / Medium (1-2 days) / High (several days)]
undefined[低(数小时)/ 中(1-2天)/ 高(数天)]
undefinedStep 4 — Preserve conversation context
步骤4 — 保留对话上下文
This step is non-blocking: if no conversation context is available, skip silently.
- Scan the user's original request and any pre-seeded in proposal for:
## Context Notes- Explicit removal/replacement intents ("remove X", "no longer needed", "delete Y")
- Platform or environment constraints ("mobile must not", "not on web", "desktop only")
- Cautions or provisional notes ("careful with Z", "provisional, pending W")
- If any of the above are found, append a section to proposal:
## Context
markdown
undefined此步骤为非阻塞式:若无可用对话上下文,静默跳过。
- 扫描用户原始请求以及提案中任何预填充的,查找:
## Context Notes- 明确的移除/替换意图("remove X"、"no longer needed"、"delete Y")
- 平台或环境约束("mobile must not"、"not on web"、"desktop only")
- 注意事项或临时说明("careful with Z"、"provisional, pending W")
- 若发现上述任何内容,在提案末尾添加章节:
## Context
markdown
undefinedContext
Context
Recorded from conversation at [YYYY-MM-DDTHH:MMZ]:
记录于对话 [YYYY-MM-DDTHH:MMZ]:
Explicit Intents
Explicit Intents
- [intent]: [exact wording or paraphrase from user]
- [意图]:[用户的原话或转述]
Platform Constraints
Platform Constraints
- [constraint]: [description]
- [约束]:[描述]
Provisional Notes
Provisional Notes
- [note]: [description and condition]
3. If nothing notable is found: skip this section — do NOT add an empty `## Context` section.- [说明]:[描述及条件]
3. 若无值得记录的内容:跳过此章节 — **请勿添加空的`## Context`章节**。Step 5 — Contradiction Resolution documentation
步骤5 — 矛盾解决文档
This step is non-blocking: only runs if contradictions were detected in exploration.
- Read the exploration artifact's section:
## Contradiction Analysis- →
mem_search(query: "sdd/{change-name}/explore")→ extract section.mem_get_observation(id) - If not found: skip — no exploration available.
- For each CERTAIN contradiction found, add a section to proposal documenting each one and its resolution approach:
## Contradiction Resolution
markdown
undefined此步骤为非阻塞式:仅当在探索阶段检测到矛盾时运行。
- 读取探索工件的章节:
## Contradiction Analysis- →
mem_search(query: "sdd/{change-name}/explore")→ 提取章节内容。mem_get_observation(id) - 若未找到:跳过 — 无可用探索内容。
- 对于每个确定的矛盾,在提案中添加章节,记录每个矛盾及其解决方法:
## Contradiction Resolution
markdown
undefinedContradiction Resolution
Contradiction Resolution
[Feature or behavior name]
[功能或行为名称]
Prior context: [what the prior spec or archived change said]
This proposal: [what this change intends to do instead]
Resolution approach: [one of: contract superseded / breaking change with migration / deprecation period / stakeholder coordination required]
3. For each **UNCERTAIN** contradiction: do NOT add it here — those may be handled by the orchestrator before propose runs as part of a multi-phase flow. If propose runs via direct invocation, document the UNCERTAIN contradictions in `## Risks` instead.历史上下文:[之前的规范或已归档变更的说明]
本提案:[此变更计划执行的内容]
解决方法:[以下选项之一:契约被替代 / 带迁移的破坏性变更 / 弃用周期 / 需要利益相关方协调]
3. 对于每个**不确定的**矛盾:请勿添加到此章节 — 这些可能会在propose运行前由编排器作为多阶段流程的一部分处理。若propose通过直接调用运行,则将不确定的矛盾记录在`## Risks`章节中。Step 6 — Summary to orchestrator
步骤6 — 向编排器提交摘要
I return a clear executive summary:
Proposal created: [change-name]
Intent: [one line]
Scope: [N deliverables included, M excluded]
Approach: [one line]
Risk: Low/Medium/High
Next step: specs + design (can run in parallel)我返回清晰的执行摘要:
已创建提案:[change-name]
意图:[一句话描述]
范围:[包含N项可交付成果,排除M项]
方案:[一句话描述]
风险:低/中/高
下一步:规范 + 设计(可并行执行)Output to Orchestrator
向编排器输出
json
{
"status": "ok|warning|blocked",
"summary": "Proposal [name]: [intent in one line]. Risk [level].",
"artifacts": ["engram:sdd/{change-name}/proposal"],
"next_recommended": ["sdd-spec", "sdd-design"],
"risks": ["[main risk if any]"]
}json
{
"status": "ok|warning|blocked",
"summary": "提案 [名称]: [一句话描述意图]. 风险 [等级].",
"artifacts": ["engram:sdd/{change-name}/proposal"],
"next_recommended": ["sdd-spec", "sdd-design"],
"risks": ["[若有主要风险]"]
}Rules
规则
- ALWAYS create the proposal — it is the entry point for all subsequent phases
- Every proposal MUST have a rollback plan and success criteria
- Success criteria must be MEASURABLE and VERIFIABLE (not vague)
- Excluded scope is as important as included scope — it prevents scope creep
- I do not go into implementation details — that is the job of
sdd-design - If the proposal is trivial (1-2 line change), I indicate it and suggest skipping the full cycle
- 始终创建提案 — 它是所有后续阶段的入口
- 每个提案必须包含回滚计划和成功标准
- 成功标准必须是可衡量、可验证的(不得模糊)
- 排除范围与包含范围同等重要 — 它能防止范围蔓延
- 我不涉及实现细节 — 那是的工作
sdd-design - 若提案内容琐碎(仅1-2行变更),我会指出并建议跳过完整流程