@namewta/speculo 0.1.20 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -78
- package/dist/src/cli.js +57 -34
- package/dist/src/cli.js.map +1 -1
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.js +128 -168
- package/dist/src/index.js.map +1 -1
- package/dist/src/migrate.d.ts +38 -0
- package/dist/src/migrate.js +646 -0
- package/dist/src/migrate.js.map +1 -0
- package/dist/src/workflows.d.ts +7 -37
- package/dist/src/workflows.js +49 -123
- package/dist/src/workflows.js.map +1 -1
- package/package.json +6 -4
- package/template/.speculo/README.md +20 -0
- package/template/.speculo/workspace.json +12 -0
- package/template/commands/docs-sync.md +28 -0
- package/template/commands/finalize.md +37 -0
- package/template/commands/knowledge-prune.md +20 -0
- package/template/commands/retro.md +15 -8
- package/template/commands/status.md +8 -51
- package/template/skills/agents-md-builder/SKILL.md +14 -101
- package/template/skills/change-lifecycle/SKILL.md +25 -0
- package/template/{workflows/dev/_templates → skills/change-lifecycle/assets}/completion-summary-template.md +2 -2
- package/template/{workflows/dev/_templates → skills/change-lifecycle/assets}/completion-verification-template.md +1 -1
- package/template/skills/change-lifecycle/references/completion-gate.md +19 -0
- package/template/skills/change-lifecycle/references/finalize-archive.md +32 -0
- package/template/skills/docs-sync/SKILL.md +22 -0
- package/template/skills/docs-sync/assets/report-template.md +45 -0
- package/template/skills/docs-sync/assets/state-template.json +20 -0
- package/template/skills/docs-sync/assets/workflow-scope-template.json +9 -0
- package/template/skills/docs-sync/references/agents-contract.md +43 -0
- package/template/skills/docs-sync/references/changelog-contract.md +39 -0
- package/template/skills/docs-sync/references/document-lifecycle-contract.md +38 -0
- package/template/skills/docs-sync/references/git-state-contract.md +67 -0
- package/template/skills/docs-sync/references/readme-contract.md +44 -0
- package/template/skills/docs-sync/references/workflow-scope-contract.md +50 -0
- package/template/skills/github-npm-ops/SKILL.md +14 -39
- package/template/skills/github-npm-ops/references/failure-recovery.md +3 -3
- package/template/skills/github-npm-ops/references/issue-pr-triage.md +1 -1
- package/template/skills/github-npm-ops/references/preflight-checklist.md +4 -4
- package/template/skills/github-npm-ops/references/release-notes-injection.md +1 -1
- package/template/skills/github-npm-ops/references/release-pipeline.md +13 -13
- package/template/skills/github-npm-ops/references/version-bump-flow.md +3 -3
- package/template/skills/knowledge-prune/SKILL.md +29 -0
- package/template/skills/knowledge-prune/references/audit-rules.md +24 -0
- package/template/skills/runtime-context/SKILL.md +43 -0
- package/template/skills/runtime-context/references/path-resolution.md +32 -0
- package/template/skills/speculo-retro/SKILL.md +13 -37
- package/template/skills/speculo-retro/references/friction-taxonomy.md +3 -3
- package/template/skills/speculo-retro/references/issue-drafting-sop.md +3 -3
- package/template/skills/worktree-isolation/SKILL.md +10 -46
- package/template/skills/worktree-isolation/references/audit-branch-tree.md +2 -2
- package/template/skills/worktree-isolation/references/create-worktree.md +6 -6
- package/template/skills/worktree-isolation/references/merge-and-cleanup.md +5 -5
- package/template/vendor/README.md +11 -10
- package/template/vendor/matt-pocock/README.md +41 -0
- package/template/vendor/matt-pocock/engineering/README.md +28 -0
- package/template/vendor/matt-pocock/engineering/ask-matt/SKILL.md +76 -0
- package/template/vendor/matt-pocock/engineering/code-review/SKILL.md +89 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/DEEPENING.md +37 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/SKILL.md +114 -0
- package/template/vendor/matt-pocock/engineering/diagnosing-bugs/SKILL.md +134 -0
- package/template/vendor/matt-pocock/engineering/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/ADR-FORMAT.md +47 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/SKILL.md +74 -0
- package/template/vendor/matt-pocock/engineering/grill-with-docs/SKILL.md +7 -0
- package/template/vendor/matt-pocock/engineering/implement/SKILL.md +15 -0
- package/template/vendor/matt-pocock/engineering/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/template/vendor/matt-pocock/engineering/improve-codebase-architecture/SKILL.md +66 -0
- package/template/vendor/matt-pocock/engineering/prototype/LOGIC.md +79 -0
- package/template/vendor/matt-pocock/engineering/prototype/SKILL.md +30 -0
- package/template/vendor/matt-pocock/engineering/prototype/UI.md +112 -0
- package/template/vendor/matt-pocock/engineering/research/SKILL.md +12 -0
- package/template/vendor/matt-pocock/engineering/resolving-merge-conflicts/SKILL.md +14 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/SKILL.md +127 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/domain.md +51 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/template/vendor/matt-pocock/engineering/tdd/SKILL.md +36 -0
- package/template/vendor/matt-pocock/engineering/tdd/mocking.md +59 -0
- package/template/vendor/matt-pocock/engineering/tdd/tests.md +77 -0
- package/template/vendor/matt-pocock/engineering/to-spec/SKILL.md +75 -0
- package/template/vendor/matt-pocock/engineering/to-tickets/SKILL.md +113 -0
- package/template/vendor/matt-pocock/engineering/triage/AGENT-BRIEF.md +204 -0
- package/template/vendor/matt-pocock/engineering/triage/OUT-OF-SCOPE.md +104 -0
- package/template/vendor/matt-pocock/engineering/triage/SKILL.md +112 -0
- package/template/vendor/matt-pocock/engineering/wayfinder/SKILL.md +127 -0
- package/template/vendor/matt-pocock/in-progress/README.md +10 -0
- package/template/vendor/matt-pocock/in-progress/claude-handoff/SKILL.md +18 -0
- package/template/vendor/matt-pocock/in-progress/loop-me/SKILL.md +32 -0
- package/template/vendor/matt-pocock/in-progress/wizard/SKILL.md +45 -0
- package/template/vendor/matt-pocock/in-progress/wizard/template.sh +211 -0
- package/template/vendor/matt-pocock/in-progress/writing-beats/SKILL.md +67 -0
- package/template/vendor/matt-pocock/in-progress/writing-fragments/SKILL.md +78 -0
- package/template/vendor/matt-pocock/in-progress/writing-shape/SKILL.md +79 -0
- package/template/vendor/matt-pocock/productivity/README.md +18 -0
- package/template/vendor/matt-pocock/productivity/grill-me/SKILL.md +7 -0
- package/template/vendor/matt-pocock/productivity/grilling/SKILL.md +12 -0
- package/template/vendor/matt-pocock/productivity/handoff/SKILL.md +16 -0
- package/template/vendor/matt-pocock/productivity/teach/GLOSSARY-FORMAT.md +35 -0
- package/template/vendor/matt-pocock/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/template/vendor/matt-pocock/productivity/teach/MISSION-FORMAT.md +31 -0
- package/template/vendor/matt-pocock/productivity/teach/RESOURCES-FORMAT.md +32 -0
- package/template/vendor/matt-pocock/productivity/teach/SKILL.md +140 -0
- package/template/vendor/matt-pocock/productivity/writing-great-skills/GLOSSARY.md +201 -0
- package/template/vendor/matt-pocock/productivity/writing-great-skills/SKILL.md +83 -0
- package/template/workflows/matt-pocock/WORKFLOW.md +145 -0
- package/template/workflows/matt-pocock/_state/status.json +5 -0
- package/template/workflows/matt-pocock/routes/architecture.md +24 -0
- package/template/workflows/matt-pocock/routes/diagnose.md +22 -0
- package/template/workflows/matt-pocock/routes/experimental.md +18 -0
- package/template/workflows/matt-pocock/routes/idea-to-delivery.md +63 -0
- package/template/workflows/matt-pocock/routes/merge-conflicts.md +19 -0
- package/template/workflows/matt-pocock/routes/productivity.md +25 -0
- package/template/workflows/matt-pocock/routes/research-prototype.md +20 -0
- package/template/workflows/matt-pocock/routes/review.md +19 -0
- package/template/workflows/matt-pocock/routes/setup.md +42 -0
- package/template/workflows/matt-pocock/routes/triage.md +25 -0
- package/template/workflows/matt-pocock/routes/wayfinder.md +27 -0
- package/template/workflows/person/M-mao-zedong-cognitive-os/M-mao-zedong-cognitive-os.md +74 -185
- package/template/workflows/person/M-mao-zedong-cognitive-os/activate.md +3 -2
- package/template/workflows/person/M-mao-zedong-cognitive-os/books/README.md +12 -238
- package/template/workflows/person/M-mao-zedong-cognitive-os/deliver.md +6 -5
- package/template/workflows/person/M-mao-zedong-cognitive-os/diagnose.md +5 -63
- package/template/workflows/person/M-mao-zedong-cognitive-os/mobilize.md +7 -54
- package/template/workflows/person/M-mao-zedong-cognitive-os/references/research/15-quote-bank.md +10 -10
- package/template/workflows/person/M-mao-zedong-cognitive-os/strategize.md +6 -72
- package/template/workflows/person/WORKFLOW.md +68 -0
- package/template/workflows/person/_state/.config/LESSONS.md +3 -0
- package/template/workflows/person/_state/.config/RULES.md +3 -0
- package/template/workflows/person/_state/changes/.gitkeep +1 -0
- package/template/workflows/person/_state/status.json +5 -0
- package/template/.speculo/.config/LESSONS.md +0 -9
- package/template/.speculo/.config/RULES.md +0 -11
- package/template/.speculo/AGENTS.md +0 -30
- package/template/.speculo/archive/AGENTS.md +0 -28
- package/template/.speculo/archive/dev/.gitkeep +0 -0
- package/template/.speculo/archive/person/.gitkeep +0 -0
- package/template/.speculo/dev/.gitkeep +0 -0
- package/template/.speculo/dev/docs-sync-state.json +0 -14
- package/template/.speculo/dev-status.json +0 -3
- package/template/.speculo/doc-status.json +0 -3
- package/template/.speculo/person/.gitkeep +0 -0
- package/template/.speculo/person-status.json +0 -1
- package/template/commands/archive.md +0 -68
- package/template/commands/caveman.md +0 -50
- package/template/commands/config-prune.md +0 -59
- package/template/commands/grill-me.md +0 -48
- package/template/commands/handoff.md +0 -59
- package/template/commands/scaffold-exercises.md +0 -56
- package/template/commands/write-a-skill.md +0 -52
- package/template/skills/caveman/SKILL.md +0 -38
- package/template/skills/caveman/references/compression-rules.md +0 -102
- package/template/skills/config-prune/SKILL.md +0 -66
- package/template/skills/grill-me/SKILL.md +0 -40
- package/template/skills/handoff/SKILL.md +0 -50
- package/template/skills/scaffold-exercises/SKILL.md +0 -41
- package/template/skills/scaffold-exercises/references/exercise-structure.md +0 -85
- package/template/skills/scaffold-exercises/references/lint-and-git.md +0 -54
- package/template/skills/speculo-write/SKILL.md +0 -56
- package/template/skills/speculo-write/references/asset-selection-sop.md +0 -67
- package/template/skills/speculo-write/references/authoring-quality-levers.md +0 -61
- package/template/skills/speculo-write/references/command-authoring-sop.md +0 -98
- package/template/skills/speculo-write/references/migration-sop.md +0 -101
- package/template/skills/speculo-write/references/persistence-contract-sop.md +0 -192
- package/template/skills/speculo-write/references/skill-authoring-sop.md +0 -212
- package/template/skills/speculo-write/references/validation-checklist.md +0 -85
- package/template/skills/speculo-write/references/workflow-authoring-sop.md +0 -132
- package/template/vendor/codebase-design/DEEPENING.md +0 -37
- package/template/vendor/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/template/vendor/codebase-design/SKILL.md +0 -114
- package/template/vendor/officecli/SKILL.md +0 -415
- package/template/vendor/resolving-merge-conflicts/SKILL.md +0 -14
- package/template/workflows/dev/01-grill-with-docs/01-grill-with-docs.md +0 -107
- package/template/workflows/dev/01-grill-with-docs/grill-context-scan.md +0 -30
- package/template/workflows/dev/01-grill-with-docs/grill-decision.md +0 -38
- package/template/workflows/dev/02-prd/02-prd.md +0 -70
- package/template/workflows/dev/02-prd/prd-synthesis.md +0 -30
- package/template/workflows/dev/02-prd/prd-zoom-out.md +0 -29
- package/template/workflows/dev/03-tdd/03-tdd.md +0 -158
- package/template/workflows/dev/03-tdd/mocking.md +0 -43
- package/template/workflows/dev/03-tdd/refactoring.md +0 -10
- package/template/workflows/dev/03-tdd/tdd-finish.md +0 -34
- package/template/workflows/dev/03-tdd/tdd-loop.md +0 -36
- package/template/workflows/dev/03-tdd/tdd-plan.md +0 -37
- package/template/workflows/dev/03-tdd/tests.md +0 -61
- package/template/workflows/dev/04-finalize/04-finalize.md +0 -137
- package/template/workflows/dev/04-finalize/completion-gate.md +0 -41
- package/template/workflows/dev/04-finalize/finalize-archive.md +0 -55
- package/template/workflows/dev/A-improve-architecture/A-improve-architecture.md +0 -143
- package/template/workflows/dev/A-improve-architecture/HTML-REPORT.md +0 -123
- package/template/workflows/dev/AGENTS.md +0 -87
- package/template/workflows/dev/D-docs-sync/D-docs-sync.md +0 -127
- package/template/workflows/dev/D-docs-sync/agents-contract.md +0 -95
- package/template/workflows/dev/D-docs-sync/changelog-contract.md +0 -155
- package/template/workflows/dev/D-docs-sync/config-contract.md +0 -75
- package/template/workflows/dev/D-docs-sync/docs-sync-diff.md +0 -86
- package/template/workflows/dev/D-docs-sync/docs-sync-finish.md +0 -37
- package/template/workflows/dev/D-docs-sync/docs-sync-state.md +0 -47
- package/template/workflows/dev/D-docs-sync/docs-sync-update.md +0 -44
- package/template/workflows/dev/D-docs-sync/knowledge-extract.md +0 -66
- package/template/workflows/dev/D-docs-sync/readme-contract.md +0 -124
- package/template/workflows/dev/D-docs-sync/state-json-schema.md +0 -172
- package/template/workflows/dev/H-diagnose/H-diagnose.md +0 -119
- package/template/workflows/dev/H-diagnose/diagnose-fix.md +0 -34
- package/template/workflows/dev/H-diagnose/diagnose-guide.md +0 -144
- package/template/workflows/dev/H-diagnose/diagnose-loop.md +0 -41
- package/template/workflows/dev/H-diagnose/scripts/hitl-loop.template.sh +0 -41
- package/template/workflows/dev/I-to-issues/I-to-issues.md +0 -140
- package/template/workflows/dev/I-to-issues/issues-slices.md +0 -211
- package/template/workflows/dev/M-domain-modeling/ADR-FORMAT.md +0 -74
- package/template/workflows/dev/M-domain-modeling/CONTEXT-FORMAT.md +0 -67
- package/template/workflows/dev/M-domain-modeling/M-domain-modeling.md +0 -118
- package/template/workflows/dev/R-review/R-review.md +0 -163
- package/template/workflows/dev/R-review/code-quality-checklist.md +0 -118
- package/template/workflows/dev/R-review/removal-checklist.md +0 -53
- package/template/workflows/dev/R-review/review-axes.md +0 -61
- package/template/workflows/dev/R-review/review-setup.md +0 -73
- package/template/workflows/dev/R-review/review-verdict.md +0 -43
- package/template/workflows/dev/R-review/security-checklist.md +0 -126
- package/template/workflows/dev/R-review/solid-checklist.md +0 -73
- package/template/workflows/dev/_templates/diagnosis-template.md +0 -20
- package/template/workflows/dev/_templates/docs-sync-report-template.md +0 -45
- package/template/workflows/dev/_templates/docs-sync-state-template.json +0 -14
- package/template/workflows/dev/_templates/domain-model-log-template.md +0 -20
- package/template/workflows/dev/_templates/grill-context-map-template.md +0 -20
- package/template/workflows/dev/_templates/grill-decision-log-template.md +0 -20
- package/template/workflows/dev/_templates/issues-slices-template.md +0 -106
- package/template/workflows/dev/_templates/prd-overview-template.md +0 -20
- package/template/workflows/dev/_templates/prd-template.md +0 -26
- package/template/workflows/dev/_templates/regression-template.md +0 -20
- package/template/workflows/dev/_templates/review-report-template.md +0 -30
- package/template/workflows/dev/_templates/review-sources-template.md +0 -33
- package/template/workflows/dev/_templates/review-verdict-template.md +0 -33
- package/template/workflows/dev/_templates/tdd-log-template.md +0 -23
- package/template/workflows/dev/_templates/tdd-plan-template.md +0 -35
- package/template/workflows/dev/_templates/tdd-verification-template.md +0 -26
- package/template/workflows/doc/AGENTS.md +0 -72
- package/template/workflows/doc/B-writing-beats/B-writing-beats.md +0 -79
- package/template/workflows/doc/B-writing-beats/writing-beats-append.md +0 -31
- package/template/workflows/doc/B-writing-beats/writing-beats-options.md +0 -29
- package/template/workflows/doc/E-edit-article/E-edit-article.md +0 -79
- package/template/workflows/doc/E-edit-article/edit-article-plan.md +0 -30
- package/template/workflows/doc/E-edit-article/edit-article-rewrite.md +0 -31
- package/template/workflows/doc/F-writing-fragments/F-writing-fragments.md +0 -80
- package/template/workflows/doc/F-writing-fragments/writing-fragments-interview.md +0 -32
- package/template/workflows/doc/F-writing-fragments/writing-fragments-log.md +0 -29
- package/template/workflows/doc/S-writing-shape/S-writing-shape.md +0 -81
- package/template/workflows/doc/S-writing-shape/writing-shape-block.md +0 -32
- package/template/workflows/doc/S-writing-shape/writing-shape-opening.md +0 -27
- package/template/workflows/doc/T-teach/T-teach.md +0 -147
- package/template/workflows/doc/T-teach/teach-lesson-wrap.md +0 -63
- package/template/workflows/doc/T-teach/teach-lesson.md +0 -53
- package/template/workflows/doc/T-teach/teach-mission.md +0 -33
- package/template/workflows/doc/T-teach/teach-resources.md +0 -36
- package/template/workflows/doc/_templates/edit-article-plan-template.md +0 -25
- package/template/workflows/doc/_templates/edit-article-template.md +0 -7
- package/template/workflows/doc/_templates/teach-glossary-template.md +0 -26
- package/template/workflows/doc/_templates/teach-learning-record-template.md +0 -38
- package/template/workflows/doc/_templates/teach-mission-template.md +0 -19
- package/template/workflows/doc/_templates/teach-resources-template.md +0 -18
- package/template/workflows/doc/_templates/writing-article-template.md +0 -7
- package/template/workflows/doc/_templates/writing-beat-options-template.md +0 -21
- package/template/workflows/doc/_templates/writing-fragments-template.md +0 -7
- package/template/workflows/doc/_templates/writing-interview-log-template.md +0 -21
- package/template/workflows/doc/_templates/writing-shape-log-template.md +0 -25
- package/template/workflows/person/AGENTS.md +0 -60
- /package/template/{.speculo/.config/adr → workflows/matt-pocock/_state/archive}/.gitkeep +0 -0
- /package/template/{.speculo/.config/context → workflows/matt-pocock/_state/changes}/.gitkeep +0 -0
- /package/template/{.speculo/archive/doc → workflows/person/_state/.config/context}/.gitkeep +0 -0
- /package/template/{.speculo/doc → workflows/person/_state/archive}/.gitkeep +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# State Write Phase
|
|
2
|
-
|
|
3
|
-
## 输入
|
|
4
|
-
|
|
5
|
-
- 更新后的 tracked assets
|
|
6
|
-
- `speculo/.speculo/dev/docs-sync-state.json`
|
|
7
|
-
- `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
8
|
-
- 当前 `HEAD`
|
|
9
|
-
|
|
10
|
-
## 产物
|
|
11
|
-
|
|
12
|
-
- 更新后的 `speculo/.speculo/dev/docs-sync-state.json`
|
|
13
|
-
- 完整的 `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
14
|
-
|
|
15
|
-
## 填写引导
|
|
16
|
-
|
|
17
|
-
1. 运行项目级校验;命令根据项目工具链决定。
|
|
18
|
-
2. 如果当前为 `bootstrap` 模式,验证通过后把推导出的 `tracked_assets`、本次创建/更新的 `synced_assets` 和当前 `HEAD` 一起写入 state,建立首次同步基线。
|
|
19
|
-
3. 如果所有差异都无需资产修改,仍把 `last_sync_sha` 推进到当前 `HEAD`,并把 `synced_assets` 置为 `[]`。
|
|
20
|
-
4. 如果修改了资产,验证通过后再推进 state。
|
|
21
|
-
5. 写回 state 时按 `state-json-schema.md` 字段顺序,2 空格缩进,尾部换行。
|
|
22
|
-
6. 原子化写入:先写 `speculo/.speculo/dev/docs-sync-state.json.tmp`,再 rename。
|
|
23
|
-
7. 按 report 模板向用户报告范围、归档来源、改动资产、新基线和验证命令。
|
|
24
|
-
8. 如果存在 `propose-only` 或 prune 候选,不因候选未执行阻塞基线推进;但必须在 report 中列出后续确认项。
|
|
25
|
-
|
|
26
|
-
## 边界
|
|
27
|
-
|
|
28
|
-
- 验证失败时不推进 `last_sync_sha`。
|
|
29
|
-
- `bootstrap` 模式没有成功创建或确认首批 `tracked_assets` 时不推进 `last_sync_sha`。
|
|
30
|
-
- 不把敏感信息、绝对路径或完整 diff 写入 state。
|
|
31
|
-
- 不把 archive 提取详情、用户确认原文或 prune 候选全文写入 state;这些只写 report。
|
|
32
|
-
|
|
33
|
-
## 完成准则
|
|
34
|
-
|
|
35
|
-
- state 已原子写入或明确记录阻塞原因
|
|
36
|
-
- report 已包含同步范围、读取归档、改动资产、`.config` 审计、验证结果
|
|
37
|
-
- `.status.json` 的 `docs_sync_status` 已更新
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# State Read Phase
|
|
2
|
-
|
|
3
|
-
## 输入
|
|
4
|
-
|
|
5
|
-
- `speculo/.speculo/dev/docs-sync-state.json`
|
|
6
|
-
- `git rev-parse HEAD`
|
|
7
|
-
- `../_templates/docs-sync-state-template.json`
|
|
8
|
-
- `state-json-schema.md`
|
|
9
|
-
|
|
10
|
-
## 产物
|
|
11
|
-
|
|
12
|
-
- `speculo/.speculo/dev/docs-sync-state.json`
|
|
13
|
-
- `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
14
|
-
|
|
15
|
-
## 填写引导
|
|
16
|
-
|
|
17
|
-
1. 设置 `STATE_FILE="speculo/.speculo/dev/docs-sync-state.json"`。
|
|
18
|
-
2. 读取 `state-json-schema.md`,按 schema 校验 state;若文件不存在,复制 `../_templates/docs-sync-state-template.json` 为骨架,把 `state_path` 设为 `speculo/.speculo/dev/docs-sync-state.json`。
|
|
19
|
-
3. 若存在 v1 state(`schema_version: 1` 或含 `tracked_docs` / `synced_docs`),迁移为 v2:
|
|
20
|
-
- `tracked_assets = tracked_docs`
|
|
21
|
-
- `synced_assets = synced_docs`
|
|
22
|
-
- 保留所有 baseline 字段
|
|
23
|
-
- `schema_version = 2`
|
|
24
|
-
- 在 report 中记录迁移摘要
|
|
25
|
-
4. 读取 `last_sync_sha` 和当前 `HEAD`。
|
|
26
|
-
5. 若 `tracked_assets` 为空、`last_sync_sha` 为 `null` 或 state 文件刚由模板创建,设置 `BOOTSTRAP_DOCS_INIT=true`,把 `.status.json` 的 `docs_sync_status` 置为 `bootstrap`,本次默认执行从 0 到 1 的完整文档初始化。
|
|
27
|
-
6. `bootstrap` 模式下自动推导首批 `tracked_assets`,不因缺少用户确认而停止;候选至少包括:
|
|
28
|
-
- 基础文档:`README.md`、`CHANGELOG.md`、`AGENTS.md`,以及项目已存在或明显需要的 `CLAUDE.md` / `.github/copilot-instructions.md`。
|
|
29
|
-
- 文档目录:已存在的 `docs/**/*.md`;若项目有复杂架构、CLI/API、发布流程或接入说明但缺少承载文档,可把待创建的 `docs/*.md` 纳入初始化候选。
|
|
30
|
-
- Speculo 知识资产:实际存在的 `speculo/.speculo/.config/RULES.md`、`speculo/.speculo/.config/LESSONS.md`、`speculo/.speculo/.config/context/**/*.md`、`speculo/.speculo/.config/adr/**/*.md`。
|
|
31
|
-
7. `bootstrap` 模式的初始化目标是:基于当前项目真实文件、元数据、命令、入口、测试、CI 和发布配置,创建或补齐首批可维护文档,并把本次创建/更新的路径写入 report 与最终 state。
|
|
32
|
-
8. `RULES.md` 只审计和提出建议,写入需用户明确确认;`.config/context` 和 `.config/adr` 中不稳定、多语义或需要取舍的内容,先交由 `../M-domain-modeling/M-domain-modeling.md` 确认。
|
|
33
|
-
9. 若已存在有效 `tracked_assets` 且 `last_sync_sha == HEAD`,仍执行 archive 和 `.config` 审计;只有审计也无变化时才报告无需操作。
|
|
34
|
-
|
|
35
|
-
## 边界
|
|
36
|
-
|
|
37
|
-
- 不把 state 写到仓库根目录。
|
|
38
|
-
- 首次空 state 不等待用户确认 `tracked_assets`;必须自动进入 `bootstrap` 初始化,并在 report 中说明推导依据。
|
|
39
|
-
- 不因 v1 迁移自动扩大已有同步范围;只有迁移后 `tracked_assets` 为空或 `last_sync_sha` 为 `null` 时才进入 `bootstrap`。
|
|
40
|
-
- 不在 State Read 阶段直接推进 `last_sync_sha`;基线只在 Finish 阶段验证通过后写回。
|
|
41
|
-
- 不在未确认时写入 `RULES.md`、删除 `.config` 文件或固化存在语义争议的 CONTEXT / ADR。
|
|
42
|
-
|
|
43
|
-
## 完成准则
|
|
44
|
-
|
|
45
|
-
- 已确定是否进入 `bootstrap`、无需同步或继续进入 diff collect
|
|
46
|
-
- v1 state 已迁移为 v2,或已明确阻塞原因
|
|
47
|
-
- `.status.json` 的 `docs_sync_status` 已更新
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Asset Audit & Update Phase
|
|
2
|
-
|
|
3
|
-
## 输入
|
|
4
|
-
|
|
5
|
-
- `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
6
|
-
- state 中的 `tracked_assets`
|
|
7
|
-
- git 差异素材
|
|
8
|
-
- archive 知识提取结果
|
|
9
|
-
- 按需读取的 contract 文件
|
|
10
|
-
|
|
11
|
-
## 产物
|
|
12
|
-
|
|
13
|
-
- 更新后的 tracked assets
|
|
14
|
-
- `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
15
|
-
|
|
16
|
-
## 填写引导
|
|
17
|
-
|
|
18
|
-
1. 若当前为 `bootstrap` 模式,先把初始化候选写入 report 的 Mapping,再按候选更新最终 `tracked_assets`;缺失的基础文档可作为 `add` 创建。
|
|
19
|
-
2. 更新 README 类文档前读取 `readme-contract.md`。
|
|
20
|
-
3. 更新 AGENTS / AI 代理手册类文档前读取 `agents-contract.md`。
|
|
21
|
-
4. 更新 CHANGELOG 类文档前读取 `changelog-contract.md`。
|
|
22
|
-
5. 更新 `.config` 前读取 `config-contract.md`;涉及术语或 ADR 语义时读取 `../M-domain-modeling/M-domain-modeling.md`,按需读取其 `CONTEXT-FORMAT.md` / `ADR-FORMAT.md`。
|
|
23
|
-
6. 常规同步只做差量修改,保留既有结构、语气和字段;`bootstrap` 模式创建缺失文档时,可按 contract 生成完整初始骨架。
|
|
24
|
-
7. 每个候选改动都按 `add | update | delete | keep | propose-only` 标记,并写入 report;不允许只追加不审计。
|
|
25
|
-
8. 多语言镜像文档必须结构对等;代码实体不翻译。
|
|
26
|
-
9. CHANGELOG 顶部必须保留 `[Unreleased]`;首次创建 CHANGELOG 时使用 Keep a Changelog 骨架,并只记录当前已存在事实。
|
|
27
|
-
10. AGENTS 类的仓库布局小节必须反映实际顶层目录变化;首次创建 AGENTS 类文档时面向 AI 代理写工作手册,不写用户 Quick Start。
|
|
28
|
-
11. `RULES.md` 只写 report 建议;用户明确确认后才可修改文件。
|
|
29
|
-
12. `LESSONS.md` 只保留可复用、已验证、非重复的经验;空占位、重复项和只适用于单次任务的内容应删除或不写入。
|
|
30
|
-
13. ADR / CONTEXT 更新前先判断是否是领域语义变化;不稳定、多语义或存在冲突时,必须交由 `../M-domain-modeling/M-domain-modeling.md` 询问确认。
|
|
31
|
-
|
|
32
|
-
## 边界
|
|
33
|
-
|
|
34
|
-
- 常规同步不整页重写 README 或代理手册;`bootstrap` 模式只在文件缺失时创建完整初始文件,已有文件仍以审计和差量修订为主。
|
|
35
|
-
- 不添加没有对应代码来源的计划中能力。
|
|
36
|
-
- 不把 docs-sync state 放回 skill 或 workflow 目录。
|
|
37
|
-
- 不自动删除 `.config` 文件;删除候选进入 report 或交由 `../../../skills/config-prune/SKILL.md` 审计,执行删除需要用户确认。
|
|
38
|
-
- 不把归档产物正文大段复制到长期文档;只沉淀可复用结论,并保留路径引用。
|
|
39
|
-
|
|
40
|
-
## 完成准则
|
|
41
|
-
|
|
42
|
-
- 需要同步的 tracked assets 已完成差量修改、`bootstrap` 初始化创建或明确列为 propose-only
|
|
43
|
-
- `docs-sync-report.md` 记录每个资产的修改理由、生命周期动作和摘要
|
|
44
|
-
- `docs-sync-report.md` 无残留 `[TODO:]`
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# Knowledge Extract Phase
|
|
2
|
-
|
|
3
|
-
本阶段把 `speculo/.speculo/archive/` 中已完成 change 的高信号产物提取为长期知识候选。归档是证据来源,不是要复制进长期文档的正文仓库。
|
|
4
|
-
|
|
5
|
-
## 输入
|
|
6
|
-
|
|
7
|
-
- `LAST_SYNC_SHA..HEAD`
|
|
8
|
-
- `speculo/.speculo/archive/`
|
|
9
|
-
- `speculo/.speculo/dev/<change>/docs-sync-report.md`
|
|
10
|
-
- git diff 中与代码、文档、`.config` 或 archive 相关的路径
|
|
11
|
-
|
|
12
|
-
## 产物
|
|
13
|
-
|
|
14
|
-
- `docs-sync-report.md` 的 `Archive Sources` 与 `Knowledge Suggestions` 小节
|
|
15
|
-
|
|
16
|
-
## 归档扫描
|
|
17
|
-
|
|
18
|
-
固定先收集:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
RANGE="$LAST_SYNC_SHA..HEAD"
|
|
22
|
-
git diff --name-status "$RANGE" -- speculo/.speculo/archive
|
|
23
|
-
git diff --name-only "$RANGE" -- speculo/.speculo/archive
|
|
24
|
-
find speculo/.speculo/archive -maxdepth 4 -type f | sort
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
若项目没有 `speculo/.speculo/archive/`,记录缺失,不阻塞 docs-sync。
|
|
28
|
-
|
|
29
|
-
## 读取优先级
|
|
30
|
-
|
|
31
|
-
只深读相关归档,不批量复制全部历史。优先读取:
|
|
32
|
-
|
|
33
|
-
- 本次 range 中新增或变更的 archive 文件。
|
|
34
|
-
- 文件名为 `decision-log.md`、`domain-model-log.md`、`prd*.md`、`issues-slices.md`、`review-report.md`、`completion-summary.md`、`retro*.md`、`report.md` 的高信号产物。
|
|
35
|
-
- 与本次 diff 触及路径、术语、模块或 ADR 编号同名/同义的归档 change。
|
|
36
|
-
|
|
37
|
-
低信号产物(日志、快照、纯执行记录)只记录路径,不提取长期知识。
|
|
38
|
-
|
|
39
|
-
## 提取映射
|
|
40
|
-
|
|
41
|
-
| 归档信号 | 映射目标 |
|
|
42
|
-
|----------|----------|
|
|
43
|
-
| 已确认、难以逆转、有权衡的 `D-*` 决策 | ADR 候选或现有 ADR 更新 |
|
|
44
|
-
| 新术语、术语冲突、上下文边界变化 | CONTEXT 候选;不稳定时转 `../M-domain-modeling/M-domain-modeling.md` |
|
|
45
|
-
| 反复出现的约束、禁止项 | RULES 建议(propose-only) |
|
|
46
|
-
| 可复用踩坑、验证经验、工作流反模式 | LESSONS 新增/合并/删除候选 |
|
|
47
|
-
| 与当前实现不一致的旧说明 | tracked assets 或 `.config` 更新/删除候选 |
|
|
48
|
-
| 被取代、合并、放弃的方案 | ADR supersession 或 prune 候选 |
|
|
49
|
-
|
|
50
|
-
## 不确定性处理
|
|
51
|
-
|
|
52
|
-
以下情况不得直接写入 `.config`:
|
|
53
|
-
|
|
54
|
-
- 同一术语存在多种含义。
|
|
55
|
-
- 决策是否仍有效无法从代码或归档判断。
|
|
56
|
-
- 归档记录与当前代码相互矛盾。
|
|
57
|
-
- 候选规则会改变用户维护的 `RULES.md`。
|
|
58
|
-
|
|
59
|
-
处理方式:在 report 中列为 `propose-only`,并调用 `../M-domain-modeling/M-domain-modeling.md` 或等待用户确认。
|
|
60
|
-
|
|
61
|
-
## 完成准则
|
|
62
|
-
|
|
63
|
-
- 已列出读取过的 archive 路径。
|
|
64
|
-
- 每个知识候选都有来源路径和生命周期动作。
|
|
65
|
-
- 无证据或低信号内容未写入长期资产。
|
|
66
|
-
- 不确定项已标记为待确认或移交领域建模。
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# README 类文档同步契约(通用)
|
|
2
|
-
|
|
3
|
-
README 类文档(`README.md`、各语言镜像版本如 `README-ZH.md` / `README.zh-CN.md` / `README-JA.md`)面向初次接触项目的外部读者。本契约提供**与具体项目无关的通用规则**;项目独有的小节结构、表格内容由项目自身的现有 README 决定,同步时保留既有结构做差量更新即可。
|
|
4
|
-
|
|
5
|
-
## 多语言镜像对等原则
|
|
6
|
-
|
|
7
|
-
如果项目维护了多语言 README,任何单边改动都必须在同一次同步内把其他语言版本补齐,包括:
|
|
8
|
-
|
|
9
|
-
1. **章节数量对等**:一级、二级标题数量相同
|
|
10
|
-
2. **章节顺序对等**:同样的标题在相同位置出现
|
|
11
|
-
3. **表格列数对等**:每个表格的列数相同,行数尽量一致
|
|
12
|
-
4. **代码块对等**:命令、路径、配置示例逐字相同,只翻译前后的说明文字
|
|
13
|
-
5. **链接对等**:外链 URL 相同;站内链接指向对方语言版本的对应文件
|
|
14
|
-
|
|
15
|
-
**不翻译的内容**(视为代码实体):
|
|
16
|
-
|
|
17
|
-
- CLI 命令、命令行标志、子命令名
|
|
18
|
-
- 文件/目录路径、文件名
|
|
19
|
-
- 版本号、依赖名、包名
|
|
20
|
-
- 环境变量名、配置键
|
|
21
|
-
- 函数名、类名、API 路由
|
|
22
|
-
|
|
23
|
-
## 顶部约定(项目通用)
|
|
24
|
-
|
|
25
|
-
建议 README 顶部保留(按项目现状为准):
|
|
26
|
-
|
|
27
|
-
1. 项目名称(一级标题)
|
|
28
|
-
2. 简短描述段(blockquote 或正文段落,一两句话)
|
|
29
|
-
3. 状态徽章(build / npm version / downloads / license / node version 等;均为代码实体,所有语言版本保持一致)
|
|
30
|
-
4. 如存在多语言镜像:语言切换行,格式建议 `**Languages:** **English** · [简体中文](./README-ZH.md)` 或等价形式
|
|
31
|
-
|
|
32
|
-
改动徽章或语言切换行时所有语言版本同步。
|
|
33
|
-
|
|
34
|
-
## 典型小节与同步触发器
|
|
35
|
-
|
|
36
|
-
下表给出常见小节及其通用同步触发条件;实际存在哪些小节由项目决定。
|
|
37
|
-
|
|
38
|
-
| 常见小节 | 同步触发条件 |
|
|
39
|
-
|---------|-------------|
|
|
40
|
-
| 简介 / 它解决什么问题 | 项目定位(tagline、package.json description 等)变化 |
|
|
41
|
-
| 特性列表 | 新增/移除对外能力 |
|
|
42
|
-
| Quick Start | 入口命令、安装命令、最小示例代码变化 |
|
|
43
|
-
| 安装 | 发布渠道、安装命令、前置依赖变化 |
|
|
44
|
-
| 使用 / 用法 | 主用例、典型调用方式变化 |
|
|
45
|
-
| CLI Reference | CLI 入口(通常是 `src/cli/**`、`cmd/**`、`bin/**` 等)命令增删或签名变化 |
|
|
46
|
-
| API Reference | 公共 API 导出表面变化 |
|
|
47
|
-
| 配置 | 支持的配置键、默认值、环境变量变化 |
|
|
48
|
-
| 架构 / 核心设计 | 顶层模块边界或核心抽象变化 |
|
|
49
|
-
| 开发 | `package.json#scripts` / `Makefile` / `justfile` / `pyproject.toml` 的任务入口变化 |
|
|
50
|
-
| 发布 / Release Pipeline | CI workflow / release automation 步骤变化 |
|
|
51
|
-
| 致谢 / Acknowledgements | 新增/移除显著借鉴项目、贡献者 |
|
|
52
|
-
| License | LICENSE 文件变化(通常只在换 license 时) |
|
|
53
|
-
|
|
54
|
-
## Quick Start 命令同步规则
|
|
55
|
-
|
|
56
|
-
代码块内容在所有语言版本中**逐字相同**,只翻译说明文字:
|
|
57
|
-
|
|
58
|
-
英文示例:
|
|
59
|
-
|
|
60
|
-
````markdown
|
|
61
|
-
```bash
|
|
62
|
-
some-cli init --name my-project
|
|
63
|
-
```
|
|
64
|
-
Initialize with a project name.
|
|
65
|
-
````
|
|
66
|
-
|
|
67
|
-
中文示例:
|
|
68
|
-
|
|
69
|
-
````markdown
|
|
70
|
-
```bash
|
|
71
|
-
some-cli init --name my-project
|
|
72
|
-
```
|
|
73
|
-
指定项目名进行初始化。
|
|
74
|
-
````
|
|
75
|
-
|
|
76
|
-
## CLI / API Reference 表同步规则
|
|
77
|
-
|
|
78
|
-
CLI / API 参考表必须反映代码中的实际入口(如 `src/cli/index.ts` 的 `program.command(...)` 声明、公共 API 导出列表、OpenAPI schema 等)。
|
|
79
|
-
|
|
80
|
-
同步流程:
|
|
81
|
-
|
|
82
|
-
1. 从代码中枚举实际命令 / 端点 / 导出符号
|
|
83
|
-
2. 对比现有 README 表格
|
|
84
|
-
3. 新增条目 → 所有语言版本同时加一行
|
|
85
|
-
4. 删除 / 改名 → 所有语言版本同步
|
|
86
|
-
5. 签名变化(参数、返回值、标志、必选/可选)→ 同步
|
|
87
|
-
|
|
88
|
-
表头在所有语言版本的列数固定;仅列名翻译。
|
|
89
|
-
|
|
90
|
-
## 目录 / 项目结构小节同步规则
|
|
91
|
-
|
|
92
|
-
如 README 含有项目结构树,它是代码树的当前快照。每次同步对照实际顶层目录,新增 / 删除 / 重命名要跟进。
|
|
93
|
-
|
|
94
|
-
建议约定:
|
|
95
|
-
|
|
96
|
-
- 只列到第二层目录;更深层用 `*` 或省略号
|
|
97
|
-
- 右侧注释可翻译,左侧路径全语言版本保持一致
|
|
98
|
-
|
|
99
|
-
## Development / Release 小节同步规则
|
|
100
|
-
|
|
101
|
-
- `开发` / `Development` 小节中的命令列表来自项目的任务运行器(`package.json#scripts`、`Makefile`、`justfile` 等);新增脚本时所有语言版本同步
|
|
102
|
-
- `Release` / `发布流程` 小节反映 CI 实际步骤;workflow 改动(步骤增删、action 换版本、flag 变化)时同步
|
|
103
|
-
- 约束类语句(例如"版本号必须与 tag 对齐")在所有语言版本中等价表达,不能丢失
|
|
104
|
-
|
|
105
|
-
## 文档交叉引用
|
|
106
|
-
|
|
107
|
-
如 README 有"相关文档 / Documentation"小节,所有语言版本都应互相指向对方语言版本与其他站内文档(AGENTS / CHANGELOG / CONTRIBUTING 等)。
|
|
108
|
-
|
|
109
|
-
## 常见错位示例
|
|
110
|
-
|
|
111
|
-
| 情形 | 处理 |
|
|
112
|
-
|------|------|
|
|
113
|
-
| 新增了一个二级标题但忘记在其他语言版本添加 | 同一次同步补齐 |
|
|
114
|
-
| 某表格某行描述改了,但其他语言版本未改 | 同步对应行 |
|
|
115
|
-
| CLI 参考加了新命令但另一语言未加 | 所有语言版本同步 |
|
|
116
|
-
| 徽章版本换了 | 所有语言版本同步 |
|
|
117
|
-
| 外链项目 URL 改了(项目迁移) | 所有语言版本同步 |
|
|
118
|
-
|
|
119
|
-
## 不做的事
|
|
120
|
-
|
|
121
|
-
- 不整页重写现有 README;只做差量修改
|
|
122
|
-
- 不翻译代码实体
|
|
123
|
-
- 不在 README 里复述 CHANGELOG / AGENTS 里的内容
|
|
124
|
-
- 不添加没有对应代码来源的"计划中"能力(那是 CHANGELOG 的工作)
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# state 文件 Schema(docs-sync 持久化状态)
|
|
2
|
-
|
|
3
|
-
**默认存储位置**:`speculo/.speculo/dev/docs-sync-state.json`
|
|
4
|
-
|
|
5
|
-
本 workflow 在首次运行时会按默认路径创建;后续读写均以同一路径为准。不要把 docs-sync state 放到仓库根目录。
|
|
6
|
-
|
|
7
|
-
**定位**:
|
|
8
|
-
|
|
9
|
-
- docs-sync workflow **唯一**的跨 change 持久化状态
|
|
10
|
-
- 每次成功同步后原子化写入
|
|
11
|
-
- 必须跟随仓库提交到 git(作为同步基线和 tracked assets 的事实来源)
|
|
12
|
-
- **不放在 workflow 资产目录内**:workflow 目录是只读知识资产,状态属于项目 `speculo/.speculo/`
|
|
13
|
-
|
|
14
|
-
**初始化模板**:`../_templates/docs-sync-state-template.json`
|
|
15
|
-
|
|
16
|
-
## 字段定义(schema_version 2)
|
|
17
|
-
|
|
18
|
-
| 字段 | 类型 | 必填 | 说明 |
|
|
19
|
-
|------|------|:---:|------|
|
|
20
|
-
| `schema_version` | integer | ✓ | 当前 `2`;字段破坏性变化时递增 |
|
|
21
|
-
| `skill` | string | ✓ | 固定为 `"docs-sync"`,便于多技能共用项目根目录时辨识 |
|
|
22
|
-
| `state_path` | string | ✓ | 自描述字段:state 文件相对仓库根的路径;协助协作者理解文件位置 |
|
|
23
|
-
| `tracked_assets` | string[] | ✓ | 本项目纳入同步的文档和 `.config` 知识资产路径(相对仓库根);首次空 state 由 `bootstrap` 初始化自动推导写入 |
|
|
24
|
-
| `last_sync_sha` | string (40 hex) \| `null` | ✓ | 上次成功同步后记录的 commit SHA;下次 diff 的起点;首次运行前为 `null` |
|
|
25
|
-
| `last_sync_short` | string (7 hex) \| `null` | ✓ | `last_sync_sha` 的前 7 位,便于日志阅读 |
|
|
26
|
-
| `last_sync_commit_subject` | string \| `null` | ✓ | 上次基线 commit 的 subject 行 |
|
|
27
|
-
| `last_sync_commit_date` | string (ISO 8601) \| `null` | ✓ | 上次基线 commit 的 author date |
|
|
28
|
-
| `last_sync_run_at` | string (ISO 8601 UTC) \| `null` | ✓ | 本次同步**完成写入**时刻;与 `last_sync_commit_date` 不同 —— 前者是"我什么时候做的",后者是"基线 commit 什么时候创建的" |
|
|
29
|
-
| `previous_sync_sha` | string (40 hex) \| `null` | ✓ | 上一次的 `last_sync_sha`;首次运行时为 `null` |
|
|
30
|
-
| `total_syncs` | integer | ✓ | 累计触发次数(含空同步) |
|
|
31
|
-
| `synced_assets` | string[] | ✓ | 本次**实际被修改**的 tracked assets;空同步时为 `[]` |
|
|
32
|
-
|
|
33
|
-
`tracked_assets` 支持两类写法:
|
|
34
|
-
|
|
35
|
-
- 精确路径:`README.md`、`AGENTS.md`、`speculo/.speculo/.config/RULES.md`
|
|
36
|
-
- 受限 Markdown glob:`docs/**/*.md`、`speculo/.speculo/.config/context/**/*.md`、`speculo/.speculo/.config/adr/**/*.md`
|
|
37
|
-
|
|
38
|
-
**禁止**放入的字段:
|
|
39
|
-
|
|
40
|
-
- commit 详细 diff(太大,用 git 现取)
|
|
41
|
-
- 用户个人信息
|
|
42
|
-
- 密钥 / token
|
|
43
|
-
- 绝对路径(影响跨环境协作)
|
|
44
|
-
- archive 提取详情和用户确认原文(写入 report,不写 state)
|
|
45
|
-
|
|
46
|
-
## 典型状态
|
|
47
|
-
|
|
48
|
-
### 首次运行前(骨架 / 模板刚复制)
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"schema_version": 2,
|
|
53
|
-
"skill": "docs-sync",
|
|
54
|
-
"state_path": "speculo/.speculo/dev/docs-sync-state.json",
|
|
55
|
-
"tracked_assets": [],
|
|
56
|
-
"last_sync_sha": null,
|
|
57
|
-
"last_sync_short": null,
|
|
58
|
-
"last_sync_commit_subject": null,
|
|
59
|
-
"last_sync_commit_date": null,
|
|
60
|
-
"last_sync_run_at": null,
|
|
61
|
-
"previous_sync_sha": null,
|
|
62
|
-
"total_syncs": 0,
|
|
63
|
-
"synced_assets": []
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 建立基线后(首次 bootstrap 完成)
|
|
68
|
-
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"schema_version": 2,
|
|
72
|
-
"skill": "docs-sync",
|
|
73
|
-
"state_path": "speculo/.speculo/dev/docs-sync-state.json",
|
|
74
|
-
"tracked_assets": ["README.md", "CHANGELOG.md", "AGENTS.md", "docs/**/*.md", "speculo/.speculo/.config/LESSONS.md"],
|
|
75
|
-
"last_sync_sha": "2d16d7a4d7f5da165c565b9aa3265824be133214",
|
|
76
|
-
"last_sync_short": "2d16d7a",
|
|
77
|
-
"last_sync_commit_subject": "chore: initial release",
|
|
78
|
-
"last_sync_commit_date": "2026-05-10T09:48:14+08:00",
|
|
79
|
-
"last_sync_run_at": "2026-05-10T12:00:00Z",
|
|
80
|
-
"previous_sync_sha": null,
|
|
81
|
-
"total_syncs": 1,
|
|
82
|
-
"synced_assets": ["README.md", "CHANGELOG.md", "AGENTS.md"]
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 常规同步(实际改了两份资产)
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"schema_version": 2,
|
|
91
|
-
"skill": "docs-sync",
|
|
92
|
-
"state_path": "speculo/.speculo/dev/docs-sync-state.json",
|
|
93
|
-
"tracked_assets": ["README.md", "CHANGELOG.md", "speculo/.speculo/.config/LESSONS.md"],
|
|
94
|
-
"last_sync_sha": "abc1234def5678...",
|
|
95
|
-
"last_sync_short": "abc1234",
|
|
96
|
-
"last_sync_commit_subject": "feat(cli): add --json to status",
|
|
97
|
-
"last_sync_commit_date": "2026-05-15T10:20:30+08:00",
|
|
98
|
-
"last_sync_run_at": "2026-05-15T14:00:00Z",
|
|
99
|
-
"previous_sync_sha": "2d16d7a4d7f5da165c565b9aa3265824be133214",
|
|
100
|
-
"total_syncs": 3,
|
|
101
|
-
"synced_assets": ["README.md", "speculo/.speculo/.config/LESSONS.md"]
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### 空同步(diff 与知识审计都无需修改)
|
|
106
|
-
|
|
107
|
-
```json
|
|
108
|
-
{
|
|
109
|
-
"schema_version": 2,
|
|
110
|
-
"skill": "docs-sync",
|
|
111
|
-
"state_path": "speculo/.speculo/dev/docs-sync-state.json",
|
|
112
|
-
"tracked_assets": ["README.md", "CHANGELOG.md", "AGENTS.md", "docs/**/*.md"],
|
|
113
|
-
"last_sync_sha": "ffe9876abc5432...",
|
|
114
|
-
"last_sync_short": "ffe9876",
|
|
115
|
-
"last_sync_commit_subject": "docs(readme): fix typo",
|
|
116
|
-
"last_sync_commit_date": "2026-05-16T09:00:00+08:00",
|
|
117
|
-
"last_sync_run_at": "2026-05-16T11:00:00Z",
|
|
118
|
-
"previous_sync_sha": "abc1234def5678...",
|
|
119
|
-
"total_syncs": 4,
|
|
120
|
-
"synced_assets": []
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## 写入规范
|
|
125
|
-
|
|
126
|
-
1. **原子化**:先写 `<state>.tmp`,再 `mv <state>.tmp <state>`。直接覆盖可能导致中断时 state 被截断
|
|
127
|
-
2. **格式化**:使用 2 空格缩进,尾部换行
|
|
128
|
-
3. **字段顺序**:保持上述表格顺序,便于 diff 阅读
|
|
129
|
-
4. **不保留注释**:JSON 标准不支持注释;所有解释都放本文件
|
|
130
|
-
|
|
131
|
-
## 读取容错
|
|
132
|
-
|
|
133
|
-
读取 state 文件时按以下降级链处理:
|
|
134
|
-
|
|
135
|
-
1. 文件不存在 → 复制 `../_templates/docs-sync-state-template.json` 到 `speculo/.speculo/dev/docs-sync-state.json`,进入 `bootstrap` 文档初始化;不要立即把基线设为当前 HEAD
|
|
136
|
-
2. JSON 解析失败 → 报错退出,要求用户手动修复或删除
|
|
137
|
-
3. `schema_version > 2` → 报错退出,提示技能版本过旧
|
|
138
|
-
4. `last_sync_sha` 不是 40 字符十六进制且不为 `null` → 视为损坏,回退到 `bootstrap` 文档初始化
|
|
139
|
-
5. `tracked_assets` 为空或 `last_sync_sha` 为 `null` → 进入 `bootstrap` 文档初始化,自动推导首批 tracked assets 并完成从 0 到 1 的文档建档
|
|
140
|
-
|
|
141
|
-
## 版本演进规则
|
|
142
|
-
|
|
143
|
-
`schema_version` 只在**破坏性**字段变化时递增:
|
|
144
|
-
|
|
145
|
-
- 加字段(optional 或有默认值):**不**递增
|
|
146
|
-
- 删字段 / 改字段类型 / 改字段语义:递增
|
|
147
|
-
|
|
148
|
-
递增时必须在本文件追加"vN → vN+1 迁移"小节,描述如何处理老格式。
|
|
149
|
-
|
|
150
|
-
## v1 → v2 迁移
|
|
151
|
-
|
|
152
|
-
v2 把 docs-only 命名扩展为 assets:
|
|
153
|
-
|
|
154
|
-
- `tracked_docs` → `tracked_assets`
|
|
155
|
-
- `synced_docs` → `synced_assets`
|
|
156
|
-
- `schema_version` → `2`
|
|
157
|
-
|
|
158
|
-
迁移时保留 baseline 字段、`previous_sync_sha` 和 `total_syncs`。若迁移后仍有有效 `tracked_assets` 和 `last_sync_sha`,不要自动扩大同步范围;若迁移后 `tracked_assets` 为空或 `last_sync_sha` 为 `null`,进入 `bootstrap` 文档初始化。
|
|
159
|
-
|
|
160
|
-
## 与 git 的协作
|
|
161
|
-
|
|
162
|
-
- state 文件**提交到 git**,作为仓库的一部分
|
|
163
|
-
- `last_sync_sha` 引用的 commit 必须在当前分支的历史中
|
|
164
|
-
- 如果多人协作导致 state 文件冲突:保留 `last_sync_sha` 值较新(即在 git 历史中更靠后)的那个,`total_syncs` 取较大值,`previous_sync_sha` 取被保留一方的值
|
|
165
|
-
|
|
166
|
-
## 不要做的事
|
|
167
|
-
|
|
168
|
-
- 不要把 state 文件放进 `.gitignore`
|
|
169
|
-
- 不要手动编辑 `last_sync_sha`(除非在修复损坏状态)
|
|
170
|
-
- 不要把敏感信息、机器信息、用户信息写入
|
|
171
|
-
- 不要让 `total_syncs` 回退
|
|
172
|
-
- 不要把 state 文件放回 workflow 资产目录——它属于项目 `speculo/.speculo/` 状态,不属于 framework 资产
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dev/H-diagnose
|
|
3
|
-
category: dev
|
|
4
|
-
name: Diagnose Hotfix
|
|
5
|
-
description: 针对 Bug、异常和性能回退执行反馈循环驱动的诊断与修复
|
|
6
|
-
keywords: [diagnose, hotfix, bug, debug, performance, 回归]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Diagnose Hotfix 工作流执行指引
|
|
10
|
-
|
|
11
|
-
本工作流是 `dev/H` 入口,用于处理 Bug、异常、测试失败和性能回退。诊断循环指引已内置在本 workflow 目录中。
|
|
12
|
-
|
|
13
|
-
## 内置指引
|
|
14
|
-
|
|
15
|
-
### 何时使用
|
|
16
|
-
|
|
17
|
-
当用户报告 Bug、异常、测试失败、性能回退,或 dev workflow 进入 `dev/H` hotfix/diagnose 路径时使用。
|
|
18
|
-
|
|
19
|
-
### 输入
|
|
20
|
-
|
|
21
|
-
- 用户描述的失败现象、日志、复现步骤或性能症状
|
|
22
|
-
- 当前 change 目录:`speculo/.speculo/dev/<change>/`(`<change>` 必须为 `YYYY-MM-DD-<kebab-name>`,例:`2026-06-12-fix-login-bug`)
|
|
23
|
-
- 可运行的测试、脚本、服务或其他反馈循环
|
|
24
|
-
|
|
25
|
-
### 输出
|
|
26
|
-
|
|
27
|
-
- `speculo/.speculo/dev/<change>/diagnosis.md`
|
|
28
|
-
- `speculo/.speculo/dev/<change>/regression.md`
|
|
29
|
-
- 诊断记录、假设列表、插桩结果、修复与回归验证结论
|
|
30
|
-
- 若缺少可信反馈循环,输出已尝试方法和需要用户提供的材料
|
|
31
|
-
|
|
32
|
-
(`<change>` 格式:`YYYY-MM-DD-<kebab-name>`)
|
|
33
|
-
|
|
34
|
-
### 执行原则
|
|
35
|
-
|
|
36
|
-
完整诊断循环为:复现 -> 最小化 -> 假设 -> 插桩 -> 修复 -> 回归测试。仅在明确合理时才跳过阶段。
|
|
37
|
-
|
|
38
|
-
反馈循环是核心。必须优先建立快速、确定、可信、可由 agent 运行的通过/失败信号。没有可信反馈循环时,不进入假设阶段;记录已尝试方法和需要用户提供的材料。
|
|
39
|
-
|
|
40
|
-
详细诊断纪律在同目录 `diagnose-guide.md`。必须由人类操作才能复现时,按 `scripts/hitl-loop.template.sh` 建立结构化 HITL 循环。
|
|
41
|
-
|
|
42
|
-
### 独立使用
|
|
43
|
-
|
|
44
|
-
本工作流**零硬依赖**,无需预先执行 dev/01、dev/02 等其他工作流即可独立进入。只需用户描述 Bug/异常/性能症状 + 当前 git 仓库即可启动。
|
|
45
|
-
|
|
46
|
-
**独立进入流程:**
|
|
47
|
-
|
|
48
|
-
1. **change 目录**:若用户未指定 `<change>` 目录,按 `YYYY-MM-DD-<kebab-name>` 格式创建(如 `2026-06-17-fix-login-timeout`),初始化 `.status.json` 并更新 `dev-status.json`。
|
|
49
|
-
2. **信息自采集**:若同 change 目录下无上游产物(PRD、decision-log 等),**自行通过代码库探索采集诊断所需上下文**,不要求用户先执行其他工作流:
|
|
50
|
-
- `git log --oneline -30` 查找近期相关变更
|
|
51
|
-
- 搜索错误信息/堆栈中的关键符号(`grep -rn` 在项目中定位)
|
|
52
|
-
- 读取相关模块的代码、测试和配置文件
|
|
53
|
-
- 检查 `speculo/.speculo/.config/` 下的项目规则与 ADR
|
|
54
|
-
3. **深度搜索**:反馈循环构建受阻时,不轻易放弃——按 `diagnose-guide.md` 的 10 种方法逐项尝试;代码库中找不到线索时,搜索项目文档、issue tracker、CI 日志。
|
|
55
|
-
4. **仅必要时询问**:仅在代码库探索无法确定的关键决策点(如需要访问外部环境、需要用户提供日志文件)使用 `AskUserQuestion`。
|
|
56
|
-
|
|
57
|
-
### 缺少 change 目录时的自初始化
|
|
58
|
-
|
|
59
|
-
若当前无对应 change 目录,按以下步骤创建:
|
|
60
|
-
|
|
61
|
-
1. 从用户报告的 Bug/异常提取 `<kebab-name>`(如 `fix-login-timeout`、`fix-payment-npe`)
|
|
62
|
-
2. 创建 `speculo/.speculo/dev/<YYYY-MM-DD>-<kebab-name>/`
|
|
63
|
-
3. 初始化 `.status.json`:
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"dev_entry": "dev/H",
|
|
67
|
-
"current_phase": "1. Diagnose Loop",
|
|
68
|
-
"phase_history": [],
|
|
69
|
-
"change_status": "active",
|
|
70
|
-
"embedded_guides": ["diagnose"],
|
|
71
|
-
"feedback_loop": "none",
|
|
72
|
-
"hypothesis_status": "open",
|
|
73
|
-
"regression_test": "blocked",
|
|
74
|
-
"debug_artifacts": []
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
4. 在 `speculo/.speculo/dev-status.json` 的 `active` 数组中追加该 change 目录名
|
|
78
|
-
|
|
79
|
-
## 阶段
|
|
80
|
-
|
|
81
|
-
### 1. Diagnose Loop — 反馈循环与假设
|
|
82
|
-
- 规范:`diagnose-loop.md`
|
|
83
|
-
- 模板:`../_templates/diagnosis-template.md`
|
|
84
|
-
- 产物:`diagnosis.md`
|
|
85
|
-
- 完成准则:
|
|
86
|
-
- 已建立可信反馈循环,或记录无法建立的原因与所需材料
|
|
87
|
-
- 已记录复现、3-5 个排序假设和插桩结果
|
|
88
|
-
- `diagnosis.md` 无残留 `[TODO:]`
|
|
89
|
-
|
|
90
|
-
### 2. Fix Regression — 修复与回归
|
|
91
|
-
- 规范:`diagnose-fix.md`
|
|
92
|
-
- 模板:`../_templates/regression-template.md`
|
|
93
|
-
- 产物:`regression.md`
|
|
94
|
-
- 完成准则:
|
|
95
|
-
- 已在正确接缝添加或说明无法添加回归测试
|
|
96
|
-
- 原始反馈循环已重新验证
|
|
97
|
-
- `regression.md` 无残留 `[TODO:]`
|
|
98
|
-
|
|
99
|
-
## 依赖
|
|
100
|
-
|
|
101
|
-
- 硬依赖:无
|
|
102
|
-
- 软依赖:无。若同 change 目录下存在其他工作流产物(如 diagnosis.md),可继承其信息加速执行;缺失时自行采集,不阻塞流程。修复阶段可嵌入 `../03-tdd/03-tdd.md` 的 Slice Loop 执行 TDD 修复,此为可选加速而非必须。
|
|
103
|
-
|
|
104
|
-
## 状态扩展字段
|
|
105
|
-
|
|
106
|
-
本工作流需在同 change 的 `.status.json` 追加:
|
|
107
|
-
|
|
108
|
-
- `dev_entry` (string) — 固定为 `dev/H`
|
|
109
|
-
- `embedded_guides` (array) — 包含 `diagnose`
|
|
110
|
-
- `feedback_loop` (none | weak | trusted | blocked) — 反馈循环状态
|
|
111
|
-
- `hypothesis_status` (open | testing | confirmed | rejected | blocked) — 假设状态
|
|
112
|
-
- `regression_test` (added | not-possible | not-needed | blocked) — 回归测试状态
|
|
113
|
-
- `debug_artifacts` (array) — 临时脚本、日志标记或 trace 路径
|
|
114
|
-
|
|
115
|
-
## 完成与状态更新
|
|
116
|
-
|
|
117
|
-
- 进入每个 phase 时更新 `current_phase` 和 `phase_history`。
|
|
118
|
-
- 若需要 TDD 实现修复,可嵌入 `../03-tdd/03-tdd.md` 的 Slice Loop。
|
|
119
|
-
- 修复验证完成后可把 `change_status` 置为 `completed`,或移交后续 review/handoff。
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Fix Regression Phase
|
|
2
|
-
|
|
3
|
-
## 输入
|
|
4
|
-
|
|
5
|
-
- `diagnosis.md`(本工作流 Phase 1 自产;独立进入时由 diagnose-loop 生成,无需外部提供)
|
|
6
|
-
- 已确认或最高可信假设
|
|
7
|
-
- 原始反馈循环和可用测试接缝
|
|
8
|
-
- `H-diagnose.md` 中的内置诊断指引
|
|
9
|
-
- 同目录 `diagnose-guide.md`
|
|
10
|
-
|
|
11
|
-
## 产物
|
|
12
|
-
|
|
13
|
-
- `speculo/.speculo/dev/<change>/regression.md`,由 `../_templates/regression-template.md` 填写
|
|
14
|
-
|
|
15
|
-
## 填写引导
|
|
16
|
-
|
|
17
|
-
1. 在修复前寻找能复现真实 Bug 模式的回归测试接缝。
|
|
18
|
-
2. 存在正确接缝时,先写失败测试,再应用修复,再验证通过。
|
|
19
|
-
3. 不存在正确接缝时,记录架构发现和后续改善建议。
|
|
20
|
-
4. 重新运行原始反馈循环,确认用户报告的问题不再复现。
|
|
21
|
-
5. 清理所有带标记的调试日志和一次性原型。
|
|
22
|
-
6. 完成前确认回归测试通过或缺少接缝已记录,所有 `[DEBUG-...]` 插桩已移除,最终正确假设已写入 `regression.md`。
|
|
23
|
-
|
|
24
|
-
## 边界
|
|
25
|
-
|
|
26
|
-
- 不提交未验证修复。
|
|
27
|
-
- 不自动归档 change。
|
|
28
|
-
- 不修改 `speculo/.speculo/.config/RULES.md` 或用户未明确授权的项目规则文档。
|
|
29
|
-
|
|
30
|
-
## 完成准则
|
|
31
|
-
|
|
32
|
-
- `regression.md` 无残留 `[TODO:]`
|
|
33
|
-
- `.status.json` 已记录 `regression_test`
|
|
34
|
-
- 原始反馈循环重新验证完成或阻塞原因已记录
|