npx skills add ...
npx skills add microsoft/fluidframework --skill review
npx skills add microsoft/fluidframework --skill review
Use when asked to review code, review a branch, or do a code review. Spawns Breaker (correctness) and API Analyst (compatibility/conventions) sub-agents while the orchestrator reviews architecture, tests, performance, and security.
Spawns dedicated Breaker (correctness) and API Analyst (compatibility/conventions) sub-agents in parallel while the orchestrator performs the Inspector pass (architecture, tests, performance, security). Depth is user-selected.
Optimize for high-confidence, concise findings. Silence is better than speculation.
Target: $ARGUMENTS
Parse $ARGUMENTS:
my-feature-branch) -> diff that branch vs mainBefore doing anything, ask the user:
I can run a code review on your branch. Pick a depth (fastest to slowest):
- Skip — skip the review
- Quick — single-pass by orchestrator, all areas, no sub-agents
- Standard — full swarm: Breaker + API Analyst sub-agents + Inspector
- Deep — Standard + reads full changed files (not just diffs) for deeper analysis
Wait for the user's response. If they say skip, stop here.
Immediately after the user picks a mode, create one task per applicable step using TaskCreate — before doing any other work. Mark each task in_progress when you start it and completed when you finish.Tasks to create by mode:
If a branch name was provided as argument, replace HEAD with origin/<branch-name> and add it to the fetch:
If on main and no branch name was provided, ask the user which branch to review.
Store the commit log, file list from --stat, and total $LINES_CHANGED.
Empty diff gate: Zero changed files -> report "No changes to review" and stop.
Size gate: >10,000 lines changed -> ask user to narrow scope before proceeding.
Exclude non-reviewable files from the file list: type declarations (.d.ts), lockfiles (pnpm-lock.yaml, package-lock.json), images, fonts, binaries, .map files, and generated API report files (*.api.md).
Read per-file diffs in batches (~50 files or ~500 changed lines per batch, whichever is smaller):
For named branches, use origin/main...origin/<branch>.
After reading diffs, identify files where fuller context is needed — typically where the change touches a function that references shared state, calls other functions in the same file, or has fragmented hunks. Read those files in one batch using the Read tool.
Read every changed file in full (the version on the review branch). Use git show HEAD:<file> or git show origin/<branch>:<file> as appropriate.
If a change threads a new prop, callback, flag, or data field through a shared component or helper, read every changed call site and adjacent wrapper that accepts or forwards it.
Compute $LINES_REVIEWED: Count total unique lines reviewed — diff lines for diff-only files, full line counts for fully-read files. This is always >= $LINES_CHANGED.
No code gate: If no executable logic files remain after exclusions (only docs/config changed), skip Breaker. API Analyst does a reduced pass. Inspector only.
Check whether any API report files changed (names only, not content — these are excluded from diff reading in Step 3):
If any matched, flag those packages for the API Analyst (triggers extra scrutiny on release tags, breaking changes, and conventions).
Skip this step in Quick mode.
For files read in full that are >200 lines, extract only: modified functions (complete bodies), their callers (same file), and shared state. Format:
Files <=200 lines: embed in full. Store as $EXTRACTED_SECTIONS.
All reviews cover these areas. The mode determines whether sub-agents handle some of them.
api-conventions.md)Before a finding can appear in the report, verify ALL of these:
If a claim depends on generic hardening advice, guessed nullability, speculative behavior, or an unverified assumption about a dependency, read more context or drop it.
Output format for all findings: [SEVERITY] file:line — description — suggested fix (CRITICAL, HIGH, MEDIUM).
The orchestrator covers all areas in a single pass, then proceeds to Step 7.
Two parallel tracks:
| Area | Owner |
|---|---|
| Correctness | The Breaker (sub-agent) |
| API Quality | The API Analyst (sub-agent) |
| Architecture, Tests, Performance, Security | The Inspector (orchestrator) |
Think like a chaos monkey working on a distributed systems framework. Your sole focus is finding ways this code produces wrong results, crashes, or behaves unexpectedly.
You are NOT here to praise good code. You are here to BREAK things.
Your mindset:
- "What if two clients send conflicting ops simultaneously?"
- "What if the network dies mid-operation?"
- "What if I attach, detach, then reattach?"
- "What happens at the edges — empty collections, maximum sizes, zero-length ops?"
- "What if the dependency changes or a guard was removed but its siblings weren't?"
- "What if summarization runs while ops are in flight?"
- "What if I call this before the container is connected?"
Think like a developer advocate who deeply understands TypeScript API design. Your sole focus is ensuring this code presents a clean, consistent, user-friendly API surface that follows Fluid Framework conventions.
You are NOT here to praise good code. You are here to find API design problems.
Your mindset:
- "Would a new user understand this API from IntelliSense alone?"
- "Does this naming follow our conventions?"
- "Is this a breaking change? Is the release tag correct?"
- "Are generics earning their keep or just adding noise?"
- "Does this type design play well with others — plain data, JSON-compatible?"
- "Will this deprecation path actually work for consumers?"
- "Is there unnecessary complexity that could be a simpler overload?"
The API Analyst receives the contents of api-conventions.md (in this skill's directory) as part of its prompt.
Read api-conventions.md:
While sub-agents run, perform the Architecture, Tests, Performance, and Security pass yourself using full diff context and cross-file reasoning.
Spawn all sub-agents in a single parallel batch using the Agent tool.
Each sub-agent prompt includes — literally pasted into the prompt text:
api-conventions.md[SEVERITY] file:line — description — suggested fix"This is a LOCAL review — the workspace checkout matches the code under review. You may read workspace files for additional context (callers, type definitions, adjacent logic) when the embedded material is insufficient.""This is a REMOTE review — the workspace checkout may be on a different branch. Do NOT read workspace files. ALL code you need is embedded above. Base your analysis ONLY on the diff and extracted sections provided."Perform the Inspector pass yourself while sub-agents run. Wait for all to complete.
Classify each finding and adjust severity:
| Area | Max Severity | Adjustment |
|---|---|---|
| Correctness | CRITICAL | Promote +1 level (MEDIUM->HIGH, HIGH->CRITICAL) |
| API Quality | CRITICAL | Promote +1 level (MEDIUM->HIGH, HIGH->CRITICAL) |
| Performance | HIGH | Cap |
| Architecture | HIGH | Cap |
| Tests | HIGH | Cap |
| Security | MEDIUM | Cap |
Multi-area findings: classify in whichever area gives higher severity. Drop uncertain findings. If a concern depends on guesswork, hypothetical misuse, or hardening beyond an already-enforcing layer, omit it.
Deduplicate on file:line, sort by severity. Drop "looks correct" findings.
Output routing:
/tmp/review-report.md and print a summary to the terminal: verdict line, finding counts by area, and the file path.Always print: Review report written to /tmp/review-report.md when writing to file.
If zero findings remain after the evidence gate, use the exact summary line:
0 CRITICAL, 0 HIGH, 0 MEDIUM — No high-confidence issues found in the current diff.
After severity caps and promotions:
10,000 lines changed: Ask user to narrow scope.
git diff origin/main...HEAD -- <file1> <file2> ...git diff --name-only origin/main...HEAD | grep -E '\.api\.md$' || true### file.ts (extracted — N lines from M total)
// Fields
#cache: Map<string, Promise<Foo>> = new Map();
// Modified: someMethod() — line 816
async someMethod(arg) { ... }
// Caller: #helperMethod — line 1118
async #helperMethod(arg) { ... }cat .claude/skills/review/api-conventions.md# Code Review Report
**Target**: Branch: <branch-name>
**Mode**: quick | standard | deep
**Lines reviewed**: $LINES_REVIEWED ($LINES_CHANGED changed)
## Verdict: Approve | Approve with suggestions | Request changes
N CRITICAL, N HIGH, N MEDIUM — one-line summary of the overall assessment.
### Findings
| Sev | # | Area | File | What | Fix |
|---|---|---|---|---|---|
| :red_circle: | C1 | Correctness | file.ts:42 | Description of violation and impact | Concrete fix suggestion |
| :orange_circle: | H1 | API Quality | file.ts:80 | Description | Fix |
| :yellow_circle: | M1 | Tests | file.test.ts:12 | Description | Fix |
**By area:** Correctness: 1:red_circle: API Quality: 1:orange_circle: Tests: 1:yellow_circle:
### Changes Overview
Table of each changed file -> what changed and why.
### Suggestions
Optional, non-blocking improvements. Each must propose a **concrete action** — never just describe what's already there. Omit this section if there are none.
---
Generated with review (mode)What next?
1. Explain a specific finding
2. Fix all critical/high issues
3. Re-review after changes