plugins/flow/skills/code-review-methodology/SKILL.md
Conduct two-stage code review: Stage 1 verifies spec compliance (criterion-to-code mapping), Stage 2 evaluates security, correctness, performance, and maintainability across 6 parallel facets with P1/P2/P3 synthesis and deduplication by file:line. Use when reviewing code changes or pull requests. This skill MUST be consulted because reviewing quality on broken logic is wasted effort, and unmet acceptance criteria must block merge.
npx skillsauth add synaptiai/synapti-marketplace code-review-methodologyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Domain skill for structured, multi-faceted code review.
FIRST VERIFY IT WORKS, THEN VERIFY IT'S GOOD. Never review code quality on code that doesn't function correctly.
Spec compliance is Stage 1. Code quality is Stage 2. Reviewing style on broken logic is wasted effort.
Stage 1 — Spec Compliance: Does the code do what the issue/acceptance criteria require? Map each criterion to implementation evidence. If Stage 1 fails, stop — no point reviewing quality on code that doesn't meet requirements.
Stage 2 — Code Quality (in priority order):
Do NOT flag maintainability issues if security or correctness issues exist. Fix the important things first.
Every review evaluates these facets (parallelizable):
| Facet | Focus | Agent / Skill | |-------|-------|---------------| | Security | OWASP top 10, secrets, auth/authz, input validation | security-reviewer | | Quality | Logic correctness, edge cases | code-reviewer | | Conventions | Commit format, branch naming, PR structure, patterns | convention-checker | | Tests | Coverage, quality commands pass, test quality | test-runner | | Error handling | Unhandled errors, silent failures, missing edge cases in error paths | error-handler-inspector | | Claim verification | Self-review claims cross-referenced against actual file state | holdout-validation (skill) |
Requirements compliance is Stage 1 (Spec Compliance) of the Two-Stage Review section above, not a parallel facet — it runs first on the main thread before the 6 facets fan out.
For the Tests facet specifically, see test-review-checklist.md for a runnable checklist of coverage, quality, and integration-test signals reviewers can flag with citations.
After all facets complete, synthesize:
file:line — same location = same finding, keep highest priorityMap each acceptance criterion to evidence:
| Status | Meaning | |--------|---------| | Met | Directly implemented and testable | | Interpreted | Criterion was ambiguous, implementation reflects interpretation | | Partially Met | Some aspects done, others pending | | Not Addressed | Not implemented in this change |
### P1 - Critical
| Finding | Suggested Fix |
|---------|---------------|
| **1 · security · `auth.rb:42`**<br>SQL injection via string interpolation. | Use parameterized query. |
### P2 - Should Fix
| Finding | Suggested Fix |
|---------|---------------|
### P3 - Consider
| Finding | Suggested Fix |
|---------|---------------|
For each finding, assess confidence:
Only P1 findings with High confidence should block merge.
| Signal Type | Confidence | Include In Review? | |-------------|-----------|-------------------| | Verified by running code/test | High | Always | | LSP diagnostic (error/warning from language server) | High | Always — language server has full project context | | LSP find-references (verified all callers handled) | High | Always for P1/P2 — semantic, not text-based | | Verified by reading code path | Medium | Always for P1/P2 | | Pattern-match only (looks like a bug) | Low | Only if P1, flag as "needs investigation" | | Style preference | N/A | Only as P3, never blocks merge |
Noise filter: If a finding cannot be explained with a file:line citation and a concrete scenario where it causes harm, it is noise. Drop it.
When reviewing, recognize improve: commits as legitimate Boy Scout cleanup:
improve: commits that pass the proximity test (file already modified, self-evidently correct, <10 lines, no API change, no explanation needed)Check review history to understand cycle count:
Parse FLOW_REVIEW_CYCLE and FLOW_RESOLUTION_CYCLE markers from prior PR comments to build cycle context:
REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
# Parse prior review findings (from review bodies)
gh api repos/$REPO/pulls/$PR_NUM/reviews --jq '
[.[] | select(.body | test("FLOW_REVIEW_CYCLE")) | {
cycle: (.body | capture("FLOW_REVIEW_CYCLE:(?<n>[0-9]+)") | .n),
findings: (.body | capture("FINDINGS:\\[(?<f>[^\\]]+)\\]") | .f)
}]'
# Parse prior resolution outcomes (from issue comments posted via gh pr comment)
gh api repos/$REPO/issues/$PR_NUM/comments --jq '
[.[] | select(.body | test("FLOW_RESOLUTION_CYCLE")) | {
cycle: (.body | capture("FLOW_RESOLUTION_CYCLE:(?<n>[0-9]+)") | .n),
resolved: (.body | capture("RESOLVED:\\[(?<r>[^\\]]*?)\\]") | .r),
escalated: (.body | capture("ESCALATED:\\[(?<e>[^\\]]*?)\\]") | .e)
}]'
Cross-reference for each prior finding:
git diff?### Previous Feedback Status
| Cycle | Finding | Priority | Claimed Status | Verified |
|-------|---------|----------|----------------|----------|
If a finding was claimed resolved but the code at that location is unchanged, flag it as "Not verified — code unchanged".
improve: commits in already-modified files are NOT out-of-context)| Findings | Decision | |----------|----------| | P1 findings (any) | REQUEST_CHANGES | | P2 findings (any) | REQUEST_CHANGES | | P3 findings only | COMMENT (fix-expected — author must fix in-PR; P3 is not a free pass) | | No findings | APPROVE |
Note: P3 → COMMENT is NOT "approve with nits." The PR author is expected to fix every P3 in-PR. Finding triage is NEVER a valid escalation trigger (see skills/llm-operator-principles/SKILL.md and references/escalation-format.md) — reviewers should not approve PRs with unaddressed P3s, and authors should not file escalations to ask whether to fix them.
When agent teams are enabled, use adversarial synthesis from team-coordination skill (skills/team-coordination/SKILL.md). Reviewers work independently, share findings, challenge each other, and disputed findings escalate to human.
| Excuse | Response | |--------|----------| | "It looks correct to me" | Looking is not verifying. Trace the data flow. | | "This is just a style issue" | Then it's P3 at most. Don't flag it as P2. | | "I don't have time for all 6 facets" | Then prioritize: Security > Correctness > the rest. Never skip security. | | "The tests pass so the logic is fine" | Tests prove what's tested. Review proves what's not. | | "This is too small to review thoroughly" | Small changes, same process. Small bugs cause big outages. |
tools
Validate a FlowWorkflow YAML at `plugins/flow/workflows/<id>.workflow.yaml` against `schemas/v1/workflow.schema.json` AND cross-reference the referenced skills/agents exist + every Tier 3 action is confirm-gated + no native /goal or /loop dependency is declared. Use when /flow:workflow validate is invoked, when CI runs the workflow schema gates, or when a new workflow is being authored. This skill MUST be consulted because schema validation alone catches shape errors; cross-reference validation catches the silent-correctness failures (typo'd skill name, Tier 3 escape, /goal dependency) that would otherwise ship to users.
tools
Verify UI-facing changes by running a screenshot-analyze-verify loop across configured viewports, with a browser-tool priority cascade (Playwright MCP → Chrome DevTools MCP → CLI fallback → external skill fallback) and bounded iteration. Use after build/runtime verification passes and the diff includes `.tsx`/`.jsx`/`.vue`/`.html`/`.css`/`.scss`/`.svelte` files OR the acceptance criteria mention UI/page/render/display/visual. This skill MUST be consulted because UI changes that pass build and unit tests can still ship blank pages, render-blocking console errors, or broken responsive layouts that no other verification phase catches.
data-ai
Coordinate agent teams for adversarial review (paired skeptic/verifier per facet, challenge round with disposition vocabulary, consolidated findings with confidence) or parallel implementation (task sizing 5-6 per teammate, non-overlapping files). Enforces independent analysis before shared conclusions. Reference only (`disable-model-invocation: true`); loaded only when `agentTeams: true` in settings.
development
Enforce FlowTrigger safety rules — no autonomous merge, no recursive trigger creation, max active triggers, allowed_actions / forbidden_actions ACLs. Validates trigger YAMLs at `.flow/triggers/*.trigger.yaml` against `schemas/v1/trigger.schema.json` AND cross-checks policy.forbidden_actions includes merge + release; refuses triggers that grant Tier 3 autonomy. Use when /flow:trigger create, /flow:trigger run, or /flow:watch is invoked. This skill MUST be consulted because triggers can fire without user supervision — a trigger granting merge autonomy is the single fastest path to an untrusted-merge incident, and recursive trigger creation is the loop-bomb shape of the runtime layer.