@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Workflow 范围契约
|
|
2
|
+
|
|
3
|
+
docs-sync 必须遵循每个 workflow 的 `WORKFLOW.md`、持久化声明与确认规则。`docs-sync.json` 是 command 拥有的标准延迟 sidecar,不属于 workflow `_state` 固定骨架。
|
|
4
|
+
|
|
5
|
+
## 发现
|
|
6
|
+
|
|
7
|
+
1. 从 `speculo/workflows/*/WORKFLOW.md` 发现已安装 workflow。
|
|
8
|
+
2. 每个包必须有匹配的 `speculo/.speculo/<workflow>/` 状态根;包或状态根单边缺失时阻塞,不猜测归属。
|
|
9
|
+
3. 读取 `<runtime-context>`、`<persistence>`、固定 archive 和所有 `consumers` 包含 `docs-sync` 的 store。
|
|
10
|
+
4. 状态根存在但没有已安装 package 时只报告 orphan,不创建 sidecar。
|
|
11
|
+
|
|
12
|
+
## Sidecar v1
|
|
13
|
+
|
|
14
|
+
每个已安装 workflow 首次 docs-sync 都创建:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"schema_version": 1,
|
|
19
|
+
"workflow": "example",
|
|
20
|
+
"manifest_path": "speculo/.speculo/example/docs-sync.json",
|
|
21
|
+
"project_targets": [],
|
|
22
|
+
"state_targets": [],
|
|
23
|
+
"scope_revision": 1,
|
|
24
|
+
"scope_confirmed_at": "ISO-8601"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
目标使用 `{ "path": "...", "kind": "file | directory" }`:
|
|
29
|
+
|
|
30
|
+
- `project_targets` 使用项目相对路径,记录该 workflow 负责维护的项目文档。
|
|
31
|
+
- `state_targets` 使用 workflow 状态根相对路径,只能位于 `consumers` 包含 `docs-sync` 的已声明 store。
|
|
32
|
+
- Directory 目标递归覆盖其中已跟踪的 Markdown、MDX、reStructuredText 和 AsciiDoc;其他格式必须作为 file 明确列出。
|
|
33
|
+
- 禁止绝对路径、反斜杠、`..`、项目根目录、无界 glob、`.git`、固定 `status.json/changes/archive` 和 sidecar 自身。
|
|
34
|
+
|
|
35
|
+
## 首次确认与修订
|
|
36
|
+
|
|
37
|
+
1. Bootstrap 同时展示全局候选,以及每个 workflow 的 project/state 候选、来源和风险。
|
|
38
|
+
2. 用户一次确认后写入全局 state 与全部 sidecar;没有候选的 workflow 也写空清单。
|
|
39
|
+
3. 一个目标只能归属全局或一个 workflow;重叠、父子目录交叉或同一路径多 owner 必须先消歧。
|
|
40
|
+
4. 后续新增、扩大、移除或转移目标必须再次展示完整新范围;确认后增加 `scope_revision` 并更新时间。
|
|
41
|
+
5. 首次确认只授予范围内常规创建和改写,不授权整文件/目录删除或受保护知识写入。
|
|
42
|
+
|
|
43
|
+
## Archive 与知识
|
|
44
|
+
|
|
45
|
+
- 固定 archive 始终可作为只读证据;优先读取本次区间新增或变更、且与受影响模块或术语相关的高信号产物。
|
|
46
|
+
- 归档中的稳定决策、术语、经验和文档漂移信号只提炼结论并保留来源路径,不复制大段正文。
|
|
47
|
+
- `existing-only` store 永远只读。RULES/policy、ADR、CONTEXT、语义冲突和任何知识文件删除均进入 `propose-only`,按目标 workflow 规则取得逐次确认。
|
|
48
|
+
- 不跨 workflow 搬运知识;共享结论必须先确认唯一归属。
|
|
49
|
+
|
|
50
|
+
完成标准:所有已安装 workflow 都有有效 sidecar;每个有效目标都有唯一 owner、声明边界和确认记录;所有受保护动作均未越权。
|
|
@@ -2,52 +2,27 @@
|
|
|
2
2
|
id: github-npm-ops
|
|
3
3
|
type: skill
|
|
4
4
|
name: GitHub npm Ops
|
|
5
|
-
description: GitHub
|
|
5
|
+
description: 提供 GitHub issue/PR/CI/security 治理与 npm provenance 发布、验证和失败恢复原子能力。
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# GitHub npm Ops
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 输入
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
- 仓库、目标分支、issue/PR/run id 或目标版本。
|
|
13
|
+
- package metadata、release workflow、CHANGELOG 和可选 docs-sync state。
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## 分支
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
1. **Issue/PR**:读取 `references/issue-pr-triage.md`;完成标准是分类、去重、标签和外部写入计划均有证据。
|
|
18
|
+
2. **CI/Security**:读取 `references/ci-and-security-ops.md`;完成标准是失败或告警根因可复现,修复动作与验证分离。
|
|
19
|
+
3. **发布预检**:读取 `references/preflight-checklist.md`、`references/package-json-checklist.md` 和 `references/publish-detection.md`;完成标准是分支、认证、版本、tag、流水线和发布目标均已判定。
|
|
20
|
+
4. **发布实施**:按需读取 `references/release-pipeline.md`、`references/workflow-yaml-reference.md`、`references/version-bump-flow.md`、`references/release-notes-injection.md` 和 `references/setup-npm-token.md`;完成标准是版本/CHANGELOG 同 commit、tag 精确指向该 commit,外部动作均已确认。
|
|
21
|
+
5. **失败恢复**:读取 `references/failure-recovery.md` 与具体错误时的 `references/troubleshooting-playbook.md`;完成标准是已判定 npm 是否上传,并选择可重试同 tag、补后续动作或必须 bump 中唯一分支。
|
|
21
22
|
|
|
22
23
|
## 输出
|
|
23
24
|
|
|
24
|
-
-
|
|
25
|
-
- npm
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- 调用方可归档的发布摘要、风险、验证命令和后续动作
|
|
29
|
-
|
|
30
|
-
## 执行步骤
|
|
31
|
-
|
|
32
|
-
1. 先判定任务类型:日常治理、发布基础设施搭建、正式发版、失败恢复。
|
|
33
|
-
2. 发布类任务先执行只读前置检查:分支、工作区、远端、`gh auth`、Node/包管理器、`release.yml`、tag 冲突、docs-sync state。
|
|
34
|
-
3. 需要同步对外文档时,交给调用方读取 `../workflows/dev/D-docs-sync/D-docs-sync.md`;本 skill 不自行选择持久化目录,只把结果交给调用方写入其声明的 `speculo/.speculo/...` 规范路径。
|
|
35
|
-
4. 正式发版必须保证 release commit 同时包含版本 bump 与 CHANGELOG 迁移,并且 tag 精确指向 release commit。
|
|
36
|
-
5. release workflow 必须包含 tag/package version 校验、质量闸、可选 npm publish、CHANGELOG release notes 注入、GitHub Release 创建。
|
|
37
|
-
6. 发布完成后做三端验证:workflow success、GitHub Release 非 draft 且正文非空、如流水线包含 npm publish 则 `npm view` 版本与 dist-tag 一致。
|
|
38
|
-
7. 失败恢复先判断 npm 是否已成功上传;一旦 npm 已上传,同版本号不可重发,只能补后续动作或 bump 新版本。
|
|
39
|
-
|
|
40
|
-
## 渐进披露
|
|
41
|
-
|
|
42
|
-
- `references/release-pipeline.md`:执行正式 npm/GitHub release 编排时读取。
|
|
43
|
-
- `references/preflight-checklist.md`:发布前只读检查或 dry-run 时读取。
|
|
44
|
-
- `references/publish-detection.md`:判断 release workflow 是否实际发布 npm 包时读取。
|
|
45
|
-
- `references/package-json-checklist.md`:检查 npm 包元数据、bin、files、provenance 相关字段时读取。
|
|
46
|
-
- `references/setup-npm-token.md`:配置或排查 `NPM_TOKEN`、2FA bypass、scope 权限时读取。
|
|
47
|
-
- `references/workflow-yaml-reference.md`:创建或修复 `.github/workflows/release.yml` 时读取。
|
|
48
|
-
- `references/release-notes-injection.md`:Release 正文为空、需要从 CHANGELOG 注入 release notes 时读取。
|
|
49
|
-
- `references/version-bump-flow.md`:执行版本 bump、release commit、tag、push 时读取。
|
|
50
|
-
- `references/failure-recovery.md`:发布编排失败、需要判断是否能重试同 tag 时读取。
|
|
51
|
-
- `references/troubleshooting-playbook.md`:npm/GitHub Actions 具体错误码排障时读取。
|
|
52
|
-
- `references/issue-pr-triage.md`:issue / PR 分诊、标签、社区响应时读取。
|
|
53
|
-
- `references/ci-and-security-ops.md`:CI 失败、安全告警、Dependabot / secret scanning 处理时读取。
|
|
25
|
+
- 操作建议或经确认后的执行结果、风险和验证证据。
|
|
26
|
+
- 发布后三端验证:workflow success、GitHub Release 非 draft 且正文非空、需要发布 npm 时 registry 版本/dist-tag 一致。
|
|
27
|
+
|
|
28
|
+
本 skill 不推进 docs-sync state,也不自行选择报告或 workflow knowledge 路径。
|
|
@@ -109,7 +109,7 @@ git push origin vX.Y.Z
|
|
|
109
109
|
# 在 [X.Y.(Z+1)] 段落开头加一句 "supersedes vX.Y.Z due to <根因>"
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
**错误码映射**:场景 D 通常是上游错误溢出(场景 B/C 处理不当后果),不单独列 E
|
|
112
|
+
**错误码映射**:场景 D 通常是上游错误溢出(场景 B/C 处理不当后果),不单独列 E 码;流程上要求**事后复盘**,把可复用根因输出给调用方,由其按所属 workflow 规则写入声明的 lessons/knowledge store(本 skill 不自行选择 workflow 或持久化目录)。
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
| 7 | 包管理器 | `pnpm --version` (或 `npm` / `yarn`) | 版本 ≥ 仓库 lockfile 隐含版本 | 安装匹配版本;不要随意切换包管理器 |
|
|
17
17
|
| 8 | release.yml 存在 | `test -f .github/workflows/release.yml` | 文件存在 | 转 `github-npm-ops` skill 的 `references/workflow-yaml-reference.md` 先落该文件 |
|
|
18
18
|
| 9 | release.yml 形态 | 见 [publish-detection.md](publish-detection.md) | 输出 `PUBLISH_TO_NPM=true` 或 `false` | 见 publish-detection 文档的判定矩阵 |
|
|
19
|
-
| 10 | docs-sync state | `test -f speculo/.speculo/
|
|
19
|
+
| 10 | docs-sync state | `test -f speculo/.speculo/commands/docs-sync/state.json && jq . speculo/.speculo/commands/docs-sync/state.json` | schema v4、scope 已确认,baseline 可解析 | 不存在/未确认 → 走 docs-sync command bootstrap;旧 schema → 先迁移并确认范围;损坏 → 阻塞修复 |
|
|
20
20
|
| 11 | tag 名称冲突 | `git rev-parse vX.Y.Z 2>/dev/null` | 退出码非 0(tag 不存在) | 同 tag 已存在:先确认是否真的失败需要重发;若是则 `git tag -d` + `git push origin :refs/tags/vX.Y.Z`,否则 bump 到下一版本 |
|
|
21
21
|
|
|
22
22
|
## 失败处理总策略
|
|
@@ -88,7 +88,7 @@ GitHub Release 的正文(body)**事后可改**(tag 不可改、npm 包不可改
|
|
|
88
88
|
|
|
89
89
|
### 3.1 命令行(推荐)
|
|
90
90
|
|
|
91
|
-
`notes_file` 只是一次性传给 `gh --notes-file` 的中间文件;若需要保留回填记录或 release notes,由调用方写入 `speculo/.speculo/commands/<YYYY-MM-DD>-<
|
|
91
|
+
`notes_file` 只是一次性传给 `gh --notes-file` 的中间文件;若需要保留回填记录或 release notes,由调用方写入 `speculo/.speculo/commands/<command>/<YYYY-MM-DD>-<scope>-<topic>[-NN].md`。
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
VERSION="0.0.10"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# npm + GitHub Release 编排
|
|
2
2
|
|
|
3
|
-
把一次 npm 包发布拆成可验证的单向流水线:前置检查 -> 普通改动 commit -> docs-sync -> release commit -> tag -> workflow 监控 -> 三端验证 -> docs-sync
|
|
3
|
+
把一次 npm 包发布拆成可验证的单向流水线:前置检查 -> 普通改动 commit -> docs-sync -> release commit -> tag -> workflow 监控 -> 三端验证 -> docs-sync 记录 release 节点。
|
|
4
4
|
|
|
5
5
|
## Iron Law
|
|
6
6
|
|
|
7
7
|
- 禁止提交破坏构建的代码;release 前必须运行仓库声明的 lint / test / build 或等价质量闸。
|
|
8
|
-
- docs-sync 必须由调用方按 `../../../
|
|
8
|
+
- docs-sync 必须由调用方按 `../../../commands/docs-sync.md` 执行;输入起点来自最后修改 state 文件的 commit,终点是运行前清洁后的 HEAD,并写入 `last_range`。
|
|
9
9
|
- tag 必须精确指向 release commit,即包含 `package.json` version bump 与 CHANGELOG 迁移的 commit;禁止指向后续 docs / state commit。
|
|
10
10
|
- npm 已成功上传后,同一 version 不可重发;不要通过删 tag 或 unpublish 试图覆盖。
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- Node 与包管理器满足仓库声明
|
|
19
19
|
- `.github/workflows/release.yml` 存在
|
|
20
20
|
- 已确定 `PUBLISH_TO_NPM=true | false`
|
|
21
|
-
- `speculo/.speculo/
|
|
21
|
+
- `speculo/.speculo/commands/docs-sync/state.json` 存在且可解析;不存在时转 docs-sync command 的首次 bootstrap
|
|
22
22
|
- 目标 tag `vX.Y.Z` 不存在,除非正在执行明确的失败恢复
|
|
23
23
|
|
|
24
24
|
任一项不通过就停止,输出修复建议。
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
|
|
33
33
|
## Phase 2 — Docs Sync
|
|
34
34
|
|
|
35
|
-
- 由调用方执行 `../../../
|
|
36
|
-
-
|
|
35
|
+
- 由调用方执行 `../../../commands/docs-sync.md`。
|
|
36
|
+
- 只修改全局 state 与 workflow sidecar 已确认范围中需要同步的文档或知识资产。
|
|
37
37
|
- CHANGELOG 类文档只写 `[Unreleased]`,保留该段落。
|
|
38
|
-
-
|
|
38
|
+
- 本阶段由 docs-sync 自动提交文档、报告与 state;最终 release commit 仍在 Phase 3 创建,发布后再由 Phase 6 记录为新输入终点。
|
|
39
39
|
|
|
40
40
|
## Phase 3 — 版本 bump + release commit + tag
|
|
41
41
|
|
|
@@ -86,15 +86,15 @@ npm view "<package-name>" dist-tags
|
|
|
86
86
|
|
|
87
87
|
判定 version 与 `dist-tags.latest` 均为 `X.Y.Z`。
|
|
88
88
|
|
|
89
|
-
## Phase 6 —
|
|
89
|
+
## Phase 6 — 记录 release 输入节点
|
|
90
90
|
|
|
91
|
-
仅当 Phase 1-5
|
|
91
|
+
仅当 Phase 1-5 全绿时执行。再次调用 `../../../commands/docs-sync.md`,并确认运行前 `HEAD` 等于 `RELEASE_COMMIT_SHA`:
|
|
92
92
|
|
|
93
|
-
- `
|
|
94
|
-
- `
|
|
95
|
-
-
|
|
93
|
+
- state 的 `last_range.to_sha` 必须等于 `RELEASE_COMMIT_SHA`。
|
|
94
|
+
- `last_range.from_sha` 来自最后修改旧 state 的 commit,或迁移期 explicit baseline。
|
|
95
|
+
- docs-sync 写入 release 后报告/state commit;tag 继续精确指向 release commit,不移动。
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
本 skill 不直接改 state 或 workflow sidecar;原子写入、范围检查和本地 commit 均由 docs-sync command 负责。
|
|
98
98
|
|
|
99
99
|
## 完成报告
|
|
100
100
|
|
|
@@ -104,5 +104,5 @@ npm view "<package-name>" dist-tags
|
|
|
104
104
|
- workflow run id 与结论
|
|
105
105
|
- GitHub Release 检查结果
|
|
106
106
|
- npm 检查结果或跳过原因
|
|
107
|
-
- docs-sync state
|
|
107
|
+
- docs-sync `last_range` 与 state-file baseline commit
|
|
108
108
|
- 失败恢复或后续建议
|
|
@@ -18,7 +18,7 @@ git tag --sort=-version:refname | head -3
|
|
|
18
18
|
head -30 CHANGELOGS.md
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
任意一项异常先解决再发版:工作区不干净 → 先提交,或调用 docs-sync 按其清洁契约处理;`[Unreleased]` 为空 → 先做 docs-sync。禁止用 stash 隐藏待发布改动。
|
|
22
22
|
|
|
23
23
|
## 1. 维护 CHANGELOG
|
|
24
24
|
|
|
@@ -46,7 +46,7 @@ head -30 CHANGELOGS.md
|
|
|
46
46
|
- [0.0.9](https://github.com/owner/repo/releases/tag/v0.0.9)
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
完整 CHANGELOG 契约见
|
|
49
|
+
完整 CHANGELOG 契约见 `../../docs-sync/references/changelog-contract.md`。
|
|
50
50
|
|
|
51
51
|
## 2. bump package.json
|
|
52
52
|
|
|
@@ -180,7 +180,7 @@ git push origin v0.0.10
|
|
|
180
180
|
|
|
181
181
|
npm 已上线 → **不要**改版本号,只补后续动作。
|
|
182
182
|
|
|
183
|
-
下面的 `notes_file` 只是一次性传给 `gh --notes-file` 的中间文件;若需要保留发布摘要或 release notes,由调用方写入 `speculo/.speculo/commands/<YYYY-MM-DD>-<
|
|
183
|
+
下面的 `notes_file` 只是一次性传给 `gh --notes-file` 的中间文件;若需要保留发布摘要或 release notes,由调用方写入 `speculo/.speculo/commands/<command>/<YYYY-MM-DD>-<scope>-<topic>[-NN].md`。
|
|
184
184
|
|
|
185
185
|
```bash
|
|
186
186
|
notes_file="$(mktemp -t speculo-release-notes.XXXXXX)"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: knowledge-prune
|
|
3
|
+
type: skill
|
|
4
|
+
name: Knowledge Prune
|
|
5
|
+
description: dry-run 审计 workflow 声明的知识与策略 namespace,返回可安全删除、合并或改写的候选清单。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Knowledge Prune
|
|
9
|
+
|
|
10
|
+
默认只分析,不自行写报告或修改文件。调用方负责 runtime context、用户确认和持久化。
|
|
11
|
+
|
|
12
|
+
## 输入
|
|
13
|
+
|
|
14
|
+
- `runtime-context` 返回的 workflow/state 根。
|
|
15
|
+
- `WORKFLOW.md#persistence` 中 role 为 knowledge、policy 或 legacy-knowledge 的 namespace。
|
|
16
|
+
- 用户确认状态:`dry-run | confirmed`。
|
|
17
|
+
|
|
18
|
+
## 流程
|
|
19
|
+
|
|
20
|
+
1. 读取 `references/audit-rules.md`,仅扫描已声明且真实存在的 namespace。
|
|
21
|
+
2. 为每个候选收集当前代码、文档、active change、archive 和交叉引用证据。
|
|
22
|
+
3. 按 `delete | merge | rewrite | keep | needs-confirmation` 返回候选;dry-run 到此完成。
|
|
23
|
+
4. confirmed 模式重新验证真实路径包含关系,再逐项执行用户批准的动作并返回结果。
|
|
24
|
+
|
|
25
|
+
完成标准:每个候选都有来源、证据和风险;未确认时文件系统未发生变化;本 skill 未自行选择报告路径。
|
|
26
|
+
|
|
27
|
+
## 渐进披露
|
|
28
|
+
|
|
29
|
+
- `references/audit-rules.md`:生成候选、判定保护项或执行确认后的修改时读取。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Knowledge Prune Audit Rules
|
|
2
|
+
|
|
3
|
+
## 扫描范围
|
|
4
|
+
|
|
5
|
+
1. 读取目标 workflow 的 `<persistence>`,选择 role 为 `knowledge | policy | legacy-knowledge` 且真实存在的 store。
|
|
6
|
+
2. `create="lazy"` 但不存在的 store 记为 `missing`,不为审计而创建;`existing-only` store 只读。
|
|
7
|
+
3. 扫描代码、文档、active changes 和 archive 中对 ADR、CONTEXT、LESSONS、RULES 及具体文件名的引用。
|
|
8
|
+
|
|
9
|
+
## 候选
|
|
10
|
+
|
|
11
|
+
- 指向不存在知识文件的引用。
|
|
12
|
+
- 已 superseded、超过 30 天且无 active 引用的 ADR。
|
|
13
|
+
- 只含占位符、模板说明或空内容的长期知识文件。
|
|
14
|
+
- 当前代码、文档和 archive 均无证据支撑的领域术语。
|
|
15
|
+
- 重复、过时、仅适用单次 change 或已被规则/ADR 吸收的经验。
|
|
16
|
+
|
|
17
|
+
## 保护规则
|
|
18
|
+
|
|
19
|
+
- 仍被代码、文档、archive 或 active change 引用的内容归入 `keep`。
|
|
20
|
+
- RULES、术语冲突、ADR/CONTEXT 改写和 existing-only legacy store 一律归入 `needs-confirmation`。
|
|
21
|
+
- 删除前解析真实路径,确认仍位于目标 workflow state root 和已声明 store 内。
|
|
22
|
+
- 不跨 workflow 合并知识,不修改 docs-sync state。
|
|
23
|
+
|
|
24
|
+
完成标准:所有已声明且存在的知识 store 均已扫描,每个候选恰好属于一个分组。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: runtime-context
|
|
3
|
+
type: skill
|
|
4
|
+
name: Runtime Context
|
|
5
|
+
description: 解析 Speculo 项目根、资产根和 workflow 状态根,向 command/workflow/skill 返回经过边界校验的统一路径上下文。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Runtime Context
|
|
9
|
+
|
|
10
|
+
从项目根注册表和 workflow XML 声明构造一次运行所需的全部路径。调用方持有持久化责任;本 skill 只解析和验证路径。
|
|
11
|
+
|
|
12
|
+
## 输入
|
|
13
|
+
|
|
14
|
+
- 当前工作目录或用户指定的项目目录。
|
|
15
|
+
- workflow id,以及对应 `WORKFLOW.md` 中的 `<runtime-context>` 和 `<persistence>`。
|
|
16
|
+
- 可选 change 名称和 command id。
|
|
17
|
+
|
|
18
|
+
## 流程
|
|
19
|
+
|
|
20
|
+
1. 按 `references/path-resolution.md` 向上定位 `speculo/.speculo/workspace.json`;找不到唯一项目根时返回 blocked。
|
|
21
|
+
2. 读取注册表与 workflow 根别名,解析 `workflow/state/commands/skills/vendor`;任一路径越界或目标缺失时返回 blocked。
|
|
22
|
+
3. 读取固定状态骨架 `status.json/changes/archive`;选择 change 时派生 `change_root`,不把派生绝对路径写回状态。
|
|
23
|
+
4. 返回 project-relative runtime context,供后续所有 skills 复用;后续调用不得重新猜测路径。
|
|
24
|
+
|
|
25
|
+
## 输出
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
project_root
|
|
29
|
+
workflow_root
|
|
30
|
+
state_root
|
|
31
|
+
changes_root
|
|
32
|
+
archive_root
|
|
33
|
+
change_root?
|
|
34
|
+
commands_root
|
|
35
|
+
skills_root
|
|
36
|
+
vendor_roots[]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
完成标准:所有返回路径均为项目根相对路径、位于声明根内且对应静态资产真实存在;本 skill 未创建任何运行时产物。
|
|
40
|
+
|
|
41
|
+
## 渐进披露
|
|
42
|
+
|
|
43
|
+
- `references/path-resolution.md`:定位根注册表、解析 XML 根别名或检查路径越界时读取。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Path Resolution
|
|
2
|
+
|
|
3
|
+
## 根定位
|
|
4
|
+
|
|
5
|
+
1. 从当前工作目录向上寻找 `speculo/.speculo/workspace.json`。
|
|
6
|
+
2. 第一个命中的目录是 `project_root`;同时命中多个候选或用户指定目录与候选不一致时停止并澄清。
|
|
7
|
+
3. `workspace.json#path_base` 必须为 `project-root`,所有 roots 必须是 POSIX 风格相对路径。
|
|
8
|
+
|
|
9
|
+
## Workflow 绑定
|
|
10
|
+
|
|
11
|
+
读取 workflow 的 `<runtime-context>`:
|
|
12
|
+
|
|
13
|
+
- `base` 必须引用 `workspace.json#roots` 中已有根。
|
|
14
|
+
- `path` 不能是绝对路径,不能包含 `..` 或反斜杠。
|
|
15
|
+
- `workflow` 和 `state` 必须分别解析到 `speculo/workflows/<workflow>` 与 `speculo/.speculo/<workflow>`。
|
|
16
|
+
- vendor 可声明零个或多个具名根,例如 `vendor:matt-pocock`。
|
|
17
|
+
|
|
18
|
+
固定派生规则:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
changes_root = state_root/changes
|
|
22
|
+
archive_root = state_root/archive
|
|
23
|
+
change_root = changes_root/<change>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 边界检查
|
|
27
|
+
|
|
28
|
+
- 解析后执行真实路径包含检查;符号链接逃逸与不存在的静态引用均阻塞。
|
|
29
|
+
- `<artifact root="change">` 只能落在当前 change。
|
|
30
|
+
- `<artifact root="state">` 只能落在 `<persistence>` 声明的额外命名空间。
|
|
31
|
+
- command 报告只能落在 `state/commands/<command>/`,skill 不自行选择路径。
|
|
32
|
+
- raw vendor skill 未经 workflow runtime context 激活时,不承诺 Speculo 持久化边界。
|
|
@@ -2,51 +2,27 @@
|
|
|
2
2
|
id: speculo-retro
|
|
3
3
|
type: skill
|
|
4
4
|
name: Speculo Retro
|
|
5
|
-
description:
|
|
5
|
+
description: 从 Speculo 使用证据中提取、去重、分级和根因化摩擦,返回可直接转成 GitHub issue 的提案。
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Speculo Retro
|
|
9
9
|
|
|
10
|
-
## 何时使用
|
|
11
|
-
|
|
12
|
-
当用户想复盘「用 Speculo 的 commands 或 workflows 时遇到的痛点、问题、值得优化的地方」,并希望把这些摩擦整理成规范化、可行动的框架反馈或 issue 时使用。
|
|
13
|
-
|
|
14
|
-
典型触发:
|
|
15
|
-
|
|
16
|
-
- “总结一下这次用 Speculo 踩的坑 / 卡点”
|
|
17
|
-
- “把使用痛点整理成可以提的 issue”
|
|
18
|
-
- “复盘 dev workflow 哪里别扭、哪里值得优化”
|
|
19
|
-
- “收集 Speculo 框架反馈”
|
|
20
|
-
|
|
21
|
-
本 skill 只负责**分析与规范化产出内容**:它去重、分级、根因化并起草 issue-ready 提案,把结果返回给调用方。它**不自行写文件、不调用 `gh`、不发布 issue**;落盘与提交由调用方 command / workflow 负责。
|
|
22
|
-
|
|
23
10
|
## 输入
|
|
24
11
|
|
|
25
|
-
-
|
|
26
|
-
- `
|
|
27
|
-
-
|
|
28
|
-
- `speculo/.speculo/.config/LESSONS.md`(已沉淀的教训,用于去重与佐证)
|
|
29
|
-
- 可选:调用方提供的已存在 issue 列表或目标仓库上下文,用于跨提案去重
|
|
30
|
-
- 本 skill 自带分析与 issue 起草规范,已内化到 `references/`,分析时**不外读仓库 `docs/`**
|
|
31
|
-
|
|
32
|
-
## 输出
|
|
12
|
+
- 当前对话与本次使用的 commands/workflows。
|
|
13
|
+
- `commands/<command>/*.md` 报告、active change 状态、archive 和 workflow 声明的 lessons/knowledge store。
|
|
14
|
+
- 可选已有 issues,用于语义去重。
|
|
33
15
|
|
|
34
|
-
|
|
35
|
-
- 提案清单,按优先级倒序排列
|
|
36
|
-
- 被合并或丢弃的低信号项说明(哪些重复、哪些更适合记入 `LESSONS.md` 而非提 issue)
|
|
37
|
-
- 每条标注「建议提 issue」或「仅记教训」的处置建议
|
|
38
|
-
- 全部以**返回内容**形式交给调用方写入其声明的 `speculo/.speculo/...` 路径;本 skill 不挑选持久化位置
|
|
16
|
+
## 流程
|
|
39
17
|
|
|
40
|
-
|
|
18
|
+
1. 读取 `references/friction-taxonomy.md`,穷尽扫描可用证据并列出原始摩擦。完成标准:每项都有来源路径或对话节点。
|
|
19
|
+
2. 按 bug、friction、missing-capability、doc-gap、ergonomics 归类,合并同一根因。完成标准:每项只属于一个根因簇,合并关系可追溯。
|
|
20
|
+
3. 评估影响与频率,过滤一次性噪声;低信号项标为丢弃或仅记教训。完成标准:每项都有优先级和处置理由。
|
|
21
|
+
4. 读取 `references/issue-drafting-sop.md`,生成 issue-ready 提案并与已有 issue 去重。完成标准:标题、证据、问题、建议、验收、影响资产和去重结论齐全。
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
2. **归类与去重** —— 按 taxonomy 把每个摩擦点归到类型(bug / friction / missing-capability / doc-gap / ergonomics),合并语义重复项。
|
|
44
|
-
3. **深度分析** —— 对每条做根因判断(是 asset 设计、持久化契约、文档还是工具问题),评估影响面与发生频率,按 `references/friction-taxonomy.md` 的优先级评分。
|
|
45
|
-
4. **过滤噪声** —— 只保留高信号、可行动项;低信号或一次性项标注为丢弃,或归入「仅记教训」。
|
|
46
|
-
5. **起草提案** —— 按 `references/issue-drafting-sop.md` 把每条规范化成 issue-ready 提案,并对照调用方提供的已存在 issue 做跨提案去重。
|
|
47
|
-
6. **返回结论** —— 把结构化提案清单、丢弃项与处置建议返回调用方;不自行写文件、不调用 `gh`。
|
|
23
|
+
## 输出
|
|
48
24
|
|
|
49
|
-
|
|
25
|
+
- 按优先级排序的 `file-issue | lesson-only | discard | duplicate` 提案。
|
|
26
|
+
- 合并/丢弃说明和调用方执行 `gh` 所需字段。
|
|
50
27
|
|
|
51
|
-
|
|
52
|
-
- `references/issue-drafting-sop.md`:把改进提案规范化成 issue-ready 结构、对照已存在 issue 去重、生成给调用方 / `gh` 的交接字段时读取。
|
|
28
|
+
本 skill 不写文件、不调用外部 API;command 负责报告、确认和 issue 创建。
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
按以下顺序采集原始摩擦点,每条记录**证据出处**(文件路径或对话节点),后续起草 issue 时要引用:
|
|
8
8
|
|
|
9
9
|
1. **当前对话上下文** —— 本次会话激活过的 command / workflow;用户在哪一步卡住、追问、返工;为绕开限制做了哪些手动动作;哪些指令被误解。
|
|
10
|
-
2. **命令产物** —— `speculo/.speculo/commands/<
|
|
11
|
-
3. **change 状态机** —— `speculo/.speculo/<
|
|
10
|
+
2. **命令产物** —— `speculo/.speculo/commands/<command>/*.md`:其中记录的验证失败、未完成和阻塞点是一手摩擦。
|
|
11
|
+
3. **change 状态机** —— `speculo/.speculo/<workflow>/changes/<change>/.status.json` 的 `phase_history`:
|
|
12
12
|
- `revisited` —— phase 被迫回退,通常意味着流程设计或前置产物有缺口
|
|
13
13
|
- `blocked` —— 卡点,记录阻塞原因
|
|
14
14
|
- `skipped` —— phase 被跳过,可能是冗余或不适用
|
|
15
15
|
- `updated_at` 长期停滞 —— 流程让人不想推进
|
|
16
16
|
4. **change 产物正文** —— `prd.md`、`tdd-*.md`、`slices.md`、`diagnosis.md` 中显式写下的「待澄清」「风险」「TODO」。
|
|
17
|
-
5. **沉淀教训** ——
|
|
17
|
+
5. **沉淀教训** —— 各 workflow 声明的 lessons/knowledge store:已记录但尚未转成改进项的教训,用于去重与佐证频率。
|
|
18
18
|
6. **契约落差** —— 实际产物路径、frontmatter、命名是否偏离 `persistence-contract`:路径散落、缺字段、命名不合 `YYYY-MM-DD-<kebab>` 都是 bug 信号。
|
|
19
19
|
|
|
20
20
|
## 摩擦类型分类
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"priority": "priority:critical | priority:high | priority:medium | priority:low",
|
|
14
14
|
"area": "string|null, 例 area:commands / area:workflows / area:skills / area:cli / area:contract",
|
|
15
15
|
"body": "string, 见正文结构",
|
|
16
|
-
"affected": ["相对路径,例 speculo/commands/
|
|
17
|
-
"evidence": ["证据出处,例 speculo/.speculo
|
|
16
|
+
"affected": ["相对路径,例 speculo/commands/finalize.md"],
|
|
17
|
+
"evidence": ["证据出处,例 speculo/.speculo/<workflow>/changes/<change>/.status.json#phase_history"],
|
|
18
18
|
"disposition": "file-issue | record-lesson | drop",
|
|
19
19
|
"dup_of": "number|null, 疑似重复的已存在 issue 编号"
|
|
20
20
|
}
|
|
@@ -74,4 +74,4 @@
|
|
|
74
74
|
|
|
75
75
|
## 交接契约
|
|
76
76
|
|
|
77
|
-
本 skill 只返回上面的结构化提案清单 + 丢弃/合并说明,**不写文件、不调用 `gh`、不创建 issue**。落盘到 `speculo/.speculo/commands/<
|
|
77
|
+
本 skill 只返回上面的结构化提案清单 + 丢弃/合并说明,**不写文件、不调用 `gh`、不创建 issue**。落盘到 `speculo/.speculo/commands/retro/<YYYY-MM-DD>-<scope>-<topic>[-NN].md` 与实际 `gh issue create` 由调用方 command 在用户确认后执行。
|
|
@@ -2,58 +2,22 @@
|
|
|
2
2
|
id: worktree-isolation
|
|
3
3
|
type: skill
|
|
4
4
|
name: Worktree Isolation
|
|
5
|
-
description: 在独立 git worktree
|
|
5
|
+
description: 在独立 git worktree 中创建、审查、合并和清理 Speculo workflow change。
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Worktree Isolation
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
仅在用户明确要求 worktree 隔离时调用;调用方提供 runtime context 和当前 change。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## 状态字段
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- **审查整条分支树**(review):审查必须覆盖 change 分支相对原分支的**全部 commit**,而不只是工作区 diff。
|
|
16
|
-
- **合并回收**(finalize):收尾验证通过后,把 change 分支合并回原分支,并清理 worktree 与分支。
|
|
14
|
+
`worktree_enabled`、`base_branch`、`change_branch`、`worktree_path`、`worktree_status` 由调用方写入当前 change `.status.json`。
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
## 流程
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
1. 确认 git 仓库、工作区状态和 `speculo/.speculo/` 跟踪策略;任一条件不满足时返回不可隔离原因。完成标准:创建前状态和降级选择清晰。
|
|
19
|
+
2. 固定 `change_branch=speculo/<workflow>/<change>`、`worktree_path=.worktree/<change>`,读取 `references/create-worktree.md`。完成标准:分支、工作树和返回状态均真实存在。
|
|
20
|
+
3. 所有代码和 change 产物在该工作树推进;review 时读取 `references/audit-branch-tree.md`。完成标准:审查覆盖 `base..change_branch` 全部 commit。
|
|
21
|
+
4. Finalize 时读取 `references/merge-and-cleanup.md`,展示合并、删分支和删 worktree 计划并等待确认。完成标准:变更已进入 base、工作树/分支状态与 `.status.json` 一致,或明确 blocked。
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
- 当前 change 目录名(`YYYY-MM-DD-<kebab>`)与其分类 `<cat>`(dev | doc | person | ops)
|
|
24
|
-
- 用户的隔离意图(是否显式请求)
|
|
25
|
-
- 仓库 `.gitignore`
|
|
26
|
-
|
|
27
|
-
本 skill 自带全部隔离程序,**不外读仓库 `docs/`**。
|
|
28
|
-
|
|
29
|
-
## 输出
|
|
30
|
-
|
|
31
|
-
- git 状态变更:隔离分支、`.worktree/<change>/` 工作树、合并与清理结果
|
|
32
|
-
- **供调用方持久化的状态字段集**(本 skill 不自行选择持久化目录,由调用方 workflow 写入同一 change 的 `.status.json`):
|
|
33
|
-
|
|
34
|
-
| 字段 | 类型 | 含义 |
|
|
35
|
-
|------|------|------|
|
|
36
|
-
| `worktree_enabled` | bool | 是否启用隔离 |
|
|
37
|
-
| `base_branch` | string | 原分支(启用隔离时的当前分支) |
|
|
38
|
-
| `change_branch` | string | 隔离分支,固定 `speculo/<cat>/<change>` |
|
|
39
|
-
| `worktree_path` | string | 工作树路径,固定 `.worktree/<change>` |
|
|
40
|
-
| `worktree_status` | string | created \| active \| merged \| removed |
|
|
41
|
-
|
|
42
|
-
- 可归档摘要:base / change 分支、worktree 路径、合并与清理结论、残留风险
|
|
43
|
-
|
|
44
|
-
## 执行步骤
|
|
45
|
-
|
|
46
|
-
1. **判定可隔离性**:确认 (a) 在 git 仓库内,(b) 工作区干净或变更可接受,(c) 目标项目 `speculo/.speculo/` 被 git 跟踪(产物需随分支合并)。任一不满足 → **不创建**,向调用方报告原因并降级为非 worktree 模式。
|
|
47
|
-
2. **命名**:base = 当前分支;`change_branch = speculo/<cat>/<change>`;`worktree_path = .worktree/<change>`。
|
|
48
|
-
3. **创建**:见 `references/create-worktree.md`。完成后返回 `base_branch / change_branch / worktree_path` 与 `worktree_status: active` 供调用方写入。
|
|
49
|
-
4. **隔离推进**:此后该 change 的全部工作(代码 + `speculo/.speculo/<cat>/<change>/` 产物)都在 `worktree_path` 内、`change_branch` 上进行。
|
|
50
|
-
5. **审查全树**(review 时):见 `references/audit-branch-tree.md`,覆盖 `base..change_branch` 的每个 commit。
|
|
51
|
-
6. **合并回收**(finalize 时):见 `references/merge-and-cleanup.md`,合并回 base、删分支、删 worktree。
|
|
52
|
-
|
|
53
|
-
**破坏性步骤**(合并、删分支、删 worktree)必须先列计划、经用户确认再执行;合并冲突即停、不强推。
|
|
54
|
-
|
|
55
|
-
## 渐进披露
|
|
56
|
-
|
|
57
|
-
- `references/create-worktree.md`:建立隔离分支与 `.worktree/` 工作树时读取(grill / change 创建)。
|
|
58
|
-
- `references/audit-branch-tree.md`:审查 change 分支树相对 base 的全部 commit 时读取(review)。
|
|
59
|
-
- `references/merge-and-cleanup.md`:把 change 分支合并回原分支并清理时读取(finalize)。
|
|
23
|
+
破坏性 git 动作逐项确认;冲突时停止并返回现状,不强推。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 审查 change 分支树
|
|
2
2
|
|
|
3
|
-
worktree 模式下,review 必须覆盖 change 分支相对 base 的**全部 commit**,而不只是工作区 diff
|
|
3
|
+
worktree 模式下,review 必须覆盖 change 分支相对 base 的**全部 commit**,而不只是工作区 diff。由当前 workflow 的 review route 调用。
|
|
4
4
|
|
|
5
5
|
## 输入
|
|
6
6
|
|
|
@@ -29,4 +29,4 @@ worktree 模式下,review 必须覆盖 change 分支相对 base 的**全部 co
|
|
|
29
29
|
|
|
30
30
|
- 不替换用户显式指定的 fixed point。
|
|
31
31
|
- 不遗漏任何 commit;clean-review 声明须确认已覆盖 `base..change_branch` 全部 commit。
|
|
32
|
-
- 不自行选择持久化目录;审查字段由调用方写入 `speculo/.speculo/<
|
|
32
|
+
- 不自行选择持久化目录;审查字段由调用方写入 `speculo/.speculo/<workflow>/changes/<change>/.status.json`。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 创建隔离 worktree
|
|
2
2
|
|
|
3
|
-
为当前 change 建立独立分支与 `.worktree/<change>/`
|
|
3
|
+
为当前 workflow change 建立独立分支与 `.worktree/<change>/` 工作树。调用方只有在用户显式启用隔离时执行。
|
|
4
4
|
|
|
5
5
|
## 前置
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
## 命名
|
|
12
12
|
|
|
13
13
|
- base 分支 = 启用隔离时的当前分支(`git rev-parse --abbrev-ref HEAD`)
|
|
14
|
-
- change 分支 = `speculo/<
|
|
14
|
+
- change 分支 = `speculo/<workflow>/<change>`
|
|
15
15
|
- worktree 路径 = `.worktree/<change>`
|
|
16
16
|
|
|
17
17
|
## 步骤
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
3. 创建分支与工作树:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
git worktree add -b speculo/<
|
|
24
|
+
git worktree add -b speculo/<workflow>/<change> .worktree/<change>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
4. 在工作树内初始化该 change 的 Speculo 产物目录 `speculo/.speculo/<
|
|
28
|
-
5. 提示调用方:此后所有工作在 `.worktree/<change>/` 内、`speculo/<
|
|
27
|
+
4. 在工作树内初始化该 change 的 Speculo 产物目录 `speculo/.speculo/<workflow>/changes/<change>/` 与 `.status.json`(由调用方按持久化契约写入)。
|
|
28
|
+
5. 提示调用方:此后所有工作在 `.worktree/<change>/` 内、`speculo/<workflow>/<change>` 分支上进行。
|
|
29
29
|
|
|
30
30
|
## 返回给调用方
|
|
31
31
|
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
|
|
35
35
|
## 边界
|
|
36
36
|
|
|
37
|
-
- 不自行选择持久化目录;字段值返回给调用方 workflow 写入 `speculo/.speculo/<
|
|
37
|
+
- 不自行选择持久化目录;字段值返回给调用方 workflow 写入 `speculo/.speculo/<workflow>/changes/<change>/.status.json`。
|
|
38
38
|
- 分支或工作树已存在时不覆盖、不复用,停止报告。
|
|
39
39
|
- 非 git 仓库 / 工作区不可用 / `speculo/.speculo/` 未被跟踪时降级为非 worktree 模式。
|