my-council
Multi-agent parallel review → Council synthesis → Prioritized fix list.
⚡ Quick Start
When the user asks for a review or changes cross a threshold:
# Check if review threshold is met
find src -type f -newer .git/HEAD -name '*.ts' -o -name '*.tsx' | wc -l
# If >5 files or ~100+ lines changed, trigger review council
Activate the council:
Spawning 5 parallel reviewers → synthesizing findings → presenting prioritized list
After user picks fixes, execute all approved items immediately.
The Pattern
1. Spawn Parallel Reviewers
Spawn 5 (or more) subagents in parallel, each with a different focus dimension:
| Dimension |
What to review |
| Security |
XSS, injection, sanitization, CSP, secrets, input validation |
| Architecture |
Component boundaries, state management, duplication, coupling |
| Type Safety / API |
Type correctness, edge cases, null safety, API surface |
| UX / Accessibility |
ARIA, keyboard nav, focus management, screen readers, contrast |
| Tests / Coverage |
Missing tests, untested branches, dead code, test quality |
| Research |
Best practices, modern alternatives, API docs, security advisories, patterns |
Each reviewer:
- Receives the same task description + file list
- Focuses only on their dimension
- Writes a structured report to
/tmp/review-{dimension}.md
2. Synthesize Reports
After all agents complete:
- Read all 5 report files
- Categorize every finding into:
- Critical — fix now (security, data loss, crash)
- Warning — fix soon (bug risk, UX barrier, type hole)
- Suggestion — consider (style, refactor, enhancement)
- De-duplicate findings that appear in multiple dimensions
- Present as numbered list with severity
3. Execute Fixes
User says "fix all" or picks a subset:
- Do NOT ask for confirmation on each individual fix
- Do NOT ask "which one next?" — just execute the list
- Fix in order: Critical → Warning → Suggestion
- Run tests after every batch of related edits
- Commit after all fixes pass
Reviewer Prompt Template
Each reviewer receives this prompt structure:
You are a {DIMENSION} reviewer for this project.
Your task: Review the following files and write a report to /tmp/review-{DIMENSION}.md.
Focus ONLY on {DIMENSION} concerns. Do NOT review other dimensions.
Review scope: {FILE_LIST}
Report format:
## Critical (fix now)
- [File:line] — Issue description
- Why: Impact + evidence
- Fix: Before/After code
## Warning (fix soon)
...
## Suggestion (consider)
...
Research Dimension
The Research reviewer is unique — it does not read the code for bugs. Instead, it:
- Researches modern best practices for technologies used in the project
- Looks up API documentation for unfamiliar libraries or patterns
- Checks for known security advisories on dependencies
- Finds alternative approaches that might be simpler or more robust
- Validates that the project's approach aligns with current community standards
Research reviewer prompt:
You are a Research reviewer for this project.
Your task: Research the technologies and patterns used in the following files.
Write a report to /tmp/review-research.md.
Use @skills/my-web-search-kagi to search the web for current best practices,
security advisories, and modern alternatives.
Focus ONLY on:
- Are we using the current best practices for each technology?
- Are there newer, simpler, or more robust alternatives?
- Are there any known security issues or deprecations in our dependencies?
- Are we missing common patterns that similar projects use?
Do NOT review code for bugs. Focus on external research and knowledge.
Research scope: {FILE_LIST} + package.json / Cargo.toml / pyproject.toml
Orchestrator Prompt
After reviewers complete, read all reports and produce:
## Code Review Council: {PROJECT_NAME}
### Critical (fix now)
1. **[File:line]** — Issue (from {reviewer})
2. ...
### Warning (fix soon)
1. ...
### Suggestion (consider)
1. ...
### Estimated effort: {X} hours
Auto-Review Threshold
Do not wait for the user to ask. Auto-invoke review before commit when:
| Trigger |
Condition |
| File count |
edit/write touched > 5 files |
| Line count |
Total diff exceeds ~100 lines |
| Risk surface |
Change touches security, auth, or error-handling paths |
If threshold is met:
- Run
git diff --stat (or equivalent) to confirm scope
- Invoke @skills/my-council (self-call)
- Fix Critical findings before committing
- Note Warnings for follow-up
- Commit with clean code
Why auto-review: Review is almost always user-initiated. Agents ship multi-file changes without review because there is no automatic trigger. This threshold removes the activation barrier.
Execution Rules
- Fix Critical first — never leave a Critical finding unaddressed
- Batch related edits — fix all items in one file before moving to next
- Run tests after each batch — unit tests + typecheck + e2e
- Commit as a single batch — one commit per dimension batch, or one commit for all
- Remove dead code immediately — if reviewers flag unused code, delete it
- Add missing tests — if reviewers flag uncovered code, write tests
Test Coverage Rule
If the project has tests → new code MUST have tests.
Check first: find . -name '*.test.*' -o -name '*.spec.*' -o -name 'test_*' | head -5
| Situation |
Requirement |
| Project has tests + new feature |
Add tests covering happy path + edge cases |
| Project has tests + bug fix |
Add regression test that would have caught the bug |
| Project has tests + refactored code |
Ensure existing tests still pass; update if behavior changed |
| No test framework in project |
Note: "Consider adding tests—project has none" |
Coverage goal: Meaningful coverage without bloat.
- Test the contract: inputs → outputs, success + failure paths
- Test edge cases: empty, null, extreme values, race conditions
- Don't test: language built-ins, trivial getters, implementation details
- One comprehensive test > three shallow tests
Build vs Buy Analysis
Question: Is this code reinventing something a mature library already solves?
When to flag:
- Common utility functions (date formatting, validation, HTTP retries)
- Security-sensitive operations (auth, crypto, parsing untrusted input)
- Complex state management with async operations
- Features with known edge cases (timezones, unicode, floating point)
- Data transformation with schema requirements
Evaluation criteria:
| Factor |
Build |
Buy |
| Complexity |
Simple, domain-specific |
General, edge-case-heavy |
| Security |
Non-critical |
Auth, crypto, parsing |
| Maintenance |
Core to business |
Commodity feature |
| Team expertise |
Deep knowledge |
Learning curve acceptable |
| Ecosystem |
Poor library options |
Mature, well-maintained |
Red Flags (always catch)
Principles
| Principle |
❌ Wrong |
✅ Right |
| Specific > Generic |
"Use better error handling" |
"Use Result type pattern. Per Context7: [pattern]" |
| Evidence > Opinion |
"I don't like this" |
"React docs discourage this since v18. Use [alternative]" |
| Actionable > Vague |
"Could be improved" |
"Replace lines 45-52: [code]. Eliminates intermediate array" |
Research Sources (priority order)
- Context7 library docs — Most authoritative for specific libraries
- Official docs — Framework/language best practices
- Codebase patterns — grep for consistency with existing code
- Community guides — With clear attribution
Fix Format
### Before (lines X-Y)
```ts
// problematic
After
// fixed
Why
- [specific benefit]
- [evidence-backed reasoning]
## Common Mistakes
❌ **Wrong:** Reviewing code without researching current best practices first
✅ **Right:** Always consult Context7 or official docs before making recommendations
❌ **Wrong:** Giving vague feedback like "this could be better"
✅ **Right:** Provide specific before/after code with evidence-backed reasoning
❌ **Wrong:** Catching style issues but missing security red flags
✅ **Right:** Check Red Flags first: input validation, secrets, async errors, race conditions
❌ **Wrong:** Suggesting a rewrite when a small fix suffices
✅ **Right:** Prefer minimal, targeted changes. Only refactor when clearly justified
❌ **Wrong:** Reviewing 50+ files as a single monolithic review
✅ **Right:** Use @skills/my-council to spawn parallel reviewers across dimensions
## When Context Is Unclear
Ask, don't guess:
- "What's intended behavior when [edge case]?"
- "Is this performance-sensitive?"
- "What versions are you targeting?"
Then deliver targeted recommendations.
## When to Skip
- Single file changed (< 20 lines)
- Only documentation or config changes
- Only test file changes
- User explicitly says "skip review"
## When to Use Research Standalone
Sometimes the user wants research without a full code review:
- "Should we use X or Y library?"
- "What's the current best practice for Z?"
- "Are there any security issues with our dependencies?"
In these cases, spawn **only the Research reviewer** and present findings directly. No council synthesis needed.
## Post-Review
After fixes are applied:
1. Run full test suite
2. Run typecheck
3. Run build
4. Verify coverage report
5. Commit with message: `review: fix {N} {dimension} findings`
6. Push
If the Research reviewer found actionable improvements (e.g., "use library X instead of Y"), create a follow-up task or implement immediately if the change is small.
## Related Skills
- **@skills/my-tech-stack** — For tool recommendations when reviewers suggest new dependencies
- **@skills/my-workflow** — For commit discipline and worktree naming during review execution
- **@skills/my-vcs-hygiene** — For committing and pushing after review fixes
## Versioning
- **Last updated:** 2026-05-28
- **Version:** 1.0
- **Update notes:** Initial council pattern based on multi-dimension parallel review experience
1---2name: my-council3description: **ALWAYS use when user mentions:** "review council", "multi-agent review", "parallel review", "team review", "full code review", "review with experts", "spawn reviewers", "council pattern", "review all dimensions", "code review", "review this", "PR review", "check my code", "critique", "how should I write this", "raise the bar". **ALWAYS use when:** a codebase has changed >5 files or ~100+ lines, or when the user wants a thorough review across multiple dimensions (security, performance, correctness, maintainability, tests, accessibility, architecture, types, research). **DO NOT use for:** single-file quick checks, asking how a specific function works, or debugging a known bug (use the appropriate debug skill instead).4---56# my-council78Multi-agent parallel review → Council synthesis → Prioritized fix list.910## ⚡ Quick Start1112**When the user asks for a review or changes cross a threshold:**1314```bash15# Check if review threshold is met16find src -type f -newer .git/HEAD -name '*.ts' -o -name '*.tsx' | wc -l17# If >5 files or ~100+ lines changed, trigger review council18```1920**Activate the council:**21```22Spawning 5 parallel reviewers → synthesizing findings → presenting prioritized list23```2425**After user picks fixes, execute all approved items immediately.**2627## The Pattern2829### 1. Spawn Parallel Reviewers3031Spawn 5 (or more) subagents in parallel, each with a **different focus dimension**:3233| Dimension | What to review |34|-----------|---------------|35| **Security** | XSS, injection, sanitization, CSP, secrets, input validation |36| **Architecture** | Component boundaries, state management, duplication, coupling |37| **Type Safety / API** | Type correctness, edge cases, null safety, API surface |38| **UX / Accessibility** | ARIA, keyboard nav, focus management, screen readers, contrast |39| **Tests / Coverage** | Missing tests, untested branches, dead code, test quality |40| **Research** | Best practices, modern alternatives, API docs, security advisories, patterns |4142Each reviewer:43- Receives the same task description + file list44- Focuses only on their dimension45- Writes a structured report to `/tmp/review-{dimension}.md`4647### 2. Synthesize Reports4849After all agents complete:501. Read all 5 report files512. Categorize every finding into:52 - **Critical** — fix now (security, data loss, crash)53 - **Warning** — fix soon (bug risk, UX barrier, type hole)54 - **Suggestion** — consider (style, refactor, enhancement)553. De-duplicate findings that appear in multiple dimensions564. Present as numbered list with severity5758### 3. Execute Fixes5960User says "fix all" or picks a subset:61- **Do NOT ask for confirmation on each individual fix**62- **Do NOT ask "which one next?"** — just execute the list63- Fix in order: Critical → Warning → Suggestion64- Run tests after every batch of related edits65- Commit after all fixes pass6667## Reviewer Prompt Template6869Each reviewer receives this prompt structure:7071```markdown72You are a {DIMENSION} reviewer for this project.7374Your task: Review the following files and write a report to /tmp/review-{DIMENSION}.md.7576Focus ONLY on {DIMENSION} concerns. Do NOT review other dimensions.7778Review scope: {FILE_LIST}7980Report format:81## Critical (fix now)82- [File:line] — Issue description83- Why: Impact + evidence84- Fix: Before/After code8586## Warning (fix soon)87...8889## Suggestion (consider)90...91```9293## Research Dimension9495The **Research** reviewer is unique — it does not read the code for bugs. Instead, it:9697- Researches modern best practices for technologies used in the project98- Looks up API documentation for unfamiliar libraries or patterns99- Checks for known security advisories on dependencies100- Finds alternative approaches that might be simpler or more robust101- Validates that the project's approach aligns with current community standards102103**Research reviewer prompt:**104```markdown105You are a Research reviewer for this project.106107Your task: Research the technologies and patterns used in the following files.108Write a report to /tmp/review-research.md.109110Use @skills/my-web-search-kagi to search the web for current best practices,111security advisories, and modern alternatives.112113Focus ONLY on:114- Are we using the current best practices for each technology?115- Are there newer, simpler, or more robust alternatives?116- Are there any known security issues or deprecations in our dependencies?117- Are we missing common patterns that similar projects use?118119Do NOT review code for bugs. Focus on external research and knowledge.120121Research scope: {FILE_LIST} + package.json / Cargo.toml / pyproject.toml122```123124## Orchestrator Prompt125126After reviewers complete, read all reports and produce:127128```markdown129## Code Review Council: {PROJECT_NAME}130131### Critical (fix now)1321. **[File:line]** — Issue (from {reviewer})1332. ...134135### Warning (fix soon)1361. ...137138### Suggestion (consider)1391. ...140141### Estimated effort: {X} hours142```143144## Auto-Review Threshold145146Do not wait for the user to ask. **Auto-invoke review** before commit when:147148| Trigger | Condition |149|---------|-----------|150| **File count** | `edit`/`write` touched > 5 files |151| **Line count** | Total diff exceeds ~100 lines |152| **Risk surface** | Change touches security, auth, or error-handling paths |153154If threshold is met:1551. Run `git diff --stat` (or equivalent) to confirm scope1562. **Invoke @skills/my-council** (self-call)1573. Fix **Critical** findings before committing1584. Note **Warnings** for follow-up1595. Commit with clean code160161**Why auto-review:** Review is almost always user-initiated. Agents ship multi-file changes without review because there is no automatic trigger. This threshold removes the activation barrier.162163## Execution Rules164165- **Fix Critical first** — never leave a Critical finding unaddressed166- **Batch related edits** — fix all items in one file before moving to next167- **Run tests after each batch** — unit tests + typecheck + e2e168- **Commit as a single batch** — one commit per dimension batch, or one commit for all169- **Remove dead code immediately** — if reviewers flag unused code, delete it170- **Add missing tests** — if reviewers flag uncovered code, write tests171172## Test Coverage Rule173174**If the project has tests → new code MUST have tests.**175176Check first: `find . -name '*.test.*' -o -name '*.spec.*' -o -name 'test_*' | head -5`177178| Situation | Requirement |179|-----------|-------------|180| Project has tests + new feature | Add tests covering happy path + edge cases |181| Project has tests + bug fix | Add regression test that would have caught the bug |182| Project has tests + refactored code | Ensure existing tests still pass; update if behavior changed |183| No test framework in project | Note: "Consider adding tests—project has none" |184185**Coverage goal**: Meaningful coverage without bloat.186- Test the contract: inputs → outputs, success + failure paths187- Test edge cases: empty, null, extreme values, race conditions188- Don't test: language built-ins, trivial getters, implementation details189- One comprehensive test > three shallow tests190191## Build vs Buy Analysis192193**Question**: Is this code reinventing something a mature library already solves?194195**When to flag**:196- Common utility functions (date formatting, validation, HTTP retries)197- Security-sensitive operations (auth, crypto, parsing untrusted input)198- Complex state management with async operations199- Features with known edge cases (timezones, unicode, floating point)200- Data transformation with schema requirements201202**Evaluation criteria**:203| Factor | Build | Buy |204|--------|-------|-----|205| **Complexity** | Simple, domain-specific | General, edge-case-heavy |206| **Security** | Non-critical | Auth, crypto, parsing |207| **Maintenance** | Core to business | Commodity feature |208| **Team expertise** | Deep knowledge | Learning curve acceptable |209| **Ecosystem** | Poor library options | Mature, well-maintained |210211## Red Flags (always catch)212213- [ ] Unvalidated user input → database214- [ ] Secrets hardcoded or unvalidated env215- [ ] Async without error handling216- [ ] Blocking operations in request handlers217- [ ] Race conditions in concurrent code218- [ ] Memory leaks in long-running processes219- [ ] Sensitive data in logs/errors220- [ ] **New code without tests (when project has tests)**221222## Principles223224| Principle | ❌ Wrong | ✅ Right |225|-----------|---------|----------|226| **Specific > Generic** | "Use better error handling" | "Use Result type pattern. Per Context7: [pattern]" |227| **Evidence > Opinion** | "I don't like this" | "React docs discourage this since v18. Use [alternative]" |228| **Actionable > Vague** | "Could be improved" | "Replace lines 45-52: [code]. Eliminates intermediate array" |229230## Research Sources (priority order)2312321. **Context7 library docs** — Most authoritative for specific libraries2332. **Official docs** — Framework/language best practices2343. **Codebase patterns** — grep for consistency with existing code2354. **Community guides** — With clear attribution236237## Fix Format238239```markdown240### Before (lines X-Y)241```ts242// problematic243```244245### After246```ts247// fixed248```249250### Why251- [specific benefit]252- [evidence-backed reasoning]253```254255## Common Mistakes256257❌ **Wrong:** Reviewing code without researching current best practices first258✅ **Right:** Always consult Context7 or official docs before making recommendations259260❌ **Wrong:** Giving vague feedback like "this could be better"261✅ **Right:** Provide specific before/after code with evidence-backed reasoning262263❌ **Wrong:** Catching style issues but missing security red flags264✅ **Right:** Check Red Flags first: input validation, secrets, async errors, race conditions265266❌ **Wrong:** Suggesting a rewrite when a small fix suffices267✅ **Right:** Prefer minimal, targeted changes. Only refactor when clearly justified268269❌ **Wrong:** Reviewing 50+ files as a single monolithic review270✅ **Right:** Use @skills/my-council to spawn parallel reviewers across dimensions271272## When Context Is Unclear273274Ask, don't guess:275- "What's intended behavior when [edge case]?"276- "Is this performance-sensitive?"277- "What versions are you targeting?"278279Then deliver targeted recommendations.280281## When to Skip282283- Single file changed (< 20 lines)284- Only documentation or config changes285- Only test file changes286- User explicitly says "skip review"287288## When to Use Research Standalone289290Sometimes the user wants research without a full code review:291- "Should we use X or Y library?"292- "What's the current best practice for Z?"293- "Are there any security issues with our dependencies?"294295In these cases, spawn **only the Research reviewer** and present findings directly. No council synthesis needed.296297## Post-Review298299After fixes are applied:3001. Run full test suite3012. Run typecheck3023. Run build3034. Verify coverage report3045. Commit with message: `review: fix {N} {dimension} findings`3056. Push306307If the Research reviewer found actionable improvements (e.g., "use library X instead of Y"), create a follow-up task or implement immediately if the change is small.308309## Related Skills310311- **@skills/my-tech-stack** — For tool recommendations when reviewers suggest new dependencies312- **@skills/my-workflow** — For commit discipline and worktree naming during review execution313- **@skills/my-vcs-hygiene** — For committing and pushing after review fixes314315## Versioning316317- **Last updated:** 2026-05-28318- **Version:** 1.0319- **Update notes:** Initial council pattern based on multi-dimension parallel review experience