dsh-pstack 0.2.0-beta.1 → 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/LICENSE +2 -3
- package/README.md +148 -84
- package/README.zh.md +198 -0
- package/assets/pstack-config-entry.png +0 -0
- package/cordis.patch.yml +105 -27
- package/dist/client.mjs +2341 -0
- package/dist/client.mjs.map +1 -0
- package/dist/host-contract-CUPSpeNk.d.mts +22 -0
- package/dist/index.d.mts +49 -238
- package/dist/index.mjs +250 -123
- package/dist/models.d.mts +44 -0
- package/dist/models.mjs +201 -0
- package/dist/paths-BT77khwm.mjs +48 -0
- package/dist/pstack/LICENSE +21 -0
- package/dist/pstack/README.md +291 -0
- package/dist/pstack/agents/poteto-agent.md +9 -0
- package/{assets → dist/pstack}/docs/guide/01-setup.md +13 -11
- package/{assets → dist/pstack}/docs/guide/02-poteto-mode.md +4 -4
- package/{assets → dist/pstack}/docs/guide/04-design.md +4 -4
- package/{assets → dist/pstack}/docs/guide/05-build-and-clean.md +2 -2
- package/{assets → dist/pstack}/docs/guide/06-verify-and-ship.md +13 -3
- package/{assets → dist/pstack}/docs/guide/07-overnight.md +15 -13
- package/{assets → dist/pstack}/docs/guide/09-make-it-yours.md +6 -2
- package/{assets → dist/pstack}/docs/guide/10-recipes-and-pitfalls.md +7 -5
- package/{assets → dist/pstack}/docs/guide/README.md +1 -1
- package/dist/pstack/docs/harness/dsh.md +98 -0
- package/{assets → dist/pstack}/skills/architect/SKILL.md +12 -12
- package/dist/pstack/skills/arena/SKILL.md +50 -0
- package/{assets → dist/pstack}/skills/automate-me/SKILL.md +14 -14
- package/{assets → dist/pstack}/skills/benchmark-checklist/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/blast-radius/SKILL.md +4 -6
- package/{assets → dist/pstack}/skills/correct/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/create-formal-verification-skill/SKILL.md +4 -2
- package/{assets → dist/pstack}/skills/create-verification-skill/SKILL.md +5 -5
- package/dist/pstack/skills/figure-it-out/SKILL.md +54 -0
- package/dist/pstack/skills/how/SKILL.md +38 -0
- package/{assets → dist/pstack}/skills/in-your-own-words/SKILL.md +1 -1
- package/dist/pstack/skills/interrogate/SKILL.md +33 -0
- package/{assets → dist/pstack}/skills/ketchup/SKILL.md +3 -5
- package/dist/pstack/skills/ketchup-video/SKILL.md +29 -0
- package/{assets → dist/pstack}/skills/maintain-formal-verification-skill/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/maintain-verification-skill/SKILL.md +3 -3
- package/dist/pstack/skills/make-bot-ui/SKILL.md +117 -0
- package/dist/pstack/skills/no-comments/SKILL.md +26 -0
- package/{assets → dist/pstack}/skills/poteto-help/SKILL.md +34 -31
- package/{assets → dist/pstack}/skills/poteto-help/references/prompting.md +1 -1
- package/{assets → dist/pstack}/skills/poteto-help/references/recipes.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/SKILL.md +20 -19
- package/dist/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/dist/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/babysit.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/eval.md +3 -3
- package/dist/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/hillclimb.md +3 -3
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/investigation.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/multi-phase-plan.md +23 -23
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/opening-a-pr.md +6 -6
- package/dist/pstack/skills/poteto-mode/playbooks/orchestrate.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/pause-safely.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/prototype.md +4 -4
- package/dist/pstack/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/dist/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/shipping.md +2 -2
- package/{assets → dist/pstack}/skills/poteto-mode/playbooks/trace-forensics.md +2 -2
- package/dist/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/dist/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/check-plan.mjs +6 -8
- package/dist/pstack/skills/poteto-mode/scripts/check-plan.test.mjs +128 -0
- package/{assets/skills/poteto-mode/scripts/check-plan.test.mjs → dist/pstack/skills/poteto-mode/scripts/expect.mjs} +12 -101
- package/dist/pstack/skills/poteto-mode/scripts/support.mjs +93 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.mjs +123 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +217 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.mjs +119 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.mjs +626 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/github.test.mjs +521 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.mjs +657 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +523 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/render.mjs +106 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/types.mjs +9 -0
- package/dist/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +5 -0
- package/{assets → dist/pstack}/skills/poteto-mode/scripts/worktree-audit.mjs +15 -22
- package/dist/pstack/skills/poteto-mode/scripts/worktree-audit.test.mjs +134 -0
- package/{assets → dist/pstack}/skills/principle-attack-the-premise/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-boundary-discipline/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-encode-lessons-in-structure/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-exhaust-the-design-space/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-experience-first/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-explain-the-number/SKILL.md +3 -2
- package/{assets → dist/pstack}/skills/principle-fix-root-causes/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-laziness-protocol/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-make-operations-idempotent/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-minimize-reader-load/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-model-the-domain/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-never-block-on-the-human/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-outcome-oriented-execution/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-prove-it-works/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/principle-redesign-from-first-principles/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-separate-before-serializing-shared-state/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-sequence-verifiable-units/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-subtract-before-you-add/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-test-behavior-not-implementation/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/principle-type-system-discipline/SKILL.md +1 -1
- package/dist/pstack/skills/recall/SKILL.md +37 -0
- package/dist/pstack/skills/reflect/SKILL.md +71 -0
- package/{assets → dist/pstack}/skills/reflect/references/divergent-reviewer.md +4 -4
- package/{assets → dist/pstack}/skills/reflect/references/judgment-reviewer.md +2 -2
- package/{assets → dist/pstack}/skills/reflect/references/synthesizer.md +5 -5
- package/{assets → dist/pstack}/skills/reflect/references/tooling-reviewer.md +2 -2
- package/dist/pstack/skills/setup-pstack/SKILL.md +80 -0
- package/{assets → dist/pstack}/skills/sharpen/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/show-me-your-work/SKILL.md +8 -8
- package/{assets → dist/pstack}/skills/show-me-your-work/scripts/log.mjs +1 -3
- package/dist/pstack/skills/show-me-your-work/scripts/log.test.mjs +56 -0
- package/dist/pstack/skills/statechart/SKILL.md +82 -0
- package/dist/pstack/skills/statechart/references/render.md +93 -0
- package/dist/pstack/skills/statechart/scripts/backends/cfg.mjs +31 -0
- package/dist/pstack/skills/statechart/scripts/backends/mermaid.mjs +186 -0
- package/dist/pstack/skills/statechart/scripts/backends/plain-text.mjs +62 -0
- package/dist/pstack/skills/statechart/scripts/backends/report.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/frontends/config.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/frontends/dot.mjs +67 -0
- package/dist/pstack/skills/statechart/scripts/frontends/marks.mjs +94 -0
- package/dist/pstack/skills/statechart/scripts/frontends/messages.mjs +48 -0
- package/dist/pstack/skills/statechart/scripts/frontends/spec.mjs +101 -0
- package/dist/pstack/skills/statechart/scripts/frontends/trace.mjs +39 -0
- package/dist/pstack/skills/statechart/scripts/frontends/value.mjs +180 -0
- package/dist/pstack/skills/statechart/scripts/frontends/verdict.mjs +40 -0
- package/dist/pstack/skills/statechart/scripts/frontends/view.mjs +99 -0
- package/dist/pstack/skills/statechart/scripts/ir.mjs +277 -0
- package/dist/pstack/skills/statechart/scripts/passes/annotate.mjs +92 -0
- package/dist/pstack/skills/statechart/scripts/passes/label.mjs +210 -0
- package/dist/pstack/skills/statechart/scripts/passes/lift.mjs +84 -0
- package/dist/pstack/skills/statechart/scripts/passes/loop-check.mjs +47 -0
- package/dist/pstack/skills/statechart/scripts/passes/paths.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/passes/reach.mjs +135 -0
- package/dist/pstack/skills/statechart/scripts/passes/region-check.mjs +82 -0
- package/dist/pstack/skills/statechart/scripts/passes/regions.mjs +268 -0
- package/dist/pstack/skills/statechart/scripts/pipeline.mjs +72 -0
- package/dist/pstack/skills/statechart/scripts/run.mjs +440 -0
- package/dist/pstack/skills/statechart/scripts/statechart.mjs +155 -0
- package/dist/pstack/skills/statechart/scripts/statechart.test.mjs +198 -0
- package/dist/pstack/skills/statechart/scripts/worker.mjs +31 -0
- package/dist/pstack/skills/swarm/SKILL.md +43 -0
- package/{assets → dist/pstack}/skills/tdd/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/teach/SKILL.md +2 -2
- package/{assets → dist/pstack}/skills/technical-writing/SKILL.md +1 -1
- package/{assets → dist/pstack}/skills/typescript-best-practices/SKILL.md +3 -6
- package/{assets → dist/pstack}/skills/why/SKILL.md +8 -8
- package/dist/remote.d.mts +27 -0
- package/dist/remote.mjs +234 -0
- package/dist/role-config-NNn5r1JX.mjs +415 -0
- package/dist/role-manifest-C3fUzjLI.d.mts +19 -0
- package/dist/role-wire-DZwTn2wF.d.mts +55 -0
- package/dist/roles.d.mts +18 -0
- package/dist/roles.mjs +323 -0
- package/dist/script.d.mts +9 -111
- package/dist/script.mjs +32 -329
- package/dist/skill.d.mts +38 -0
- package/dist/skill.mjs +183 -0
- package/dist/skills/authored/decision-audit/SKILL.md +103 -0
- package/dist/skills/authored/decision-audit/SKILL.zh.md +103 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.md +17 -0
- package/dist/skills/authored/decision-audit/references/recover-commit.zh.md +17 -0
- package/dist/skills/authored/decision-write/SKILL.md +133 -0
- package/dist/skills/authored/decision-write/SKILL.zh.md +133 -0
- package/dist/skills/authored/decision-write/references/land.md +48 -0
- package/dist/skills/authored/decision-write/references/land.zh.md +48 -0
- package/dist/skills/authored/decision-write/references/scope.md +16 -0
- package/dist/skills/authored/decision-write/references/scope.zh.md +16 -0
- package/dist/skills/authored/docs-drift/SKILL.md +120 -0
- package/dist/skills/authored/docs-drift/SKILL.zh.md +120 -0
- package/dist/skills/authored/setup-project-docs/SKILL.md +63 -0
- package/dist/skills/authored/setup-project-docs/SKILL.zh.md +63 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.md +13 -0
- package/dist/skills/authored/setup-project-docs/references/decision-conventions.zh.md +13 -0
- package/dist/skills/vendored/retro/SKILL.md +44 -0
- package/dist/skills/vendored/retro/agents/openai.yaml +5 -0
- package/dist/skills/vendored/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/dist/skills/vendored/writing-for-agents/SKILL.md +81 -0
- package/dist/skills/vendored/writing-for-agents/agents/openai.yaml +3 -0
- package/dist/subagent.d.mts +54 -206
- package/dist/subagent.mjs +258 -963
- package/locale/en.json +3 -2
- package/locale/zh.json +3 -2
- package/package.json +93 -66
- package/assets/agents/poteto-agent.md +0 -8
- package/assets/docs/harness/dsh.md +0 -60
- package/assets/docs/pstack-models.example.md +0 -54
- package/assets/skills/arena/SKILL.md +0 -50
- package/assets/skills/figure-it-out/SKILL.md +0 -54
- package/assets/skills/how/SKILL.md +0 -38
- package/assets/skills/interrogate/SKILL.md +0 -71
- package/assets/skills/interrogate/references/code-quality-review.md +0 -47
- package/assets/skills/interrogate/references/lead-judgment.md +0 -39
- package/assets/skills/interrogate/references/reviewer-prompt.md +0 -62
- package/assets/skills/interrogate/references/rubric.md +0 -77
- package/assets/skills/no-comments/SKILL.md +0 -26
- package/assets/skills/poteto-mode/playbooks/authoring-a-skill.md +0 -12
- package/assets/skills/poteto-mode/playbooks/autonomous-run.md +0 -15
- package/assets/skills/poteto-mode/playbooks/autopilot-full.md +0 -25
- package/assets/skills/poteto-mode/playbooks/autopilot-stack.md +0 -12
- package/assets/skills/poteto-mode/playbooks/bug-fix.md +0 -15
- package/assets/skills/poteto-mode/playbooks/feature.md +0 -21
- package/assets/skills/poteto-mode/playbooks/orchestrate.md +0 -112
- package/assets/skills/poteto-mode/playbooks/perf-issue.md +0 -25
- package/assets/skills/poteto-mode/playbooks/refactoring.md +0 -16
- package/assets/skills/poteto-mode/playbooks/runtime-forensics.md +0 -11
- package/assets/skills/poteto-mode/playbooks/session-pickup.md +0 -11
- package/assets/skills/poteto-mode/playbooks/visual-parity.md +0 -11
- package/assets/skills/poteto-mode/playbooks/worktree-cleanup.md +0 -20
- package/assets/skills/poteto-mode/scripts/orch/orch.mjs +0 -4282
- package/assets/skills/poteto-mode/scripts/orch/orch.test.mjs +0 -2042
- package/assets/skills/poteto-mode/scripts/watch-pr/cli.test.mjs +0 -5101
- package/assets/skills/poteto-mode/scripts/watch-pr/github.test.mjs +0 -1177
- package/assets/skills/poteto-mode/scripts/watch-pr/policy.test.mjs +0 -1441
- package/assets/skills/poteto-mode/scripts/watch-pr/watch-pr.mjs +0 -4601
- package/assets/skills/recall/SKILL.md +0 -37
- package/assets/skills/reflect/SKILL.md +0 -69
- package/assets/skills/setup-pstack/SKILL.md +0 -67
- package/assets/skills/swarm/SKILL.md +0 -43
- package/dist/frontmatter-BQX3ekwP.mjs +0 -229
- package/dist/frontmatter-BQX3ekwP.mjs.map +0 -1
- package/dist/history.d.mts +0 -429
- package/dist/history.mjs +0 -1129
- package/dist/history.mjs.map +0 -1
- package/dist/host-contract-o47JH_r8.d.mts +0 -527
- package/dist/index.mjs.map +0 -1
- package/dist/paths-D_JlVmBk.mjs +0 -42
- package/dist/paths-D_JlVmBk.mjs.map +0 -1
- package/dist/script.mjs.map +0 -1
- package/dist/subagent.mjs.map +0 -1
- /package/{static/icon.png → assets/logo.png} +0 -0
- /package/{assets → dist/pstack}/agents/comment-sicko.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/03-understand.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/08-principles.md +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/design.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/overnight.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/recipes.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/router.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/understanding.jpg +0 -0
- /package/{assets → dist/pstack}/docs/guide/images/verification.jpg +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/design-red-flags.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/rationale-template.md +0 -0
- /package/{assets → dist/pstack}/skills/architect/references/runner-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/bro/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/README.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/create-note.md +0 -0
- /package/{assets → dist/pstack}/skills/create-verification-skill/references/feature-map-example/search.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explainer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/how/references/explorer-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/poteto-mode/references/bugbot-triage.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-build-the-lever/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-foundational-thinking/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/principle-guard-the-context-window/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/show-me-your-work/references/decision-log-template.tsv +0 -0
- /package/{assets → dist/pstack}/skills/typescript-best-practices/references/patterns.md +0 -0
- /package/{assets → dist/pstack}/skills/unslop/SKILL.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/epistemics.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/investigator-prompt.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/source-playbook.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/code-archaeology.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/databricks.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/datadog.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/incident-postmortem.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/linear.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/notion.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/sentry.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/sources/slack.md +0 -0
- /package/{assets → dist/pstack}/skills/why/references/synthesizer-prompt.md +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: decision-write
|
|
3
|
+
description: 撰写、更新、落地或取代决策记录。用于已定取舍、缺失设计理由、推翻决策或记录文件改动;落地模式查找并校验实现,仅更新 `Review` 时保留当前状态。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 撰写或更新决策记录
|
|
7
|
+
|
|
8
|
+
将一项已收敛的选择交付为经校验的记录和证据报告。所有记录修改都通过本技能;`decision-audit` 只读报告。
|
|
9
|
+
|
|
10
|
+
## 入口规则
|
|
11
|
+
|
|
12
|
+
任何对 `Status`、`Implemented-by`、`Superseded-by`、`Review`、正文或链接的修改都执行本流程。流程无法运行时停下报告;本规则优先于 `<dir>/AGENTS.md` 中允许直接编辑的约定。
|
|
13
|
+
|
|
14
|
+
## 定位记录目录
|
|
15
|
+
|
|
16
|
+
按以下顺序定位 `<dir>`:
|
|
17
|
+
|
|
18
|
+
1. 使用调用方提供的记录或目录路径。
|
|
19
|
+
2. 否则,解析根目录 `AGENTS.md` 的 `## Project docs` 中的决策指针;目标为现存的 `<dir>/AGENTS.md` 时使用该目录。
|
|
20
|
+
3. 否则,检查 `docs/decisions/`、`docs/adr/` 和 `doc/adr/`。
|
|
21
|
+
|
|
22
|
+
沿用选中目录的命名约定,并在存在时读取其 `AGENTS.md` 与 `README.md` 约定。仍有多个候选时,询问哪个是当前目录并等待。都不存在时,报告未找到决策目录,建议使用 `/setup-project-docs`,然后停止。
|
|
23
|
+
|
|
24
|
+
`AGENTS.md` 与 `README.md` 是约定而非记录;检索、分类与更新都排除它们。
|
|
25
|
+
|
|
26
|
+
## 选择模式
|
|
27
|
+
|
|
28
|
+
- **撰写:** 没有既有记录拥有这个决策、新记录取代旧记录,或既有记录需要实质更新正文或关系。重复与部分重叠的归类留在撰写模式;明确的状态字段更新走落地。执行步骤 1–5,在步骤 6 展示确认关口,仅在确认后写入,再执行步骤 7 报告。
|
|
29
|
+
- **落地:** 用户明确要求把既有记录标为 `accepted` 或更新其状态字段。完整读取目标记录,再执行步骤 4、5、7。记录路径加 `accepted` 就是足够输入;不要自行进入落地。未给出路径时,列出 `Scope` 匹配落地改动的记录并询问更新哪一条。仅更新 `Review` 时保留 `Status` 与 `Implemented-by`,跳过步骤 4、5,执行步骤 7 报告。
|
|
30
|
+
|
|
31
|
+
## 1. 确认选择
|
|
32
|
+
|
|
33
|
+
先从改动与讨论中取得全部三项,只询问缺失内容并等待:
|
|
34
|
+
|
|
35
|
+
- **目标:** 这个决策要解决的问题。
|
|
36
|
+
- **约束:** 排除某个选项的边界。
|
|
37
|
+
- **备选方案:** 实际被否决的选项,或者只考虑过单一候选这一明确事实。
|
|
38
|
+
|
|
39
|
+
## 2. 查找相关记录
|
|
40
|
+
|
|
41
|
+
用主题、受影响模块和备选方案的专有词检索:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
grep -ril --exclude=AGENTS.md --exclude=README.md \
|
|
45
|
+
-e "<关键词 1>" -e "<关键词 2>" <dir>/*.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
读取每个命中至第一个 `## ` 标题;头部无法区分归类,或无法提供更新所需内容时再读正文。检索过宽时收紧关键词,不通读整个目录。给每个命中分类:
|
|
49
|
+
|
|
50
|
+
- **重复:** 既有记录拥有这个决策。更新该记录,不另写第二条。
|
|
51
|
+
- **完全取代:** 起草新记录,让两条记录互相链接;把旧记录的取代变更放进确认关口。
|
|
52
|
+
- **部分重叠:** 保留两者,互相链接,并更正已变化的事实。
|
|
53
|
+
- **无关:** 不作修改。
|
|
54
|
+
- **未决:** 将关系与需要人工回答的问题带入报告。
|
|
55
|
+
|
|
56
|
+
每个命中都有归类、每项由此产生的修改都已明确时,本步完成。
|
|
57
|
+
|
|
58
|
+
## 3. 起草记录
|
|
59
|
+
|
|
60
|
+
遵循 `<dir>/AGENTS.md`,包括标题语言;没有该文件时使用:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
# Decision: <one-line title>
|
|
64
|
+
|
|
65
|
+
Status: proposed | accepted | superseded
|
|
66
|
+
Date: YYYY-MM-DD
|
|
67
|
+
Scope: <glob>[, <glob>...]
|
|
68
|
+
Implemented-by: <PR #N | commit:SHA | ->
|
|
69
|
+
Review: YYYY-MM-DD
|
|
70
|
+
Superseded-by: <记录路径> — <一句原因> (仅 Status 为 superseded 时)
|
|
71
|
+
|
|
72
|
+
## Background
|
|
73
|
+
## Decision
|
|
74
|
+
## Alternatives
|
|
75
|
+
## Consequences
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
让 `Background` 脱离所选方案也能读懂。已接受的记录在 `Decision` 中用现在时描述系统。每个实际考虑过的备选方案独立成段并写明落选原因;只有单一候选时如实说明。
|
|
79
|
+
|
|
80
|
+
## 4. 设定状态并校验锚点
|
|
81
|
+
|
|
82
|
+
`Status` 与 `Implemented-by` 是一对。按证据选中下表的一行,并在同一次修改中写入两个字段:
|
|
83
|
+
|
|
84
|
+
| 证据 | Status | Implemented-by |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| 没有可核验的落地锚点 | `proposed` | `-` |
|
|
87
|
+
| `PR #N` 为 `MERGED` | `accepted` | `PR #N` |
|
|
88
|
+
| `commit:SHA` 是默认分支的祖先 | `accepted` | `commit:SHA` |
|
|
89
|
+
| 用户确认仅记录提交的例外 | `accepted` | `commit:<记录提交>` |
|
|
90
|
+
| 被更新的草稿取代 | `superseded` | 保留原值 |
|
|
91
|
+
|
|
92
|
+
新记录在落地前保持 `proposed`。`Implemented-by` 指向实现改动;追溯性记录指向更早的实现。仅记录提交必须走用户确认的例外。squash 合并的仓库优先用已合并 PR。
|
|
93
|
+
|
|
94
|
+
落地模式没有给定锚点,或需要“仅记录提交”例外时,编辑前读取[查找并校验实现](references/land.zh.md)。校验其他已有锚点时,只执行该参考中的校验流程,不执行查找步骤。
|
|
95
|
+
|
|
96
|
+
`<base>` 取仓库默认分支,并报告选中的 ref。校验每个锚点。撰写模式中,证据不可用或基线无法解析时,新记录保持 `proposed` + `-`;落地模式中停止并报告,不编辑记录。既有 `accepted` 记录的锚点校验失败时,停下报告,不静默降级。只改证据要求的字段;单独推进 `Review` 不改变状态。
|
|
97
|
+
|
|
98
|
+
新草稿取代旧记录时,在同一次获批的修改中把旧记录改为 `superseded`,即使旧记录原为 `accepted`。保留旧正文与锚点,添加互链,并在 `Review` 下方写 `Superseded-by: <新记录路径> — <一句原因>`。原因缺失时先询问并等待。原为 `proposed` 的旧记录保留 `Implemented-by: -`。
|
|
99
|
+
|
|
100
|
+
## 5. 检查范围覆盖改动
|
|
101
|
+
|
|
102
|
+
所有 glob/路径检查都使用[匹配 Scope 路径](references/scope.zh.md),包括落地模式的锚点查找。调用方提供 `scope` 路径时直接使用。带已核验实现改动的落地分支,用以下命令列出实现路径:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
gh pr view N --json files --jq '.files[].path'
|
|
106
|
+
git show --pretty=format: --name-only SHA
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
经确认的“仅记录提交”回退跳过本项检查,并在报告中说明例外。其他分支收集相对基线的提交与未提交改动:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git diff --name-only "$(git merge-base HEAD <base>)"..HEAD
|
|
113
|
+
git status --porcelain=v1 --untracked-files=all
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
解析 `git status` 中的路径,重命名取目标路径。每条新增或更新的记录都必须有至少一个所选改动路径匹配其 `Scope` glob。全部不匹配时,询问是放宽 glob,还是该记录不属于这次改动。将匹配路径留作报告。
|
|
117
|
+
|
|
118
|
+
## 6. 草稿确认关口
|
|
119
|
+
|
|
120
|
+
每次撰写写入(包括重复记录的更新)都要展示每条新增或更新记录的完整结果,以及每个相关记录的分类。包括每项拟议的旧记录取代变更及其 `Superseded-by` 路径和原因。请求用户明确确认并等待。确认后严格应用获批的修改;草稿被拒绝时保持所有文件不变。
|
|
121
|
+
|
|
122
|
+
## 7. 报告
|
|
123
|
+
|
|
124
|
+
根目录 `AGENTS.md` 没有可解析到所选 `<dir>` 的决策指针时,建议用 `/setup-project-docs` 登记。覆盖每个检索命中、改动的记录、关系判断、锚点校验、范围匹配和未决问题。等待落地的 `proposed` 记录在合并后需要一次“落地”更新。报告查到的实现及其改动路径;仅记录锚点须标明为经确认的例外。包括每个 `Superseded-by` 路径和原因。
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Record: docs/decisions/2026-10-27-use-postgres.md
|
|
128
|
+
Status: accepted
|
|
129
|
+
Related: 2026-03-02-mysql-setup.md -> overlapping, cross-linked
|
|
130
|
+
Anchor: PR #412 -> MERGED (gh pr view 412 --json state,files)
|
|
131
|
+
Scope: src/db/** matched src/db/client.ts
|
|
132
|
+
Open: none
|
|
133
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Find and verify the implementation
|
|
2
|
+
|
|
3
|
+
Use this reference for Land anchor discovery, record-only fallback, and anchor verification. The main skill owns status pairs, supersession, scope, approval, and reporting.
|
|
4
|
+
|
|
5
|
+
## Find the implementation
|
|
6
|
+
|
|
7
|
+
In Land when no candidate anchor is available, resolve `<base>` as described under **Verify the anchor**, then search commits and merged PRs touching the record's `Scope`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git log --since=<Date> --format='%H %cs %s' <base> --
|
|
11
|
+
gh pr list --state merged --search "<record title or scope keyword>" --json number,title,mergedAt,files --limit 20
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If `Scope` is absent, search commit subjects and PR titles for the record's title or keywords. Start at its `Date`; for a retrospective record, also inspect recent commits before `Date` that touch `Scope`. If `gh` is unavailable, search commits and report that PR discovery was skipped.
|
|
15
|
+
|
|
16
|
+
Keep candidates whose changed paths intersect `Scope` and include at least one path outside `<dir>`; a change containing only decision records is not an implementation. Use one clearly matching candidate's `PR #N` or `commit:SHA`. If several match, list their dates, titles, and paths and ask which one. If none matches, use the fallback below.
|
|
17
|
+
|
|
18
|
+
## Record-only fallback
|
|
19
|
+
|
|
20
|
+
When no implementation exists and the user still wants `accepted`, explain both points and wait for explicit confirmation:
|
|
21
|
+
|
|
22
|
+
- **Reason:** the record commit records the decision but does not implement it, so the anchor would claim a landing that never happened.
|
|
23
|
+
- **Consequence:** `decision-audit` reports this anchor as a C finding; a later implementation should replace it.
|
|
24
|
+
|
|
25
|
+
Ask whether to use `commit:<record-commit>` or leave `proposed` + `-`. Use `accepted` + `commit:<record-commit>` only after confirmation, and report the exception. This exception overrides an `<dir>/AGENTS.md` ban on record-only anchors. If that commit is outside the default branch, retain `proposed` + `-` until it merges.
|
|
26
|
+
|
|
27
|
+
## Verify the anchor
|
|
28
|
+
|
|
29
|
+
Resolve `<base>` as the default branch:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null ||
|
|
33
|
+
git rev-parse --verify origin/main 2>/dev/null ||
|
|
34
|
+
git rev-parse --verify origin/master 2>/dev/null ||
|
|
35
|
+
git rev-parse --verify main 2>/dev/null ||
|
|
36
|
+
git rev-parse --verify master 2>/dev/null
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Verify every proposed `Implemented-by` value:
|
|
40
|
+
|
|
41
|
+
| Value | Command | Verified when |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `PR #N` | `gh pr view N --json state,files` | `state` is `MERGED` and the change implements the decision |
|
|
44
|
+
| `commit:SHA` | `git merge-base --is-ancestor SHA <base>` | Exit code 0 and the change implements the decision |
|
|
45
|
+
|
|
46
|
+
List candidate paths with `gh pr view N --json files --jq '.files[].path'` or `git show --pretty=format: --name-only SHA`. A real implementation intersects `Scope` and includes a path outside `<dir>`; a record-only anchor needs the confirmed exception. Return these paths to the scope check.
|
|
47
|
+
|
|
48
|
+
In Draft, unlanded work, failed verification, unavailable `gh`, or an unresolved `<base>` leaves a new record `proposed` + `-`; report the evidence or attempted refs. In Land, stop and report without editing. An unresolved base also blocks base-relative scope checks; use caller-supplied paths or report that evidence as unavailable. Never demote an existing `accepted` record on failed verification; return its broken anchor to the main skill's stop-and-report rule. A Review-only update skips this reference.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 查找并校验实现
|
|
2
|
+
|
|
3
|
+
本参考用于落地锚点查找、仅记录提交回退和锚点校验。状态成对、取代、范围、确认和报告规则见主技能。
|
|
4
|
+
|
|
5
|
+
## 查找实现
|
|
6
|
+
|
|
7
|
+
落地模式没有可用的候选锚点时,先按“校验锚点”解析 `<base>`,再检索触及记录 `Scope` 的提交与已合并 PR:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git log --since=<Date> --format='%H %cs %s' <base> --
|
|
11
|
+
gh pr list --state merged --search "<记录标题或范围关键词>" --json number,title,mergedAt,files --limit 20
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
没有 `Scope` 时,用记录标题或关键词检索提交主题与 PR 标题。从记录的 `Date` 开始;追溯性记录也检查 `Date` 之前最近触及 `Scope` 的提交。`gh` 不可用时只检索提交,并报告已跳过 PR 查找。
|
|
15
|
+
|
|
16
|
+
保留改动路径与 `Scope` 相交、且至少有一个 `<dir>` 之外路径的候选;只含决策记录的改动不是实现。只有一个明确候选时,用它的 `PR #N` 或 `commit:SHA`。多个候选时列出日期、标题、路径并询问选哪个。没有候选时走下面的回退。
|
|
17
|
+
|
|
18
|
+
## 仅记录提交的回退
|
|
19
|
+
|
|
20
|
+
没有找到实现、而用户仍要求 `accepted` 时,解释以下两点并等待明确确认:
|
|
21
|
+
|
|
22
|
+
- **原因:** 记录提交只记录决策,没有实现它,锚点会声称一个并未发生的落地。
|
|
23
|
+
- **后果:** `decision-audit` 会把该锚点报为 C 类发现;后续实现落地后应替换它。
|
|
24
|
+
|
|
25
|
+
直接询问是用 `commit:<记录提交>`,还是保持 `proposed` + `-`。只有用户确认后才写 `accepted` + `commit:<记录提交>`,并在报告中说明例外。本例外优先于 `<dir>/AGENTS.md` 中禁止仅记录锚点的约定。记录提交不在默认分支时,保持 `proposed` + `-` 直到合并。
|
|
26
|
+
|
|
27
|
+
## 校验锚点
|
|
28
|
+
|
|
29
|
+
将 `<base>` 解析为默认分支:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null ||
|
|
33
|
+
git rev-parse --verify origin/main 2>/dev/null ||
|
|
34
|
+
git rev-parse --verify origin/master 2>/dev/null ||
|
|
35
|
+
git rev-parse --verify main 2>/dev/null ||
|
|
36
|
+
git rev-parse --verify master 2>/dev/null
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
校验每个拟写入的 `Implemented-by` 值:
|
|
40
|
+
|
|
41
|
+
| 值 | 命令 | 通过条件 |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `PR #N` | `gh pr view N --json state,files` | `state` 为 `MERGED`,且改动实现该决策 |
|
|
44
|
+
| `commit:SHA` | `git merge-base --is-ancestor SHA <base>` | 退出码为 0,且改动实现该决策 |
|
|
45
|
+
|
|
46
|
+
用 `gh pr view N --json files --jq '.files[].path'` 或 `git show --pretty=format: --name-only SHA` 列出候选路径。真实实现与 `Scope` 相交,且至少有一个 `<dir>` 之外的路径;仅记录锚点需要经确认的例外。将这些路径交给范围检查。
|
|
47
|
+
|
|
48
|
+
撰写模式中,改动未落地、校验失败、`gh` 不可用或 `<base>` 无法解析时,新记录保持 `proposed` + `-`,并报告证据或尝试过的 ref。落地模式中停止并报告,不编辑记录。基线无法解析也会阻止相对基线的范围检查;此时使用调用方提供的路径,或报告该证据不可用。既有 `accepted` 记录校验失败时不得降级;回到主技能的停下报告规则处理断裂锚点。仅更新 `Review` 时不读取本参考。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Match Scope paths
|
|
2
|
+
|
|
3
|
+
Use this one matcher for every `Scope` check in `decision-write` and `decision-audit`: changed paths, implementation paths, and existing files.
|
|
4
|
+
|
|
5
|
+
Treat `Scope` as comma-separated Git ignore globs, anchored at the repository root. Paths are repository-relative with `/` separators. `*` stays within one path segment; `**` spans segments. A glob that matches a directory also covers its descendants: for example, `src/*` matches `src/client/index.ts` through `src/client/`.
|
|
6
|
+
|
|
7
|
+
Initialize an isolated temporary Git directory once per run so the repository's own ignore rules cannot affect the result. For each glob, remove a leading `./` and any trailing `/`; reject a leading `/`, a `..` segment, or a newline. Test both forms:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
sandbox="$(mktemp -d)"
|
|
11
|
+
git init -q "$sandbox"
|
|
12
|
+
printf '/%s\n/%s/**\n' "$glob" "$glob" >"$sandbox/rules"
|
|
13
|
+
git -C "$sandbox" -c core.excludesFile="$sandbox/rules" check-ignore -v --no-index -- "$path"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The only files in the sandbox are Git metadata and the rule file; it needs no checkout. Overwrite the rule file for each glob, then remove the verified temporary directory after the run. The path is matcher input, not a file that must exist. Accept a match only when the verbose output names `$sandbox/rules` as its source. Exit 0 with that source is a match. Exit 1 is no match; report any other exit code with its error. Record each matching glob and path. Every record matches when at least one of its globs matches at least one selected path.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# 匹配 Scope 路径
|
|
2
|
+
|
|
3
|
+
`decision-write` 与 `decision-audit` 的所有 `Scope` 检查都使用这一个匹配器:改动路径、实现路径与现存文件均相同。
|
|
4
|
+
|
|
5
|
+
`Scope` 是逗号分隔、以仓库根目录为锚点的 Git ignore glob。路径使用仓库相对形式和 `/` 分隔符。`*` 不跨路径段,`**` 可以跨段;匹配目录的 glob 也覆盖其所有后代,例如 `src/*` 通过匹配 `src/client/` 而匹配 `src/client/index.ts`。
|
|
6
|
+
|
|
7
|
+
每次运行初始化一个隔离的临时 Git 目录,避免仓库自身的 ignore 规则影响结果。对每个 glob 去掉开头的 `./` 与末尾的 `/`;拒绝以 `/` 开头、包含 `..` 路径段或换行的 glob。再测试两种形式:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
sandbox="$(mktemp -d)"
|
|
11
|
+
git init -q "$sandbox"
|
|
12
|
+
printf '/%s\n/%s/**\n' "$glob" "$glob" >"$sandbox/rules"
|
|
13
|
+
git -C "$sandbox" -c core.excludesFile="$sandbox/rules" check-ignore -v --no-index -- "$path"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
沙箱中只有 Git 元数据和规则文件,无需检出。每个 glob 都覆盖写入规则文件,运行结束后删除已确认路径的临时目录。路径是匹配器输入,不要求文件存在。仅当详细输出把 `$sandbox/rules` 标为来源时才接受匹配。退出码为 0 且来源正确即匹配;退出码为 1 则不匹配;其他退出码连同错误一起报告。记录每个匹配的 glob 与路径。只要任一 glob 匹配任一所选路径,该记录即匹配。
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-drift
|
|
3
|
+
description: Audit living project documentation for drift and redundancy; repair approved findings.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Check project documentation drift
|
|
8
|
+
|
|
9
|
+
Audit living project documents against current evidence, then stop after a read-only report or apply approved documentation repairs. Keep implementation changes outside this skill.
|
|
10
|
+
|
|
11
|
+
## Choose the mode
|
|
12
|
+
|
|
13
|
+
- **Report:** `/docs-drift` or `/docs-drift report`. Do steps 1–5 without writing files.
|
|
14
|
+
- **Fix:** `/docs-drift fix`. Do the same inspection, then steps 6–7. Invoking Fix is not write approval.
|
|
15
|
+
|
|
16
|
+
Accept optional paths or globs to add to or narrow the candidate set, plus optional exclusions. Ask when the requested mode or scope is ambiguous.
|
|
17
|
+
|
|
18
|
+
## 1. Discover the maintained documents
|
|
19
|
+
|
|
20
|
+
Start with the root agent documents and root README files that actually exist, including linked language variants. Record absent entry points without creating replacements.
|
|
21
|
+
|
|
22
|
+
Read project maintenance rules and follow pointers designating documents that agents must read, update, or keep synchronized. Use the project's real document names and locations; conventional architecture, glossary, or decision-document paths are leads, not requirements. Ordinary links may supply evidence or receive link checks without recursively adding their targets to the full scan.
|
|
23
|
+
|
|
24
|
+
Apply explicit paths, globs, narrowing, and exclusions to the candidate set. A whole-repository request broadens candidate discovery without making every stored document a maintained project document. Read the nested agent instructions governing each candidate.
|
|
25
|
+
|
|
26
|
+
Classify every candidate using project pointers, governing instructions, and ownership and update conventions:
|
|
27
|
+
|
|
28
|
+
- **Maintained:** owned by this project and updated as its implementation or workflows evolve. Apply all five checks.
|
|
29
|
+
- **Reference-only:** documentation of a dependency, host product, library, or other external system, even when stored inside the repository. Use it as evidence without auditing its own drift.
|
|
30
|
+
- **Excluded:** outside the requested scope or otherwise excluded by an explicit rule.
|
|
31
|
+
- **Unresolved:** maintenance ownership is unclear. Ask before including it and continue classifying unrelated candidates.
|
|
32
|
+
|
|
33
|
+
Determine ownership from evidence rather than paths, directory names, file types, or subjects. A project's own component documents may be maintained; bundled component-library documents may be reference-only. Include governing instruction files in the maintained set only under the same ownership rules.
|
|
34
|
+
|
|
35
|
+
Keep generated, vendored, and upstream content outside the editable set. Record the authoritative source or upstream destination and any project generation procedure for their findings. Record missing pointer targets and links used only as evidence. Complete this step when every candidate has a classification or unresolved question and the maintained, reference-only, excluded, and editable boundaries have source-backed evidence.
|
|
36
|
+
|
|
37
|
+
## 2. Build the evidence inventory
|
|
38
|
+
|
|
39
|
+
Read every maintained document and the instructions governing it. Inventory its checkable claims about current modules, responsibilities, paths, entry points, commands, tools, configuration, dependencies, interfaces, behavior, counts, and status.
|
|
40
|
+
|
|
41
|
+
Trace those claims to current code, configuration, manifests, real directories, entry points, and relevant tests. Treat paths mentioned by documentation as leads, not proof. Use existing read-only project checks when they answer a specific evidence question.
|
|
42
|
+
|
|
43
|
+
Distinguish current facts, intended requirements, and historical statements. Current implementation establishes what exists, not whether that behavior is correct. Mark a claim unverified when the repository cannot supply sufficient evidence.
|
|
44
|
+
|
|
45
|
+
Complete this step when every checkable claim in every maintained document has a source-backed disposition or an explicit evidence limitation.
|
|
46
|
+
|
|
47
|
+
## 3. Apply all five checks
|
|
48
|
+
|
|
49
|
+
**Implementation drift.** Find stale statements or statements contradicted by current evidence about architecture, behavior, paths, commands, interfaces, configuration, dependencies, counts, and status.
|
|
50
|
+
|
|
51
|
+
**Contradictions.** Find incompatible statements within one document or across documents. Distinguish contradictions from intentionally different levels of detail.
|
|
52
|
+
|
|
53
|
+
**Terminology.** Find one concept with conflicting names, one name denoting incompatible concepts, and definitions that diverge from actual usage. Check intentional language variants for corresponding meaning.
|
|
54
|
+
|
|
55
|
+
**Links and pointers.** Resolve repository-relative links, referenced paths, and anchors from their containing document. Check external links when feasible; classify network or access failures as unverified rather than dead.
|
|
56
|
+
|
|
57
|
+
**Redundancy and unsupported elaboration.** Find semantic duplication, scattered rules, obsolete passages, and unsupported facts, assumptions, or invented elaboration accumulated during iteration. Examples include fabricated module responsibilities, command behavior, configuration defaults, design rationale, compatibility, performance conclusions, test coverage, and acceptance status. Shrink disproven or unsupported elaboration to the smallest evidence-backed statement. Insufficient evidence alone makes a claim unverified, not a deletion candidate. Preserve the context of historical statements and explicit future plans.
|
|
58
|
+
|
|
59
|
+
Before proposing consolidation, identify an authoritative location. Preserve intentional summaries, audience-specific views, language variants, and unique qualifications.
|
|
60
|
+
|
|
61
|
+
Report style, formatting, or completeness preferences only when they substantiate one of these findings. Complete this step when every class has been applied to every maintained document and every potential finding has a location, observed statement, supporting evidence or evidence boundary, and proposed action.
|
|
62
|
+
|
|
63
|
+
## 4. Resolve authority and classify findings
|
|
64
|
+
|
|
65
|
+
Use the kind of question to determine authority:
|
|
66
|
+
|
|
67
|
+
- Explicit user requirements govern requested behavior.
|
|
68
|
+
- Current project specifications and binding conventions govern declared constraints.
|
|
69
|
+
- Verifiable implementation evidence governs descriptions of current behavior.
|
|
70
|
+
- A document's historical context governs statements about past events.
|
|
71
|
+
|
|
72
|
+
Documentation repair is appropriate when evidence establishes the current fact and the edit only corrects its description or removes genuine redundancy or unsupported elaboration.
|
|
73
|
+
|
|
74
|
+
Stop resolving an item and ask the user when:
|
|
75
|
+
|
|
76
|
+
- The implementation may be wrong and the documentation may state the requirement.
|
|
77
|
+
- A repair would change functionality, public contracts, acceptance criteria, or an established constraint.
|
|
78
|
+
- Requirements, specifications, tests, and implementation support incompatible answers.
|
|
79
|
+
- Evidence is insufficient or conflicting.
|
|
80
|
+
- A fix requires changing implementation, generated output, vendored content, upstream content, or a protected source.
|
|
81
|
+
- Existing uncommitted changes make the intended state unclear.
|
|
82
|
+
|
|
83
|
+
Continue read-only inspection of unrelated items, but exclude unresolved items from the repair plan. Complete this step when every potential finding is classified as repairable, needs-user-decision, or unverified, and every repairable action is documentation-only.
|
|
84
|
+
|
|
85
|
+
## 5. Report
|
|
86
|
+
|
|
87
|
+
Report the candidate and maintained scopes, ownership evidence, reference-only documents, exclusions, missing pointer targets, evidence limitations, and every maintained document's disposition. Keep unresolved questions and unverified claims visible rather than counting them as clean.
|
|
88
|
+
|
|
89
|
+
Use one entry per finding:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
[Implementation drift | Contradiction | Terminology | Link | Redundancy] Title
|
|
93
|
+
Location: <document>:<line or section>
|
|
94
|
+
Current: <statement, duplicated material, or unsupported elaboration>
|
|
95
|
+
Evidence: <source and observed fact, or the evidence boundary>
|
|
96
|
+
Proposal: <documentation-only correction, deletion, or consolidation>
|
|
97
|
+
Disposition: repairable | needs-user-decision | unverified
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For redundancy, name the proposed authoritative location and what each other location will retain, merge, or link to. For unsupported elaboration, state whether to delete it or shrink it to an evidence-backed statement. When nothing needs attention, say so and list any remaining unverified items.
|
|
101
|
+
|
|
102
|
+
Report mode ends here without writing files or creating a report artifact. Complete this step when every maintained document and potential finding has a reported outcome, and every candidate has a reported classification or unresolved question.
|
|
103
|
+
|
|
104
|
+
## 6. Approve and repair
|
|
105
|
+
|
|
106
|
+
For Fix, group the exact proposed edits by file and finding. Show exact replacement text or deletion boundaries for substantive rewrites, deletions, and consolidations, including all affected language variants. Identify edits excluded by unresolved questions.
|
|
107
|
+
|
|
108
|
+
Request explicit approval and wait. The user may approve any subset. Apply exactly the approved edits, preserving unrelated content and existing user changes.
|
|
109
|
+
|
|
110
|
+
Repair the authoritative source and synchronize intentional summaries and language variants where the evidence supports doing so. Use the project's generation procedure for generated results. Preserve every unique requirement, constraint, caveat, and evidence pointer during consolidation. If a new semantic conflict appears, stop that item and request a new decision rather than expanding the approved edit.
|
|
111
|
+
|
|
112
|
+
Complete this step when every approved item has been applied exactly or remains explicitly unapplied with its reason, and no unapproved file changed.
|
|
113
|
+
|
|
114
|
+
## 7. Verify and close
|
|
115
|
+
|
|
116
|
+
Re-read every changed document. Confirm that approved findings are resolved, links resolve, corresponding language views agree, consolidated content remains traceable, and no unapproved semantic change occurred.
|
|
117
|
+
|
|
118
|
+
Run relevant existing project checks and record their actual results. Report changed files, resolved findings, approved omissions, unresolved questions, unverified claims, and verification evidence. When no edits were approved or needed, state that no files changed.
|
|
119
|
+
|
|
120
|
+
Complete this step when every approved edit has verification evidence or a concrete remaining failure, and every check has an actual result.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-drift
|
|
3
|
+
description: 巡检项目持续维护的文档并修复获批的漂移、冗余与无依据扩写。
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 检查项目文档漂移
|
|
8
|
+
|
|
9
|
+
将项目持续维护的文档与当前证据对照,然后以只读报告结束,或应用经批准的文档修复。实现改动不属于本技能。
|
|
10
|
+
|
|
11
|
+
## 选择模式
|
|
12
|
+
|
|
13
|
+
- **Report:**`/docs-drift` 或 `/docs-drift report`。执行步骤 1–5,不写文件。
|
|
14
|
+
- **Fix:**`/docs-drift fix`。执行同样的检查,再执行步骤 6–7。调用 Fix 本身不构成写入批准。
|
|
15
|
+
|
|
16
|
+
接受可选的路径或 glob,用于增加或收窄候选集合,也接受可选排除项。请求的模式或范围有歧义时先询问。
|
|
17
|
+
|
|
18
|
+
## 1. 发现维护中的文档
|
|
19
|
+
|
|
20
|
+
从实际存在的根 agent 文档和根 README 开始,包括链接到的语言版本。记录缺失的入口,不创建替代文件。
|
|
21
|
+
|
|
22
|
+
读取项目维护规则,跟随将文档指定为 agent 必须阅读、更新或保持同步之对象的指针。使用项目真实的文档名称与位置;常规架构、术语或决策文档路径只是调查线索,不是必备条件。普通链接可以作为证据或接受链接检查,但不因此递归加入全文巡检。
|
|
23
|
+
|
|
24
|
+
将显式路径、glob、收窄和排除应用于候选集合。“整个仓库”只扩大候选发现范围,不使仓库内每份文档都成为项目维护文档。读取管辖每份候选文档的嵌套 agent 指令。
|
|
25
|
+
|
|
26
|
+
根据项目指针、管辖指令、归属及更新约定给每个候选文档分类:
|
|
27
|
+
|
|
28
|
+
- **维护文档:**由本项目所有,并随项目实现或工作流迭代更新。执行全部五类检查。
|
|
29
|
+
- **仅作参考:**依赖、宿主产品、程序库或其他外部系统的说明文档,即使存放在仓库内。只用作证据,不检查其自身漂移。
|
|
30
|
+
- **已排除:**不在请求范围内,或被显式规则排除。
|
|
31
|
+
- **未决:**维护归属不明确。纳入前先询问,同时继续分类无关候选文档。
|
|
32
|
+
|
|
33
|
+
按证据判断维护归属,不按路径、目录名、文件类型或文档主题推断。项目自己的组件文档可能属于维护文档,附带的组件库文档则可能仅作参考。管辖指令文件也只有符合同样的归属规则时才纳入维护文档集合。
|
|
34
|
+
|
|
35
|
+
生成、vendored 和上游内容不进入可编辑集合。相关发现须记录权威来源或上游去处,以及项目的生成流程(如有)。记录失效指针目标和仅用于取证的链接。每个候选文档都有分类或未决问题,且维护、参考、排除和可编辑边界都有来源依据时,本步完成。
|
|
36
|
+
|
|
37
|
+
## 2. 建立证据清单
|
|
38
|
+
|
|
39
|
+
阅读每份维护文档及管辖它的指令。盘点其中关于当前模块、职责、路径、入口、命令、工具、配置、依赖、接口、行为、数量和状态的可核验陈述。
|
|
40
|
+
|
|
41
|
+
把这些陈述追溯到当前代码、配置、清单、真实目录、入口与相关测试。文档提到的路径只是调查线索,不是证据本身。现有只读项目检查能够回答具体证据问题时加以使用。
|
|
42
|
+
|
|
43
|
+
区分当前事实、预期要求与历史陈述。当前实现证明现状,不证明行为正确。仓库无法提供充分证据时,将陈述标为未核验。
|
|
44
|
+
|
|
45
|
+
每份维护文档中的每项可核验陈述都有来源依据的处置结果或明确的证据限制时,本步完成。
|
|
46
|
+
|
|
47
|
+
## 3. 执行全部五类检查
|
|
48
|
+
|
|
49
|
+
**实现漂移。** 查找关于架构、行为、路径、命令、接口、配置、依赖、数量和状态的过时段落,或与当前证据冲突的陈述。
|
|
50
|
+
|
|
51
|
+
**矛盾。** 查找同一文档内部或跨文档的互斥陈述。区分真正矛盾与有意采用的不同详略层次。
|
|
52
|
+
|
|
53
|
+
**术语。** 查找一个概念使用冲突名称、一个名称指代不兼容概念,以及定义偏离实际用法的情况。检查有意的语言版本是否保持对应含义。
|
|
54
|
+
|
|
55
|
+
**链接与指针。** 从引用所在文档解析仓库相对链接、路径与锚点。条件允许时检查外链;网络或访问失败归为未核验,不直接判为死链。
|
|
56
|
+
|
|
57
|
+
**冗余与无依据扩写。** 查找语义重复、规则散落、过时段落,以及持续迭代中积累的无依据事实、假设与臆造扩写。例子包括虚构的模块职责、命令行为、配置默认值、设计理由、兼容性、性能结论、测试覆盖与验收状态。将已证伪或无依据的扩写收缩为有证据支持的最小陈述;仅证据不足时标为未核验,不作为删除候选。历史陈述和明确的未来计划保留其语境。
|
|
58
|
+
|
|
59
|
+
提出合并前确定权威位置。保留有意的摘要、面向不同读者的视图、语言版本与独有限定条件。
|
|
60
|
+
|
|
61
|
+
文风、格式或完整性偏好只有构成上述发现时才报告。每份维护文档都执行过全部五类检查,且每项潜在发现都有位置、当前陈述、支持证据或证据边界及建议动作时,本步完成。
|
|
62
|
+
|
|
63
|
+
## 4. 判定权威并分类发现
|
|
64
|
+
|
|
65
|
+
按问题类型确定权威:
|
|
66
|
+
|
|
67
|
+
- 用户明确要求决定预期行为。
|
|
68
|
+
- 当前项目规格与有约束力的约定决定其声明的限制。
|
|
69
|
+
- 可核验的实现证据决定当前行为的描述。
|
|
70
|
+
- 文档的历史语境决定过去事件的表述。
|
|
71
|
+
|
|
72
|
+
证据能够确定当前事实,且编辑只纠正描述、消除真正冗余或清理无依据扩写时,适合修复文档。
|
|
73
|
+
|
|
74
|
+
出现下列情况时停止处理该项并询问用户:
|
|
75
|
+
|
|
76
|
+
- 实现可能有误,而文档可能表达的是要求。
|
|
77
|
+
- 修复会改变功能、公开契约、验收标准或既定约束。
|
|
78
|
+
- 要求、规格、测试与实现支持互不兼容的答案。
|
|
79
|
+
- 证据不足或相互冲突。
|
|
80
|
+
- 修复需要修改实现、生成产物、vendored 内容、上游内容或受保护来源。
|
|
81
|
+
- 已有未提交改动使预期状态无法确定。
|
|
82
|
+
|
|
83
|
+
继续只读检查无关项,但未决项不进入修复计划。每项潜在发现都归为可修复、需要用户决定或未核验,且每项可修复动作都只涉及文档时,本步完成。
|
|
84
|
+
|
|
85
|
+
## 5. 报告
|
|
86
|
+
|
|
87
|
+
报告候选范围与维护文档范围、归属证据、仅作参考的文档、排除项、失效指针目标、证据限制和每份维护文档的处置结果。未决问题与未核验陈述保持可见,不计为无问题。
|
|
88
|
+
|
|
89
|
+
每项发现使用以下结构:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
[实现漂移 | 矛盾 | 术语 | 链接 | 冗余] 标题
|
|
93
|
+
位置:<文档>:<行号或章节>
|
|
94
|
+
现状:<陈述、重复内容或无依据扩写>
|
|
95
|
+
证据:<来源与观察到的事实,或证据边界>
|
|
96
|
+
建议:<仅文档纠正、删除或合并>
|
|
97
|
+
处置:可修复 | 需要用户决定 | 未核验
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
冗余发现须写明拟定的权威位置,以及其他位置分别保留、合并或链接什么。无依据扩写须说明是删除,还是收缩为有证据支持的陈述。无需关注时明确说明,并列出仍存在的未核验项。
|
|
101
|
+
|
|
102
|
+
Report 到此结束,不写文件,也不创建报告产物。每份维护文档和每项潜在发现都有已报告的结果,且每个候选文档都有已报告的分类或未决问题时,本步完成。
|
|
103
|
+
|
|
104
|
+
## 6. 批准并修复
|
|
105
|
+
|
|
106
|
+
Fix 按文件和发现分组展示精确的拟修改内容。实质改写、删除或合并须展示精确的替换文本或删除边界,并覆盖所有受影响语言版本。单独标明因未决问题而排除的修改。
|
|
107
|
+
|
|
108
|
+
请求明确批准并等待。用户可以只批准其中一个子集。严格应用获批修改,保留无关内容与用户已有改动。
|
|
109
|
+
|
|
110
|
+
证据支持时,修复权威来源并同步有意的摘要与语言版本。生成结果使用项目的生成流程。合并必须保留每项独有要求、约束、注意事项与证据指针。出现新的语义冲突时停止该项并请求新的决定,不借此扩大获批范围。
|
|
111
|
+
|
|
112
|
+
每个获批项都已严格应用,或明确保持未应用并说明原因,且没有未获批文件变化时,本步完成。
|
|
113
|
+
|
|
114
|
+
## 7. 核验并收尾
|
|
115
|
+
|
|
116
|
+
重新阅读每份修改过的文档。确认获批发现已解决、链接可解析、对应语言视图一致、合并内容仍可追溯,且没有未批准的语义变化。
|
|
117
|
+
|
|
118
|
+
运行相关的现有项目检查并记录实际结果。报告修改文件、已解决发现、获批保留项、未决问题、未核验陈述与验证证据。没有获批或需要修改的内容时,明确说明没有文件变化。
|
|
119
|
+
|
|
120
|
+
每项获批修改都有验证证据或具体的剩余失败,且每项检查都有实际结果时,本步完成。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-project-docs
|
|
3
|
+
description: Bootstrap architecture, glossary, decision-record conventions, and root agent-doc pointers; rerun to fill approved gaps.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Set up project docs
|
|
8
|
+
|
|
9
|
+
Create or complete living project documentation and its context pointers. Obtain approval before writing or modifying files.
|
|
10
|
+
|
|
11
|
+
| Piece | Answers | Default location |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| Architecture | What is the system now? | `docs/architecture.md` |
|
|
14
|
+
| Glossary | What is each concept called? | `docs/glossary.md` |
|
|
15
|
+
| Decision conventions | How are decisions recorded and found? | `docs/decisions/AGENTS.md` |
|
|
16
|
+
| Pointers | When should an agent open each document? | Root `AGENTS.md` |
|
|
17
|
+
|
|
18
|
+
## 1. Inventory the repository
|
|
19
|
+
|
|
20
|
+
Inspect root `AGENTS.md` and existing architecture and glossary documents. Resolve `<dir>` in this order:
|
|
21
|
+
|
|
22
|
+
1. Use a caller-supplied record or directory path.
|
|
23
|
+
2. Otherwise, resolve the decision pointer in root `AGENTS.md` under `## Project docs` when it points to an existing `<dir>/AGENTS.md`.
|
|
24
|
+
3. Otherwise, inspect `docs/decisions/`, `docs/adr/`, and `doc/adr/`.
|
|
25
|
+
|
|
26
|
+
Use the selected directory and read its `AGENTS.md` and `README.md` conventions when present. If several candidates remain, ask which is current and wait. When none exists, use the default location from the table.
|
|
27
|
+
|
|
28
|
+
Read build and workspace configuration, real directories, and entry points until every principal module has a source-backed responsibility. Finish with an outline for each proposed document and an explicit list of facts the repository cannot supply.
|
|
29
|
+
|
|
30
|
+
## 2. Confirm the plan
|
|
31
|
+
|
|
32
|
+
Present existing, missing, and proposed paths. Lead with recommendations for decisions the repository cannot supply:
|
|
33
|
+
|
|
34
|
+
- **Decision records:** recommend them when choices are costly to reverse; a small script or disposable prototype usually needs none. Declining leaves the related skills inert.
|
|
35
|
+
- **Glossary layout:** recommend one file; split by context only for genuinely separate bounded contexts.
|
|
36
|
+
|
|
37
|
+
Confirm the proposed paths and scope. On a rerun, limit the plan to missing pieces and stale pointers. Confirming this plan is not write approval: step 3 presents the content for that approval.
|
|
38
|
+
|
|
39
|
+
## 3. Draft source-backed content
|
|
40
|
+
|
|
41
|
+
- **Architecture:** use a module table with real directories and entry points. Document dependency direction and extension points demonstrated by the code; put rationale in decision records.
|
|
42
|
+
- **Glossary:** define three to five existing code terms whose ambiguity could produce divergent names.
|
|
43
|
+
- **Decision conventions:** create no placeholder record. Leave any real record to `decision-write`; when enabled, draft `<dir>/AGENTS.md` following [the decision-record conventions](references/decision-conventions.md).
|
|
44
|
+
|
|
45
|
+
Present every draft together and obtain approval before writing. The approved set is the write plan.
|
|
46
|
+
|
|
47
|
+
## 4. Write or update
|
|
48
|
+
|
|
49
|
+
Create or update exactly the approved paths, editing existing files in place. Keep one `## Project docs` block in root `AGENTS.md`, adapted to its language and actual paths:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Project docs
|
|
53
|
+
|
|
54
|
+
- Read `docs/architecture.md` before changing a module; update it when module boundaries or entry points change.
|
|
55
|
+
- Read `docs/glossary.md` when naming a concept; add terms when introducing concepts.
|
|
56
|
+
- Before starting any repository task, read `docs/decisions/AGENTS.md` and follow its search rules to read the records relevant to the task.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This block contains only document pointers. Include each pointer only for a document retained in the approved plan. Translate the pointer text into the root document's language and adapt its target to the actual path. Replace an existing `## Project docs` block with these pointers; preserve the rest of root `AGENTS.md`. Leave decision status meanings and record-selection rules in the decision directory's `AGENTS.md`.
|
|
60
|
+
|
|
61
|
+
## 5. Verify and report
|
|
62
|
+
|
|
63
|
+
Confirm that every approved path was written or updated, root `AGENTS.md` contains one `## Project docs` block with only document pointers, and every pointer resolves to a retained document from the repository root. Report written, updated, and skipped paths with reasons. State that pointers take effect in the next session.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-project-docs
|
|
3
|
+
description: 初始化架构、术语表、决策记录约定及根目录 agent 文档指针;重跑时补齐已批准的缺口。
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 建立项目文档
|
|
8
|
+
|
|
9
|
+
创建或补齐持续维护的项目文档及其上下文指针。写入或修改文件前必须获得批准。
|
|
10
|
+
|
|
11
|
+
| 部分 | 回答 | 默认位置 |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| 架构 | 系统现在是什么? | `docs/architecture.md` |
|
|
14
|
+
| 术语表 | 每个概念叫什么? | `docs/glossary.md` |
|
|
15
|
+
| 决策约定 | 如何记录并查找决策? | `docs/decisions/AGENTS.md` |
|
|
16
|
+
| 指针 | agent 何时打开每份文档? | 根目录 `AGENTS.md` |
|
|
17
|
+
|
|
18
|
+
## 1. 盘点仓库
|
|
19
|
+
|
|
20
|
+
检查根目录 `AGENTS.md`、既有架构与术语文档。按以下顺序定位 `<dir>`:
|
|
21
|
+
|
|
22
|
+
1. 使用调用方提供的记录或目录路径。
|
|
23
|
+
2. 否则,解析根目录 `AGENTS.md` 的 `## Project docs` 中的决策指针;目标为现存的 `<dir>/AGENTS.md` 时使用该目录。
|
|
24
|
+
3. 否则,检查 `docs/decisions/`、`docs/adr/` 和 `doc/adr/`。
|
|
25
|
+
|
|
26
|
+
沿用选中的目录,并在存在时读取其 `AGENTS.md` 与 `README.md` 约定。仍有多个候选时,询问哪个是当前目录并等待。都不存在时使用表中的默认位置。
|
|
27
|
+
|
|
28
|
+
读取构建与工作区配置、真实目录和入口点,直到每个主要模块的职责都有代码依据。最终为每份拟建文档形成提纲,并明确列出仓库无法提供的事实。
|
|
29
|
+
|
|
30
|
+
## 2. 确认计划
|
|
31
|
+
|
|
32
|
+
列出已有内容、缺失内容与拟用路径。对仓库无法决定的事项先给建议:
|
|
33
|
+
|
|
34
|
+
- **决策记录:** 选择难以逆转时建议启用;小脚本或一次性原型通常不需要。拒绝会让相关技能保持惰性。
|
|
35
|
+
- **术语表布局:** 建议单个文件;仅对真正独立的限界上下文按上下文拆分。
|
|
36
|
+
|
|
37
|
+
确认拟用路径与范围。重跑时,计划只覆盖缺失部分和失效指针。确认计划不等于批准写入;步骤 3 展示内容以取得写入批准。
|
|
38
|
+
|
|
39
|
+
## 3. 起草有依据的内容
|
|
40
|
+
|
|
41
|
+
- **架构:** 用真实目录与入口点列出模块表;记录代码已体现的依赖方向与扩展点,理由写入决策记录。
|
|
42
|
+
- **术语表:** 定义代码中已有且易引发不同命名的三到五个术语。
|
|
43
|
+
- **决策约定:** 不创建占位记录。真实决策交给 `decision-write`;启用时按[决策记录约定](references/decision-conventions.zh.md)起草 `<dir>/AGENTS.md`。
|
|
44
|
+
|
|
45
|
+
集中展示所有草稿,获得批准后再写入。批准集合就是写入计划。
|
|
46
|
+
|
|
47
|
+
## 4. 写入或更新
|
|
48
|
+
|
|
49
|
+
只创建或更新已批准的路径,既有文件就地编辑。根目录 `AGENTS.md` 只保留一个 `## Project docs` 块,并适配其语言与实际路径:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Project docs
|
|
53
|
+
|
|
54
|
+
- Read `docs/architecture.md` before changing a module; update it when module boundaries or entry points change.
|
|
55
|
+
- Read `docs/glossary.md` when naming a concept; add terms when introducing concepts.
|
|
56
|
+
- Before starting any repository task, read `docs/decisions/AGENTS.md` and follow its search rules to read the records relevant to the task.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
此块只写文档指针。只包含获批计划中保留的文档指针,将指针文字翻译为根文档的语言,并按实际路径调整目标。已有 `## Project docs` 块替换为这些指针,根目录 `AGENTS.md` 的其他内容保持不变。决策状态的含义与记录筛选规则留在决策目录的 `AGENTS.md`。
|
|
60
|
+
|
|
61
|
+
## 5. 验证并报告
|
|
62
|
+
|
|
63
|
+
确认每个已批准的路径均已写入或更新,根目录 `AGENTS.md` 只有一个 `## Project docs` 块且只含文档指针,每个指针都能从仓库根目录解析到保留的文档。报告写入、更新和跳过的路径及原因。说明指针从下个会话开始生效。
|