@nano-step/skill-manager 5.6.0 → 5.6.2

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.
Files changed (44) hide show
  1. package/dist/utils.d.ts +1 -1
  2. package/dist/utils.js +1 -1
  3. package/package.json +1 -1
  4. package/private-catalog.json +5 -0
  5. package/skills/deep-design/SKILL.md +402 -0
  6. package/skills/deep-design/evals/evals.json +23 -0
  7. package/skills/deep-design/skill.json +7 -0
  8. package/skills/feature-analysis/SKILL.md +290 -0
  9. package/skills/feature-analysis/skill.json +15 -0
  10. package/skills/nano-brain/AGENTS_SNIPPET.md +0 -9
  11. package/skills/nano-brain/skill.json +7 -0
  12. package/skills/pr-code-reviewer/CHANGELOG.md +287 -0
  13. package/skills/pr-code-reviewer/RESEARCH.md +60 -0
  14. package/skills/pr-code-reviewer/SKILL.md +530 -0
  15. package/skills/pr-code-reviewer/assets/config.json +47 -0
  16. package/skills/pr-code-reviewer/checklists/backend-express.md +357 -0
  17. package/skills/pr-code-reviewer/checklists/ci-cd.md +428 -0
  18. package/skills/pr-code-reviewer/checklists/consumer-search-matrix.md +339 -0
  19. package/skills/pr-code-reviewer/checklists/database.md +382 -0
  20. package/skills/pr-code-reviewer/checklists/frontend-vue-nuxt.md +426 -0
  21. package/skills/pr-code-reviewer/checklists/review-checklist.md +116 -0
  22. package/skills/pr-code-reviewer/references/framework-rules/express.md +39 -0
  23. package/skills/pr-code-reviewer/references/framework-rules/nestjs.md +41 -0
  24. package/skills/pr-code-reviewer/references/framework-rules/typeorm.md +52 -0
  25. package/skills/pr-code-reviewer/references/framework-rules/typescript.md +50 -0
  26. package/skills/pr-code-reviewer/references/framework-rules/vue-nuxt.md +53 -0
  27. package/skills/pr-code-reviewer/references/nano-brain-integration.md +61 -0
  28. package/skills/pr-code-reviewer/references/performance-patterns.md +26 -0
  29. package/skills/pr-code-reviewer/references/quality-patterns.md +25 -0
  30. package/skills/pr-code-reviewer/references/report-template.md +167 -0
  31. package/skills/pr-code-reviewer/references/security-patterns.md +31 -0
  32. package/skills/pr-code-reviewer/references/subagent-prompts.md +323 -0
  33. package/skills/pr-code-reviewer/skill.json +15 -0
  34. package/skills/rri-t-testing/SKILL.md +224 -0
  35. package/skills/rri-t-testing/assets/rri-t-coverage-dashboard.md +138 -0
  36. package/skills/rri-t-testing/assets/rri-t-memory-protocol.md +271 -0
  37. package/skills/rri-t-testing/assets/rri-t-persona-interview.md +249 -0
  38. package/skills/rri-t-testing/assets/rri-t-quality-scorecard.md +122 -0
  39. package/skills/rri-t-testing/assets/rri-t-risk-matrix.md +87 -0
  40. package/skills/rri-t-testing/assets/rri-t-stress-matrix.md +100 -0
  41. package/skills/rri-t-testing/assets/rri-t-test-case.md +181 -0
  42. package/skills/rri-t-testing/assets/rri-t-testability-gate.md +131 -0
  43. package/skills/rri-t-testing/assets/rri-t-traceability-matrix.md +105 -0
  44. package/skills/rri-t-testing/skill.json +9 -0
