thachvd-kit 1.0.37 → 1.0.38
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 +241 -11
- package/bin/cli.js +1791 -1785
- package/bin/config.js +164 -0
- package/bin/entry.js +11 -1
- package/bin/native-skills.js +183 -149
- package/bin/spec-doctor.js +251 -0
- package/bin/spec-link.js +97 -0
- package/bin/spec-recipe.js +74 -0
- package/bin/spec-state.js +415 -0
- package/bin/spec.js +859 -0
- package/package.json +3 -3
- package/skills/system-discovery/SKILL.md +140 -0
- package/skills/system-reverse-engineer/SKILL.md +208 -0
- package/skills/system-spec-review/SKILL.md +177 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thachvd-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "Cross-agent project rules bootstrap kit for Codex, Antigravity, and Claude Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"thachvd-kit": "./bin/entry.js"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"node": ">=16.7"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"test": "node test/cli.test.js && node test/policy.test.js && node test/matt-skills.test.js && node test/native-skills.test.js && node test/upgrade.test.js && node test/global.test.js",
|
|
21
|
-
"release:verify": "npm test && node --check bin/cli.js && node --check bin/entry.js && node --check bin/policy.js && node --check bin/matt-skills.js && node --check bin/native-skills.js && node --check bin/upgrade.js && node --check bin/global.js && node --check skills/subagent-driven-development/scripts/sdd-workspace-lib.js && node --check skills/subagent-driven-development/scripts/sdd-workspace.js && node --check skills/subagent-driven-development/scripts/task-brief.js && node --check skills/subagent-driven-development/scripts/review-package.js && npm pack --dry-run",
|
|
20
|
+
"test": "node test/config.test.js && node test/cli.test.js && node test/spec.test.js && node test/spec-state.test.js && node test/spec-doctor.test.js && node test/spec-recipe.test.js && node test/spec-link.test.js && node test/policy.test.js && node test/matt-skills.test.js && node test/native-skills.test.js && node test/upgrade.test.js && node test/global.test.js",
|
|
21
|
+
"release:verify": "npm test && node --check bin/cli.js && node --check bin/config.js && node --check bin/entry.js && node --check bin/spec.js && node --check bin/spec-state.js && node --check bin/spec-doctor.js && node --check bin/spec-recipe.js && node --check bin/spec-link.js && node --check bin/policy.js && node --check bin/matt-skills.js && node --check bin/native-skills.js && node --check bin/upgrade.js && node --check bin/global.js && node --check skills/subagent-driven-development/scripts/sdd-workspace-lib.js && node --check skills/subagent-driven-development/scripts/sdd-workspace.js && node --check skills/subagent-driven-development/scripts/task-brief.js && node --check skills/subagent-driven-development/scripts/review-package.js && npm pack --dry-run",
|
|
22
22
|
"preversion": "npm run release:verify",
|
|
23
23
|
"release:patch": "npm version patch",
|
|
24
24
|
"release:dry-run": "npm pack --dry-run",
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-discovery
|
|
3
|
+
description: Build or refresh the AS-IS system map for a brownfield multi-repository workspace using Codebase Memory MCP as the primary structural source.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# System Discovery
|
|
7
|
+
|
|
8
|
+
Use this skill only for documentation/discovery. Do not modify product code.
|
|
9
|
+
|
|
10
|
+
## Preconditions
|
|
11
|
+
|
|
12
|
+
- `.thachvd/system.json` exists.
|
|
13
|
+
- Repositories in that manifest have been indexed with Codebase Memory MCP.
|
|
14
|
+
- If the index is stale or missing, stop and tell the user to run `thachvd-kit spec index`.
|
|
15
|
+
|
|
16
|
+
## Goal
|
|
17
|
+
|
|
18
|
+
Create a reviewed AS-IS map of what the current system does before detailed reverse-engineered specs are generated.
|
|
19
|
+
|
|
20
|
+
## Analysis profile
|
|
21
|
+
|
|
22
|
+
Read `profile` from `.thachvd/system.json`.
|
|
23
|
+
|
|
24
|
+
- `auto`: infer a practical profile for each repository from code/config evidence. A multi-repo system may mix backend, frontend, mobile, and infra repos. Record inferred profiles with evidence.
|
|
25
|
+
- `backend`: emphasize routes/RPC, middleware, auth/policies, services/domain logic, persistence/migrations/transactions, cache, queues/events/jobs/schedulers, external clients, feature flags, retry/idempotency/concurrency and rollback/failure paths.
|
|
26
|
+
- `frontend`: emphasize routes/navigation, page/component composition, state management, API/data clients, forms/validation, auth/session, feature flags, analytics, accessibility, loading/error/empty states, browser storage and build/runtime config.
|
|
27
|
+
- `fullstack`: apply both backend and frontend emphasis and trace client/server boundaries, shared schemas/types, auth/session propagation, BFF/SSR/server actions, and end-to-end failures.
|
|
28
|
+
- `mobile`: emphasize navigation, lifecycle/background work, local storage/cache, offline/sync, permissions, push, deep links, auth refresh, platform-specific code, device integrations and release config.
|
|
29
|
+
- `infra`: emphasize IaC modules/stacks, environments/workspaces, CI/CD, secrets, IAM, networking, state backends, observability, capacity/autoscaling, deployment ordering, rollback/recovery and destructive-change safeguards.
|
|
30
|
+
|
|
31
|
+
Profile guidance is a checklist, not a source of truth. Never omit real behavior merely because it falls outside the selected profile.
|
|
32
|
+
|
|
33
|
+
## Documentation language
|
|
34
|
+
|
|
35
|
+
Read `language` from `.thachvd/system.json`.
|
|
36
|
+
|
|
37
|
+
- `vi`: write prose, headings, explanations, and summaries in natural Vietnamese.
|
|
38
|
+
- `en`: write prose, headings, explanations, and summaries in English.
|
|
39
|
+
- Always preserve code identifiers, class/function names, API routes, event/queue names, database/schema names, file paths, commands, and source anchors exactly as they appear in source.
|
|
40
|
+
- When writing Vietnamese, retain the original English technical term in parentheses if translating it would reduce precision.
|
|
41
|
+
|
|
42
|
+
The implementation and tests are the source of truth. Never invent business intent.
|
|
43
|
+
|
|
44
|
+
## Read first
|
|
45
|
+
|
|
46
|
+
1. `.thachvd/system.json`
|
|
47
|
+
2. Existing files under the configured `spec_root`
|
|
48
|
+
3. Relevant `AGENTS.md` / `.agent/docs/*` files when present
|
|
49
|
+
|
|
50
|
+
## Discovery method
|
|
51
|
+
|
|
52
|
+
Use Codebase Memory MCP first for structural questions: repository inventory, symbols, entry points, callers/callees, data flow, cross-service links, routes, jobs, events, schedulers, queues, clients, and shared persistence. Use direct file reads only to verify or fill gaps.
|
|
53
|
+
|
|
54
|
+
Inspect all configured repositories. Pay special attention to framework side paths that are often missed by direct call graphs: middleware, observers/hooks, event listeners, background jobs, schedulers, policies/guards, migrations, CLI commands, configuration, and tests.
|
|
55
|
+
|
|
56
|
+
Do not document dead code as active behavior unless evidence shows it is reachable or intentionally retained.
|
|
57
|
+
|
|
58
|
+
## Outputs
|
|
59
|
+
|
|
60
|
+
Write or update these files under `spec_root`:
|
|
61
|
+
|
|
62
|
+
- `architecture/system-overview.md`
|
|
63
|
+
- `architecture/repo-map.md`
|
|
64
|
+
- `architecture/capability-map.md`
|
|
65
|
+
- `architecture/integrations.md`
|
|
66
|
+
- `glossary.md`
|
|
67
|
+
|
|
68
|
+
### system-overview.md
|
|
69
|
+
|
|
70
|
+
Describe:
|
|
71
|
+
- system purpose as observable from code
|
|
72
|
+
- major actors/interfaces
|
|
73
|
+
- major runtime/deployment components
|
|
74
|
+
- major data stores
|
|
75
|
+
- major external systems
|
|
76
|
+
- top-level business capabilities
|
|
77
|
+
- uncertainty / missing evidence
|
|
78
|
+
|
|
79
|
+
### repo-map.md
|
|
80
|
+
|
|
81
|
+
For every repository:
|
|
82
|
+
- responsibility
|
|
83
|
+
- primary entry points
|
|
84
|
+
- owned data or services
|
|
85
|
+
- inbound dependencies
|
|
86
|
+
- outbound dependencies
|
|
87
|
+
- events/queues/jobs
|
|
88
|
+
- important source anchors
|
|
89
|
+
|
|
90
|
+
### capability-map.md
|
|
91
|
+
|
|
92
|
+
Group by business capability, not repository boundary.
|
|
93
|
+
|
|
94
|
+
For every capability:
|
|
95
|
+
- short observable purpose
|
|
96
|
+
- participating repositories
|
|
97
|
+
- primary entry points
|
|
98
|
+
- important data/entities
|
|
99
|
+
- integrations/events
|
|
100
|
+
- candidate scope for later reverse engineering
|
|
101
|
+
|
|
102
|
+
Add a matrix showing capability × repository participation.
|
|
103
|
+
|
|
104
|
+
### integrations.md
|
|
105
|
+
|
|
106
|
+
Document cross-repository and external contracts:
|
|
107
|
+
- HTTP/RPC
|
|
108
|
+
- events/messages/queues
|
|
109
|
+
- scheduled/batch interactions
|
|
110
|
+
- shared database/storage access
|
|
111
|
+
- third-party systems
|
|
112
|
+
|
|
113
|
+
Include direction, producer/caller, consumer/callee, contract location, and evidence.
|
|
114
|
+
|
|
115
|
+
### glossary.md
|
|
116
|
+
|
|
117
|
+
Capture domain terms found in code/tests/docs. Mark ambiguous terms instead of guessing.
|
|
118
|
+
|
|
119
|
+
## Evidence rules
|
|
120
|
+
|
|
121
|
+
For every important claim, include the strongest available source anchor: repository + file + symbol/function/class; add line ranges when available.
|
|
122
|
+
|
|
123
|
+
Classify uncertain statements as one of:
|
|
124
|
+
- Confirmed by implementation
|
|
125
|
+
- Confirmed by tests
|
|
126
|
+
- Inferred
|
|
127
|
+
- Unknown / owner confirmation required
|
|
128
|
+
|
|
129
|
+
Never turn an inference into a requirement or business rationale.
|
|
130
|
+
|
|
131
|
+
## Human review gate
|
|
132
|
+
|
|
133
|
+
End by summarizing:
|
|
134
|
+
- proposed capability boundaries
|
|
135
|
+
- ambiguous ownership
|
|
136
|
+
- suspicious cross-repo coupling
|
|
137
|
+
- missing/uncertain business terminology
|
|
138
|
+
- areas that should be split/merged before detailed specs
|
|
139
|
+
|
|
140
|
+
Do not proceed to detailed PRD/Design reverse engineering until the user/team approves the capability map.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-reverse-engineer
|
|
3
|
+
description: Reverse-engineer an approved brownfield system map into durable AS-IS PRD, design, flow, and contract specifications across one or many repositories.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# System Reverse Engineer
|
|
7
|
+
|
|
8
|
+
Use this skill after `/system-discovery` has produced a human-reviewed capability map.
|
|
9
|
+
|
|
10
|
+
This is a documentation workflow. Do not modify product code.
|
|
11
|
+
|
|
12
|
+
## Goal
|
|
13
|
+
|
|
14
|
+
Turn the current implementation of the whole system into a durable AS-IS specification set that helps members understand the system and gives future coding agents reliable context.
|
|
15
|
+
|
|
16
|
+
One invocation should cover the whole approved system. Work capability-by-capability internally so each area can be verified and checkpointed. A named capability in the handoff is only a targeted refresh.
|
|
17
|
+
|
|
18
|
+
## Analysis profile
|
|
19
|
+
|
|
20
|
+
Read `profile` from `.thachvd/system.json` and apply the same profile-specific emphasis defined by `/system-discovery`. In `auto` mode, use the repo profiles inferred during discovery. Re-check the evidence if the implementation has changed.
|
|
21
|
+
|
|
22
|
+
Profile guidance must never suppress behavior outside the selected profile. Source code/tests remain authoritative.
|
|
23
|
+
|
|
24
|
+
## Documentation language
|
|
25
|
+
|
|
26
|
+
Read `language` from `.thachvd/system.json`.
|
|
27
|
+
|
|
28
|
+
- `vi`: write prose, headings, explanations, summaries, PRDs, design docs, flows, and contract explanations in natural Vietnamese.
|
|
29
|
+
- `en`: write those documents in English.
|
|
30
|
+
- Always preserve code identifiers, class/function names, API routes, event/queue names, database/schema names, file paths, commands, and source anchors exactly as they appear in source.
|
|
31
|
+
- When writing Vietnamese, retain the original English technical term in parentheses if translating it would reduce precision.
|
|
32
|
+
|
|
33
|
+
## Preconditions
|
|
34
|
+
|
|
35
|
+
Read:
|
|
36
|
+
|
|
37
|
+
1. `.thachvd/system.json`
|
|
38
|
+
2. the configured `spec_root/architecture/system-overview.md`
|
|
39
|
+
3. `spec_root/architecture/repo-map.md`
|
|
40
|
+
4. `spec_root/architecture/capability-map.md`
|
|
41
|
+
5. `spec_root/architecture/integrations.md`
|
|
42
|
+
6. `spec_root/glossary.md`
|
|
43
|
+
7. `spec_root/_meta/reverse-progress.json`
|
|
44
|
+
|
|
45
|
+
The capability map must have been reviewed by a human. If it is obviously still draft or ambiguous, stop rather than manufacturing detailed specs.
|
|
46
|
+
|
|
47
|
+
## Durable checkpoint and resume
|
|
48
|
+
|
|
49
|
+
`thachvd-kit spec reverse` creates a durable checkpoint. Full-system runs use `spec_root/_meta/reverse-progress.json`; targeted refreshes use `spec_root/_meta/reverse-progress-<capability>.json`. Use the exact checkpoint path declared by the handoff prompt.
|
|
50
|
+
|
|
51
|
+
Expected shape:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"schema_version": 1,
|
|
56
|
+
"system": "example",
|
|
57
|
+
"mode": "full",
|
|
58
|
+
"target": null,
|
|
59
|
+
"started_at": "<ISO-8601>",
|
|
60
|
+
"updated_at": "<ISO-8601>",
|
|
61
|
+
"status": "in_progress",
|
|
62
|
+
"capabilities": {
|
|
63
|
+
"booking": {
|
|
64
|
+
"title": "Booking",
|
|
65
|
+
"status": "pending",
|
|
66
|
+
"updated_at": "<ISO-8601>",
|
|
67
|
+
"source_paths": {}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Rules:
|
|
74
|
+
|
|
75
|
+
1. If `capabilities` is empty, derive the approved capability list from `capability-map.md` and populate it before deep work.
|
|
76
|
+
2. In targeted mode, include/work only the requested capability.
|
|
77
|
+
3. Before working on a capability, set it to `in_progress` and persist the file.
|
|
78
|
+
4. After both PRD/design exist and the capability-level quality checks below pass, set it to `completed`, save its relevant `source_paths` by repo, and persist.
|
|
79
|
+
5. If blocked, set `blocked` with a concise reason and continue with other capabilities when possible.
|
|
80
|
+
6. On a later invocation, resume `pending`, `in_progress`, or retryable `blocked` capabilities. Do not redo `completed` capabilities unless the handoff is a targeted refresh or the user explicitly reset progress.
|
|
81
|
+
7. Mark top-level `status` `completed` only when every intended capability is completed or explicitly blocked.
|
|
82
|
+
8. Update `updated_at` after every state change.
|
|
83
|
+
9. A targeted refresh must never overwrite the full-system checkpoint.
|
|
84
|
+
|
|
85
|
+
Do not keep progress only in chat memory.
|
|
86
|
+
|
|
87
|
+
## Sources of truth
|
|
88
|
+
|
|
89
|
+
Use, in order of evidentiary strength:
|
|
90
|
+
|
|
91
|
+
- production implementation
|
|
92
|
+
- tests
|
|
93
|
+
- configuration
|
|
94
|
+
- schemas/migrations
|
|
95
|
+
- existing reviewed system docs
|
|
96
|
+
|
|
97
|
+
Use Codebase Memory MCP as the primary source for structural discovery, cross-repository tracing, callers/callees, routes, jobs, events, queues, schedulers, and data flow. Read source files directly to verify important behavior and fill gaps.
|
|
98
|
+
|
|
99
|
+
Do not infer undocumented business rationale from implementation.
|
|
100
|
+
|
|
101
|
+
## Processing model
|
|
102
|
+
|
|
103
|
+
For each approved capability:
|
|
104
|
+
|
|
105
|
+
1. Identify every participating repository and coherent implementation scope.
|
|
106
|
+
2. Trace entry points through services, persistence, async work, integrations, and outputs.
|
|
107
|
+
3. Inspect tests that lock down observable behavior.
|
|
108
|
+
4. Explicitly inspect framework side paths that call graphs may miss: middleware, policies/guards, observers/hooks, event listeners, jobs, schedulers, migrations, CLI commands, config and feature flags.
|
|
109
|
+
5. Extract current requirements, invariants, error/failure behavior, state transitions, retries/idempotency, and contracts.
|
|
110
|
+
6. Verify important claims against code/tests.
|
|
111
|
+
7. Write the capability PRD and design doc using the fixed templates below.
|
|
112
|
+
8. Record uncertainty explicitly.
|
|
113
|
+
9. Save stable repository-relative source paths into the progress entry for later drift checking.
|
|
114
|
+
10. Continue to the next incomplete capability.
|
|
115
|
+
|
|
116
|
+
If Shinpr's `/recipe-reverse-engineer` workflow is installed, it may be used as a high-assurance helper for coherent implementation scopes. It is optional.
|
|
117
|
+
|
|
118
|
+
## Fixed PRD template
|
|
119
|
+
|
|
120
|
+
Every `spec_root/capabilities/<capability>/prd.md` must contain these sections in this order:
|
|
121
|
+
|
|
122
|
+
1. **Purpose**
|
|
123
|
+
2. **Actors**
|
|
124
|
+
3. **Current Behaviors / Use Cases**
|
|
125
|
+
4. **Requirements**
|
|
126
|
+
5. **Business Rules and Invariants**
|
|
127
|
+
6. **Error and Edge Cases**
|
|
128
|
+
7. **Current Limitations**
|
|
129
|
+
8. **Unknown Business Rationale / Owner Confirmation**
|
|
130
|
+
9. **Evidence Summary**
|
|
131
|
+
|
|
132
|
+
Requirements describe what the current system demonstrably does, not what it should ideally do.
|
|
133
|
+
|
|
134
|
+
## Fixed design template
|
|
135
|
+
|
|
136
|
+
Every `spec_root/capabilities/<capability>/design.md` must contain these sections in this order:
|
|
137
|
+
|
|
138
|
+
1. **Participating Repositories**
|
|
139
|
+
2. **Entry Points**
|
|
140
|
+
3. **Components / Modules**
|
|
141
|
+
4. **End-to-End Execution Flow**
|
|
142
|
+
5. **Data Model and Ownership**
|
|
143
|
+
6. **Persistence**
|
|
144
|
+
7. **State Transitions**
|
|
145
|
+
8. **Events / Queues / Jobs / Schedulers**
|
|
146
|
+
9. **External Integrations**
|
|
147
|
+
10. **Configuration / Feature Flags**
|
|
148
|
+
11. **Failure / Retry / Rollback / Idempotency**
|
|
149
|
+
12. **Tests**
|
|
150
|
+
13. **Source Map**
|
|
151
|
+
14. **Known Ambiguities**
|
|
152
|
+
|
|
153
|
+
Do not omit a section silently. Use "None observed" or "Unknown / requires confirmation" when evidence does not establish content.
|
|
154
|
+
|
|
155
|
+
## System-level outputs
|
|
156
|
+
|
|
157
|
+
Update only when real evidence warrants them:
|
|
158
|
+
|
|
159
|
+
- `spec_root/flows/*.md` for important end-to-end or cross-repository flows
|
|
160
|
+
- `spec_root/contracts/*.md` for HTTP/RPC, events/messages, queues, shared storage, or other cross-boundary contracts
|
|
161
|
+
|
|
162
|
+
For cross-repository contracts, verify both producer/caller and consumer/callee when both codebases are available.
|
|
163
|
+
|
|
164
|
+
Do not create files merely to fill directories.
|
|
165
|
+
|
|
166
|
+
## Evidence and uncertainty
|
|
167
|
+
|
|
168
|
+
Attach repository + file + symbol/function/class anchors to important behavior. Add line ranges when reliably available.
|
|
169
|
+
|
|
170
|
+
Distinguish:
|
|
171
|
+
|
|
172
|
+
- Confirmed by implementation
|
|
173
|
+
- Confirmed by tests
|
|
174
|
+
- Inferred
|
|
175
|
+
- Unknown / owner confirmation required
|
|
176
|
+
|
|
177
|
+
Never promote an inference to a requirement without evidence.
|
|
178
|
+
|
|
179
|
+
## Capability quality gate
|
|
180
|
+
|
|
181
|
+
Before marking one capability `completed` in progress:
|
|
182
|
+
|
|
183
|
+
- PRD and design templates are complete
|
|
184
|
+
- PRD and design agree
|
|
185
|
+
- primary entry points were traced
|
|
186
|
+
- relevant tests were inspected
|
|
187
|
+
- async/framework side paths were considered
|
|
188
|
+
- important failure/state-transition behavior is represented
|
|
189
|
+
- material cross-repo contracts are represented
|
|
190
|
+
- major claims have source anchors
|
|
191
|
+
- relevant `source_paths` were recorded in progress
|
|
192
|
+
- no undocumented business rationale was invented
|
|
193
|
+
- dead/unreachable code is not presented as active without evidence
|
|
194
|
+
|
|
195
|
+
This is an author-side gate only. A later independent `/system-spec-review` decides whether the result is actually verified.
|
|
196
|
+
|
|
197
|
+
## Final output
|
|
198
|
+
|
|
199
|
+
Return a concise coverage summary:
|
|
200
|
+
|
|
201
|
+
- capabilities completed
|
|
202
|
+
- capabilities blocked
|
|
203
|
+
- unresolved ambiguities
|
|
204
|
+
- specs needing owner review
|
|
205
|
+
- cross-repository flows/contracts produced
|
|
206
|
+
- current checkpoint status
|
|
207
|
+
|
|
208
|
+
Do not claim the specs are independently verified. That happens only after `thachvd-kit spec verify` + `/system-spec-review`.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: system-spec-review
|
|
3
|
+
description: Independently verify generated AS-IS system specs against implementation and tests, then write machine-readable verification metadata for drift detection.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# System Spec Review
|
|
7
|
+
|
|
8
|
+
Review an existing generated system-spec set independently from the agent that wrote it.
|
|
9
|
+
|
|
10
|
+
Do not modify product code. Do not silently rewrite the source specs during the first review pass.
|
|
11
|
+
|
|
12
|
+
## Goal
|
|
13
|
+
|
|
14
|
+
Try to prove the generated specs incomplete, unsupported, stale, or internally inconsistent.
|
|
15
|
+
|
|
16
|
+
## Analysis profile
|
|
17
|
+
|
|
18
|
+
Read `profile` from `.thachvd/system.json`. Use it to expand the independent coverage inventory with the same specialized concerns used during discovery/reverse engineering. In `auto` mode, independently check whether the inferred per-repository profiles are supported by code/config evidence.
|
|
19
|
+
|
|
20
|
+
Do not treat profile compliance as proof of completeness; actively look for behavior outside the expected profile.
|
|
21
|
+
|
|
22
|
+
The result is not a style review. It is an evidence and coverage review.
|
|
23
|
+
|
|
24
|
+
## Read first
|
|
25
|
+
|
|
26
|
+
1. `.thachvd/system.json`
|
|
27
|
+
2. the configured `spec_root/architecture/*`
|
|
28
|
+
3. `spec_root/capabilities/*/{prd.md,design.md}`
|
|
29
|
+
4. `spec_root/flows/*`
|
|
30
|
+
5. `spec_root/contracts/*`
|
|
31
|
+
6. `spec_root/_meta/reverse-progress.json` when present
|
|
32
|
+
|
|
33
|
+
Read `language` from the manifest and write the human-facing review report in that language. Preserve all code identifiers and source anchors exactly.
|
|
34
|
+
|
|
35
|
+
## Source of truth
|
|
36
|
+
|
|
37
|
+
Use:
|
|
38
|
+
- production implementation
|
|
39
|
+
- tests
|
|
40
|
+
- config
|
|
41
|
+
- schemas/migrations
|
|
42
|
+
- Codebase Memory MCP for structural discovery and cross-repository tracing
|
|
43
|
+
|
|
44
|
+
Do not trust generated specs simply because they contain source anchors. Follow a representative and risk-weighted sample of anchors into code and verify them.
|
|
45
|
+
|
|
46
|
+
## Independent verification method
|
|
47
|
+
|
|
48
|
+
If the client supports subagents, run this review in a fresh reviewer subagent that did not author the specs. Otherwise, deliberately reconstruct the implementation inventory from code/MCP before reading each capability's conclusions in detail. Do not rely on the author agent's summary as evidence.
|
|
49
|
+
|
|
50
|
+
For each approved capability:
|
|
51
|
+
|
|
52
|
+
1. Build an implementation inventory independently from the capability spec:
|
|
53
|
+
- entry points/routes/commands
|
|
54
|
+
- services/modules
|
|
55
|
+
- state transitions
|
|
56
|
+
- persistence
|
|
57
|
+
- jobs/schedulers
|
|
58
|
+
- events/listeners/queues
|
|
59
|
+
- middleware/policies/observers/hooks
|
|
60
|
+
- external clients/integrations
|
|
61
|
+
- tests
|
|
62
|
+
2. Compare that inventory with PRD and design docs.
|
|
63
|
+
3. Check important claims against implementation/tests.
|
|
64
|
+
4. Look for implementation behavior not represented in the spec.
|
|
65
|
+
5. Look for spec claims with no implementation/test evidence.
|
|
66
|
+
6. Check PRD vs design consistency.
|
|
67
|
+
7. Check cross-repository flows and contracts from both sides of each boundary.
|
|
68
|
+
8. Check whether dead/unreachable code was described as active.
|
|
69
|
+
9. Check ambiguous business rationale remains marked unknown rather than invented.
|
|
70
|
+
|
|
71
|
+
Prioritize high-risk boundaries: authentication/authorization, money/payment/refund, schema/state changes, async processing, external side effects, retries/idempotency, concurrency, and destructive operations.
|
|
72
|
+
|
|
73
|
+
## Verification statuses
|
|
74
|
+
|
|
75
|
+
A capability may be:
|
|
76
|
+
|
|
77
|
+
- `verified`: no material unsupported claims or coverage gaps found in the performed review.
|
|
78
|
+
- `needs_review`: material gaps, unsupported claims, contradictions, or ambiguous coverage remain.
|
|
79
|
+
- `blocked`: verification could not be completed because required code, tests, repositories, or runtime evidence are unavailable.
|
|
80
|
+
|
|
81
|
+
Do not use `verified` to mean mathematically complete. The review report must state what was sampled and any residual risk.
|
|
82
|
+
|
|
83
|
+
## Required outputs
|
|
84
|
+
|
|
85
|
+
Create/update:
|
|
86
|
+
|
|
87
|
+
- `spec_root/_meta/review.md`
|
|
88
|
+
- `spec_root/_meta/verification.json`
|
|
89
|
+
|
|
90
|
+
If the handoff names one capability, perform a targeted re-review:
|
|
91
|
+
- verify only that capability against current code/tests
|
|
92
|
+
- update only that capability entry in `verification.json`
|
|
93
|
+
- preserve other capability entries and their per-capability verified commits
|
|
94
|
+
- append/update the human review report without erasing unrelated findings
|
|
95
|
+
|
|
96
|
+
### review.md
|
|
97
|
+
|
|
98
|
+
Include:
|
|
99
|
+
- review scope and date
|
|
100
|
+
- repositories/commits reviewed
|
|
101
|
+
- capability-by-capability status
|
|
102
|
+
- missing behavior
|
|
103
|
+
- unsupported claims
|
|
104
|
+
- broken or weak source anchors
|
|
105
|
+
- PRD/design contradictions
|
|
106
|
+
- flow/contract gaps
|
|
107
|
+
- unresolved ambiguities
|
|
108
|
+
- residual review risk
|
|
109
|
+
- recommended remediation
|
|
110
|
+
|
|
111
|
+
Do not automatically edit the source spec to hide findings.
|
|
112
|
+
|
|
113
|
+
### verification.json
|
|
114
|
+
|
|
115
|
+
Write valid JSON with this shape:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"schema_version": 1,
|
|
120
|
+
"verified_at": "<ISO-8601>",
|
|
121
|
+
"system": "<manifest name>",
|
|
122
|
+
"repositories": {
|
|
123
|
+
"<repo-name>": {
|
|
124
|
+
"commit": "<git HEAD SHA>"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"capabilities": {
|
|
128
|
+
"<capability-slug>": {
|
|
129
|
+
"title": "<human title>",
|
|
130
|
+
"status": "verified",
|
|
131
|
+
"source_paths": {
|
|
132
|
+
"<repo-name>": [
|
|
133
|
+
"path/to/module",
|
|
134
|
+
"path/to/important-file.ext"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"verified_commits": {
|
|
138
|
+
"<repo-name>": "<Git SHA used to verify this capability>"
|
|
139
|
+
},
|
|
140
|
+
"evidence": {
|
|
141
|
+
"implementation_claims_checked": 0,
|
|
142
|
+
"test_claims_checked": 0,
|
|
143
|
+
"unsupported_claims": 0,
|
|
144
|
+
"potential_gaps": 0,
|
|
145
|
+
"broken_anchors": 0
|
|
146
|
+
},
|
|
147
|
+
"notes": []
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Rules:
|
|
154
|
+
- top-level repository commits MUST be current `git rev-parse HEAD` values for a full-system review; they represent the latest whole-system review snapshot
|
|
155
|
+
- every `verified` capability MUST record `verified_commits` for each repo present in its `source_paths`
|
|
156
|
+
- for targeted re-review, update that capability's `verified_commits` to current HEAD without advancing unrelated capabilities' baselines
|
|
157
|
+
- `source_paths` MUST contain paths actually relevant to the capability; prefer stable module/directory prefixes plus exceptional files
|
|
158
|
+
- do not use wildcards; paths are repository-relative
|
|
159
|
+
- every capability in the approved capability map must appear
|
|
160
|
+
- capabilities that were not fully checked must not be marked `verified`
|
|
161
|
+
- every `verified` capability must have at least one repository-relative `source_paths` entry and matching `verified_commits`
|
|
162
|
+
- for a `verified` capability, `unsupported_claims`, `potential_gaps`, and `broken_anchors` must all be 0; otherwise use `needs_review`
|
|
163
|
+
- all evidence counts must be non-negative integers; use 0 rather than inventing counts
|
|
164
|
+
- source paths must stay inside their repository; never use absolute paths or `../`
|
|
165
|
+
|
|
166
|
+
## Final gate
|
|
167
|
+
|
|
168
|
+
Before marking the review complete:
|
|
169
|
+
|
|
170
|
+
- every approved capability has a verification status
|
|
171
|
+
- every configured repo has a top-level reviewed commit SHA after a full review
|
|
172
|
+
- verified capabilities have source paths and capability-specific verified commits for every repo they materially use
|
|
173
|
+
- no known material gap is hidden under `verified`
|
|
174
|
+
- the JSON parses cleanly
|
|
175
|
+
- the human report and JSON statuses agree
|
|
176
|
+
|
|
177
|
+
Return a concise summary of verified, needs-review, blocked, and the highest-risk gaps.
|