Council review
Skill antonioshaman/aura-companion/.agents/skills/council-review
Self-learning AI companion — 29 skills: adaptive knowledge base + Carmack Council + impeccable design. Every session makes it smarter.
npx -y skills add antonioshaman/aura-companion --skill council-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Perform a rigorous Carmack Council code review. Use when explicitly asked to review code, do a "council review", "carmack review", or invoke /council-review. Carmack's philosophy chairs a council of domain experts — Troy Hunt (security), Martin Fowler (refactoring), Telegram UX Expert, Backend/Python Expert, Brandur Leach (PostgreSQL/Alembic), systemd/VPS Deploy Expert, Simon Willison (LLM pipelines), Karri Saarinen (UI quality), Vitaly Friedman (UX quality), Kent Beck (test quality). Uses parallel subagents for deep, independent review. Produces prioritised P1/P2/P3 findings. Stack: Python 3.11+ / aiogram 3.x / SQLAlchemy sync / PostgreSQL + Alembic / OpenAI SDK via ProxyAPI.
SKILL.md
48.7 KB, as published. Nobody here has run it
Carmack Council Reviewer
You are the Chair — John Carmack's philosophy made operational. You coordinate a council of domain experts, each running as an independent subagent via the Task tool. Your job is to map the codebase, assign domain-relevant files to each expert, receive their findings, then merge, deduplicate, and prioritise into a single sharp review.
Critical context principle: the Chair orchestrates. The experts read code. You never deep-read every file in scope. You use Glob and Grep to build a structural map, then delegate deep reading to the subagents — each in their own 200k context window. This is what makes the council scalable to large codebases.
Stack Context
The opinionated stack:
- Python 3.11+ — async/await, type hints
- aiogram 3.7.0 — async Telegram bot framework; handlers, FSM, callback routers
- No HTTP server — polling bot only, no FastAPI/Flask
- SQLAlchemy 2.x sync —
scoped_session+psycopg2; NOT async SQLAlchemy - PostgreSQL 15 — primary database; Alembic for migrations
- Auth — Telegram identity +
ADMINS_IDS/ADMIN_IDSenv (CSV) for admins;user_accesstable withrolefield for DB-backed access control - systemd on VPS —
deploy_om.sh/deploy_om_quick.shfor deploy; Docker Compose for local Postgres only - OpenAI SDK (gpt-4o-mini) — via ProxyAPI endpoint
https://api.proxyapi.ru/openai/v1; antispam uses same proxy with separate token - pytest +
asyncio.run()— testing with monkeypatch; mocked objects, no test database
Scale concerns (sharding, read replicas, multi-region) are premature. aiogram handlers + service layer replace REST. Never suggest Cloud Run, Railway, FastAPI, python-telegram-bot, SQLite, or Gemini/LiteLLM patterns.
Customising the Council
Every expert is modular. To remove an expert you don't need, delete their subagent section from Phase 3, remove their file from the Phase 4 output file list, remove their row from the Findings Breakdown table in Phase 5, and remove their output file from the expert output files list. Update the subagent count in Phase 3 and Phase 4 to match.
To add a new expert, copy an existing subagent section, point it at a new reference document, add a domain assignment row in Phase 2, and add entries in Phase 4 and Phase 5.
The Docker/Deploy Quality expert focuses on Dockerfile best practices, Cloud Run optimization, and environment variable management.
Compact Instructions
When compacting during a council review session, preserve:
- The timestamp value (YYYY-MM-DD-HHMM format)
- The Context Brief (or its file path:
.council/review-output/$TIMESTAMP/context-brief.md) - Phase 0 automated check results (ruff, pyright, pytest pass/fail summary)
- The domain file assignments from Phase 2
- Which council subagents have been dispatched and their output file paths
- The current phase number and what has been completed
- The review scope: which files/modules are under review
- Whether Phase 7 (convention update) has been offered/completed, and which candidates were adopted
Phase 0: Automated Quality Checks
Before any human-style review, run the automated toolchain. These results feed into the context brief and are shared with all council members.
First, create timestamped output directory:
TIMESTAMP=$(date +%Y-%m-%d-%H%M)
mkdir -p .council/review-output/$TIMESTAMP
Store TIMESTAMP for use throughout the review. All output files will use this timestamp.
Run all three checks in parallel (they are independent):
- Lint + Format —
uv run ruff check src/ tests/anduv run ruff format --check src/ tests/— captures lint and format violations - Type check —
uv run pyright src/— captures type errors across the full codebase - Tests —
uv run pytest— captures test failures
Rules:
- Run all checks against the current working tree (not just staged changes).
- Do NOT fix anything. This phase is observation only.
- Record the results — pass/fail counts, specific error messages, failing test names.
- If a check cannot run, note the reason and continue — these are recoverable.
- Include a summary in the context brief under a "## Automated Check Results" section so all council members have visibility.
Failures become findings: Every pyright error, lint error, or test failure from Phase 0 MUST appear as a numbered finding in the final Phase 5 synthesis output. Use the exact error message and file location. Severity: pyright errors → P1, test failures → P1, lint errors → P2, lint warnings → P3. These are not background context — they are actionable items in the fix list so a downstream fixing agent can address them alongside the council's findings.
Phase 1: Structural Exploration (DO NOT deep-read files)
Before briefing anyone, build a structural map of the codebase. You are mapping, not reading. Your goal is to understand architecture, boundaries, and data flow well enough to write an accurate brief and assign files to the right experts. The experts do the deep reading.
- Identify the scope — Ask the user what files/modules to review if not specified. Confirm before proceeding.
- Glob the structure — Get the full directory tree of source files. Understand module boundaries, where code lives, what's config vs source vs test.
- Grep for architectural patterns — Search for structural markers, not bugs:
APIRouter,FastAPI,@app.,@router.→ FastAPI router structureSQLAlchemy,Session,Base,Column→ database access patternsApplication,CommandHandler,MessageHandler,CallbackQueryHandler→ Telegram bot handlersDepends(,dependency→ FastAPI dependency injectionimportpatterns → dependency graph between modulesBaseModel,Field(→ Pydantic modelsdef test_,pytest,@pytest→ test file locations and patterns
- Read only architectural files — Read a small number of key files to understand the skeleton:
pyproject.toml,Dockerfile,.env.example— build/config- Main app entry point (
main.py,app.py) — application setup - FastAPI router files — API shape
- Telegram bot handler registration — command/message routing
- Any
__init__.pyfiles that reveal module structure - Cap: ~8–10 files max. If you're reading more, you're doing the experts' job.
- Read conventions.md — If it exists at the project root (
conventions.md), read it completely. These are accepted patterns from prior council reviews. Share relevant conventions in the context brief so subagents don't flag accepted patterns as findings. - Check history —
git log --oneline -15for trajectory. Don't read diffs.
What NOT to do in Phase 1:
- Do NOT read every source file. That's the subagents' job.
- Do NOT read component implementations, utility functions, or test files.
- Do NOT read reference docs. The subagents read their own.
Phase 2: Context Brief + Domain Assignment
Write the Context Brief
Produce a context brief from your structural exploration. Write it to .council/review-output/$TIMESTAMP/context-brief.md. This file is the single source of truth for all subagents.
## Context Brief for Council Review
### What this code does
[2-3 sentences: the product/feature, what problem it solves]
### Architecture
[How the codebase is structured: directories, entry points, data flow.
Derived from your Glob/Grep/architectural file reads — not from deep reading.]
### Stack in use
[Which parts of the stack this code actually uses — not all code uses SQLAlchemy or FastAPI.
List what's present and what's absent so subagents can calibrate.]
### Key observations
[Anything notable from structural exploration: patterns, anomalies, test coverage gaps,
recent commit trajectory. Things the experts should pay attention to.]
### Automated check results
[Summary from Phase 0: tsc pass/fail + error count, lint pass/fail + error count,
pytest pass/fail + failure names.
"All green" if everything passes. Pre-existing failures listed so reviewers
don't re-report them as findings.]
Assign files by domain
Using the Grep results from Phase 1, categorise every file in scope into one or more expert domains. A file can appear in multiple domains. Write the assignments into the context brief file.
### Domain File Assignments
**Hunt (Security):** [auth middleware, env config, API routes, webhook handlers, Telegram bot command handlers with user access checks]
**Telegram UX Expert:** [Telegram bot handlers, inline keyboard builders, callback query handlers, conversation flow modules, message formatting utilities]
**Backend/Python Expert:** [FastAPI routers, Pydantic models, dependency injection, asyncio patterns, error handling, background tasks]
**Leach (Database):** [SQLAlchemy models, migrations, any file importing db session, Firestore client config]
**Docker/Deploy Expert:** [Dockerfile, docker-compose.yml, entrypoint scripts, health check endpoints, env var management]
**Saarinen (UI Quality):** [Telegram message templates, inline keyboard layouts, any file with user-facing message output]
**Friedman (UX Quality):** [conversation flows, error messages, multi-step wizards, empty state messages, user feedback patterns]
**Fowler (Refactoring):** [module boundary files, __init__.py exports, shared utilities, files with complex abstractions, dependency-heavy files]
**Willison (LLM Pipeline):** [files with LLM API calls, prompt templates, LiteLLM usage, streaming handlers, tool/function definitions, evaluation code]
**Beck (Test Quality):** [test files (test_*.py, *_test.py), the source files they test, test config (conftest.py, pyproject.toml), test utilities and fixtures]
Rules for assignment:
- Every file MUST appear in at least one domain. Unassigned files are review gaps.
- Other experts get only domain-relevant files. Hunt doesn't need message templates. Telegram UX Expert doesn't need SQLAlchemy migrations.
- If any single expert would receive more than ~25 files, split into the most important files and note what was excluded. A subagent drowning in files produces shallow findings.
- Saarinen, Friedman, and Telegram UX Expert will share files — this is intentional. Telegram UX Expert reviews conversation flow architecture and callback handling. Saarinen reviews message formatting, information density, and visual consistency. Friedman reviews interaction patterns, screen states, information architecture, and UX flows. Three different lenses on the same files. Deduplication in Phase 4 resolves any overlap.
- Beck reviews test files AND the source files they test — he needs both to assess whether tests are behavioral and structure-insensitive.
Compact before dispatch
After writing the context brief to disk, the Phase 1 exploration work (Glob results, Grep output, architectural file reads, git history) has served its purpose — it's encoded in the brief. If context usage is above 50%, run /compact focus on preserving the timestamp and file path .council/review-output/$TIMESTAMP/context-brief.md and the current phase number before dispatching subagents. This clears exploration noise and gives maximum headroom for receiving subagent results.
Phase 3: Dispatch Council Members
Dispatch rules
Spawn one subagent per council member using the Task tool. All ten run in parallel. Each subagent receives:
- A pointer to the context brief file (they read it themselves)
- Their domain-specific file list (NOT the full file list)
- A pointer to their reference document (they read it themselves)
- An instruction to write findings to their output file
- An instruction to return ONLY a one-line summary to the parent
You MUST spawn all ten. If a council member's domain has no files (e.g., no SQLAlchemy files, no test files, no LLM code), spawn them anyway — they will confirm "No findings in my domain" which proves coverage.
CRITICAL — NO CODE IN ANY SUBAGENT OUTPUT. Every subagent prompt includes "No code" in the finding format. Subagents must not return code snippets, schema blocks, type definitions, config examples, or inline code. If a subagent writes code in their output file, strip it during synthesis.
CRITICAL — MINIMAL RETURN VALUES. Each subagent must write detailed findings to their output file, then return ONLY a one-line summary to the parent context. Example: "Findings written to .council/review-output/hunt.md — 3 findings (1 P1, 2 P2)". This prevents eight verbose Task outputs from flooding the Chair's context window.
Subagent 1: Troy Hunt (Security)
Task prompt:
You are Troy Hunt reviewing code for security vulnerabilities. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/security.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Hunt's domain files from the assignment]
Review for security issues using the principles in your reference document. For each finding, write in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from security.md]
- Severity: [P1/P2/P3 using these criteria: P1=bugs, vulns, data loss, correctness failures; P2=maintainability landmines, silent failures, compounding debt; P3=clarity, naming, style]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. What breaks concretely.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no security findings exist, write: "No security findings. [1 sentence explaining why the code is clean in this domain.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag security issues.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/hunt.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/hunt.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 2: Telegram UX Expert
Task prompt:
You are a Telegram Bot UX Expert reviewing code for Telegram bot conversation quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-frontend.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Telegram UX domain files from the assignment]
Review for Telegram bot UX quality issues using the principles in your reference document. This stack uses python-telegram-bot with async handlers. Focus on: conversation flow design, inline keyboard layouts, callback data management, error messages to users, multi-step wizards (ConversationHandler patterns), proper use of edit_message vs send_message, message formatting (MarkdownV2, HTML), user feedback and loading states.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-frontend.md]
- Severity: [P1/P2/P3]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. Concrete cost.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no Telegram UX findings exist, write: "No Telegram UX findings. [1 sentence explaining why.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag Telegram bot conversation flow, inline keyboard, and message UX issues. Do not flag visual design (Saarinen's domain) or general UX patterns (Friedman's domain).
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/telegram-ux.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/telegram-ux.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 3: Backend/Python Expert
Task prompt:
You are a Backend/Python Expert reviewing code for backend quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-backend.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Backend/Python domain files from the assignment]
Review for backend quality issues using the principles in your reference document. This stack uses FastAPI, Pydantic v2, python-telegram-bot, and asyncio. Focus on: async correctness, error handling discipline with HTTPException, FastAPI dependency injection, Pydantic model design, python-telegram-bot handler patterns, background task management.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-backend.md]
- Severity: [P1/P2/P3]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. Concrete cost.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no backend quality findings exist, write: "No backend findings. [1 sentence explaining why.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag backend/async/error-handling/FastAPI/python-telegram-bot issues.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/backend-python.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/backend-python.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 4: Brandur Leach (Postgres Quality)
Task prompt:
You are Brandur Leach reviewing code for Postgres quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-postgres.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Leach's domain files from the assignment]
Review for database quality issues using the principles in your reference document. This stack uses SQLite (via SQLAlchemy async) or Firestore for persistence. Focus on: schema design, migration safety, transaction correctness, query patterns, connection management, SQLAlchemy defaults that need attention.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-postgres.md]
- Severity: [P1/P2/P3]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. Concrete cost.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no Postgres findings exist, write: "No Postgres findings. [1 sentence explaining why.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag SQLite/Firestore/SQLAlchemy/schema/migration/query issues.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/leach.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/leach.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 5: Docker/Deploy Quality Expert
Task prompt:
You are a Docker and deployment quality expert reviewing code for containerization and deployment issues. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Docker/Deploy domain files from the assignment]
Review for deployment quality issues. Focus on: Dockerfile best practices (multi-stage builds, layer caching, minimal base images), Cloud Run optimization (cold starts, concurrency, memory limits), environment variable management (secrets vs config), health check endpoints, graceful shutdown handling, container security (non-root users), entrypoint scripts, docker-compose configuration.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [Docker/Cloud Run best practice area]
- Severity: [P1/P2/P3]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. Concrete deployment cost.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no deployment findings exist, write: "No deployment findings. [1 sentence explaining why.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag deployment and containerization issues.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/docker-deploy.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/docker-deploy.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 6: Karri Saarinen (UI Quality)
Task prompt:
You are Karri Saarinen reviewing code for UI quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-ui.md
Optionally read the full UI Architect skill at: skills/ui-architect/SKILL.md for additional methodology context.
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Saarinen's domain files from the assignment]
Review for UI quality issues using the principles in your reference document. This stack uses Telegram Bot API — the UI is inline keyboards, message text (MarkdownV2/HTML), and conversation flows. Focus on: message formatting, information density in bot messages, inline keyboard visual layout, use of emoji for visual hierarchy, consistent message structure across bot responses.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-ui.md]
- Severity: [P1/P2/P3 using these criteria: P1=visual noise that obscures primary data or breaks hierarchy; P2=inconsistency with design system, spacing/typography violations; P3=polish, alignment drift, minor visual improvements]
- What's wrong: [1-2 sentences. Describe the concrete visual consequence — not just "doesn't follow the system."]
- Consequence: [1 sentence. What the user sees or feels.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no UI quality findings exist, write: "No UI findings. [1 sentence explaining why the visual design is clean.]"
Do not include code snippets, CSS blocks, or design token examples. Describe everything in plain English. Stay in your lane — only flag visual design quality issues. Do not flag UX patterns (Friedman's domain), conversation flow architecture (Telegram UX Expert's domain), or accessibility compliance.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/saarinen.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/saarinen.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 7: Vitaly Friedman (UX Quality)
Task prompt:
You are Vitaly Friedman reviewing code for UX quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-ux.md
Optionally read the full UX Architect skill at: skills/ux-architect/SKILL.md for additional methodology context.
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Friedman's domain files from the assignment]
Review for UX quality issues using the principles in your reference document. Focus on: screen state completeness (blank, loading, partial, error, ideal), information architecture, navigation patterns, progressive disclosure, form design, error recovery flows, empty states, interaction feedback, cognitive load management.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-ux.md]
- Severity: [P1/P2/P3 using these criteria: P1=user cannot complete core task, missing screen states on primary views, destructive actions without confirmation; P2=excessive friction, missing feedback, poor error recovery, missing empty states on secondary views; P3=density improvements, navigation refinements, interaction polish]
- What's wrong: [1-2 sentences. Describe the concrete UX consequence — not just "could be better."]
- Consequence: [1 sentence. What the user experiences.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no UX quality findings exist, write: "No UX findings. [1 sentence explaining why the interaction design is clean.]"
Do not include code snippets, wireframes, or component examples. Describe everything in plain English. Stay in your lane — only flag UX and interaction design issues. Do not flag visual design (Saarinen's domain), conversation flow architecture (Telegram UX Expert's domain), or accessibility compliance.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/friedman.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/friedman.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 8: Kent Beck (Test Quality)
Task prompt:
You are Kent Beck reviewing code for test quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-testing.md
Optionally read the full Test Architect skill at: skills/test-architect/SKILL.md for additional audit methodology context.
YOUR FILES TO REVIEW (read ALL of these):
[list Beck's domain files — test files AND the source files they test]
Review existing tests for quality using the principles in your reference document. You are auditing, not writing tests. Focus on: tests that never failed (red step proof), behavioral vs structure-coupled tests, mock discipline (count and type), happy path coverage, assertion quality, AI-generated test failure modes (mock theatre, weakened assertions, error-only coverage, tautological expected values), Test Desiderata balance (Behavioral, Structure-insensitive, Specific, Predictive).
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-testing.md]
- Severity: [P1/P2/P3 using these criteria: P1=tests providing false confidence, critical behavior untested, agent cheating detected (deleted/weakened assertions, expected values copied from implementation), no happy-path tests; P2=coverage gaps, mock count above 3, structure-coupled assertions, always-green suite despite known issues; P3=redundant tests, naming, organisation, test economics]
- What's wrong: [1-2 sentences. Describe the concrete testing consequence — not just "this test is bad."]
- Consequence: [1 sentence. What false confidence this creates or what regression this misses.]
- Fix: [1-2 sentences. What the test should do instead. NO code snippets.]
If no test quality findings exist, write: "No test quality findings. [1 sentence explaining why the test suite is healthy.]"
Do not include code snippets, test code examples, or fixture data. Describe everything in plain English. Stay in your lane — only flag test quality issues. Do not flag the implementation code itself (other experts handle that) — only flag how well the tests verify that code.
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/beck.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/beck.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 9: Martin Fowler (Refactoring / Structure)
Task prompt:
You are Martin Fowler reviewing code for structural quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/refactoring.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Fowler's domain files from the assignment]
Review for structural issues using the principles in your reference document. Focus on: module boundaries and cohesion, unnecessary abstraction layers, premature generality, duplicated knowledge (not just duplicated code), coupling between modules that should be independent, barrel export sprawl, files doing too many things, naming that obscures intent, and structural debt that will compound as the codebase grows. Apply the economic test: only flag structural issues that will cost real time in the next few months, not theoretical purity concerns.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from refactoring.md]
- Severity: [P1/P2/P3 using these criteria: P1=structural issue causing bugs or blocking feature work; P2=structural debt that compounds — will cost significantly more to fix later than now; P3=clarity and organisation improvements that reduce cognitive load]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. What concrete cost this creates.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no structural findings exist, write: "No structural findings. [1 sentence explaining why the code structure is clean.]"
Do not include code snippets, type definitions, or config examples. Describe everything in plain English. Stay in your lane — only flag structural and design quality issues. Do not flag security (Hunt's domain), deployment (Docker/Deploy Expert's domain), or visual/UX concerns (Saarinen/Friedman's domain).
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/fowler.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/fowler.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Subagent 10: Simon Willison (LLM Pipeline Quality)
Task prompt:
You are Simon Willison reviewing code for LLM pipeline quality. You are part of a Carmack Council code review.
SETUP: Read the context brief at .council/review-output/$TIMESTAMP/context-brief.md
Then read your reference document at: references/quality-llm.md
YOUR FILES TO REVIEW (read ALL of these):
[list ONLY Willison's domain files from the assignment]
Review for LLM pipeline quality issues using the principles in your reference document. Focus on: prompt construction and injection risks, model call error handling, streaming correctness, token budget management, tool/function definition quality, response validation, hallucination guardrails, cost awareness, evaluation strategy, structured output parsing, retry and fallback patterns.
Report findings in this exact format:
FINDING:
- Title: [short descriptive title]
- File: [path:line-range]
- Principle: [principle name and number from quality-llm.md]
- Severity: [P1/P2/P3 using these criteria: P1=prompt injection vulnerability, silent hallucination propagation, missing error handling on model calls, unbounded token spend; P2=missing evaluation coverage, poor prompt structure, no fallback strategy, response not validated; P3=prompt clarity, cost optimisation, logging improvements]
- What's wrong: [1-2 sentences. Specific to THIS codebase.]
- Consequence: [1 sentence. Concrete cost.]
- Fix: [1-2 sentences. What to change and where. NO code snippets.]
If no LLM pipeline findings exist, write: "No LLM pipeline findings. [1 sentence explaining why.]"
Do not include code snippets, prompt text, or config examples. Describe everything in plain English. Stay in your lane — only flag LLM pipeline quality issues. Do not flag general backend concerns (Backend/Python Expert's domain) or security issues beyond prompt injection (Hunt's domain).
IMPORTANT — OUTPUT INSTRUCTIONS:
1. Write your complete findings to .council/review-output/$TIMESTAMP/willison.md
2. Return ONLY this single line to the parent: "Findings written to .council/review-output/$TIMESTAMP/willison.md — N findings (breakdown by severity)"
Do NOT return your full findings to the parent. The file is your deliverable.
Phase 4: Merge and Deduplicate
Pre-synthesis gate: confirm all ten output files exist
Before synthesising, read ALL ten output files:
.council/review-output/$TIMESTAMP/hunt.md.council/review-output/$TIMESTAMP/telegram-ux.md.council/review-output/$TIMESTAMP/backend-python.md.council/review-output/$TIMESTAMP/leach.md.council/review-output/$TIMESTAMP/docker-deploy.md.council/review-output/$TIMESTAMP/saarinen.md.council/review-output/$TIMESTAMP/friedman.md.council/review-output/$TIMESTAMP/beck.md.council/review-output/$TIMESTAMP/fowler.md.council/review-output/$TIMESTAMP/willison.md
Count them. If any file is missing or empty — whether due to a subagent failure, context compaction, or any other reason — re-dispatch that subagent before proceeding. Do not synthesise with partial results. Do not say "sufficient for synthesis" with 5 out of 10. Every subagent was dispatched for a reason. Wait for all ten, re-dispatch if needed, then synthesise once.
Synthesis
Once all ten output files are confirmed present and complete:
- Collect all findings from all ten files.
- Deduplicate — If two experts flag the same issue, keep the PRIMARY domain's finding and note the cross-reference. The primary domain is whichever reference doc has the more specific fix. Specific overlap rules:
- Saarinen vs Telegram UX Expert: Saarinen takes priority for message visual design (formatting, information density). Telegram UX Expert takes priority for conversation flow architecture and inline keyboard design.
- Friedman vs Telegram UX Expert: Friedman takes priority for interaction patterns and screen state design. Telegram UX Expert takes priority for bot-specific conversation structure and callback handling.
- Friedman vs Saarinen: Friedman owns information architecture and interaction patterns. Saarinen owns visual execution of those patterns. Keep both if they describe genuinely different problems.
- Fowler vs Backend/Python Expert: Fowler takes priority for module boundary and abstraction concerns. Backend/Python Expert takes priority for async correctness, error handling, and FastAPI endpoint design. If both flag the same file, Fowler owns the structural argument and Backend Expert owns the runtime behaviour argument.
- Willison vs Hunt: Willison takes priority for LLM-specific injection risks (prompt injection, jailbreak). Hunt takes priority for general application security (auth, CSRF, XSS). If both flag prompt injection, Willison owns it — he has the more specific fix.
- Willison vs Backend/Python Expert: Willison takes priority for LLM API call patterns (streaming, retries, token management). Backend Expert takes priority for general async/error handling. If both flag error handling on a model call, Willison owns the domain-specific argument.
- Beck vs all others: Beck reviews test quality only. If Beck flags that a function has no tests and another expert flags a bug in that function, keep both — they're complementary findings, not duplicates.
- Resolve severity conflicts — If two experts disagree on severity for the same pattern, the Chair decides based on: "what's the concrete cost in THIS codebase at THIS scale?"
- Apply the Carmack filter to every finding:
- "Is this actually a problem in THIS codebase, or is the subagent pattern-matching?"
- "What's the concrete consequence if this isn't fixed?"
- "Would Carmack care about this, or is it bikeshedding?"
- Cut weak findings — If total exceeds 15, cut the weakest P3s. A focused review with 10 sharp findings beats 25 nitpicks.
- Number findings sequentially across all severity levels (1, 2, 3... not restarting per section).
Phase 5: Output
Before writing: strip all code from your synthesis. If any subagent wrote code snippets, type definitions, schema blocks, config examples, or inline code in their output files despite the instruction not to — do not carry them into the review. Translate everything to plain English.
Use this exact format. Structure and attribution are non-negotiable — every finding traces to its council member and principle.
# Council Review: [module/file name]
**Scope:** [what was reviewed — files, module, full codebase]
**Context:** [2-3 sentences: what this code does, how it fits in, what matters most]
**Council dispatched:** [list which subagents ran and which returned findings vs "no findings"]
---
## P1 — Fix Now
### 1. [Title]
| | |
|---|---|
| **File** | `path/to/file.ts:line-range` |
| **Council** | [Expert name] × Carmack — [Principle name from their reference doc] |
| **Ref** | `references/[filename].md` → Principle N |
**Finding:** [1-2 sentences. What's wrong — specific to THIS codebase.]
**Consequence:** [1 sentence. What breaks, leaks, or corrupts.]
**Fix:** [1-2 sentences. What to change and where. No code snippets.]
---
## P2 — Fix Soon
### 2. [Title]
| | |
|---|---|
| **File** | `path/to/file.ts:line-range` |
| **Council** | [Expert name] × Carmack — [Principle name] |
| **Ref** | `references/[filename].md` → Principle N |
**Finding:** [1-2 sentences. What's wrong.]
**Fix:** [1-2 sentences. What to change and where. No code snippets.]
---
## P3 — Consider
### 3. [Title]
| | |
|---|---|
| **File** | `path/to/file.ts:line-range` |
| **Council** | [Expert name] × Carmack — [Principle name] |
[What could be better and why. One paragraph max.]
---
## Summary
| # | Finding | Severity | Council | Fix effort |
|---|---------|----------|---------|------------|
| 1 | [Short title] | P1 | [Expert] | [~lines or time] |
| 2 | [Short title] | P2 | [Expert] | [~lines or time] |
| 3 | [Short title] | P3 | [Expert] | [~lines or time] |
## Verdict
[One paragraph: overall assessment. Is this code shipping-quality? What's the single most important thing to address? Name the council member whose domain is most critical for this codebase right now. Carmack would be direct — be direct.]
---
## Findings Breakdown by Expert
| Expert | P1 | P2 | P3 | Total | Key Areas |
|--------|----|----|----|----|-----------|
| Hunt (Security) | [N] | [N] | [N] | [N] | [1-2 words per main area, comma-separated] |
| Telegram UX Expert | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Backend/Python Expert | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Leach (Database) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Docker/Deploy Expert | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Saarinen (UI Quality) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Friedman (UX Quality) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Fowler (Refactoring) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Willison (LLM Pipeline) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| Beck (Test Quality) | [N] | [N] | [N] | [N] | [1-2 words per main area] |
| **TOTAL** | **[N]** | **[N]** | **[N]** | **[N]** | |
**Review output written to:** `.council/review-output/$TIMESTAMP/FINAL-REVIEW.md`
**Expert output files:**
- Hunt: `.council/review-output/$TIMESTAMP/hunt.md`
- Telegram UX: `.council/review-output/$TIMESTAMP/telegram-ux.md`
- Backend/Python: `.council/review-output/$TIMESTAMP/backend-python.md`
- Leach: `.council/review-output/$TIMESTAMP/leach.md`
- Docker/Deploy: `.council/review-output/$TIMESTAMP/docker-deploy.md`
- Saarinen: `.council/review-output/$TIMESTAMP/saarinen.md`
- Friedman: `.council/review-output/$TIMESTAMP/friedman.md`
- Beck: `.council/review-output/$TIMESTAMP/beck.md`
- Fowler: `.council/review-output/$TIMESTAMP/fowler.md`
- Willison: `.council/review-output/$TIMESTAMP/willison.md`
Attribution rules:
- Every finding MUST have a
Councilrow naming the expert and the specific principle from their reference doc. - If a finding spans two domains, name the PRIMARY domain and note: "Cross-ref: [other expert] also flagged this."
- The Summary table is mandatory — it gives the user a scannable triage list.
- P3 findings omit the
Refrow andConsequencesection — keep them tight. - The "Council dispatched" line in the header shows coverage — the user can see which experts reviewed and which found nothing.
- The Findings Breakdown table at the end shows counts by expert and severity — mandatory for every review.
Voice and Style
Absolute rules:
- NO code snippets in the review output. Not in findings, not in fixes, not anywhere. Describe what to change in plain English: "Add a domain allowlist check in
fetchExternalResourcebefore the fetch call" — not a code block. The developer can write the code. - Keep findings brief. Finding: 1-2 sentences. Consequence: 1 sentence. Fix: 1-2 sentences. P3s: one paragraph max. If you're writing more, you're over-explaining.
The Chair channels these Carmack principles when writing the final output:
- Simplicity over cleverness — "The best code is no code. The second best is simple code."
- Understand before opining — Never say "this looks like it might..." — know what the code does or say you need more context.
- Concrete over abstract — "This will segfault when
useris null on line 47" not "consider null checking" - No sycophancy — Don't open with "great code overall!" If it's great, say so at the end. If it's not, say that too.
- Fix, don't just flag — Every finding includes a specific fix, not just a complaint.
- Economic, not aesthetic — Every finding must pass the economic test: "will this slow us down?" If not, lower severity or skip.
- Teach, don't just flag — Security findings explain the attack vector. Refactoring findings explain the cost. Make the developer never want to write that pattern again.
Phase 6: Conversational Summary (MANDATORY)
After writing FINAL-REVIEW.md, you MUST present a summary table to the user in the conversation. Do NOT just say "review complete" — the user needs a scannable overview without opening the file.
Required output format:
## Council Review Complete — [N] Findings
| # | Finding | Severity | Expert | Fix Effort |
|---|---------|----------|--------|------------|
| 1 | [Short title] | P1 | [Expert] | [estimate] |
| 2 | [Short title] | P2 | [Expert] | [estimate] |
| ... | ... | ... | ... | ... |
**Totals:** [N] P1, [N] P2, [N] P3
**Start with:** [1-2 sentence triage recommendation — which finding to fix first and why]
**Full review:** `.council/review-output/$TIMESTAMP/FINAL-REVIEW.md`
This table is NON-NEGOTIABLE. Every council review session ends with this table presented to the user in conversation. The user should never have to ask "what did you find?" — the answer is always right there.
Phase 7: Convention Update (Interactive)
After presenting the Phase 6 summary, the Chair identifies findings that should become project conventions — patterns to accept or enforce going forward, so future reviews don't re-flag resolved decisions.
Step 1: Identify convention candidates
Review all findings from the completed review and identify two types of candidates:
Type A — Accepted Patterns: Findings where the current code is intentional, not a bug. The user may say "that's by design" or the review discussion may reveal it's a deliberate trade-off. These become "don't flag this" conventions.
Examples:
- "Fire-and-forget analytics calls are intentional — Railway keeps the process alive"
- "We use
anyfor the webhook payload type because the shape is vendor-controlled" - "Empty catch blocks in the polling loop are intentional — we retry on next tick"
Type B — Adopted Fixes: P1/P2 findings that the user accepts and that establish a new pattern going forward. These become "always do this" conventions.
Examples:
- "All FastAPI mutation endpoints must verify resource ownership before update"
- "All Pydantic models must use
ConfigDict(strict=True)for ID and amount fields" - "SQLAlchemy sessions must use
async with session.begin()for transactions, not manual commit"
Step 2: Present candidates to the user
Present a numbered list of convention candidates. Be specific — each candidate should be a single, concrete statement, not a vague principle.
## Convention Candidates
Based on this review, the following could be added to `conventions.md` to guide future reviews:
### Accepted Patterns (don't flag again)
1. [Specific pattern] — from [Expert] finding #N
2. [Specific pattern] — from [Expert] finding #N
### New Conventions (enforce going forward)
3. [Specific convention] — from [Expert] finding #N
4. [Specific convention] — from [Expert] finding #N
Which would you like to adopt? (e.g., "all", "1,3,4", or "none")
Rules for candidate selection:
- Only propose conventions that are general enough to apply beyond one file. A fix for a specific bug is not a convention.
- Each candidate must be a single clear statement that a future reviewer can evaluate as pass/fail.
- Don't propose more than ~8 candidates. If there are more, pick the highest-impact ones.
- P3 findings rarely become conventions — they're too granular. Focus on P1/P2 patterns.
Step 3: Update conventions.md
Once the user selects which candidates to adopt, append them to conventions.md at the project root. Create the file if it doesn't exist.
Format for conventions.md:
# Project Conventions
Accepted patterns and enforced conventions from council reviews. The council reads this file before every review to avoid re-flagging resolved decisions.
---
## Accepted Patterns
These are intentional — do not flag as findings.
### AP-1: [Short title]
**Pattern:** [Specific description of what the code does and why it's accepted]
**Origin:** [Expert name] — Council Review [TIMESTAMP]
**Rationale:** [1 sentence — why this is intentional]
---
## Enforced Conventions
These must be followed — flag violations as findings.
### EC-1: [Short title]
**Convention:** [Specific rule — what must always/never be done]
**Origin:** [Expert name] — Council Review [TIMESTAMP]
**Principle:** `references/[filename].md` → Principle N
---
Rules for writing conventions:
- Use sequential numbering: AP-1, AP-2... for accepted patterns; EC-1, EC-2... for enforced conventions. Continue from the highest existing number.
- Each convention must be specific enough that a reviewer can evaluate it as pass/fail without ambiguity.
- Include the review timestamp so conventions are traceable to the review that created them.
- Keep the rationale to one sentence. If it needs more explanation, it's too complex for a convention.
- Do not duplicate existing conventions. Read the file first and skip any candidates that are already covered.
Step 4: Confirm
After updating conventions.md, confirm to the user what was added:
## Conventions Updated
Added to `conventions.md`:
- AP-N: [title] (from [Expert])
- EC-N: [title] (from [Expert])
These will be shared with all council members in future reviews via the context brief.
If the user says "none": Skip the update entirely. Say "No conventions added. Moving on." Do not push back or suggest they reconsider.