ci: Claude multi-agent PR review workflow#67
Conversation
Adds a swarm of five specialist Claude review agents that run in parallel on each PR, one per concern (PostgreSQL, TypeScript, Docker, security, docs). Each agent loads a domain-specific skill from `.claude/skills/` and posts inline + summary comments scoped to its lane. All agents run on `claude-haiku-4-5` to keep cost low. Security model is borrowed from stellar/actions PR #103, but uses `pull_request` (not `_target`) since this repo doesn't accept fork contributions. The five skills are vendored under `.claude/skills/` so the CI runner can load them without external dependencies.
Note on this PR's empty reviewThe five review jobs ran on this PR but each self-skipped with:
This is a built-in safety check in Once this PR merges, the workflow will fire normally on subsequent PRs. No further config is needed — To verify end-to-end after merging: open a small follow-up PR with any code change and confirm all five agents post their summary comments. |
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow that runs five parallel Claude review “lanes” on each pull request, and vendors the referenced lane “skills” into the repo so the action can load them without external setup.
Changes:
- Introduces
.github/workflows/claude-review.ymlto run a matrix of five specialist review jobs (Postgres, TypeScript, Docker, Security, Docs) and post PR comments. - Vendors multiple Claude skills under
.claude/skills/(including Postgres optimization, Docker patterns, database migrations, and a productionalize-node playbook) for the agents to load. - Adds a verification-focused skill intended to prevent “claims without evidence”.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/claude-review.yml | New multi-agent PR review workflow using a matrix of five aspects and a restricted tool allowlist. |
| .claude/skills/verification-before-completion/SKILL.md | New skill text emphasizing running verification commands before declaring completion. |
| .claude/skills/productionalize-node/SKILL.md | New “productionalize-node” skill defining an assessment/execution playbook for hardening a Node/TS codebase. |
| .claude/skills/productionalize-node/references/tooling-defaults.md | Reference doc listing a default tooling stack and alternatives. |
| .claude/skills/productionalize-node/references/phase-8-final-review.md | Reference doc describing final review steps and completion criteria. |
| .claude/skills/productionalize-node/references/phase-7-documentation.md | Reference doc for README/docs/CHANGELOG updates and verification. |
| .claude/skills/productionalize-node/references/phase-6-ci.md | Reference doc with an example CI workflow and CI best-practice notes. |
| .claude/skills/productionalize-node/references/phase-5-testing.md | Reference doc describing Vitest setup, coverage workflow, and test conventions. |
| .claude/skills/productionalize-node/references/phase-4-dependencies.md | Reference doc for audits/upgrades plus a “dependency freshness” gate script. |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3.5-cors-evaluation.md | Reference doc for deciding whether to configure CORS and how to verify it. |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3.4-env-validation.md | Reference doc for centralized env validation via t3-env + Zod. |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3.3-security.md | Reference doc for baseline Express security hardening (helmet, rate limiting, secrets audit). |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3.2-input-validation.md | Reference doc for boundary validation using Zod schemas/middleware. |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3.1-error-handling.md | Reference doc for establishing an error hierarchy and error middleware patterns. |
| .claude/skills/productionalize-node/references/phase-3-hardening/phase-3-hardening.md | Reference doc describing Phase 3 sequencing and verification gates. |
| .claude/skills/productionalize-node/references/phase-2-quality-infra.md | Reference doc for ESLint/Prettier setup and structured logging guidance. |
| .claude/skills/productionalize-node/references/phase-1-foundation.md | Reference doc for TS strict migration, scripts/Makefile, and repo hygiene. |
| .claude/skills/productionalize-node/references/assessment-checklist.md | Reference doc providing an assessment checklist for production readiness. |
| .claude/skills/postgres-optimization/SKILL.md | New Postgres optimization skill covering indexing, plans, partitioning, pooling, and diagnostics. |
| .claude/skills/docker-patterns/SKILL.md | New Docker patterns skill covering Compose, Dockerfile hygiene, and container security. |
| .claude/skills/database-migrations/SKILL.md | New database migration patterns skill with safety checklists and ORM-specific guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Group by PR + aspect so a new push cancels stale runs of the same | ||
| # aspect, but parallel aspects on the same PR don't cancel each other. | ||
| concurrency: | ||
| group: claude-review-${{ github.event.pull_request.number }}-${{ github.job }} |
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: anthropics/claude-code-action@v1 |
| for (const [name, version] of Object.entries(allDeps)) { | ||
| try { | ||
| const raw = execSync(`npm view ${name} time --json`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }) | ||
| const times = JSON.parse(raw) |
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: pnpm/action-setup@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 |
Addresses two issues Copilot caught on the PR:
1. The workflow-level concurrency.group used ${{ github.job }}, which
resolves to the constant job id "review" for every matrix entry.
All five agents shared one group and would have cancelled each
other. Workflow-level concurrency can't reference matrix.*, so the
group moves to the job level and keys on matrix.id.
2. Pin anthropics/claude-code-action to a commit SHA (matching the
existing convention for third-party actions in this repo) to reduce
supply-chain risk. SHA is the current v1 tag.
Re-pushed addressing Copilot reviewTwo real bugs Copilot caught:
The two other Copilot comments touch vendored skill markdown ( |
Summary
Adds
.github/workflows/claude-review.yml— a swarm of five specialist Claude review agents that run in parallel on every PR. Each focuses on one concern and stays in its lane:postgrespostgres-optimization,database-migrationstypescriptproductionalize-nodedocker.dockerignore, cache orderdocker-patternssecuritysecurity-auditdocs.env.example/Makefile/docs drift introduced by the PREach agent posts inline comments prefixed with its lane (e.g.
[Security Review]) plus one summary PR comment so reviewers see five stacked sections.Cost
All agents run on
claude-haiku-4-5with--max-turns 25. Per the Slack thread (#dev-tools, 2026-05-13), keeping the model small + the prompts focused keeps spend manageable while still beating Copilot in practice.Skills are vendored
The five skills the agents reference live under
.claude/skills/in the repo so the GitHub Actions runner can load them with no external setup.security-auditwas already present from a prior change; the other four were copied from local sources (dereferenced viacp -RL— the originals are symlinks).Security model
Borrowed from
stellar/actions#103(stellar/actions#103):pull_request(notpull_request_target) — laboratory-backend doesn't accept fork contributions, so the safer default is fine. Secrets are stripped on fork PRs by GitHub, which is the desired behavior here.permissions: {}; job opts in tocontents: read,pull-requests: write,id-token: write.gh prcommands to the current PR number explicitly.Once
stellar/actions#103merges and grows model selection, we should migrate to the reusable workflow there and drop the local copy of the security boilerplate.Required setup
ANTHROPIC_API_KEYmust be present as a repo secret.Test plan
ANTHROPIC_API_KEYis configured in repo secrets.Claude Multi-Agent Reviewshould run.## <Title> Review.[<Title>].