opencode-codeops 1.4.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/CHANGELOG.md +179 -0
- package/LICENSE +21 -0
- package/README.md +171 -0
- package/_shared/auto-design.md +129 -0
- package/_shared/layout-convention.md +198 -0
- package/_shared/quality-profile.md +134 -0
- package/_shared/recommendation-hardening.md +166 -0
- package/_shared/scope-expansion-control.md +176 -0
- package/_shared/spec-first-ordering.md +79 -0
- package/_shared/zero-ambiguity-gate.md +311 -0
- package/agent-templates/codebase-scout.md +17 -0
- package/agent-templates/concurrency-auditor.md +5 -0
- package/agent-templates/design-challenger.md +26 -0
- package/agent-templates/financial-integrity-auditor.md +5 -0
- package/agent-templates/perf-auditor.md +23 -0
- package/agent-templates/phase-reviewer.md +54 -0
- package/agent-templates/plan-task-executor-opus.md +46 -0
- package/agent-templates/plan-task-executor.md +43 -0
- package/agent-templates/preflight-auditor.md +45 -0
- package/agent-templates/security-auditor.md +42 -0
- package/agent-templates/semantics-reviewer.md +5 -0
- package/agent-templates/spec-test-author.md +29 -0
- package/agents/concurrency-auditor.md +15 -0
- package/agents/correctness-reviewer.md +66 -0
- package/agents/demanding-executor.md +58 -0
- package/agents/design-challenger.md +38 -0
- package/agents/executor.md +55 -0
- package/agents/explorer.md +29 -0
- package/agents/financial-integrity-auditor.md +15 -0
- package/agents/performance-auditor.md +35 -0
- package/agents/preflight-auditor.md +57 -0
- package/agents/security-auditor.md +54 -0
- package/agents/semantics-reviewer.md +15 -0
- package/agents/spec-test-author.md +41 -0
- package/bin/codeops-worktree +244 -0
- package/bin/index.mjs +106 -0
- package/bin/install-agents.mjs +453 -0
- package/bin/install-skills.mjs +466 -0
- package/bin/lib/opencode-install.mjs +185 -0
- package/install.sh +55 -0
- package/package.json +73 -0
- package/plugin/index.ts +181 -0
- package/references/domains/compiler-and-language.md +28 -0
- package/references/domains/data-and-migration.md +22 -0
- package/references/domains/distributed-and-concurrent.md +26 -0
- package/references/domains/financial-system.md +28 -0
- package/references/domains/selection.md +19 -0
- package/references/domains/web-application.md +23 -0
- package/schemas/codeops-config.schema.json +56 -0
- package/scripts/check-version.mjs +163 -0
- package/scripts/codeops-migrate.sh +355 -0
- package/scripts/codeops-roadmap-compact.sh +232 -0
- package/scripts/codeops-roadmap-sync.sh +275 -0
- package/scripts/codeops_outcomes.py +155 -0
- package/scripts/codeops_plan.py +239 -0
- package/scripts/codeops_plan_migrate.py +318 -0
- package/scripts/codeops_worktree_snapshot.py +99 -0
- package/scripts/install_agents.py +288 -0
- package/scripts/release.mjs +533 -0
- package/skills/analyze-project/SKILL.md +28 -0
- package/skills/clean-comments/SKILL.md +22 -0
- package/skills/exec-plan/SKILL.md +267 -0
- package/skills/exec-plan/commit-modes.md +113 -0
- package/skills/exec-plan/execution-protocol.md +471 -0
- package/skills/git-commit/SKILL.md +35 -0
- package/skills/github-issues/SKILL.md +38 -0
- package/skills/grill-me/SKILL.md +342 -0
- package/skills/make-plan/SKILL.md +282 -0
- package/skills/make-plan/quality-checklist.md +96 -0
- package/skills/make-plan/templates.md +535 -0
- package/skills/make-plan/zero-ambiguity-gate.md +19 -0
- package/skills/make-requirements/SKILL.md +268 -0
- package/skills/make-requirements/discovery-phases.md +255 -0
- package/skills/make-requirements/review-and-add.md +73 -0
- package/skills/make-requirements/templates.md +296 -0
- package/skills/make-requirements/zero-ambiguity-gate.md +18 -0
- package/skills/outcome-review/SKILL.md +34 -0
- package/skills/preflight/SKILL.md +310 -0
- package/skills/preflight/dimensions.md +181 -0
- package/skills/preflight/report-format.md +300 -0
- package/skills/retro-requirements/SKILL.md +218 -0
- package/skills/retro-requirements/confidence-classification.md +45 -0
- package/skills/retro-requirements/phases.md +609 -0
- package/skills/retro-requirements/triage-gate.md +135 -0
- package/skills/roadmap/SKILL.md +381 -0
- package/skills/roadmap/stage-hooks.md +80 -0
- package/skills/roadmap/template.md +200 -0
- package/skills/setup-codeops/SKILL.md +94 -0
- package/skills/setup-codeops/migration.md +106 -0
- package/skills/setup-codeops/scaffold.md +99 -0
- package/skills/setup-routing/SKILL.md +102 -0
- package/skills/setup-routing/routing.md +44 -0
- package/skills/techdocs/SKILL.md +199 -0
- package/skills/techdocs/authoring-and-update.md +178 -0
- package/skills/techdocs/templates.md +655 -0
- package/skills/techdocs/vitepress-setup.md +143 -0
- package/skills/upgrade-plan/SKILL.md +75 -0
- package/skills/upgrade-plan/content-quality-gate.md +35 -0
- package/skills/upgrade-plan/upgrade-checklists.md +107 -0
- package/standards/coding-standards-full.md +124 -0
- package/standards/coding-standards.md +64 -0
- package/standards/output-style.md +17 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: techdocs
|
|
3
|
+
description: >-
|
|
4
|
+
Creates and maintains VitePress-compatible technical architecture documentation and
|
|
5
|
+
architecture decision records (ADRs). Use when the user says "make_techdocs",
|
|
6
|
+
"review_techdocs", "techdocs", "document the architecture", "create architecture docs",
|
|
7
|
+
"write ADRs", or "architecture decision records". Covers two modes: make_techdocs to
|
|
8
|
+
create or comprehensively regenerate the docs/ set (system overview, data model, API
|
|
9
|
+
design, infrastructure, security, ADRs, developer guides, reference), and review_techdocs
|
|
10
|
+
to run a 7-dimension health check (staleness, completeness, accuracy, ADR coverage, link
|
|
11
|
+
health, diagram accuracy, getting-started) and produce a diagnostic report. Also fires
|
|
12
|
+
automatically as an incremental or comprehensive update when an exec-plan phase or plan
|
|
13
|
+
completes, or when make-requirements completes — but only if the project has opted in.
|
|
14
|
+
Scope is technical/architectural docs for developers, NOT product/end-user documentation.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# techdocs — Technical Architecture Documentation
|
|
18
|
+
|
|
19
|
+
> **CodeOps Artifact Schema**: 1
|
|
20
|
+
|
|
21
|
+
Create and maintain a living, VitePress-compatible technical architecture documentation set in
|
|
22
|
+
the project's `docs/` directory, capturing accumulated design knowledge across requirements and
|
|
23
|
+
planning phases. The body branches by phrasing and arguments:
|
|
24
|
+
|
|
25
|
+
| Phrasing / argument | Mode | Action |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `make_techdocs`, "document the architecture", "create architecture docs" | **Create / regenerate** | Phases 1–6: comprehensive create or full regeneration |
|
|
28
|
+
| `make_techdocs --continue` | **Resume** | Pick up an interrupted authoring session (see Session resume) |
|
|
29
|
+
| `review_techdocs`, "review the techdocs", "health check the docs" | **Health check** | 7-dimension diagnostic report (no file changes) |
|
|
30
|
+
| *(auto)* exec-plan phase complete | **Incremental** | Add ADRs / update changed sections only |
|
|
31
|
+
| *(auto)* exec-plan plan complete | **Comprehensive** | Full pass over every section vs. codebase |
|
|
32
|
+
| *(auto)* make-requirements complete | **Incremental** | New design decisions → ADRs |
|
|
33
|
+
|
|
34
|
+
## What this is (and is NOT)
|
|
35
|
+
|
|
36
|
+
| In scope — TECHNICAL docs (this skill) | Out of scope — PRODUCT docs |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Architecture, design decisions, data models, API contracts, infrastructure, security | End-user guides, tutorials, FAQ, release notes, marketing |
|
|
39
|
+
| Developer onboarding, dev workflow, deployment procedures | Feature announcements, user-facing changelogs |
|
|
40
|
+
|
|
41
|
+
Product documentation is a separate concern. If the project needs user-facing docs, the user
|
|
42
|
+
should request them explicitly. They live elsewhere (e.g. `docs/product/`) and are NOT governed
|
|
43
|
+
by this skill.
|
|
44
|
+
|
|
45
|
+
## Opt-in, then auto-update
|
|
46
|
+
|
|
47
|
+
Technical documentation is **not mandatory by default**, but once opted in it is **automatically
|
|
48
|
+
maintained**.
|
|
49
|
+
|
|
50
|
+
### The opt-in marker
|
|
51
|
+
|
|
52
|
+
The presence of `docs/index.md` with this frontmatter marker means techdocs are active:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
---
|
|
56
|
+
techdocs: true
|
|
57
|
+
---
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If `docs/index.md` exists but lacks this marker, it is NOT a techdocs-managed file — do not
|
|
61
|
+
auto-update it.
|
|
62
|
+
|
|
63
|
+
### Detection & ask-once protocol
|
|
64
|
+
|
|
65
|
+
When this skill fires as an auto-update hook (from the exec-plan or make-requirements skills):
|
|
66
|
+
|
|
67
|
+
1. **Does `docs/index.md` exist with the `techdocs: true` marker?**
|
|
68
|
+
- **Yes** → run the appropriate auto-update (incremental or comprehensive — see the mode table).
|
|
69
|
+
- **No** → ask the user once: *"Would you like to create technical architecture docs for this
|
|
70
|
+
project?"*
|
|
71
|
+
- **Yes** → run the create flow (Phases 1–6).
|
|
72
|
+
- **No** → skip, and do not ask again until the next plan completes.
|
|
73
|
+
|
|
74
|
+
### Auto-update triggers
|
|
75
|
+
|
|
76
|
+
Once opted in, update techdocs at these checkpoints:
|
|
77
|
+
|
|
78
|
+
| Trigger (from another skill) | Update type | What to update |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| exec-plan **phase** completion | Incremental | New ADRs for decisions made; sections that changed |
|
|
81
|
+
| exec-plan **plan** completion | Comprehensive | Full review of all sections; consistency; diagrams |
|
|
82
|
+
| make-requirements completion | Incremental | New design decisions, updated scope, integration points |
|
|
83
|
+
| Manual `make_techdocs` | Comprehensive | Full review and regeneration |
|
|
84
|
+
|
|
85
|
+
**Incremental** = quick pass; add new ADRs, update changed sections only.
|
|
86
|
+
**Comprehensive** = full pass; review every section against actual codebase state.
|
|
87
|
+
|
|
88
|
+
> 🚨 **Design Intent Preservation is non-negotiable.** Auto-updates MUST NOT silently overwrite
|
|
89
|
+
> documented design intent (ADR decisions) with observed code behavior. The full rule, including
|
|
90
|
+
> the divergence-flagging protocol, lives in
|
|
91
|
+
> [authoring-and-update.md](authoring-and-update.md) — read it before any comprehensive update.
|
|
92
|
+
|
|
93
|
+
## Relationship to other skills
|
|
94
|
+
|
|
95
|
+
| Skill | Relationship |
|
|
96
|
+
|---|---|
|
|
97
|
+
| the make-requirements skill | **Upstream.** Requirements define WHAT. Techdocs capture architectural decisions made during requirements discovery. On completion → incremental techdocs update. |
|
|
98
|
+
| the make-plan skill | **Parallel.** Plans define HOW for one feature; techdocs capture SYSTEM-LEVEL architecture spanning features. make-plan reads techdocs as context. |
|
|
99
|
+
| the exec-plan skill | **Downstream.** Architecture evolves during execution. Phase complete → incremental; plan complete → comprehensive. Auto-update hooks fire from it. |
|
|
100
|
+
| the retro-requirements skill | **Upstream.** When reverse-engineering an existing system, techdocs capture the discovered architecture. |
|
|
101
|
+
|
|
102
|
+
## Phase overview
|
|
103
|
+
|
|
104
|
+
| Phase | What happens | Reference |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| **1. Information gathering** | Read `requirements/`, `plans/*/`, the codebase, the project's AGENTS.md (or detected conventions). Ask clarifying questions only on a first run with no requirements/plans. | below |
|
|
107
|
+
| **2. Document structure** | Lay out the VitePress `docs/` tree; adapt sections to the project type (only create relevant sections). | below |
|
|
108
|
+
| **3. VitePress setup** | Install VitePress, generate `.vitepress/config.ts`, add npm scripts, update `.gitignore`. | [vitepress-setup.md](vitepress-setup.md) |
|
|
109
|
+
| **4. Document templates** | Write each section from the canonical templates. | [templates.md](templates.md) |
|
|
110
|
+
| **5. Authoring guidelines** | Apply writing style, Mermaid diagram conventions, cross-referencing, and what NOT to document. | [authoring-and-update.md](authoring-and-update.md) |
|
|
111
|
+
| **6. Incremental update protocol** | Auto-update after phase/plan/requirements completion, including Design Intent Preservation. | [authoring-and-update.md](authoring-and-update.md) |
|
|
112
|
+
|
|
113
|
+
### Phase 1 — Information gathering
|
|
114
|
+
|
|
115
|
+
Gather from: existing `requirements/`, existing `plans/*/`, the current codebase (structure,
|
|
116
|
+
patterns, dependencies), and the project's AGENTS.md (or detected project conventions). In a
|
|
117
|
+
**nested-layout** repo these sources live under `codeops/features/<f>/{requirements,plans}/`
|
|
118
|
+
(resolve via [../../_shared/layout-convention.md](../../_shared/layout-convention.md)); in flat layout
|
|
119
|
+
they are the top-level `requirements/` and `plans/*/` as before. If this skill runs right after
|
|
120
|
+
make-requirements or exec-plan, most of this is already in context.
|
|
121
|
+
|
|
122
|
+
**Ask clarifying questions only on a true first run with no requirements/plans:** system purpose,
|
|
123
|
+
key stakeholders and their experience level, architecture style (monolith / microservices /
|
|
124
|
+
serverless / hybrid), key integrations, deployment model. If requirements/plans exist, extract
|
|
125
|
+
these from the documents — do not re-ask.
|
|
126
|
+
|
|
127
|
+
### Phase 2 — Document structure
|
|
128
|
+
|
|
129
|
+
Create only the sections relevant to the project type — empty placeholders add noise, not value.
|
|
130
|
+
Full VitePress directory layout:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
docs/
|
|
134
|
+
├── .vitepress/
|
|
135
|
+
│ └── config.ts # VitePress configuration
|
|
136
|
+
├── index.md # System overview + techdocs opt-in marker (ENTRY POINT)
|
|
137
|
+
├── architecture/
|
|
138
|
+
│ ├── system-overview.md # High-level architecture, component diagram
|
|
139
|
+
│ ├── data-model.md # Domain model, entity relationships, schemas
|
|
140
|
+
│ ├── api-design.md # API contracts, endpoints, protocols
|
|
141
|
+
│ ├── infrastructure.md # Deployment, Docker, CI/CD, networking
|
|
142
|
+
│ └── security.md # Security architecture, threat model
|
|
143
|
+
├── decisions/
|
|
144
|
+
│ ├── index.md # ADR log (chronological)
|
|
145
|
+
│ ├── ADR-001-[short-name].md # Individual decision records
|
|
146
|
+
│ └── ...
|
|
147
|
+
├── guides/
|
|
148
|
+
│ ├── getting-started.md # Developer setup, prerequisites, first run
|
|
149
|
+
│ ├── development.md # Dev workflow, coding patterns, conventions
|
|
150
|
+
│ └── deployment.md # How to deploy, environments, configuration
|
|
151
|
+
└── reference/
|
|
152
|
+
├── configuration.md # Config options, env vars, feature flags
|
|
153
|
+
└── integrations.md # External system connections, protocols, auth
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Adapting to project type** (create required sections; add optional ones as warranted):
|
|
157
|
+
|
|
158
|
+
| Project type | Required | Optional |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| Web App / SaaS | All | — |
|
|
161
|
+
| API / Backend | system-overview, data-model, api-design, security, infrastructure | — |
|
|
162
|
+
| Library / SDK | system-overview, api-design, getting-started, development | data-model, infrastructure |
|
|
163
|
+
| CLI Tool | system-overview, getting-started, development | data-model, infrastructure |
|
|
164
|
+
| Microservices | All (esp. infrastructure, integrations) | — |
|
|
165
|
+
| Mobile App | system-overview, data-model, api-design, security | infrastructure |
|
|
166
|
+
| Infrastructure | system-overview, infrastructure, security, deployment | data-model, api-design |
|
|
167
|
+
|
|
168
|
+
Then proceed to Phase 3 ([vitepress-setup.md](vitepress-setup.md)) and Phase 4
|
|
169
|
+
([templates.md](templates.md)).
|
|
170
|
+
|
|
171
|
+
## review_techdocs (health check)
|
|
172
|
+
|
|
173
|
+
When the user asks for `review_techdocs`, run the read-only 7-dimension health check (staleness,
|
|
174
|
+
completeness, accuracy, ADR coverage, link health, diagram accuracy, getting-started) and produce
|
|
175
|
+
a diagnostic report. It changes no files. The full check table and report template are in
|
|
176
|
+
[authoring-and-update.md](authoring-and-update.md).
|
|
177
|
+
|
|
178
|
+
## Session resume
|
|
179
|
+
|
|
180
|
+
Techdocs authoring can be lengthy. If you need to stop mid-run, save all completed documents to
|
|
181
|
+
`docs/`, record which sections remain in `docs/_draft/techdocs-progress.md`, and tell the user to
|
|
182
|
+
resume with `make_techdocs --continue`. On `--continue`, read `docs/_draft/techdocs-progress.md`,
|
|
183
|
+
read the existing completed documents, and continue from the next section. (OpenCode
|
|
184
|
+
auto-compacts context — no manual threshold handling is needed.)
|
|
185
|
+
|
|
186
|
+
## Conventions
|
|
187
|
+
|
|
188
|
+
- Follow your project's coding standards and your project's testing standards (the project's
|
|
189
|
+
AGENTS.md, or detected project conventions) when documenting development and testing guides.
|
|
190
|
+
- Document security architecture against your project's security coding standards (AGENTS.md).
|
|
191
|
+
- When new pages are added (ADRs, sections), update `.vitepress/config.ts` sidebar — see
|
|
192
|
+
[vitepress-setup.md](vitepress-setup.md).
|
|
193
|
+
- Related skills: make-requirements, make-plan, exec-plan, retro-requirements.
|
|
194
|
+
|
|
195
|
+
## Reference files
|
|
196
|
+
|
|
197
|
+
- [templates.md](templates.md) — all VitePress file templates (index, architecture/*, ADR log + ADR template, guides/*, reference/*). Read when writing any document in Phase 4.
|
|
198
|
+
- [vitepress-setup.md](vitepress-setup.md) — Phase 3 install, `config.ts`, npm scripts, `.gitignore`, and sidebar auto-update. Read when scaffolding VitePress or adding pages.
|
|
199
|
+
- [authoring-and-update.md](authoring-and-update.md) — Phase 5 authoring guidelines + Mermaid types, Phase 6 incremental/comprehensive update protocol with the Design Intent Preservation rule, and the review_techdocs health check. Read before authoring, before any auto-update, and for review_techdocs.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# techdocs — Authoring, Update Protocol & Health Check (Phases 5–6 + review_techdocs)
|
|
2
|
+
|
|
3
|
+
> **CodeOps Artifact Schema**: 1
|
|
4
|
+
|
|
5
|
+
Read this before authoring any document, before any auto-update, and when running
|
|
6
|
+
`review_techdocs`.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Phase 5 — Authoring guidelines
|
|
11
|
+
|
|
12
|
+
### Writing style
|
|
13
|
+
|
|
14
|
+
Technical documentation must be:
|
|
15
|
+
|
|
16
|
+
- **Clear** — Written for a developer who has never seen the project. No assumed context.
|
|
17
|
+
- **Concise** — Say what needs saying, nothing more. Prefer tables over paragraphs for structured data.
|
|
18
|
+
- **Current** — Every document has a "Last Updated" date. Stale docs are worse than no docs.
|
|
19
|
+
- **Concrete** — Include code examples, diagrams, and specific values. Avoid vague statements like "uses best practices."
|
|
20
|
+
- **Correct** — Every statement must reflect the actual codebase. Don't document aspirations as reality.
|
|
21
|
+
|
|
22
|
+
### Diagrams (Mermaid)
|
|
23
|
+
|
|
24
|
+
Use Mermaid syntax — rendered via `vitepress-plugin-mermaid`, which the setup step installs (vanilla VitePress does not render Mermaid):
|
|
25
|
+
|
|
26
|
+
- **Architecture diagrams**: `graph TB` or `graph LR`
|
|
27
|
+
- **Entity relationships**: `erDiagram`
|
|
28
|
+
- **Sequences**: `sequenceDiagram`
|
|
29
|
+
- **State machines**: `stateDiagram-v2`
|
|
30
|
+
|
|
31
|
+
### Cross-referencing
|
|
32
|
+
|
|
33
|
+
- Use relative links between doc pages (e.g. `[System Overview](/architecture/system-overview)`).
|
|
34
|
+
- Reference ADRs by number when explaining design choices (e.g. "See [ADR-003](/decisions/ADR-003-chosen-database)").
|
|
35
|
+
- Link to source code files when documenting specific implementations.
|
|
36
|
+
|
|
37
|
+
### What NOT to document
|
|
38
|
+
|
|
39
|
+
- **Secrets, credentials, or API keys** — Never. Not even examples that look real.
|
|
40
|
+
- **Auto-generated code** — Don't document what can be read from the code itself.
|
|
41
|
+
- **Temporary decisions** — If something is likely to change next week, don't write an ADR for it.
|
|
42
|
+
- **Obvious code** — Don't explain what `getUserById()` does. Document the *why*, not the *what*.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 6 — Incremental update protocol
|
|
47
|
+
|
|
48
|
+
### 6.1 After phase completion (incremental)
|
|
49
|
+
|
|
50
|
+
When an exec-plan phase completes and techdocs exist:
|
|
51
|
+
|
|
52
|
+
1. **Scan for architectural changes** — Did this phase introduce: new components/services? New
|
|
53
|
+
data entities or relationships? New API endpoints? New external integrations? Infrastructure
|
|
54
|
+
changes? Significant design decisions?
|
|
55
|
+
2. **If YES to any** → update the relevant sections:
|
|
56
|
+
- New components → `system-overview.md`
|
|
57
|
+
- New entities → `data-model.md`
|
|
58
|
+
- New endpoints → `api-design.md`
|
|
59
|
+
- New integrations → `integrations.md`
|
|
60
|
+
- Significant decisions → create ADRs
|
|
61
|
+
3. **If NO** → skip (not every phase changes architecture).
|
|
62
|
+
4. **Update "Last Updated"** dates on modified documents.
|
|
63
|
+
|
|
64
|
+
For incremental updates, check new/changed code against the ADRs covering the affected area, and
|
|
65
|
+
apply the Design Intent Preservation check (6.4) for any relevant ADR.
|
|
66
|
+
|
|
67
|
+
### 6.2 After plan completion (comprehensive)
|
|
68
|
+
|
|
69
|
+
When all exec-plan tasks are complete and techdocs exist:
|
|
70
|
+
|
|
71
|
+
1. **Review every section** against the current codebase.
|
|
72
|
+
2. **Update all diagrams** to reflect current architecture.
|
|
73
|
+
3. **Verify all links** work.
|
|
74
|
+
4. **🚨 Check for design intent divergence** — see 6.4 below.
|
|
75
|
+
5. **Check for stale content** — anything no longer reflecting reality.
|
|
76
|
+
6. **Update the VitePress sidebar** if new pages were added.
|
|
77
|
+
7. **Update "Last Updated"** dates on all modified documents.
|
|
78
|
+
8. **Create ADRs** for any undocumented decisions from plan execution.
|
|
79
|
+
|
|
80
|
+
### 6.3 After make-requirements completion (incremental)
|
|
81
|
+
|
|
82
|
+
When make-requirements completes and techdocs exist:
|
|
83
|
+
|
|
84
|
+
1. **Extract design decisions** from the requirements documents.
|
|
85
|
+
2. **Create ADRs** for each significant decision (technology choices, architecture patterns, integration decisions).
|
|
86
|
+
3. **Update architecture sections** if the requirements imply architectural changes.
|
|
87
|
+
4. **Update the decision log** in `decisions/index.md`.
|
|
88
|
+
|
|
89
|
+
### 6.4 🚨 Design Intent Preservation — NON-NEGOTIABLE
|
|
90
|
+
|
|
91
|
+
**Auto-updates MUST NOT silently overwrite design intent with observed code behavior.** This rule
|
|
92
|
+
prevents the documentation tautology — where code changes (including bugs, regressions, and
|
|
93
|
+
architectural violations) get automatically documented as the new "intended architecture,"
|
|
94
|
+
erasing the original design rationale.
|
|
95
|
+
|
|
96
|
+
**The problem this solves:** If exec-plan introduces an architectural violation (e.g. a service
|
|
97
|
+
that should call through an API layer instead directly accesses the database), a naive auto-update
|
|
98
|
+
would change the architecture diagram and component description to match the violation. The next
|
|
99
|
+
make-plan run would then read the updated techdocs and treat the violation as the established
|
|
100
|
+
architecture. The original design intent is permanently lost.
|
|
101
|
+
|
|
102
|
+
**During every comprehensive update (6.2), you MUST:**
|
|
103
|
+
|
|
104
|
+
1. **Read all existing ADRs** — these are the documented design decisions.
|
|
105
|
+
2. **Compare the current codebase against ADR decisions** — does the code still follow them?
|
|
106
|
+
3. **If code MATCHES the ADR decisions** → update documentation normally (describe what exists).
|
|
107
|
+
4. **If code DIVERGES from an ADR decision** → DO NOT silently update. Instead:
|
|
108
|
+
|
|
109
|
+
a. **Flag the divergence** to the user:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
⚠️ Design Intent Divergence Detected
|
|
113
|
+
|
|
114
|
+
ADR-003 decided: "All database access goes through the repository layer"
|
|
115
|
+
Current code: UserController directly queries the database in src/controllers/user.ts:47
|
|
116
|
+
|
|
117
|
+
Options:
|
|
118
|
+
(A) Code is wrong — this is a violation that should be fixed
|
|
119
|
+
(B) Decision changed — create a new ADR superseding ADR-003
|
|
120
|
+
(C) Partial exception — document the exception with rationale
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
b. **Ask the user** and wait for their decision before updating the affected section.
|
|
124
|
+
c. **If option (B)** → create a new ADR with status "Supersedes ADR-XXX" and update docs accordingly.
|
|
125
|
+
d. **If option (A)** → do NOT update the architecture docs to match the violation. Note it in a
|
|
126
|
+
`⚠️ Known Violations` section for the next exec-plan run to fix.
|
|
127
|
+
|
|
128
|
+
**Rules:**
|
|
129
|
+
|
|
130
|
+
- ❌ NEVER silently change an architecture description to match code that contradicts an existing ADR.
|
|
131
|
+
- ❌ NEVER delete or modify an ADR's Decision/Rationale section during auto-update.
|
|
132
|
+
- ✅ ADR status can change to "Deprecated" or "Superseded" ONLY with user approval.
|
|
133
|
+
- ✅ New ADRs can be created to document evolved decisions, with explicit supersession references.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## review_techdocs — Health check
|
|
138
|
+
|
|
139
|
+
When the user asks for `review_techdocs`, perform a read-only health check (it changes no files):
|
|
140
|
+
|
|
141
|
+
1. Read all documents in `docs/`.
|
|
142
|
+
2. Analyze the current codebase structure.
|
|
143
|
+
3. Run the 7-dimension check:
|
|
144
|
+
|
|
145
|
+
| Check | What to look for |
|
|
146
|
+
|-------|-----------------|
|
|
147
|
+
| **Staleness** | "Last Updated" dates older than the most recent code changes |
|
|
148
|
+
| **Completeness** | Missing sections for existing components, entities, endpoints, integrations |
|
|
149
|
+
| **Accuracy** | Documented architecture doesn't match actual code structure |
|
|
150
|
+
| **ADR coverage** | Significant technology/pattern choices without corresponding ADRs |
|
|
151
|
+
| **Link health** | Broken internal links between documentation pages |
|
|
152
|
+
| **Diagram accuracy** | Mermaid diagrams that don't match actual architecture |
|
|
153
|
+
| **Getting started** | Setup guide works with current project state |
|
|
154
|
+
|
|
155
|
+
4. Produce a diagnostic report:
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
## Techdocs Health Check: [Project Name]
|
|
159
|
+
|
|
160
|
+
**Documents Analyzed:** X files
|
|
161
|
+
**Date:** [Date]
|
|
162
|
+
|
|
163
|
+
### ✅ Passing
|
|
164
|
+
- [Check that passed]
|
|
165
|
+
|
|
166
|
+
### ⚠️ Warnings (Stale or Incomplete)
|
|
167
|
+
- [Section] — Last updated [date], but [component] was modified on [date]
|
|
168
|
+
- [Section] — Missing documentation for [component/entity/endpoint]
|
|
169
|
+
|
|
170
|
+
### ❌ Issues Found (Incorrect or Broken)
|
|
171
|
+
- [Specific inaccuracy or broken link]
|
|
172
|
+
|
|
173
|
+
### 📝 Missing ADRs
|
|
174
|
+
- [Decision that should have an ADR but doesn't]
|
|
175
|
+
|
|
176
|
+
### Suggestions
|
|
177
|
+
- [Improvement opportunity]
|
|
178
|
+
```
|