opencode-agent-orchestration-kit 1.0.33 → 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 +101 -6
- package/docs/cli.md +31 -3
- package/docs/models.md +30 -0
- package/docs/releases/v1.0.34.md +59 -0
- package/docs/releases/v1.0.35.md +62 -0
- package/docs/releases/v1.0.36.md +58 -0
- package/docs/releases/v1.0.37.md +53 -0
- package/docs/releases/v1.0.38.md +44 -0
- package/docs/supply-chain.md +2 -2
- package/opencode/agents/lead.md +11 -2
- package/opencode/agents/review_api.md +26 -9
- package/opencode/agents/review_coordinator.md +60 -68
- package/opencode/agents/review_quality.md +27 -11
- package/opencode/agents/review_security.md +26 -10
- package/opencode/agents/review_tests.md +26 -9
- package/opencode/agents/reviewer.md +95 -80
- package/opencode/commands/autonomous.md +75 -0
- package/opencode/commands/evolve.md +3 -1
- package/opencode/commands/feature.md +6 -2
- package/opencode/commands/loop.md +12 -8
- package/opencode/commands/review-orchestrated.md +26 -24
- package/opencode/commands/review-preflight.md +8 -7
- package/opencode/commands/review.md +27 -10
- package/opencode/docs/ai/harness/README.md +3 -0
- package/opencode/docs/ai/harness/agents.md +20 -3
- package/opencode/docs/ai/harness/checks.md +9 -0
- package/opencode/docs/ai/harness/commands.md +36 -0
- package/opencode/docs/ai/harness/orchestrated-review.md +8 -1
- package/opencode/docs/ai/harness/orchestration-contracts.json +34 -1
- package/opencode/package-lock.json +3 -3
- package/opencode/package.json +1 -1
- package/opencode/plugins/shell-export-guard.ts +23 -0
- package/opencode/scripts/adversarial-harness.test.mjs +5 -2
- package/opencode/scripts/check-harness.mjs +241 -10
- package/opencode/scripts/check-harness.test.mjs +190 -8
- package/opencode/scripts/loop-state.mjs +88 -14
- package/opencode/scripts/loop-state.test.mjs +82 -5
- package/opencode/scripts/review-orchestrated-prepare.mjs +18 -1
- package/opencode/scripts/review-orchestrated-prepare.test.mjs +49 -0
- package/opencode/scripts/shell-export-policy.d.mts +4 -0
- package/opencode/scripts/shell-export-policy.mjs +272 -0
- package/opencode/scripts/shell-export-policy.test.mjs +96 -0
- package/opencode/skills/code-review-and-quality/SKILL.md +63 -321
- package/opencode/skills/code-review-and-quality/references/profiles/backend-clean-ddd-cqrs.md +60 -0
- package/opencode/skills/code-review-and-quality/references/profiles/backend.md +54 -0
- package/opencode/skills/code-review-and-quality/references/profiles/frontend-clean-layered.md +60 -0
- package/opencode/skills/code-review-and-quality/references/profiles/frontend.md +62 -0
- package/opencode/skills/code-review-and-quality/references/review-policy.md +258 -0
- package/package.json +5 -3
- package/scripts/check-supply-chain.mjs +9 -2
- package/scripts/check-supply-chain.test.mjs +16 -11
- package/scripts/check.sh +8 -4
- package/scripts/oak.mjs +47 -1
- package/scripts/oak.test.mjs +61 -2
- package/scripts/oc-switch.mjs +472 -0
- package/scripts/oc-switch.test.mjs +217 -0
- package/scripts/package-smoke.mjs +16 -2
- package/scripts/package-smoke.test.mjs +7 -5
- package/scripts/version.test.mjs +2 -2
- package/supply-chain.json +1 -1
- package/docker/open-design/data/app.sqlite +0 -0
- package/docker/open-design/data/app.sqlite-shm +0 -0
- package/docker/open-design/data/app.sqlite-wal +0 -0
- package/docker/open-design/opencode-auth/log/2026-05-02T105802.log +0 -17
- package/docker/open-design/opencode-auth/log/2026-05-04T102127.log +0 -16
- package/docker/open-design/opencode-auth/opencode.db +0 -0
- package/docker/open-design/opencode-auth/opencode.db-shm +0 -0
- package/docker/open-design/opencode-auth/opencode.db-wal +0 -0
|
@@ -21,345 +21,87 @@ origin: null
|
|
|
21
21
|
status: active
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
# Code Review
|
|
24
|
+
# Code Review And Quality
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Purpose
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Route every code review through one canonical policy and only the profiles that
|
|
29
|
+
match the changed surface and declared architecture. This file is an entrypoint,
|
|
30
|
+
not a second source of review rules.
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
## Required Loading Sequence
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
1. Read [`references/review-policy.md`](references/review-policy.md) completely.
|
|
35
|
+
2. Always activate the `core` policy.
|
|
36
|
+
3. Activate the generic backend and/or frontend profile from the changed
|
|
37
|
+
surface.
|
|
38
|
+
4. Activate a strict architecture profile only from an explicit declaration in
|
|
39
|
+
the task, applicable repository instructions, an ADR, a specification, or
|
|
40
|
+
architecture documentation.
|
|
41
|
+
5. Treat file names and folders only as corroborating evidence; layout alone
|
|
42
|
+
does not activate a strict profile.
|
|
43
|
+
6. Report `profile_resolution`: selected profiles, omitted profiles, evidence
|
|
44
|
+
for selection, and fallback used when architecture is not declared.
|
|
45
|
+
7. Apply the findings and final-output contracts from the canonical policy.
|
|
33
46
|
|
|
34
|
-
|
|
35
|
-
- After completing a feature implementation
|
|
36
|
-
- When another agent or model produced code you need to evaluate
|
|
37
|
-
- When refactoring existing code
|
|
38
|
-
- After any bug fix (review both the fix and the regression test)
|
|
47
|
+
## Profile Routing
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
### Generic backend
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
Read
|
|
52
|
+
[`references/profiles/backend.md`](references/profiles/backend.md) for server,
|
|
53
|
+
worker, consumer, persistence, backend API, or server-side integration changes.
|
|
43
54
|
|
|
44
|
-
###
|
|
55
|
+
### Declared Clean/DDD/hexagonal/CQRS backend
|
|
45
56
|
|
|
46
|
-
|
|
57
|
+
Read
|
|
58
|
+
[`references/profiles/backend-clean-ddd-cqrs.md`](references/profiles/backend-clean-ddd-cqrs.md)
|
|
59
|
+
only for the parts of Clean Architecture, DDD, hexagonal architecture, or CQRS
|
|
60
|
+
that the repository or task explicitly declares.
|
|
47
61
|
|
|
48
|
-
|
|
49
|
-
- Are edge cases handled (null, empty, boundary values)?
|
|
50
|
-
- Are error paths handled (not just the happy path)?
|
|
51
|
-
- Does it pass all tests? Are the tests actually testing the right things?
|
|
52
|
-
- Are there off-by-one errors, race conditions, or state inconsistencies?
|
|
62
|
+
### Generic frontend
|
|
53
63
|
|
|
54
|
-
|
|
64
|
+
Read
|
|
65
|
+
[`references/profiles/frontend.md`](references/profiles/frontend.md) for web,
|
|
66
|
+
mobile, desktop, UI, client state, navigation, local storage, or client network
|
|
67
|
+
changes.
|
|
55
68
|
|
|
56
|
-
|
|
69
|
+
### Declared Clean/layered frontend
|
|
57
70
|
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
- Are there any "clever" tricks that should be simplified?
|
|
62
|
-
- **Could this be done in fewer lines?** (1000 lines where 100 suffice is a failure)
|
|
63
|
-
- **Are abstractions earning their complexity?** (Don't generalize until the third use case)
|
|
64
|
-
- Would comments help clarify non-obvious intent? (But don't comment obvious code.)
|
|
65
|
-
- Are there dead code artifacts: no-op variables (`_unused`), backwards-compat shims, or `// removed` comments?
|
|
71
|
+
Read
|
|
72
|
+
[`references/profiles/frontend-clean-layered.md`](references/profiles/frontend-clean-layered.md)
|
|
73
|
+
only when a layered/Clean client architecture is explicitly declared.
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
## Contextual Adaptation
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
When no strict profile is declared:
|
|
70
78
|
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
-
|
|
79
|
+
- preserve correctness, dependency direction, boundary clarity, testability,
|
|
80
|
+
replaceability, and explicit contracts;
|
|
81
|
+
- translate those principles into the project's actual modules, services,
|
|
82
|
+
stores, hooks, components, controllers, adapters, or other boundaries;
|
|
83
|
+
- follow applicable local instructions, ADRs, and canonical examples;
|
|
84
|
+
- do not require DDD building blocks, Clean layers, CQRS, repositories, value
|
|
85
|
+
objects, use-case classes, or specific folder/naming conventions;
|
|
86
|
+
- do not treat personal preference as architecture evidence.
|
|
76
87
|
|
|
77
|
-
|
|
88
|
+
## Optional Supporting Skills
|
|
78
89
|
|
|
79
|
-
|
|
90
|
+
Load `security-and-hardening`, `performance-optimization`,
|
|
91
|
+
`test-driven-development`, or `debugging-and-error-recovery` only when the diff
|
|
92
|
+
or evidence activates that risk. Supporting skills may deepen an axis but may
|
|
93
|
+
not redefine the canonical policy's causality, stage, verdict, or blocking
|
|
94
|
+
rules.
|
|
80
95
|
|
|
81
|
-
|
|
82
|
-
- Are secrets kept out of code, logs, and version control?
|
|
83
|
-
- Is authentication/authorization checked where needed?
|
|
84
|
-
- Are SQL queries parameterized (no string concatenation)?
|
|
85
|
-
- Are outputs encoded to prevent XSS?
|
|
86
|
-
- Are dependencies from trusted sources with no known vulnerabilities?
|
|
87
|
-
- Is data from external sources (APIs, logs, user content, config files) treated as untrusted?
|
|
88
|
-
- Are external data flows validated at system boundaries before use in logic or rendering?
|
|
96
|
+
## Completion Check
|
|
89
97
|
|
|
90
|
-
|
|
98
|
+
Before returning:
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
## Change Sizing
|
|
102
|
-
|
|
103
|
-
Small, focused changes are easier to review, faster to merge, and safer to deploy. Target these sizes:
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
~100 lines changed → Good. Reviewable in one sitting.
|
|
107
|
-
~300 lines changed → Acceptable if it's a single logical change.
|
|
108
|
-
~1000 lines changed → Too large. Split it.
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**What counts as "one change":** A single self-contained modification that addresses one thing, includes related tests, and keeps the system functional after submission. One part of a feature — not the whole feature.
|
|
112
|
-
|
|
113
|
-
**Splitting strategies when a change is too large:**
|
|
114
|
-
|
|
115
|
-
| Strategy | How | When |
|
|
116
|
-
|----------|-----|------|
|
|
117
|
-
| **Stack** | Submit a small change, start the next one based on it | Sequential dependencies |
|
|
118
|
-
| **By file group** | Separate changes for groups needing different reviewers | Cross-cutting concerns |
|
|
119
|
-
| **Horizontal** | Create shared code/stubs first, then consumers | Layered architecture |
|
|
120
|
-
| **Vertical** | Break into smaller full-stack slices of the feature | Feature work |
|
|
121
|
-
|
|
122
|
-
**When large changes are acceptable:** Complete file deletions and automated refactoring where the reviewer only needs to verify intent, not every line.
|
|
123
|
-
|
|
124
|
-
**Separate refactoring from feature work.** A change that refactors existing code and adds new behavior is two changes — submit them separately. Small cleanups (variable renaming) can be included at reviewer discretion.
|
|
125
|
-
|
|
126
|
-
## Change Descriptions
|
|
127
|
-
|
|
128
|
-
Every change needs a description that stands alone in version control history.
|
|
129
|
-
|
|
130
|
-
**First line:** Short, imperative, standalone. "Delete the FizzBuzz RPC" not "Deleting the FizzBuzz RPC." Must be informative enough that someone searching history can understand the change without reading the diff.
|
|
131
|
-
|
|
132
|
-
**Body:** What is changing and why. Include context, decisions, and reasoning not visible in the code itself. Link to bug numbers, benchmark results, or design docs where relevant. Acknowledge approach shortcomings when they exist.
|
|
133
|
-
|
|
134
|
-
**Anti-patterns:** "Fix bug," "Fix build," "Add patch," "Moving code from A to B," "Phase 1," "Add convenience functions."
|
|
135
|
-
|
|
136
|
-
## Review Process
|
|
137
|
-
|
|
138
|
-
### Step 1: Understand the Context
|
|
139
|
-
|
|
140
|
-
Before looking at code, understand the intent:
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
- What is this change trying to accomplish?
|
|
144
|
-
- What spec or task does it implement?
|
|
145
|
-
- What is the expected behavior change?
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Step 2: Review the Tests First
|
|
149
|
-
|
|
150
|
-
Tests reveal intent and coverage:
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
- Do tests exist for the change?
|
|
154
|
-
- Do they test behavior (not implementation details)?
|
|
155
|
-
- Are edge cases covered?
|
|
156
|
-
- Do tests have descriptive names?
|
|
157
|
-
- Would the tests catch a regression if the code changed?
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Step 3: Review the Implementation
|
|
161
|
-
|
|
162
|
-
Walk through the code with the five axes in mind:
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
For each file changed:
|
|
166
|
-
1. Correctness: Does this code do what the test says it should?
|
|
167
|
-
2. Readability: Can I understand this without help?
|
|
168
|
-
3. Architecture: Does this fit the system?
|
|
169
|
-
4. Security: Any vulnerabilities?
|
|
170
|
-
5. Performance: Any bottlenecks?
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Step 4: Categorize Findings
|
|
174
|
-
|
|
175
|
-
Label every comment with its severity so the author knows what's required vs optional:
|
|
176
|
-
|
|
177
|
-
| Prefix | Meaning | Author Action |
|
|
178
|
-
|--------|---------|---------------|
|
|
179
|
-
| *(no prefix)* | Required change | Must address before merge |
|
|
180
|
-
| **Critical:** | Blocks merge | Security vulnerability, data loss, broken functionality |
|
|
181
|
-
| **Nit:** | Minor, optional | Author may ignore — formatting, style preferences |
|
|
182
|
-
| **Optional:** / **Consider:** | Suggestion | Worth considering but not required |
|
|
183
|
-
| **FYI** | Informational only | No action needed — context for future reference |
|
|
184
|
-
|
|
185
|
-
This prevents authors from treating all feedback as mandatory and wasting time on optional suggestions.
|
|
186
|
-
|
|
187
|
-
### Step 5: Verify the Verification
|
|
188
|
-
|
|
189
|
-
Check the author's verification story:
|
|
190
|
-
|
|
191
|
-
```
|
|
192
|
-
- What tests were run?
|
|
193
|
-
- Did the build pass?
|
|
194
|
-
- Was the change tested manually?
|
|
195
|
-
- Are there screenshots for UI changes?
|
|
196
|
-
- Is there a before/after comparison?
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
## Multi-Model Review Pattern
|
|
200
|
-
|
|
201
|
-
Use different models for different review perspectives:
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
Model A writes the code
|
|
205
|
-
│
|
|
206
|
-
▼
|
|
207
|
-
Model B reviews for correctness and architecture
|
|
208
|
-
│
|
|
209
|
-
▼
|
|
210
|
-
Model A addresses the feedback
|
|
211
|
-
│
|
|
212
|
-
▼
|
|
213
|
-
Human makes the final call
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
This catches issues that a single model might miss — different models have different blind spots.
|
|
217
|
-
|
|
218
|
-
**Example prompt for a review agent:**
|
|
219
|
-
```
|
|
220
|
-
Review this code change for correctness, security, and adherence to
|
|
221
|
-
our project conventions. The spec says [X]. The change should [Y].
|
|
222
|
-
Flag any issues as Critical, Important, or Suggestion.
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
## Dead Code Hygiene
|
|
226
|
-
|
|
227
|
-
After any refactoring or implementation change, check for orphaned code:
|
|
228
|
-
|
|
229
|
-
1. Identify code that is now unreachable or unused
|
|
230
|
-
2. List it explicitly
|
|
231
|
-
3. **Ask before deleting:** "Should I remove these now-unused elements: [list]?"
|
|
232
|
-
|
|
233
|
-
Don't leave dead code lying around — it confuses future readers and agents. But don't silently delete things you're not sure about. When in doubt, ask.
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
DEAD CODE IDENTIFIED:
|
|
237
|
-
- formatLegacyDate() in src/utils/date.ts — replaced by formatDate()
|
|
238
|
-
- OldTaskCard component in src/components/ — replaced by TaskCard
|
|
239
|
-
- LEGACY_API_URL constant in src/config.ts — no remaining references
|
|
240
|
-
→ Safe to remove these?
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## Review Speed
|
|
244
|
-
|
|
245
|
-
Slow reviews block entire teams. The cost of context-switching to review is less than the waiting cost imposed on others.
|
|
246
|
-
|
|
247
|
-
- **Respond within one business day** — this is the maximum, not the target
|
|
248
|
-
- **Ideal cadence:** Respond shortly after a review request arrives, unless deep in focused coding. A typical change should complete multiple review rounds in a single day
|
|
249
|
-
- **Prioritize fast individual responses** over quick final approval. Quick feedback reduces frustration even if multiple rounds are needed
|
|
250
|
-
- **Large changes:** Ask the author to split them rather than reviewing one massive changeset
|
|
251
|
-
|
|
252
|
-
## Handling Disagreements
|
|
253
|
-
|
|
254
|
-
When resolving review disputes, apply this hierarchy:
|
|
255
|
-
|
|
256
|
-
1. **Technical facts and data** override opinions and preferences
|
|
257
|
-
2. **Style guides** are the absolute authority on style matters
|
|
258
|
-
3. **Software design** must be evaluated on engineering principles, not personal preference
|
|
259
|
-
4. **Codebase consistency** is acceptable if it doesn't degrade overall health
|
|
260
|
-
|
|
261
|
-
**Don't accept "I'll clean it up later."** Experience shows deferred cleanup rarely happens. Require cleanup before submission unless it's a genuine emergency. If surrounding issues can't be addressed in this change, require filing a bug with self-assignment.
|
|
262
|
-
|
|
263
|
-
## Honesty in Review
|
|
264
|
-
|
|
265
|
-
When reviewing code — whether written by you, another agent, or a human:
|
|
266
|
-
|
|
267
|
-
- **Don't rubber-stamp.** "LGTM" without evidence of review helps no one.
|
|
268
|
-
- **Don't soften real issues.** "This might be a minor concern" when it's a bug that will hit production is dishonest.
|
|
269
|
-
- **Quantify problems when possible.** "This N+1 query will add ~50ms per item in the list" is better than "this could be slow."
|
|
270
|
-
- **Push back on approaches with clear problems.** Sycophancy is a failure mode in reviews. If the implementation has issues, say so directly and propose alternatives.
|
|
271
|
-
- **Accept override gracefully.** If the author has full context and disagrees, defer to their judgment. Comment on code, not people — reframe personal critiques to focus on the code itself.
|
|
272
|
-
|
|
273
|
-
## Dependency Discipline
|
|
274
|
-
|
|
275
|
-
Part of code review is dependency review:
|
|
276
|
-
|
|
277
|
-
**Before adding any dependency:**
|
|
278
|
-
1. Does the existing stack solve this? (Often it does.)
|
|
279
|
-
2. How large is the dependency? (Check bundle impact.)
|
|
280
|
-
3. Is it actively maintained? (Check last commit, open issues.)
|
|
281
|
-
4. Does it have known vulnerabilities? (`npm audit`)
|
|
282
|
-
5. What's the license? (Must be compatible with the project.)
|
|
283
|
-
|
|
284
|
-
**Rule:** Prefer standard library and existing utilities over new dependencies. Every dependency is a liability.
|
|
285
|
-
|
|
286
|
-
## The Review Checklist
|
|
287
|
-
|
|
288
|
-
```markdown
|
|
289
|
-
## Review: [PR/Change title]
|
|
290
|
-
|
|
291
|
-
### Context
|
|
292
|
-
- [ ] I understand what this change does and why
|
|
293
|
-
|
|
294
|
-
### Correctness
|
|
295
|
-
- [ ] Change matches spec/task requirements
|
|
296
|
-
- [ ] Edge cases handled
|
|
297
|
-
- [ ] Error paths handled
|
|
298
|
-
- [ ] Tests cover the change adequately
|
|
299
|
-
|
|
300
|
-
### Readability
|
|
301
|
-
- [ ] Names are clear and consistent
|
|
302
|
-
- [ ] Logic is straightforward
|
|
303
|
-
- [ ] No unnecessary complexity
|
|
304
|
-
|
|
305
|
-
### Architecture
|
|
306
|
-
- [ ] Follows existing patterns
|
|
307
|
-
- [ ] No unnecessary coupling or dependencies
|
|
308
|
-
- [ ] Appropriate abstraction level
|
|
309
|
-
|
|
310
|
-
### Security
|
|
311
|
-
- [ ] No secrets in code
|
|
312
|
-
- [ ] Input validated at boundaries
|
|
313
|
-
- [ ] No injection vulnerabilities
|
|
314
|
-
- [ ] Auth checks in place
|
|
315
|
-
- [ ] External data sources treated as untrusted
|
|
316
|
-
|
|
317
|
-
### Performance
|
|
318
|
-
- [ ] No N+1 patterns
|
|
319
|
-
- [ ] No unbounded operations
|
|
320
|
-
- [ ] Pagination on list endpoints
|
|
321
|
-
|
|
322
|
-
### Verification
|
|
323
|
-
- [ ] Tests pass
|
|
324
|
-
- [ ] Build succeeds
|
|
325
|
-
- [ ] Manual verification done (if applicable)
|
|
326
|
-
|
|
327
|
-
### Verdict
|
|
328
|
-
- [ ] **Approve** — Ready to merge
|
|
329
|
-
- [ ] **Request changes** — Issues must be addressed
|
|
330
|
-
```
|
|
331
|
-
## See Also
|
|
332
|
-
|
|
333
|
-
- For detailed security review guidance, see `references/security-checklist.md`
|
|
334
|
-
- For performance review checks, see `references/performance-checklist.md`
|
|
335
|
-
|
|
336
|
-
## Common Rationalizations
|
|
337
|
-
|
|
338
|
-
| Rationalization | Reality |
|
|
339
|
-
|---|---|
|
|
340
|
-
| "It works, that's good enough" | Working code that's unreadable, insecure, or architecturally wrong creates debt that compounds. |
|
|
341
|
-
| "I wrote it, so I know it's correct" | Authors are blind to their own assumptions. Every change benefits from another set of eyes. |
|
|
342
|
-
| "We'll clean it up later" | Later never comes. The review is the quality gate — use it. Require cleanup before merge, not after. |
|
|
343
|
-
| "AI-generated code is probably fine" | AI code needs more scrutiny, not less. It's confident and plausible, even when wrong. |
|
|
344
|
-
| "The tests pass, so it's good" | Tests are necessary but not sufficient. They don't catch architecture problems, security issues, or readability concerns. |
|
|
345
|
-
|
|
346
|
-
## Red Flags
|
|
347
|
-
|
|
348
|
-
- PRs merged without any review
|
|
349
|
-
- Review that only checks if tests pass (ignoring other axes)
|
|
350
|
-
- "LGTM" without evidence of actual review
|
|
351
|
-
- Security-sensitive changes without security-focused review
|
|
352
|
-
- Large PRs that are "too big to review properly" (split them)
|
|
353
|
-
- No regression tests with bug fix PRs
|
|
354
|
-
- Review comments without severity labels — makes it unclear what's required vs optional
|
|
355
|
-
- Accepting "I'll fix it later" — it never happens
|
|
356
|
-
|
|
357
|
-
## Verification
|
|
358
|
-
|
|
359
|
-
After review is complete:
|
|
360
|
-
|
|
361
|
-
- [ ] All Critical issues are resolved
|
|
362
|
-
- [ ] All Important issues are resolved or explicitly deferred with justification
|
|
363
|
-
- [ ] Tests pass
|
|
364
|
-
- [ ] Build succeeds
|
|
365
|
-
- [ ] The verification story is documented (what changed, how it was verified)
|
|
100
|
+
- the canonical policy was read;
|
|
101
|
+
- selected profiles and activation evidence are explicit;
|
|
102
|
+
- the real diff and primary evidence were inspected;
|
|
103
|
+
- relevant deterministic validation was independently repeated or listed as
|
|
104
|
+
`not_run` with impact;
|
|
105
|
+
- every finding follows the common schema and causal blocking rules;
|
|
106
|
+
- pre-existing debt remains non-blocking;
|
|
107
|
+
- only the general reviewer emits `review_stage: final` and a final verdict.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Declared Clean DDD CQRS Backend Profile
|
|
2
|
+
|
|
3
|
+
## Activation
|
|
4
|
+
|
|
5
|
+
Activate only when the task, applicable instructions, ADR, specification, or
|
|
6
|
+
architecture documentation explicitly declares Clean Architecture, DDD,
|
|
7
|
+
hexagonal architecture, and/or CQRS. Apply only the declared parts. Layout
|
|
8
|
+
alone does not activate this profile.
|
|
9
|
+
|
|
10
|
+
Local declarations and canonical examples control exact vocabulary, package
|
|
11
|
+
structure, naming, HTTP conventions, migration practices, and tactical DDD
|
|
12
|
+
depth.
|
|
13
|
+
|
|
14
|
+
## Questions
|
|
15
|
+
|
|
16
|
+
- Do dependencies point toward the declared domain/application core?
|
|
17
|
+
- Can domain rules run without framework, ORM, HTTP, broker, storage, or UI
|
|
18
|
+
startup?
|
|
19
|
+
- Are business invariants owned by the declared aggregate/entity/value-object
|
|
20
|
+
boundaries instead of controllers or adapters?
|
|
21
|
+
- Do application/use-case handlers orchestrate policy through declared ports
|
|
22
|
+
rather than constructing infrastructure clients?
|
|
23
|
+
- If CQRS is declared, do writes use the domain model and reads use the
|
|
24
|
+
project's declared projection path without leaking write-side rules?
|
|
25
|
+
- Are adapters thin translations, and are ORM/transport types prevented from
|
|
26
|
+
becoming domain or public-contract types?
|
|
27
|
+
- Are domain events, public events, mappings, and known consumers propagated
|
|
28
|
+
through the complete declared chain?
|
|
29
|
+
- If atomic state plus message publication is required, does the change preserve
|
|
30
|
+
the declared outbox or equivalent guarantee?
|
|
31
|
+
- Are bounded contexts protected by explicit translations rather than shared
|
|
32
|
+
mutable models?
|
|
33
|
+
|
|
34
|
+
## Required Evidence By Risk
|
|
35
|
+
|
|
36
|
+
- Domain rules: pure unit tests with no framework boot.
|
|
37
|
+
- Use cases: port doubles or in-memory fakes following local convention.
|
|
38
|
+
- Adapters: contract/integration tests for the declared port behavior.
|
|
39
|
+
- Dependency direction: architecture/import-rule checks when the project has
|
|
40
|
+
them, otherwise direct import evidence.
|
|
41
|
+
- Events/contracts: mapping and known-consumer compatibility evidence.
|
|
42
|
+
|
|
43
|
+
## Typical Blocking Findings
|
|
44
|
+
|
|
45
|
+
- Newly introduced outer-layer dependency in a declared inner layer.
|
|
46
|
+
- Business invariant bypassed or moved into a transport/persistence adapter.
|
|
47
|
+
- Use case coupled directly to an ORM, broker, HTTP client, or framework type
|
|
48
|
+
contrary to the declared architecture.
|
|
49
|
+
- Public contract exposing an internal domain/persistence model contrary to the
|
|
50
|
+
declared anti-corruption boundary.
|
|
51
|
+
- Declared write/read or event-publication guarantee broken by the diff.
|
|
52
|
+
|
|
53
|
+
## Non-blocking Or Contextual Findings
|
|
54
|
+
|
|
55
|
+
- Pre-existing dependency violations not worsened or required by the change.
|
|
56
|
+
- Missing tactical DDD building blocks the project does not declare.
|
|
57
|
+
- Preferences for value objects, repository names, controllers, or package
|
|
58
|
+
layout that conflict with the project's canonical example.
|
|
59
|
+
- A migration toward this profile when the task only requested a safe local
|
|
60
|
+
change.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Backend Review Profile
|
|
2
|
+
|
|
3
|
+
## Activation
|
|
4
|
+
|
|
5
|
+
Activate for server-side code, workers, consumers, scheduled jobs, persistence,
|
|
6
|
+
or backend-facing contracts. This profile is architecture-neutral. It does not
|
|
7
|
+
require DDD, CQRS, hexagonal layers, repositories, aggregates, or particular
|
|
8
|
+
folder names.
|
|
9
|
+
|
|
10
|
+
## Questions
|
|
11
|
+
|
|
12
|
+
- Are untrusted inputs validated at the boundary and translated into stable
|
|
13
|
+
application/business types?
|
|
14
|
+
- Does every operation enforce authentication, authorization, tenant/owner
|
|
15
|
+
isolation, and least privilege where applicable?
|
|
16
|
+
- Are transactions and consistency boundaries correct across writes, events,
|
|
17
|
+
caches, and retries?
|
|
18
|
+
- Can retries, duplicate messages, concurrent requests, or partial failures
|
|
19
|
+
duplicate effects or corrupt state?
|
|
20
|
+
- Are database queries parameterized, bounded, ordered, and free of obvious
|
|
21
|
+
N+1 or lock-contention regressions?
|
|
22
|
+
- Are errors mapped deliberately without leaking secrets or infrastructure
|
|
23
|
+
details?
|
|
24
|
+
- Are public API/event/schema changes traced to known consumers?
|
|
25
|
+
- Will logs, metrics, and traces make important runtime failures attributable
|
|
26
|
+
without exposing sensitive data?
|
|
27
|
+
|
|
28
|
+
## Required Evidence By Risk
|
|
29
|
+
|
|
30
|
+
- Pure policy: focused unit tests and static analysis.
|
|
31
|
+
- Database/adapters: relevant integration tests against realistic semantics.
|
|
32
|
+
- Concurrency/idempotency: repeat or parallel-path regression evidence.
|
|
33
|
+
- Public contracts: producer/schema/consumer trace and compatibility checks.
|
|
34
|
+
- Security boundaries: negative authorization/input tests.
|
|
35
|
+
- Performance-sensitive IO: query plan, measurement, or bounded-operation proof
|
|
36
|
+
proportional to the claim.
|
|
37
|
+
|
|
38
|
+
## Typical Blocking Findings
|
|
39
|
+
|
|
40
|
+
- Introduced authorization bypass or cross-tenant access.
|
|
41
|
+
- Transaction boundary that can persist partial state or publish an impossible
|
|
42
|
+
fact.
|
|
43
|
+
- Duplicate effects under a plausible retry or concurrent request.
|
|
44
|
+
- Unbounded query/list operation on a production path.
|
|
45
|
+
- Introduced breaking contract with a known consumer left incompatible.
|
|
46
|
+
- Business or consistency rule placed where the project's architecture cannot
|
|
47
|
+
enforce or test it safely.
|
|
48
|
+
|
|
49
|
+
## Non-blocking Or Contextual Findings
|
|
50
|
+
|
|
51
|
+
- Pre-existing architectural debt not worsened by the diff.
|
|
52
|
+
- Alternative naming or layering preferences unsupported by project rules.
|
|
53
|
+
- Performance speculation without a plausible hot path or evidence.
|
|
54
|
+
- DDD/CQRS recommendations when the strict backend profile is not active.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Declared Clean Layered Frontend Profile
|
|
2
|
+
|
|
3
|
+
## Activation
|
|
4
|
+
|
|
5
|
+
Activate only when the task, applicable instructions, ADR, specification, or
|
|
6
|
+
architecture documentation explicitly declares a layered/Clean client
|
|
7
|
+
architecture, feature boundaries, pure domain, unidirectional state, ports, or
|
|
8
|
+
repositories. Apply only the declared parts. Layout alone does not activate
|
|
9
|
+
this profile.
|
|
10
|
+
|
|
11
|
+
Local conventions control the state manager, folder names, DTO style, use-case
|
|
12
|
+
shape, dependency injection, navigation, and test vocabulary.
|
|
13
|
+
|
|
14
|
+
## Questions
|
|
15
|
+
|
|
16
|
+
- Do dependencies point toward the declared domain/application layers?
|
|
17
|
+
- Can declared domain rules run without UI framework, HTTP, storage, or native
|
|
18
|
+
plugin startup?
|
|
19
|
+
- Does presentation render prepared state and dispatch actions instead of
|
|
20
|
+
owning business decisions or calling infrastructure directly?
|
|
21
|
+
- Are screen states immutable and explicit enough to prevent impossible
|
|
22
|
+
combinations?
|
|
23
|
+
- Is data flow unidirectional according to the project's state model?
|
|
24
|
+
- Do declared repositories/use cases expose business operations instead of
|
|
25
|
+
transport verbs and types?
|
|
26
|
+
- Are API/storage DTOs mapped explicitly at the infrastructure boundary rather
|
|
27
|
+
than deserialized into domain models?
|
|
28
|
+
- Are network/storage/plugin errors translated before reaching presentation?
|
|
29
|
+
- Is composition/wiring outside the declared domain and application core?
|
|
30
|
+
- Does shared code represent a real stable cross-feature concept rather than
|
|
31
|
+
coupling unrelated features prematurely?
|
|
32
|
+
|
|
33
|
+
## Required Evidence By Risk
|
|
34
|
+
|
|
35
|
+
- Domain/use-case/state logic: pure focused tests.
|
|
36
|
+
- DTO mapping: tolerant-read and strict-write contract tests where applicable.
|
|
37
|
+
- Presentation states: component/widget tests for explicit state variants.
|
|
38
|
+
- Infrastructure adapters: integration/contract tests through declared seams.
|
|
39
|
+
- Dependency direction: architecture/import checks or direct import evidence.
|
|
40
|
+
- Core user flow: runtime/integration evidence with external network mocked.
|
|
41
|
+
|
|
42
|
+
## Typical Blocking Findings
|
|
43
|
+
|
|
44
|
+
- Newly introduced framework/network/storage dependency in a declared pure
|
|
45
|
+
inner layer.
|
|
46
|
+
- Presentation calling an API/repository directly contrary to declared flow.
|
|
47
|
+
- Business rule implemented only in a component and bypassable from another
|
|
48
|
+
entry point.
|
|
49
|
+
- Impossible state combinations introduced where closed states are declared.
|
|
50
|
+
- API DTO or transport error leaking into domain/presentation contrary to the
|
|
51
|
+
declared boundary.
|
|
52
|
+
- Duplicate source of truth that can produce divergent visible state.
|
|
53
|
+
|
|
54
|
+
## Non-blocking Or Contextual Findings
|
|
55
|
+
|
|
56
|
+
- Pre-existing boundary drift not worsened by the task.
|
|
57
|
+
- Missing value objects, repositories, use-case classes, or feature folders not
|
|
58
|
+
required by the project's declaration.
|
|
59
|
+
- Alternative state-management or DI preferences.
|
|
60
|
+
- Broad architecture migration outside the requested feature.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Frontend Review Profile
|
|
2
|
+
|
|
3
|
+
## Activation
|
|
4
|
+
|
|
5
|
+
Activate for web, mobile, desktop, UI components, client state, navigation,
|
|
6
|
+
local storage, client networking, or user-visible behavior. This profile is
|
|
7
|
+
framework-neutral and does not require a domain layer, repository pattern,
|
|
8
|
+
specific state manager, or feature-folder structure.
|
|
9
|
+
|
|
10
|
+
## Questions
|
|
11
|
+
|
|
12
|
+
- Does every async path represent loading, success, empty when meaningful, and
|
|
13
|
+
error/retry behavior without impossible boolean combinations?
|
|
14
|
+
- Can double taps, repeated submits, stale responses, cancellation, navigation,
|
|
15
|
+
or lifecycle changes duplicate effects or update disposed/stale UI?
|
|
16
|
+
- Is there one owned source of truth, with derived state instead of manual
|
|
17
|
+
duplication?
|
|
18
|
+
- Does the UI expose correct semantics, focus/keyboard behavior, labels,
|
|
19
|
+
contrast, text scaling, and assistive-technology behavior for the platform?
|
|
20
|
+
- Does it remain usable at applicable viewport sizes, orientations, input
|
|
21
|
+
methods, and platform constraints?
|
|
22
|
+
- Are navigation, deep links, restoration, and back behavior correct when they
|
|
23
|
+
are affected?
|
|
24
|
+
- Are user-visible strings, dates, numbers, currencies, pluralization, and RTL
|
|
25
|
+
behavior handled through project localization conventions?
|
|
26
|
+
- Are secrets and authorization decisions kept out of the client security
|
|
27
|
+
boundary, and is local sensitive data minimized/protected?
|
|
28
|
+
- Does the change introduce unnecessary rerenders, unbounded lists, main-thread
|
|
29
|
+
work, oversized assets, layout shifts, or resource leaks?
|
|
30
|
+
- Is the real rendered behavior verified when static/component tests cannot
|
|
31
|
+
prove it?
|
|
32
|
+
|
|
33
|
+
## Required Evidence By Risk
|
|
34
|
+
|
|
35
|
+
- State/domain logic: focused unit tests.
|
|
36
|
+
- Loading/error/empty/data UI: component or widget tests for affected states.
|
|
37
|
+
- Visual/layout change: runtime render, screenshot, or equivalent visual
|
|
38
|
+
evidence at relevant sizes/themes.
|
|
39
|
+
- Interaction/navigation: runtime flow or integration evidence.
|
|
40
|
+
- Accessibility: semantic/focus checks plus manual/runtime evidence when tools
|
|
41
|
+
cannot prove behavior.
|
|
42
|
+
- Remote/local contract changes: DTO/storage compatibility and upgrade path.
|
|
43
|
+
- Performance claim: profile/measurement before and after.
|
|
44
|
+
|
|
45
|
+
## Typical Blocking Findings
|
|
46
|
+
|
|
47
|
+
- New async flow with no reachable error state or recovery.
|
|
48
|
+
- Duplicate submission or stale-response race with real user-visible effects.
|
|
49
|
+
- Inaccessible primary action, missing semantics, broken focus, or unreadable
|
|
50
|
+
content introduced by the change.
|
|
51
|
+
- Visual change not verified in a runtime where layout behavior is acceptance
|
|
52
|
+
critical.
|
|
53
|
+
- Direct exposure of sensitive data or reliance on client-only authorization.
|
|
54
|
+
- Breaking remote/local data compatibility for installed clients.
|
|
55
|
+
|
|
56
|
+
## Non-blocking Or Contextual Findings
|
|
57
|
+
|
|
58
|
+
- Pre-existing visual/accessibility debt not worsened by the diff.
|
|
59
|
+
- A preferred state-management library or component decomposition unsupported
|
|
60
|
+
by local conventions.
|
|
61
|
+
- Strict layering suggestions when the declared frontend profile is inactive.
|
|
62
|
+
- Hypothetical device/layout cases outside the product's supported matrix.
|