Loading...
Loading...
Compare original and translation side by side
references/references/erDiagram
VISION ||--o{ EPIC : "parent-vision"
VISION ||--o{ JOURNEY : "parent-vision"
EPIC ||--o{ SPEC : "parent-epic"
EPIC ||--o{ STORY : "parent-epic"
JOURNEY ||--|{ PAIN_POINT : "PP-NN"
PAIN_POINT }o--o{ EPIC : "addresses"
PAIN_POINT }o--o{ SPEC : "addresses"
PAIN_POINT }o--o{ STORY : "addresses"
PERSONA }o--o{ JOURNEY : "linked-personas"
PERSONA }o--o{ STORY : "linked-stories"
ADR }o--o{ SPEC : "linked-adrs"
ADR }o--o{ EPIC : "linked-epics"
SPEC }o--o{ SPIKE : "linked-research"
SPEC ||--o| IMPL_PLAN : "seeds"
RUNBOOK }o--o{ EPIC : "validates"
RUNBOOK }o--o{ SPEC : "validates"
BUG }o--o{ SPEC : "affected-artifacts"
BUG }o--o{ EPIC : "affected-artifacts"
BUG ||--o| IMPL_PLAN : "fix-ref"
SPIKE }o--o{ ADR : "linked-research"
SPIKE }o--o{ EPIC : "linked-research"
SPIKE }o--o{ BUG : "linked-research"
DESIGN }o--o{ EPIC : "linked-designs"
DESIGN }o--o{ STORY : "linked-designs"
DESIGN }o--o{ SPEC : "linked-designs"
DESIGN }o--o{ BUG : "linked-designs"
EPIC {
string parent_vision FK
list success_criteria "required"
list depends_on "optional"
}
JOURNEY {
string parent_vision FK
list linked_personas "optional"
}
SPEC {
string parent_epic FK
list linked_research "optional"
list linked_adrs "optional"
list addresses "optional"
}
STORY {
string parent_epic FK
list addresses "optional"
}
ADR {
list linked_epics "optional"
list linked_specs "optional"
}
PERSONA {
list linked_journeys "optional"
list linked_stories "optional"
}
RUNBOOK {
list validates "required"
string parent_epic "optional"
string mode "agentic or manual"
string trigger "required"
}
BUG {
string severity "critical/high/medium/low"
list affected_artifacts "optional"
string discovered_in "required"
string fix_ref "optional"
}
SPIKE {
string question "required"
string gate "required"
list depends_on "optional"
}
DESIGN {
string superseded_by "optional"
list linked_epics "optional"
list linked_stories "optional"
list linked_specs "optional"
list linked_bugs "optional"
list depends_on "optional"
}
IMPL_PLAN {
string origin_ref "SPEC-NNN"
list spec_tags "mutable"
}||--o{}o--o{depends-on:erDiagram
VISION ||--o{ EPIC : "parent-vision"
VISION ||--o{ JOURNEY : "parent-vision"
EPIC ||--o{ SPEC : "parent-epic"
EPIC ||--o{ STORY : "parent-epic"
JOURNEY ||--|{ PAIN_POINT : "PP-NN"
PAIN_POINT }o--o{ EPIC : "addresses"
PAIN_POINT }o--o{ SPEC : "addresses"
PAIN_POINT }o--o{ STORY : "addresses"
PERSONA }o--o{ JOURNEY : "linked-personas"
PERSONA }o--o{ STORY : "linked-stories"
ADR }o--o{ SPEC : "linked-adrs"
ADR }o--o{ EPIC : "linked-epics"
SPEC }o--o{ SPIKE : "linked-research"
SPEC ||--o| IMPL_PLAN : "seeds"
RUNBOOK }o--o{ EPIC : "validates"
RUNBOOK }o--o{ SPEC : "validates"
BUG }o--o{ SPEC : "affected-artifacts"
BUG }o--o{ EPIC : "affected-artifacts"
BUG ||--o| IMPL_PLAN : "fix-ref"
SPIKE }o--o{ ADR : "linked-research"
SPIKE }o--o{ EPIC : "linked-research"
SPIKE }o--o{ BUG : "linked-research"
DESIGN }o--o{ EPIC : "linked-designs"
DESIGN }o--o{ STORY : "linked-designs"
DESIGN }o--o{ SPEC : "linked-designs"
DESIGN }o--o{ BUG : "linked-designs"
EPIC {
string parent_vision FK
list success_criteria "required"
list depends_on "optional"
}
JOURNEY {
string parent_vision FK
list linked_personas "optional"
}
SPEC {
string parent_epic FK
list linked_research "optional"
list linked_adrs "optional"
list addresses "optional"
}
STORY {
string parent_epic FK
list addresses "optional"
}
ADR {
list linked_epics "optional"
list linked_specs "optional"
}
PERSONA {
list linked_journeys "optional"
list linked_stories "optional"
}
RUNBOOK {
list validates "required"
string parent_epic "optional"
string mode "agentic or manual"
string trigger "required"
}
BUG {
string severity "critical/high/medium/low"
list affected_artifacts "optional"
string discovered_in "required"
string fix_ref "optional"
}
SPIKE {
string question "required"
string gate "required"
list depends_on "optional"
}
DESIGN {
string superseded_by "optional"
list linked_epics "optional"
list linked_stories "optional"
list linked_specs "optional"
list linked_bugs "optional"
list depends_on "optional"
}
IMPL_PLAN {
string origin_ref "SPEC-NNN"
list spec_tags "mutable"
}||--o{}o--o{depends-on:specwatch.shdocs/[text](path/to/file.md)depends-onparent-*linked-*addressesvalidatesaffected-artifactssuperseded-byfix-refscripts/specwatch.sh| Command | What it does |
|---|---|
| Run a full stale-reference scan (no watcher needed) |
| Start background filesystem watcher (requires |
| Stop a running watcher |
| Show watcher status and log summary |
| Refresh the sentinel keepalive timer |
.agents/specwatch.logspecwatch.log.gitignoreSTALE <source-file>:<line>
broken: <relative-path-as-written>
found: <suggested-new-path>
artifact: <TYPE-NNN>
STALE_REF <source-file>:<line> (frontmatter)
field: <frontmatter-field-name>
target: <TYPE-NNN>
resolved: NONE
issue: unresolvable artifact ID
WARN <source-file>:<line> (frontmatter)
field: <frontmatter-field-name>
target: <TYPE-NNN>
resolved: <relative-path-to-target>
issue: <target is Abandoned | source is X but target is still Y>specwatch.shdocs/[text](path/to/file.md)depends-onparent-*linked-*addressesvalidatesaffected-artifactssuperseded-byfix-refscripts/specwatch.sh| 命令 | 功能 |
|---|---|
| 执行完整的过期引用扫描(无需监控器) |
| 启动后台文件系统监控器(需要 |
| 停止运行中的监控器 |
| 显示监控器状态和日志摘要 |
| 刷新哨兵保活计时器 |
.agents/specwatch.log.gitignorespecwatch.logSTALE <source-file>:<line>
broken: <relative-path-as-written>
found: <suggested-new-path>
artifact: <TYPE-NNN>
STALE_REF <source-file>:<line> (frontmatter)
field: <frontmatter-field-name>
target: <TYPE-NNN>
resolved: NONE
issue: unresolvable artifact ID
WARN <source-file>:<line> (frontmatter)
field: <frontmatter-field-name>
target: <TYPE-NNN>
resolved: <relative-path-to-target>
issue: <target is Abandoned | source is X but target is still Y>scripts/specwatch.sh scan.agents/specwatch.logwatchfswatchscripts/specwatch.sh scan.agents/specwatch.logwatchfswatchspecgraph.sh/tmp/docs/*.mdscripts/specgraph.sh| Command | What it does |
|---|---|
| Default. Hierarchy tree with status indicators + execution tracking |
| Force-rebuild graph from frontmatter |
| What does this artifact depend on? (direct dependencies) |
| What depends on this artifact? (inverse lookup) |
| Transitive dependency tree (all ancestors) |
| Active/Planned artifacts with all deps resolved |
| What to work on next (ready items + what they unblock, blocked items + what they need) |
| Mermaid diagram to stdout |
| Summary table by type and phase |
blocks <ID>readytree <ID>specgraph.sh/tmp/docs/*.mdscripts/specgraph.sh| 命令 | 功能 |
|---|---|
| 默认命令。带状态标识的层级树 + 执行追踪信息 |
| 强制从前置元数据重建图谱 |
| 查询指定工件依赖的对象(直接依赖) |
| 查询依赖指定工件的对象(反向查找) |
| 查询传递依赖树(所有祖先节点) |
| 查询所有依赖已解决的活跃/规划中工件 |
| 查询下一步工作内容(可开展项及其解锁的任务、阻塞项及其所需依赖) |
| 向标准输出输出Mermaid图 |
| 按工件类型和阶段生成汇总表格 |
blocks <ID>readytree <ID>undefinedundefined| Phase | Date | Commit | Notes |
|---|---|---|---|
| Planned | 2026-02-24 | abc1234 | Initial creation |
| Active | 2026-02-25 | def5678 | Dependency X satisfied |
Commit hashes reference the repo state at the time of the transition, not the commit that writes the hash stamp itself. Commit the transition first, then stamp the resulting hash into the lifecycle table and index in a second commit. This keeps the stamped hash reachable in git history.| 阶段 | 日期 | 提交哈希 | 备注 |
|---|---|---|---|
| Planned | 2026-02-24 | abc1234 | 初始创建 |
| Active | 2026-02-25 | def5678 | 依赖项X已满足 |
提交哈希引用的是阶段流转时的仓库状态,而非写入该哈希戳的提交。需先提交流转变更,再将生成的哈希戳写入生命周期表格和索引,作为单独的二次提交。这种两次提交的方式可确保哈希戳在Git历史中可追溯。list-<type>.mdlist-<type>.mddocs/<type>/list-<type>.mddocs/<type>/list-<type>.md| Operation | Trigger |
|---|---|
| Create artifact | New row in the appropriate phase table |
| Edit artifact content or frontmatter | Update last-updated date and commit hash |
| Transition phase | Move row between phase tables |
| Abandon / end-of-life | Move row to the end-of-life table |
| 操作 | 触发条件 |
|---|---|
| 创建工件 | 在对应阶段表格中添加新行 |
| 编辑工件内容或前置元数据 | 更新最后更新日期和提交哈希 |
| 阶段流转 | 在阶段表格间移动行 |
| 废弃/终结 | 将行移至终结阶段表格 |
| Agent | Responsibility |
|---|---|
| Lifecycle auditor | Check every artifact in |
| Cross-reference checker | Verify all |
| Naming & structure validator | Confirm directory/file names follow |
| Phase/folder alignment | Run |
| Dependency coherence auditor | Validate that |
depends-ondepends-ondepends-ondepends-onlinked-*references/git mv| 代理 | 职责 |
|---|---|
| 生命周期审计员 | 检查 |
| 交叉引用检查器 | 验证所有 |
| 命名与结构验证器 | 确认目录/文件名遵循 |
| 阶段/文件夹对齐器 | 运行 |
| 依赖一致性审计员 | 验证 |
depends-ondepends-ondepends-onlinked-*references/git mvoverviewoverviewspecgraph.sh overviewspecgraph.sh overview ✓ VISION-001: Personal Agent Patterns [Active]
├── → EPIC-007: Spec Management System [Active]
│ ├── ✓ SPEC-001: Artifact Lifecycle [Implemented]
│ ├── ✓ SPEC-002: Dependency Graph [Implemented]
│ └── → SPEC-003: Cross-reference Validation [Draft]
│ ↳ blocked by: SPIKE-002
└── → EPIC-008: Execution Tracking [Proposed]
── Cross-cutting ──
├── → ADR-001: Graph Storage Format [Adopted]
└── → PERSONA-001: Solo Developer [Validated]
── Execution Tracking ──
(bd status output here)✓→↳ blocked by:bd statusspecgraph.sh overview ✓ VISION-001: Personal Agent Patterns [Active]
├── → EPIC-007: Spec Management System [Active]
│ ├── ✓ SPEC-001: Artifact Lifecycle [Implemented]
│ ├── ✓ SPEC-002: Dependency Graph [Implemented]
│ └── → SPEC-003: Cross-reference Validation [Draft]
│ ↳ blocked by: SPIKE-002
└── → EPIC-008: Execution Tracking [Proposed]
── Cross-cutting ──
├── → ADR-001: Graph Storage Format [Adopted]
└── → PERSONA-001: Solo Developer [Validated]
── Execution Tracking ──
(bd status output here)✓→↳ blocked by:bd statusspecgraph.sh overview| Command | When to use |
|---|---|
| Flat summary table grouped by artifact type — useful for counts and phase distribution |
| Ready items + what they'd unblock, blocked items + what they need — useful for deciding what to work on |
| Mermaid diagram to stdout — useful for documentation or visual export |
| 命令 | 使用场景 |
|---|---|
| 按工件类型分组的扁平汇总表格——适用于统计数量和阶段分布 |
| 可开展项及其解锁的任务、阻塞项及其所需依赖——适用于决定下一步工作 |
| 向标准输出输出Mermaid图——适用于文档或可视化导出 |
docs/<type>/docs/epic/Proposed/docs/spec/Draft/mkdir -plist-<type>.mddocs/<type>/docs/epic/Proposed/docs/spec/Draft/mkdir -plist-<type>.md| Type | Definition | Template |
|---|---|---|
| Product Vision (VISION-NNN) | references/vision-definition.md | references/vision-template.md.template |
| User Journey (JOURNEY-NNN) | references/journey-definition.md | references/journey-template.md.template |
| Epic (EPIC-NNN) | references/epic-definition.md | references/epic-template.md.template |
| User Story (STORY-NNN) | references/story-definition.md | references/story-template.md.template |
| Agent Spec (SPEC-NNN) | references/spec-definition.md | references/spec-template.md.template |
| Research Spike (SPIKE-NNN) | references/spike-definition.md | references/spike-template.md.template |
| Persona (PERSONA-NNN) | references/persona-definition.md | references/persona-template.md.template |
| ADR (ADR-NNN) | references/adr-definition.md | references/adr-template.md.template |
| Runbook (RUNBOOK-NNN) | references/runbook-definition.md | references/runbook-template.md.template |
| Bug (BUG-NNN) | references/bug-definition.md | references/bug-template.md.template |
| 类型 | 定义文件 | 模板 |
|---|---|---|
| 产品愿景(VISION-NNN) | references/vision-definition.md | references/vision-template.md.template |
| 用户旅程(JOURNEY-NNN) | references/journey-definition.md | references/journey-template.md.template |
| Epic(EPIC-NNN) | references/epic-definition.md | references/epic-template.md.template |
| 用户故事(STORY-NNN) | references/story-definition.md | references/story-template.md.template |
| Agent Spec(SPEC-NNN) | references/spec-definition.md | references/spec-template.md.template |
| 研究Spike(SPIKE-NNN) | references/spike-definition.md | references/spike-template.md.template |
| 用户画像(PERSONA-NNN) | references/persona-definition.md | references/persona-template.md.template |
| ADR(ADR-NNN) | references/adr-definition.md | references/adr-template.md.template |
| 运行手册(RUNBOOK-NNN) | references/runbook-definition.md | references/runbook-template.md.template |
| Bug(BUG-NNN) | references/bug-definition.md | references/bug-template.md.template |
git mvgit mv docs/epic/Proposed/(EPIC-001)-Foo/ docs/epic/Active/(EPIC-001)-Foo/git mvgit mv docs/epic/Proposed/(EPIC-001)-Foo/ docs/epic/Active/(EPIC-001)-Foo/| Tier | Artifacts | Rule |
|---|---|---|
| Implementation | SPEC, STORY, BUG | Execution-tracking must be invoked when the artifact comes up for implementation — create a tracked plan before writing code |
| Coordination | EPIC, VISION, JOURNEY | Swain-design decomposes into implementable children first; swain-do runs on the children, not the container |
| Research | SPIKE | Execution-tracking is optional but recommended for complex spikes with multiple investigation threads |
| Reference | ADR, PERSONA, RUNBOOK | No execution tracking expected |
| 层级 | 工件 | 规则 |
|---|---|---|
| 实施层 | SPEC、STORY、BUG | 当工件进入实施阶段时,必须调用执行追踪——在编写代码前创建可追踪计划 |
| 协调层 | EPIC、VISION、JOURNEY | Swain-design先将其拆解为可实施的子工件;swain-do仅作用于子工件,而非父容器 |
| 研究层 | SPIKE | 执行追踪为可选操作,但对于包含多个调查线程的复杂Spike,建议使用 |
| 参考层 | ADR、PERSONA、RUNBOOK | 无需执行追踪 |
swain-doswain-doswain-do: requiredswain-do: requiredswain-do: requiredswain-do: requiredaddressesspec:SPEC-NNNstory:STORY-NNNaddressesspec:SPEC-NNNstory:STORY-NNNbrainstormingwriting-plansls .claude/skills/brainstorming/SKILL.md .claude/skills/writing-plans/SKILL.md 2>/dev/nullbrainstormingwriting-planswriting-plansdocs/plans/YYYY-MM-DD-<feature-name>.mdpython3 .claude/skills/swain-do/scripts/ingest-plan.py \
docs/plans/<plan-file>.md <ARTIFACT-ID>brainstormingwriting-plansls .claude/skills/brainstorming/SKILL.md .claude/skills/writing-plans/SKILL.md 2>/dev/nullbrainstormingwriting-planswriting-plansdocs/plans/YYYY-MM-DD-<feature-name>.mdpython3 .claude/skills/swain-do/scripts/ingest-plan.py \
docs/plans/<plan-file>.md <ARTIFACT-ID>docs/docs/SPEC-003SPEC-003todoin_progressblockeddone[SPEC-003] Add export endpointtodoin_progressblockeddone[SPEC-003] 添加导出端点