@@ -0,0 +1,290 @@
1
+ ---
2
+ name: feature-analysis
3
+ description: "Deep code analysis of any feature or service before writing docs, diagrams, or making changes. Enforces read-everything-first discipline. Traces exact execution paths, data transformations, guard clauses, bugs, and gaps between existing docs and actual code. Produces a validated Mermaid diagram and structured analysis output. Language and framework agnostic."
4
+ compatibility: "OpenCode"
5
+ metadata:
6
+ version: "2.0.0"
7
+ tools:
8
+ required:
9
+ - Read (every file in the feature)
10
+ - Bash (find all files, run mermaid validator)
11
+ uses:
12
+ - mermaid-validator skill (validate any diagram produced)
13
+ triggers:
14
+ - "analyze [feature]"
15
+ - "how does X work"
16
+ - "trace the flow of"
17
+ - "understand X"
18
+ - "what does X do"
19
+ - "deep dive into"
20
+ - "working on X - understand it first"
21
+ - "update docs/brain for"
22
+ ---
23
+
24
+ # Feature Analysis Skill
25
+
26
+ A disciplined protocol for deeply analyzing any feature in any codebase before producing docs, diagrams, or making changes. Framework-agnostic. Language-agnostic.
27
+
28
+ ---
29
+
30
+ ## The Core Rule
31
+
32
+ **READ EVERYTHING. PRODUCE NOTHING. THEN SYNTHESIZE.**
33
+
34
+ Do not write a single diagram node, doc line, or description until every file in the feature has been read. Every time you produce output before reading all files, you will miss something.
35
+
36
+ ---
37
+
38
+ ## Phase 1: Discovery — Find Every File
39
+
40
+ Before reading anything, map the full file set.
41
+
42
+ ```bash
43
+ # Find all source files for the feature
44
+ find <feature-dir> -type f | sort
45
+
46
+ # Check imports to catch shared utilities, decorators, helpers
47
+ grep -r "import\|require" <feature-dir> | grep -v node_modules | sort -u
48
+ ```
49
+
50
+ **Read in dependency order (bottom-up — foundations first):**
51
+
52
+ 1. **Entry point / bootstrap** — port, env vars, startup config
53
+ 2. **Schema / model files** — DB schema, columns, nullable, indexes, types
54
+ 3. **Utility / helper files** — every function, every transformation, every constant
55
+ 4. **Decorator / middleware files** — wrapping logic, side effects, return value handling
56
+ 5. **Infrastructure services** — cache, lock, queue, external connections
57
+ 6. **Core business logic** — the main service/handler files
58
+ 7. **External / fetch services** — HTTP calls, filters applied, error handling
59
+ 8. **Entry controllers / routers / handlers** — HTTP method, route, params, return
60
+ 9. **Wiring files** — module/DI config, middleware registration
61
+
62
+ **Do not skip any file. Do not skim.**
63
+
64
+ ---
65
+
66
+ ## Phase 2: Per-File Checklist
67
+
68
+ For each file, answer these questions before moving to the next.
69
+
70
+ ### Entry point / bootstrap
71
+ - [ ] What port or address? (default? env override?)
72
+ - [ ] Any global middleware, pipes, interceptors, or lifecycle hooks?
73
+
74
+ ### Schema / model files
75
+ - [ ] Table/collection name
76
+ - [ ] Every field: type, nullable, default, constraints, indexes
77
+ - [ ] Relations / references to other entities
78
+
79
+ ### Utility / helper files
80
+ - [ ] Every exported function — what does it do, step by step?
81
+ - [ ] For transformations: what inputs? what outputs? what edge cases handled?
82
+ - [ ] Where is this function called? (grep for usages)
83
+ - [ ] How many times is it called within a single method? (once per batch? once per item?)
84
+
85
+ ### Decorator / middleware files
86
+ - [ ] What does it wrap?
87
+ - [ ] What side effects before / after the original method?
88
+ - [ ] **Does it `return` the result of the original method?** (missing `return` = silent discard bug)
89
+ - [ ] Does it use try/finally? What runs in finally?
90
+ - [ ] What happens on the early-exit path?
91
+
92
+ ### Core business logic files
93
+ - [ ] Every method: signature, return type
94
+ - [ ] For each method: trace every line — no summarizing
95
+ - [ ] Accumulator variables — where initialized, where incremented, where returned
96
+ - [ ] Loop structure: sequential or parallel?
97
+ - [ ] Every external call: what service/module, what args, what returned
98
+ - [ ] Guard clauses: every early return / continue / throw
99
+ - [ ] Every branch in conditionals
100
+
101
+ ### External / fetch service files
102
+ - [ ] Exact URLs or endpoints (hardcoded or env?)
103
+ - [ ] Filters applied to response data (which calls filter, which don't?)
104
+ - [ ] Error handling on external calls
105
+
106
+ ### Entry controllers / routers / handlers
107
+ - [ ] HTTP method (GET vs POST — don't assume)
108
+ - [ ] Route path
109
+ - [ ] What core method is called?
110
+ - [ ] What is returned?
111
+
112
+ ### Wiring / module files
113
+ - [ ] What is imported / registered?
114
+ - [ ] What is exported / exposed?
115
+
116
+ ---
117
+
118
+ ## Phase 3: Execution Trace
119
+
120
+ After reading all files, produce a numbered step-by-step trace of the full execution path. This is not prose — it is a precise trace.
121
+
122
+ **Format:**
123
+ ```
124
+ 1. [HTTP METHOD] /route → HandlerName.methodName()
125
+ 2. HandlerName.methodName() → ServiceName.methodName()
126
+ 3. @DecoratorName: step A (e.g. acquire lock, check cache)
127
+ 4. → if condition X: early return [what is returned / not returned]
128
+ 5. ServiceName.methodName():
129
+ 6. step 1: call externalService.fetchAll() → parallel([fetchA(), fetchB()])
130
+ 7. fetchA(): GET https://... → returns all items (no filter)
131
+ 8. fetchB(): GET https://... → filter(x => x.field !== null) → returns filtered
132
+ 9. step 2: parallel([processItems(a, 'typeA'), processItems(b, 'typeB')])
133
+ 10. processItems(items, type):
134
+ 11. init: totalUpdated = 0, totalInserted = 0
135
+ 12. for loop (sequential): i = 0 to items.length, step batchSize
136
+ 13. batch = items.slice(i, i + batchSize)
137
+ 14. { updated, inserted } = await processBatch(batch)
138
+ 15. totalUpdated += updated; totalInserted += inserted
139
+ 16. return { total: items.length, updated: totalUpdated, inserted: totalInserted }
140
+ 17. processBatch(batch):
141
+ 18. guard: if batch.length === 0 → return { updated: 0, inserted: 0 }
142
+ 19. step 1: names = batch.map(item => transform(item.field)) ← called ONCE per batch
143
+ 20. step 2: existing = repo.find(WHERE field IN names)
144
+ 21. step 3: map = existing.reduce(...)
145
+ 22. step 4: for each item in batch:
146
+ 23. value = transform(item.field) ← called AGAIN per item
147
+ 24. ...decision tree...
148
+ 25. repo.save(itemsToSave)
149
+ 26. return { updated, inserted }
150
+ 27. @DecoratorName finally: releaseLock()
151
+ 28. BUG: decorator does not return result → caller receives undefined
152
+ ```
153
+
154
+ **Key things to call out in the trace:**
155
+ - When a utility function is called more than once (note the count and context)
156
+ - Every accumulator variable (where init, where increment, where return)
157
+ - Every guard clause / early exit
158
+ - Sequential vs parallel (for loop vs Promise.all / asyncio.gather / goroutines)
159
+ - Any discarded return values
160
+
161
+ ---
162
+
163
+ ## Phase 4: Data Transformations Audit
164
+
165
+ For every utility/transformation function used:
166
+
167
+ | Function | What it does (step by step) | Called where | Called how many times |
168
+ |----------|----------------------------|--------------|----------------------|
169
+ | `transformFn(x)` | 1. step A 2. step B 3. step C | methodName | TWICE: once in step N (batch), once per item in loop |
170
+
171
+ ---
172
+
173
+ ## Phase 5: Gap Analysis — Docs vs Code
174
+
175
+ Compare existing docs/brain files against what the code actually does:
176
+
177
+ | Claim in docs | What code actually does | Verdict |
178
+ |---------------|------------------------|---------|
179
+ | "POST /endpoint" | `@Get()` in controller | ❌ Wrong |
180
+ | "Port 3000" | `process.env.PORT \|\| 4001` in entrypoint | ❌ Wrong |
181
+ | "function converts X" | Also does Y (undocumented) | ⚠️ Incomplete |
182
+ | "returns JSON result" | Decorator discards return value | ❌ Bug |
183
+
184
+ ---
185
+
186
+ ## Phase 6: Produce Outputs
187
+
188
+ Only now, after phases 1–5 are complete, produce:
189
+
190
+ ### 6a. Structured Analysis Document
191
+
192
+ ```markdown
193
+ ## Feature Analysis: [Feature Name]
194
+ Repo: [repo] | Date: [date]
195
+
196
+ ### Files Read
197
+ - `path/to/controller.ts` — entry point, GET /endpoint, calls ServiceA.run()
198
+ - `path/to/service.ts` — core logic, orchestrates fetch + batch loop
199
+ - [... every file ...]
200
+
201
+ ### Execution Trace
202
+ [numbered trace from Phase 3]
203
+
204
+ ### Data Transformations
205
+ [table from Phase 4]
206
+
207
+ ### Guard Clauses & Edge Cases
208
+ - processBatch: empty batch guard → returns {0,0} immediately
209
+ - fetchItems: filters items where field === null
210
+ - LockManager: if lock not acquired → returns void immediately (no error thrown)
211
+
212
+ ### Bugs / Issues Found
213
+ - path/to/decorator.ts line N: `await originalMethod.apply(this, args)` missing `return`
214
+ → result is discarded, caller always receives undefined
215
+ - [any others]
216
+
217
+ ### Gaps: Docs vs Code
218
+ [table from Phase 5]
219
+
220
+ ### Files to Update
221
+ - [ ] `.agents/_repos/[repo].md` — update port, endpoint method, transformation description
222
+ - [ ] `.agents/_domains/[domain].md` — if architecture changed
223
+ ```
224
+
225
+ ### 6b. Mermaid Diagram
226
+
227
+ Write the diagram. Then **immediately run the validator before doing anything else.**
228
+
229
+ If you have the mermaid-validator skill:
230
+ ```bash
231
+ node /path/to/project/scripts/validate-mermaid.mjs [file.md]
232
+ ```
233
+
234
+ Otherwise validate manually — common syntax errors:
235
+ - Labels with `()` must be wrapped in `"double quotes"`: `A["method()"]`
236
+ - No `\n` in node labels — use `<br/>` or shorten
237
+ - No HTML entities (`&amp;`, `&gt;`) in labels — use literal characters
238
+ - `end` is a reserved word in Mermaid — use `END` or `done` as node IDs
239
+
240
+ If errors → fix → re-run. Do not proceed until clean.
241
+
242
+ **Diagram must include:**
243
+ - Every step from the execution trace
244
+ - Data transformation nodes (show what the function does, not just its name)
245
+ - Guard clauses as decision nodes
246
+ - Parallel vs sequential clearly distinguished
247
+ - Bugs annotated inline (e.g. "BUG: result discarded")
248
+
249
+ ### 6c. Doc / Brain File Updates
250
+
251
+ Update relevant docs with:
252
+ - Corrected facts (port, endpoint method, etc.)
253
+ - The validated Mermaid diagram
254
+ - Data transformation table
255
+ - Known bugs section
256
+
257
+ ---
258
+
259
+ ## Anti-Patterns (What This Skill Prevents)
260
+
261
+ | Anti-pattern | What gets missed | Rule violated |
262
+ |---|---|---|
263
+ | Drew diagram before reading utility files | Transformation called twice — not shown | READ EVERYTHING FIRST |
264
+ | Trusted existing docs for endpoint method | GET vs POST wrong in docs | GAP ANALYSIS required |
265
+ | Summarized service method instead of tracing | Guard clause (empty batch) missed | TRACE NOT SUMMARIZE |
266
+ | Trusted existing docs for port/config | Wrong values | Verify entry point |
267
+ | Read decorator without checking return | Silent result discard bug | RETURN VALUE AUDIT |
268
+ | Merged H1/H2 paths into shared loop node | Sequential vs parallel distinction lost | TRACE LOOP STRUCTURE |
269
+ | Assumed filter applies to all fetches | One fetch had no filter — skipped items | READ EVERY FETCH FILE |
270
+
271
+ ---
272
+
273
+ ## Quick Reference Checklist
274
+
275
+ Before producing any output, verify:
276
+
277
+ - [ ] Entry point read — port/address confirmed
278
+ - [ ] All schema/model files read — every field noted
279
+ - [ ] All utility files read — every transformation step documented
280
+ - [ ] All decorator/middleware files read — return value audited
281
+ - [ ] All core service files read — every method traced line by line
282
+ - [ ] All fetch/external services read — filters noted (which have filters, which don't)
283
+ - [ ] All controller/router/handler files read — HTTP method confirmed (not assumed)
284
+ - [ ] All wiring/module files read — dependency graph understood
285
+ - [ ] Utility functions: call count per method noted
286
+ - [ ] All guard clauses documented
287
+ - [ ] Accumulator variables traced (init → increment → return)
288
+ - [ ] Loop structure confirmed (sequential vs parallel)
289
+ - [ ] Existing docs compared against code (gap analysis done)
290
+ - [ ] Mermaid diagram validated before saving
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "feature-analysis",
3
+ "version": "2.0.0",
4
+ "description": "Deep code analysis of any feature or service before writing docs, diagrams, or making changes. Enforces read-everything-first discipline with execution tracing, data transformation audits, and gap analysis.",
5
+ "compatibility": "OpenCode",
6
+ "agent": null,
7
+ "commands": [],
8
+ "tags": [
9
+ "analysis",
10
+ "code-review",
11
+ "documentation",
12
+ "mermaid",
13
+ "tracing"
14
+ ]
15
+ }
@@ -19,15 +19,6 @@ nano-brain supports two access methods. Try MCP first; if unavailable, use CLI.
19
19
 
20
20
  ### Session Workflow
21
21
 
22
- **Start of session:** Check memory for relevant past context before exploring the codebase.
23
- ```
24
- # MCP (if available):
25
- memory_query("what have we done regarding {current task topic}")
26
-
27
- # CLI fallback:
28
- npx nano-brain query "what have we done regarding {current task topic}"
29
- ```
30
-
31
22
  **End of session:** Save key decisions, patterns discovered, and debugging insights.
32
23
  ```
33
24
  # MCP (if available):
@@ -5,6 +5,13 @@
5
5
  "compatibility": "OpenCode",
6
6
  "agent": null,
7
7
  "commands": [],
8
+ "mcp": {
9
+ "nano-brain": {
10
+ "type": "remote",
11
+ "url": "http://host.docker.internal:3100/mcp",
12
+ "enabled": true
13
+ }
14
+ },
8
15
  "tags": [
9
16
  "memory",
10
17
  "persistence",
@@ -0,0 +1,287 @@
1
+ # PR Code Reviewer Changelog
2
+
3
+ ## v3.1.0 (2026-03-16) - Verification Pipeline (False Positive Reduction)
4
+
5
+ **FIX**: ~50% of critical/warning findings were false positives because subagents inspected code locally without verifying the full execution context. This release adds a 3-layer verification pipeline that reduces false positives to ~10%.
6
+
7
+ ### Added
8
+ - **VERIFICATION PROTOCOL** in all 4 subagent prompts — mandatory 4-step process (IDENTIFY → TRACE → VERIFY → DECIDE) before reporting any critical/warning finding
9
+ - **Evidence field** (`evidence`, `confidence`, `trace_path`) in finding schema — subagents must cite concrete file:line proof for critical/warning findings
10
+ - **Evidence examples** (good vs bad) in filtering rules — teaches subagents what constitutes valid evidence
11
+ - **Consensus scoring** in Phase 4 — tracks how many subagents independently flagged the same issue; single-agent findings without evidence are auto-downgraded
12
+ - **Phase 4.5: Orchestrator Verification Spot-Check** — orchestrator reads actual code at cited evidence locations to verify critical/warning findings (30s timeout per finding)
13
+ - **`phase-4.5-verification.json` checkpoint** — tracks verification results for resumability
14
+ - **Verification metadata in report TL;DR** — shows how many findings were dropped as false positives
15
+
16
+ ### Changed
17
+ - Phase 4 now includes consensus scoring step after deduplication
18
+ - Phase 4 checkpoint `next_phase` updated from `5` to `4.5`
19
+ - Manifest schema includes Phase 4.5 in `phase_status`
20
+ - Finding schema in SKILL.md Phase 3 updated to include new fields
21
+ - All 4 subagent return format sections updated with `evidence`, `confidence`, `trace_path`
22
+
23
+ ### How It Works
24
+ 1. **Layer 1 (Subagent self-verification)**: Subagents trace error handling to HTTP boundary, null safety to data source, framework patterns to usage context — before reporting
25
+ 2. **Layer 2 (Orchestrator spot-check)**: Orchestrator reads cited files and verifies evidence claims for critical/warning findings
26
+ 3. **Layer 3 (Consensus scoring)**: Multi-agent agreement boosts confidence; single-agent findings without evidence are downgraded
27
+
28
+ ## v2.7.0 (2026-03-09) - Clone to Temp Folder
29
+
30
+ **FIX**: Reviews now clone the PR branch into a unique temp folder instead of checking out locally. Prevents branch conflicts and enables simultaneous multi-PR reviews.
31
+
32
+ ### Added
33
+ - **Phase 0: Repository Preparation (Clone to Temp)** — MANDATORY pre-review step
34
+ - Creates unique temp dir: `/tmp/pr-review-{repo}-{pr}-{unix_timestamp}`
35
+ - Shallow clones repo with `--depth=50 --branch={head_branch}`
36
+ - Falls back to `gh pr checkout` if branch not found on remote
37
+ - Verifies clone succeeded before proceeding
38
+ - Records `$REVIEW_DIR` path for all subsequent phases
39
+ - **Phase 6: Cleanup** — asks user before removing temp folder (NEVER auto-deletes)
40
+ - Shows folder path and size
41
+ - Requires explicit user confirmation to delete
42
+ - Handles multiple PR temp folders individually
43
+ - **Review Checklist** (`checklists/review-checklist.md`) — step-by-step checklist covering all phases
44
+ - All 4 subagent prompts now include `## REVIEW DIRECTORY` section pointing to temp clone
45
+
46
+ ### Why (replaces v7.1.0 checkout approach)
47
+ - `gh pr checkout` on the local repo **disturbs your working directory** — uncommitted changes, stashes, branch switches
48
+ - Cloning to `/tmp` means your workspace is **never touched**
49
+ - Unique timestamp in folder name enables **parallel reviews** of multiple PRs
50
+ - User controls cleanup — temp folder persists until explicitly removed
51
+
52
+ ### Changed
53
+ - Phase 1 now reads full file context from `$REVIEW_DIR` instead of GitHub API
54
+ - Subagent prompts explicitly instruct agents to read from `$REVIEW_DIR`, not workspace repo
55
+ - User notification now includes temp folder path and cleanup prompt
56
+
57
+ ---
58
+
59
+ ## v7.1.0 (2026-03-05) - Branch Alignment Before Review (SUPERSEDED by v2.7.0)
60
+
61
+ **FIX**: Reviews now always run against the correct PR branch, not whatever branch happens to be checked out locally.
62
+
63
+ ### Added
64
+ - **Phase 0: Repository Preparation (Branch Alignment)** — MANDATORY pre-review step
65
+ - Extracts repo info from PR URL / `github_get_pull_request`
66
+ - Clones repo if not present locally
67
+ - Saves current branch and stashes uncommitted changes
68
+ - Checks out the PR's head branch via `gh pr checkout`
69
+ - Verifies checkout succeeded before proceeding
70
+ - Optionally updates consumer repos to their default branch for cross-repo search
71
+ - **Phase 6: Repository Cleanup** — restores original branch and unstashes changes after review
72
+ - **🚫 Read-Only Rule** — explicit absolute prohibition on any GitHub write actions (push, comment, merge, review, etc.)
73
+ - Subagent prompts now explicitly note that all file reads happen against the checked-out PR branch
74
+
75
+ ### Why
76
+ Local repos may be on any branch (feature branch, old release, etc.). Previous versions read files from whatever was checked out, which could produce:
77
+ - False positives (flagging code that doesn't exist in the PR)
78
+ - Missed bugs (not seeing code that IS in the PR)
79
+ - Wrong context for cross-repo consumer search
80
+
81
+ This version ensures the reviewer always sees the actual PR code.
82
+
83
+ ---
84
+
85
+ ## v7.0.0 (2026-02-24) - Unified Architecture
86
+
87
+ MAJOR: Merged project-level v6.1 (cross-repo consumer search, better-context structural analysis) with global v2.6 (4 parallel subagents, nano-brain memory, iterative refinement) into a single unified skill.
88
+
89
+ ### Added
90
+ - 5 parallel subagents (was inline review in v6.1, was 4 subagents in v2.6)
91
+ - Code Quality (explore)
92
+ - Security and Logic (oracle)
93
+ - Docs and Best Practices (librarian)
94
+ - Tests and Integration (quick)
95
+ - Cross-Repo Consumer Search (explore, conditional)
96
+ - nano-brain integration for persistent memory across review sessions
97
+ - PR Summary generation (GitHub Copilot-style)
98
+ - Iterative refinement with dedup, severity filtering, and gap analysis
99
+ - Configuration file support (.opencode/code-reviewer.json)
100
+ - Smart tracing by change type (LOGIC/STYLE/REFACTOR/NEW)
101
+
102
+ ### Enhanced
103
+ - Subagent prompts now include better-context structural data (centrality, dependents)
104
+ - Subagent prompts now include breaking change signals from Phase 2
105
+ - Report template includes both Structural Analysis and Cross-Repo Consumer Search sections
106
+ - Framework checklists and rules passed to relevant subagents
107
+
108
+ ### Preserved from v6.1
109
+ - better-context structural analysis (Phase 1.5)
110
+ - MANDATORY cross-repo consumer search (now as 5th subagent)
111
+ - Breaking change signal detection (Phase 2)
112
+ - All checklists: consumer-search-matrix, backend-express, frontend-vue-nuxt, database, ci-cd
113
+ - All framework rules: express, nestjs, typeorm, typescript, vue-nuxt
114
+ - Severity reference with cross-repo icon
115
+
116
+ ### Preserved from v2.6
117
+ - Parallel subagent architecture
118
+ - nano-brain integration (query + save)
119
+ - Compact report philosophy
120
+ - Iterative refinement and filtering
121
+ - Config file support
122
+
123
+ ### Architecture
124
+ - Project-level skill (takes priority over global)
125
+ - SKILL.md is concise, references external files for details
126
+ - 13 reference/checklist files for domain-specific knowledge
127
+
128
+ ---
129
+
130
+ ## v6.1.1 (2026-02-12) - Centralized Manifests
131
+
132
+ **FIX**: Moved better-context manifests to centralized location to avoid polluting individual repos.
133
+
134
+ ### Changed
135
+ - Manifests now stored at `.better-context/{repo}.json` at workspace root
136
+ - No `.better-context/` folders in individual repos
137
+ - No gitignore changes needed in repos
138
+ - Updated scan command to use `--out` for centralized output
139
+
140
+ ---
141
+
142
+ ## v6.1.0 (2026-02-12) - better-context Integration
143
+
144
+ **ENHANCEMENT**: Integrated better-context for structural analysis using PageRank centrality and dependency graphs.
145
+
146
+ ### Added
147
+ - **better-context Integration** (Phase 1.5)
148
+ - `uvx better-context scan` - Index codebase and detect cycles
149
+ - `uvx better-context stats` - PageRank centrality ranking
150
+ - `uvx better-context focus <file>` - Ego-centric context for changed files
151
+ - `uvx better-context deps <file>` - Dependencies and dependents
152
+
153
+ - **Structural Analysis Output**
154
+ - Changed files impact table with centrality scores
155
+ - High-centrality file flags (> 0.05 = critical)
156
+ - Dependency cycle warnings
157
+ - Suggested reading order for understanding changes
158
+
159
+ - **Centrality-Based Review Priority**
160
+ - Files with centrality > 0.08 → CRITICAL (core infrastructure)
161
+ - Files with centrality 0.05-0.08 → HIGH (shared utilities)
162
+ - Files with > 10 dependents → WIDE IMPACT flag
163
+
164
+ - **Configuration Files**
165
+ - `.ctx.json` - better-context configuration
166
+ - `.ctxignore` - Patterns to exclude from analysis
167
+
168
+ ### Enhanced
169
+ - Report template now includes Structural Analysis section
170
+ - High-impact files flagged based on PageRank score
171
+ - Dependency cycle detection integrated into review workflow
172
+
173
+ ### Why better-context?
174
+ - **PageRank Centrality**: Mathematically identifies critical files (not guesswork)
175
+ - **Focus Mode**: Shows exactly what depends on a changed file
176
+ - **Cycle Detection**: Found 2 circular dependency cycles in tradeit-backend
177
+ - **Token Optimization**: Efficient context selection for AI review
178
+
179
+ ### Complementary to Our AGENTS.md
180
+ - better-context provides **structural intelligence** (what depends on what)
181
+ - Our AGENTS.md provides **domain intelligence** (business logic, cross-repo relationships)
182
+ - Together: Complete picture for thorough PR reviews
183
+
184
+ ---
185
+
186
+ ## v6.0.0 (2026-02-11) - Cross-Repo Consumer Search
187
+
188
+ **MAJOR**: Mandatory cross-repo consumer search for ALL breaking changes
189
+
190
+ ### Added
191
+ - **Consumer Search Matrix** (`checklists/consumer-search-matrix.md`)
192
+ - Comprehensive matrix of what changes require cross-repo search
193
+ - Search patterns for each change type (API fields, Redis keys, DB columns, etc.)
194
+ - Critical fields list that should never be removed without migration
195
+
196
+ - **Domain-Specific Checklists**
197
+ - `checklists/backend-express.md` - Express/Node patterns, error handling, timeouts
198
+ - `checklists/frontend-vue-nuxt.md` - Vue 3/Nuxt 3 patterns, reactivity, state management
199
+ - `checklists/database.md` - MySQL/Redis patterns, transactions, migrations
200
+ - `checklists/ci-cd.md` - Docker, CircleCI, deployment safety
201
+
202
+ - **Breaking Change Signal Detection**
203
+ - Conditional/ternary removed → CRITICAL (PR #1101 imgURL issue)
204
+ - Default case logic changed → WARNING (PR #1101 insightService issue)
205
+ - Middleware removed → Search httpContext consumers
206
+ - External URL pattern changed → Search all frontend consumers
207
+
208
+ - **Timeout/Hang Detection**
209
+ - AI/LLM calls without timeout → CRITICAL
210
+ - External HTTP calls without timeout → CRITICAL
211
+ - Database queries in loops without limit → WARNING
212
+
213
+ ### Enhanced
214
+ - SKILL.md now requires Consumer Search Output section in all reviews
215
+ - Backend signal detection includes service logic changes
216
+ - Cross-repo search scope expanded to tradeit, tradeit-admin, tradeit-extension
217
+
218
+ ### Post-mortem
219
+ PR #1101 review revealed two critical issues that would have been caught with proper consumer search:
220
+ 1. `imgURL` conditional removed in inventoryService.js → 30+ frontend components affected
221
+ 2. `insightService.js` default case changed → AI content generation broken for category slugs
222
+
223
+ Both issues were NOT in the PR diff but affected by the changes. This version makes cross-repo consumer search MANDATORY.
224
+
225
+ ---
226
+
227
+ ## v5.1.0 (2026-02-11) - CRITICAL FIX
228
+
229
+ **CRITICAL FIX**: Mandatory consumer search for Pinia store migrations
230
+
231
+ ### Added
232
+ - Phase 1.5 - Breaking Change Signal Detection
233
+ - Automatic detection of Pinia stores from file paths
234
+ - MANDATORY consumer search with exact grep commands
235
+ - Required output format for consumer search results
236
+ - Orchestrator verification that consumer search was performed
237
+ - Re-run mechanism for incomplete reviews
238
+
239
+ ### Enhanced
240
+ - state-mgmt subagent prompt with step-by-step consumer search
241
+
242
+ ### Fixed
243
+ - Subagents now search ENTIRE codebase, not just PR files
244
+
245
+ ### Post-mortem
246
+ PR #3088 review missed `rootState.currency` bug in `store/inventory.js` because:
247
+ 1. The file was NOT in the PR (not assigned to subagent)
248
+ 2. Consumer search instructions were advisory, not mandatory
249
+ 3. No verification that search was actually performed
250
+
251
+ ---
252
+
253
+ ## v5.0.0 (2026-02-11)
254
+
255
+ ### Added
256
+ - Vuex/Pinia migration checklist (from PR #3108 analysis)
257
+ - Cross-repo impact analysis with database ownership check
258
+ - Devil's Advocate verification protocol
259
+ - OWASP 2025-aligned security checklist
260
+ - Historical context check before flagging issues
261
+ - Research synthesis documentation
262
+
263
+ ### Enhanced
264
+ - state-mgmt category with migration patterns
265
+ - security category with OWASP Top 10 (2025)
266
+ - cross-repo category with consumer search patterns
267
+
268
+ ---
269
+
270
+ ## v4.0.0 (2026-02-10)
271
+
272
+ ### Redesigned
273
+ - Token-efficient orchestrator (< 3000 tokens)
274
+
275
+ ### Added
276
+ - Path-based file categorization
277
+ - Subagent file-based output
278
+ - Checklist tracking
279
+
280
+ ### Removed
281
+ - Django, Next.js, React framework rules
282
+
283
+ ---
284
+
285
+ ## v3.0.0
286
+
287
+ - Initial parallel subagent architecture
@@ -0,0 +1,60 @@
1
+ # PR Code Reviewer - Research & Design Decisions
2
+
3
+ ## Why This Architecture?
4
+
5
+ | Decision | Research Source | Rationale |
6
+ |----------|-----------------|-----------|
7
+ | Orchestrator < 3000 tokens | AI tool comparison | Most tools bloat context with full file reads |
8
+ | Path-based categorization | Google CODEOWNERS | Proven at scale, no code parsing needed |
9
+ | Parallel subagents | Meta's review speed research | P75 review time correlates with satisfaction |
10
+ | Devil's Advocate verification | Senior reviewer practices | Reduces false positives significantly |
11
+ | Cross-repo awareness | Microservices research | Breaking changes are #1 cause of outages |
12
+ | Historical context check | Google Critique | "Why was this written?" prevents bad flags |
13
+
14
+ ## What We Learned from PR #3108 and PR #3088
15
+
16
+ The `rootState.currency` bug taught us:
17
+
18
+ 1. **State migrations are invisible**: Pinia stores don't appear in Vuex's rootState
19
+ 2. **Reverts compound problems**: Double-revert brought back broken state
20
+ 3. **AI misses cross-store dependencies**: Need explicit migration checklist
21
+ 4. **Pattern matching isn't enough**: Must trace actual execution paths
22
+
23
+ ### PR #3088 Post-Mortem (v5.1 trigger)
24
+
25
+ The v5.0 skill had the RIGHT instructions but WRONG enforcement:
26
+ - Instructions said "search for rootState.{storeName}"
27
+ - But subagent only reviewed PR files, not entire codebase
28
+ - `store/inventory.js` (NOT in PR) still used `rootState.currency`
29
+ - Bug was missed because consumer search was ADVISORY, not MANDATORY
30
+
31
+ **Root Cause**: Subagents only read assigned files. Consumer search requires searching ENTIRE codebase.
32
+
33
+ **Fix (v5.1)**:
34
+ - Phase 1.5: Detect breaking change signals from file paths
35
+ - Mandatory consumer search with EXACT grep commands
36
+ - Required output format for verification
37
+ - Orchestrator verification that search was performed
38
+
39
+ ## Comparison: Our Approach vs Industry
40
+
41
+ | Aspect | Google | Meta | AI Tools | Our v5.1 |
42
+ |--------|--------|------|----------|----------|
43
+ | Token efficiency | N/A | N/A | Poor | ✅ Excellent |
44
+ | Cross-repo | Glean indexing | Monorepo | Limited | ✅ Manual check |
45
+ | Speed | Hours | Minutes | Seconds | Minutes |
46
+ | False positives | Low | Low | High | Medium (Devil's Advocate) |
47
+ | Context awareness | Deep | Deep | Shallow | Medium (repo rules) |
48
+ | Breaking changes | Manual | Automated | Limited | ✅ Mandatory search |
49
+
50
+ ## Future Enhancements (v6.0 Candidates)
51
+
52
+ 1. **Automated contract testing**: Integrate Pact-style consumer checks
53
+ 2. **Review metrics**: Track time-to-review, false positive rate
54
+ 3. **Stacked diff support**: Review incremental changes like Meta
55
+ 4. **Git blame integration**: Automatic historical context lookup
56
+ 5. **Cross-repo dependency graph**: Visualize service dependencies
57
+
58
+ ## Full Research
59
+
60
+ See `.opencode/research/code-review-research-synthesis.md` for complete analysis.