@namewta/speculo 0.1.21 → 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 +1 -1
- package/template/skills/github-npm-ops/references/preflight-checklist.md +1 -1
- 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 -59
- package/template/workflows/person/M-mao-zedong-cognitive-os/activate.md +2 -2
- package/template/workflows/person/M-mao-zedong-cognitive-os/deliver.md +5 -5
- package/template/workflows/person/M-mao-zedong-cognitive-os/diagnose.md +2 -2
- package/template/workflows/person/M-mao-zedong-cognitive-os/mobilize.md +4 -4
- package/template/workflows/person/M-mao-zedong-cognitive-os/strategize.md +3 -3
- 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 -44
- package/template/skills/config-prune/references/audit-rules.md +0 -38
- package/template/skills/grill-me/SKILL.md +0 -40
- package/template/skills/handoff/SKILL.md +0 -73
- 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 -271
- 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 -165
- 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 -55
- package/template/workflows/dev/03-tdd/agents/tdd-finish-agent.md +0 -34
- package/template/workflows/dev/03-tdd/agents/tdd-implement-agent.md +0 -34
- package/template/workflows/dev/03-tdd/agents/tdd-plan-agent.md +0 -34
- 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 -57
- package/template/workflows/dev/04-finalize/agents/completion-gate-agent.md +0 -35
- 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 -60
- package/template/workflows/dev/A-improve-architecture/HTML-REPORT.md +0 -123
- package/template/workflows/dev/A-improve-architecture/architecture-grill.md +0 -30
- package/template/workflows/dev/A-improve-architecture/architecture-review.md +0 -29
- package/template/workflows/dev/A-improve-architecture/architecture-scan.md +0 -37
- package/template/workflows/dev/AGENTS.md +0 -95
- package/template/workflows/dev/D-docs-sync/D-docs-sync.md +0 -140
- package/template/workflows/dev/D-docs-sync/agents/docs-diff-agent.md +0 -34
- package/template/workflows/dev/D-docs-sync/agents/docs-update-agent.md +0 -34
- 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 -108
- package/template/workflows/dev/H-diagnose/agents/diagnose-agent.md +0 -33
- package/template/workflows/dev/H-diagnose/agents/fix-agent.md +0 -34
- 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 -79
- 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 -102
- package/template/workflows/dev/R-review/R-review.md +0 -75
- package/template/workflows/dev/R-review/agents/engineering-review-agent.md +0 -33
- package/template/workflows/dev/R-review/agents/spec-review-agent.md +0 -34
- package/template/workflows/dev/R-review/agents/standards-review-agent.md +0 -34
- 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 -111
- 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/overview-template.md +0 -19
- 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 -80
- 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 -64
- 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-lesson-html-template.md +0 -24
- 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 -72
- /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,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,108 +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 目录**:若无 active change,执行 `../AGENTS.md` 进入协议步骤 3(原子三步),不得内联自初始化 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
|
-
若无 active change,执行 `../AGENTS.md` 进入协议步骤 3(原子三步),不得内联自初始化 JSON。
|
|
60
|
-
|
|
61
|
-
## 阶段
|
|
62
|
-
|
|
63
|
-
| Phase | id | agent | 规范 | 模板 | 产物 |
|
|
64
|
-
|-------|-----|-------|------|------|------|
|
|
65
|
-
| 1. Diagnose Loop | `diagnose-loop` | `agents/diagnose-agent.md` | `diagnose-loop.md` | `../_templates/diagnosis-template.md` | `diagnosis.md` |
|
|
66
|
-
| 2. Fix Regression | `fix-regression` | `agents/fix-agent.md` | `diagnose-fix.md` | `../_templates/regression-template.md` | `regression.md` |
|
|
67
|
-
|
|
68
|
-
### 1. Diagnose Loop — 反馈循环与假设
|
|
69
|
-
- id:`diagnose-loop`
|
|
70
|
-
- 规范:`diagnose-loop.md`
|
|
71
|
-
- 模板:`../_templates/diagnosis-template.md`
|
|
72
|
-
- 产物:`diagnosis.md`
|
|
73
|
-
- 完成准则:
|
|
74
|
-
- 已建立可信反馈循环,或记录无法建立的原因与所需材料
|
|
75
|
-
- 已记录复现、3-5 个排序假设和插桩结果
|
|
76
|
-
- `diagnosis.md` 无残留 `[TODO:]`
|
|
77
|
-
|
|
78
|
-
### 2. Fix Regression — 修复与回归
|
|
79
|
-
- id:`fix-regression`
|
|
80
|
-
- 规范:`diagnose-fix.md`
|
|
81
|
-
- 模板:`../_templates/regression-template.md`
|
|
82
|
-
- 产物:`regression.md`
|
|
83
|
-
- 完成准则:
|
|
84
|
-
- 已在正确接缝添加或说明无法添加回归测试
|
|
85
|
-
- 原始反馈循环已重新验证
|
|
86
|
-
- `regression.md` 无残留 `[TODO:]`
|
|
87
|
-
|
|
88
|
-
## 依赖
|
|
89
|
-
|
|
90
|
-
- 硬依赖:无
|
|
91
|
-
- 软依赖:无。若同 change 目录下存在其他工作流产物(如 diagnosis.md),可继承其信息加速执行;缺失时自行采集,不阻塞流程。修复阶段可嵌入 `../03-tdd/03-tdd.md` 的 Slice Loop 执行 TDD 修复,此为可选加速而非必须。
|
|
92
|
-
|
|
93
|
-
## 状态扩展字段
|
|
94
|
-
|
|
95
|
-
本工作流需在同 change 的 `.status.json` 追加:
|
|
96
|
-
|
|
97
|
-
- `dev_entry` (string) — 固定为 `dev/H`
|
|
98
|
-
- `embedded_guides` (array) — 包含 `diagnose`
|
|
99
|
-
- `feedback_loop` (none | weak | trusted | blocked) — 反馈循环状态
|
|
100
|
-
- `hypothesis_status` (open | testing | confirmed | rejected | blocked) — 假设状态
|
|
101
|
-
- `regression_test` (added | not-possible | not-needed | blocked) — 回归测试状态
|
|
102
|
-
- `debug_artifacts` (array) — 临时脚本、日志标记或 trace 路径
|
|
103
|
-
|
|
104
|
-
## 完成与状态更新
|
|
105
|
-
|
|
106
|
-
- 进入每个 phase 时更新 `current_phase` 和 `phase_history`。
|
|
107
|
-
- 若需要 TDD 实现修复,可嵌入 `../03-tdd/03-tdd.md` 的 Slice Loop。
|
|
108
|
-
- 修复验证完成后移交 `../04-finalize/04-finalize.md` 或 `../R-review/R-review.md`;不得自行写入 `change_status: completed`。
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dev/H-diagnose/diagnose-agent
|
|
3
|
-
type: agent
|
|
4
|
-
name: Diagnose Agent
|
|
5
|
-
description: 隔离执行 Diagnose Loop phase:反馈循环与假设验证
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 使命
|
|
9
|
-
|
|
10
|
-
建立可信反馈循环,记录复现、假设与插桩结果,产出 `diagnosis.md`。
|
|
11
|
-
|
|
12
|
-
## 输入契约
|
|
13
|
-
|
|
14
|
-
- change 路径:`speculo/.speculo/dev/<change>/`
|
|
15
|
-
- `current_phase` / phase-id:`diagnose-loop`
|
|
16
|
-
- 用户描述的失败现象、日志、复现步骤
|
|
17
|
-
- 模板:`../_templates/diagnosis-template.md`
|
|
18
|
-
|
|
19
|
-
## 执行规范
|
|
20
|
-
|
|
21
|
-
- 按 `../diagnose-loop.md` 与 `../diagnose-guide.md` 执行诊断循环。
|
|
22
|
-
- HITL 场景按 `../scripts/hitl-loop.template.sh` 建立结构化循环。
|
|
23
|
-
- 产物写入 `speculo/.speculo/dev/<change>/diagnosis.md`。
|
|
24
|
-
|
|
25
|
-
## 产物与状态
|
|
26
|
-
|
|
27
|
-
- 产物:`diagnosis.md`
|
|
28
|
-
- `.status.json`:更新 `current_phase: diagnose-loop`、`feedback_loop`、`hypothesis_status`
|
|
29
|
-
|
|
30
|
-
## 边界
|
|
31
|
-
|
|
32
|
-
- 不越过本 phase;不实施修复或回归测试。
|
|
33
|
-
- 不写 `change_status`。
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dev/H-diagnose/fix-agent
|
|
3
|
-
type: agent
|
|
4
|
-
name: Fix Agent
|
|
5
|
-
description: 隔离执行 Fix Regression phase:修复与回归验证
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 使命
|
|
9
|
-
|
|
10
|
-
在正确接缝实施修复并验证回归,产出 `regression.md`。
|
|
11
|
-
|
|
12
|
-
## 输入契约
|
|
13
|
-
|
|
14
|
-
- change 路径:`speculo/.speculo/dev/<change>/`
|
|
15
|
-
- `current_phase` / phase-id:`fix-regression`
|
|
16
|
-
- 上游产物:`diagnosis.md`
|
|
17
|
-
- 模板:`../_templates/regression-template.md`
|
|
18
|
-
|
|
19
|
-
## 执行规范
|
|
20
|
-
|
|
21
|
-
- 按 `../diagnose-fix.md` 实施修复。
|
|
22
|
-
- 可在接缝添加回归测试;必要时嵌入 `../../03-tdd/03-tdd.md` 的 Slice Loop。
|
|
23
|
-
- 重新验证原始反馈循环。
|
|
24
|
-
- 产物写入 `speculo/.speculo/dev/<change>/regression.md`。
|
|
25
|
-
|
|
26
|
-
## 产物与状态
|
|
27
|
-
|
|
28
|
-
- 产物:`regression.md`
|
|
29
|
-
- `.status.json`:更新 `current_phase: fix-regression`、`regression_test`
|
|
30
|
-
|
|
31
|
-
## 边界
|
|
32
|
-
|
|
33
|
-
- 不越过本 phase;不写 `change_status`。
|
|
34
|
-
- 完成后移交 `../../04-finalize/04-finalize.md` 或 `../../R-review/R-review.md`。
|
|
@@ -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
|
-
- 原始反馈循环重新验证完成或阻塞原因已记录
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
# 诊断
|
|
2
|
-
|
|
3
|
-
针对疑难 Bug 和性能回退的纪律化诊断循环。复现 -> 最小化 -> 假设 -> 插桩 -> 修复 -> 回归测试。当用户报告 Bug、异常、失败测试或性能回退时使用。
|
|
4
|
-
|
|
5
|
-
一套针对疑难 Bug 的纪律。仅在明确合理时才跳过阶段。
|
|
6
|
-
|
|
7
|
-
## 独立诊断时的信息采集
|
|
8
|
-
|
|
9
|
-
当本工作流独立进入(无上游 PRD、decision-log 等产物)时,在构建反馈循环之前先执行以下信息采集。不要求用户先跑其他工作流。
|
|
10
|
-
|
|
11
|
-
### 1. 快速环境扫描
|
|
12
|
-
|
|
13
|
-
- `git log --oneline -30` 查看近期变更,关注可能与 Bug 相关的 commit
|
|
14
|
-
- `git log --oneline --all -- <相关文件路径>` 追溯问题模块的变更历史
|
|
15
|
-
- 读取 `speculo/.speculo/.config/RULES.md` 了解项目规则
|
|
16
|
-
- 读取相关模块的 `README.md` 或 `AGENTS.md` 了解架构约定
|
|
17
|
-
|
|
18
|
-
### 2. 症状定位
|
|
19
|
-
|
|
20
|
-
- 若有错误信息/堆栈:`grep -rn "<关键符号>"` 在项目中全局搜索,定位所有相关代码路径
|
|
21
|
-
- 若有性能回退:搜索相关模块最近的性能敏感变更(循环、查询、缓存)
|
|
22
|
-
- 若为测试失败:读取失败测试文件及其覆盖的源代码,理解预期行为
|
|
23
|
-
- 搜索项目中是否已有类似的 issue、TODO、FIXME 提及该问题
|
|
24
|
-
|
|
25
|
-
### 3. 相关模块深度探索
|
|
26
|
-
|
|
27
|
-
- 读取问题代码路径的所有相关文件(调用链上下游)
|
|
28
|
-
- 阅读现有测试了解模块契约
|
|
29
|
-
- 检查 `speculo/.speculo/.config/adr/` 中与问题模块相关的架构决策
|
|
30
|
-
- 搜索 `speculo/.speculo/doc/` 中已有的领域文档
|
|
31
|
-
|
|
32
|
-
### 4. 信息仍不足时
|
|
33
|
-
|
|
34
|
-
- 用 `AskUserQuestion` 向用户索取:复现环境、日志文件、HAR 捕获、核心转储等——但仅在代码库探索穷尽后
|
|
35
|
-
- 不要因缺少上游产物而放弃或要求用户先执行 dev/01、dev/02
|
|
36
|
-
|
|
37
|
-
探索代码库时,使用项目的领域术语表来建立相关模块的清晰心智模型,并查阅你所触及区域的 ADR。
|
|
38
|
-
|
|
39
|
-
## 阶段 1 —— 构建反馈循环
|
|
40
|
-
|
|
41
|
-
**这是整个技能的核心。** 其余都是机械操作。如果你拥有一个快速、确定性的、可由 agent 运行的通过/失败信号来检测 Bug,你就能找到原因——二分查找、假设检验和插桩都只是在消费这个信号。如果没有这样的信号,再多的代码凝视也救不了你。
|
|
42
|
-
|
|
43
|
-
在这里投入不成比例的努力。**要大胆,要有创造力,绝不放弃。**
|
|
44
|
-
|
|
45
|
-
### 构建方法——大致按此顺序尝试
|
|
46
|
-
|
|
47
|
-
1. **失败测试** —— 在能触及 Bug 的任何接缝处编写——单元测试、集成测试、端到端测试。
|
|
48
|
-
2. **Curl / HTTP 脚本** —— 对运行中的开发服务器发请求。
|
|
49
|
-
3. **CLI 调用** —— 使用 fixture 输入,将 stdout 与已知正确的快照做 diff。
|
|
50
|
-
4. **无头浏览器脚本**(Playwright / Puppeteer)——驱动 UI,对 DOM/控制台/网络进行断言。
|
|
51
|
-
5. **重放捕获的 trace。** 将真实的网络请求/载荷/事件日志保存到磁盘;隔离地重放经过代码路径。
|
|
52
|
-
6. **一次性测试工具。** 启动系统的最小子集(一个服务,mock 依赖),通过单个函数调用触发 Bug 代码路径。
|
|
53
|
-
7. **属性/模糊循环。** 如果 Bug 是「有时输出错误」,运行 1000 个随机输入寻找失败模式。
|
|
54
|
-
8. **二分查找工具。** 如果 Bug 出现在两个已知状态之间(commit、数据集、版本),自动化「在状态 X 启动、检查、重复」,以便用 `git bisect run` 定位。
|
|
55
|
-
9. **差异循环。** 将相同输入分别通过旧版本和新版本(或两种配置),diff 输出。
|
|
56
|
-
10. **HITL bash 脚本。** 最后手段。如果必须由人类点击,用同目录 `scripts/hitl-loop.template.sh` 来驱动他们,使循环仍然结构化。捕获的输出反馈给你。
|
|
57
|
-
|
|
58
|
-
构建正确的反馈循环,Bug 就解决了 90%。
|
|
59
|
-
|
|
60
|
-
### 在循环本身上迭代
|
|
61
|
-
|
|
62
|
-
把循环当作产品来对待。一旦你有了_一个_循环,问自己:
|
|
63
|
-
|
|
64
|
-
- 能更快吗?(缓存设置、跳过无关初始化、缩小测试范围。)
|
|
65
|
-
- 能让信号更锐利吗?(断言具体症状,而不是「没有崩溃」。)
|
|
66
|
-
- 能更确定吗?(固定时间、设定随机种子、隔离文件系统、冻结网络。)
|
|
67
|
-
|
|
68
|
-
一个 30 秒的不稳定循环几乎不比没有循环好。一个 2 秒的确定性循环是调试超能力。
|
|
69
|
-
|
|
70
|
-
### 非确定性 Bug
|
|
71
|
-
|
|
72
|
-
目标不是干净的复现,而是**更高的复现率**。循环触发 100 次,并行化,增加压力,缩小时间窗口,注入 sleep。50% 概率出现的 Bug 可以调试;1% 的不行——持续提高复现率直到可以调试。
|
|
73
|
-
|
|
74
|
-
### 当你确实无法构建循环时
|
|
75
|
-
|
|
76
|
-
停下来明确说明。列出你尝试过的内容。向用户请求:(a) 访问能复现问题的环境,(b) 捕获的产物(HAR 文件、日志转储、核心转储、带时间戳的屏幕录制),或 (c) 在生产环境添加临时插桩的权限。在没有循环的情况下**不要**进入假设阶段。
|
|
77
|
-
|
|
78
|
-
在你拥有一个你信任的循环之前,不要进入阶段 2。
|
|
79
|
-
|
|
80
|
-
## 阶段 2 —— 复现
|
|
81
|
-
|
|
82
|
-
运行循环,观察 Bug 出现。
|
|
83
|
-
|
|
84
|
-
确认:
|
|
85
|
-
|
|
86
|
-
- [ ] 循环产生的是**用户**描述的失败模式——而不是附近碰巧的另一个失败。错误的 Bug = 错误的修复。
|
|
87
|
-
- [ ] 失败在多次运行中可复现(或者,对于非确定性 Bug,以足够高的概率复现以便调试)。
|
|
88
|
-
- [ ] 你已捕获了确切的症状(错误信息、错误输出、慢响应时间),以便后续阶段能验证修复确实解决了问题。
|
|
89
|
-
|
|
90
|
-
在你复现 Bug 之前不要继续。
|
|
91
|
-
|
|
92
|
-
## 阶段 3 —— 假设
|
|
93
|
-
|
|
94
|
-
在测试任何假设之前,先产生 **3–5 个排序的假设**。单假设生成会锚定在第一个看似合理的想法上。
|
|
95
|
-
|
|
96
|
-
每个假设必须是**可证伪的**:说明它做出的预测。
|
|
97
|
-
|
|
98
|
-
> 格式:「如果 <X> 是原因,那么 <改变 Y> 将使 Bug 消失 / <改变 Z> 将使它更严重。」
|
|
99
|
-
|
|
100
|
-
如果你无法说明预测,这个假设只是一种感觉——丢弃或锐化它。
|
|
101
|
-
|
|
102
|
-
**在测试之前将排序列表展示给用户。** 他们通常拥有能即时重新排序的领域知识(「我们刚部署了 #3 的变更」),或者知道他们已经排除的假设。低成本的检查点,大幅节省时间。不要因此阻塞——如果用户不在,按你的排序继续。
|
|
103
|
-
|
|
104
|
-
## 阶段 4 —— 插桩
|
|
105
|
-
|
|
106
|
-
每个探针必须映射到阶段 3 中的特定预测。**每次只改变一个变量。**
|
|
107
|
-
|
|
108
|
-
工具偏好:
|
|
109
|
-
|
|
110
|
-
1. **调试器 / REPL 检查**(如果环境支持)。一个断点胜过十个日志。
|
|
111
|
-
2. **定向日志** —— 在能区分假设的边界处打日志。
|
|
112
|
-
3. 绝不「把所有东西都打日志然后 grep」。
|
|
113
|
-
|
|
114
|
-
**给每个调试日志加上唯一前缀标签**,例如 `[DEBUG-a4f2]`。最后的清理变成一次 grep。未标记的日志保留;带标记的日志删除。
|
|
115
|
-
|
|
116
|
-
**性能分支。** 对于性能回退,日志通常是错的。正确做法:建立基线测量(计时工具、`performance.now()`、profiler、查询计划),然后二分查找。先测量,后修复。
|
|
117
|
-
|
|
118
|
-
## 阶段 5 —— 修复 + 回归测试
|
|
119
|
-
|
|
120
|
-
在修复**之前**编写回归测试——但前提是在**正确的接缝**处。
|
|
121
|
-
|
|
122
|
-
正确的接缝是指测试能在调用点触发**真实 Bug 模式**的地方。如果唯一可用的接缝太浅(当 Bug 需要多个调用者时只有单调用者测试,无法复制触发 Bug 的调用链的单元测试),那么在该处的回归测试只会给出虚假的信心。
|
|
123
|
-
|
|
124
|
-
**如果不存在正确的接缝,这本身就是发现。** 记录下来。代码库架构正在阻止 Bug 被锁定。在下一阶段标记此问题。
|
|
125
|
-
|
|
126
|
-
如果存在正确的接缝:
|
|
127
|
-
|
|
128
|
-
1. 将最小化复现转化为该接缝处的失败测试。
|
|
129
|
-
2. 观察它失败。
|
|
130
|
-
3. 应用修复。
|
|
131
|
-
4. 观察它通过。
|
|
132
|
-
5. 针对原始(未最小化的)场景重新运行阶段 1 的反馈循环。
|
|
133
|
-
|
|
134
|
-
## 阶段 6 —— 清理 + 事后分析
|
|
135
|
-
|
|
136
|
-
在宣布完成之前必须做:
|
|
137
|
-
|
|
138
|
-
- [ ] 原始复现不再复现(重新运行阶段 1 的循环)
|
|
139
|
-
- [ ] 回归测试通过(或缺少接缝已记录)
|
|
140
|
-
- [ ] 所有 `[DEBUG-...]` 插桩已移除(用 `grep` 搜索前缀)
|
|
141
|
-
- [ ] 一次性原型已删除(或移到明确标记的调试位置)
|
|
142
|
-
- [ ] 最终正确的假设已写在 commit / PR 信息中——以便下一个调试者从中学习
|
|
143
|
-
|
|
144
|
-
**然后问:什么能预防这个 Bug?** 如果答案涉及架构变更(没有好的测试接缝、纠缠的调用者、隐藏的耦合),将具体信息交给横向工作流 `../A-improve-architecture/A-improve-architecture.md` 处理。在修复**之后**提出建议,而不是之前——你现在比开始时拥有更多信息。
|