review-logic
Skill0 starsChanged 5 months agoMITView on GitHub
Use when: reviewing code for logic correctness, algorithmic bugs, missing error handling, async/await mistakes, null/undefined risks, race conditions, type contract violations, or spec compliance. Dispatched by review-orchestrator for --frontend, --backend, and --all. Also invoked directly: "review logic", "check correctness", "are there any bugs here". NOT for: security vulnerabilities, performance profiling, style/naming preferences, or architectural pattern concerns — those belong in their respective specialized reviewers.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- autodoc-analystSkill
- autodoc-architectSkill
- autodoc-assemblerSkill
- autodoc-orchestratorSkill
- autodoc-scannerSkill
- autodoc-writerSkill
- brainstormSkill
- brd-creatorSkill
- caveman-modeSkill
- changelogSkill
- claude-md-managementSkill
- code-ai-reviewSkill
- code-boss-reviewSkill
- code-mobx-store-reviewSkill
- code-reviewSkill
- code-style-reviewSkill
- code-verifierSkill
- commitSkill
- constraint-driven-developmentSkill
- context-collectorSkill
- db-migrateSkill
- dependency-updateSkill
- deploySkill
- doubt-driven-developmentSkill
- feature-analyzerSkill
- feature-devSkill
- fsd-creatorSkill
- gproject-consistency-checkerSkill
- gproject-discoverySkill
- gproject-orchestratorSkill
- gproject-patterns-researcherSkill
- gproject-plannerSkill
- gproject-problem-definerSkill
- gproject-spec-writerSkill
- gproject-stack-advisorSkill
- hookifySkill
- iagoSkill
- interviewerSkill
- interviewSkill
- issue-analyzerSkill
- job-documenterSkill
- job-orchestratorSkill
- perf-checkSkill
- plan-gatekeeperSkill
- prd-creatorSkill
- pr-issue-documenterSkill
- pr-review-commentsSkill
- prSkill
- pushSkill
- review-architectureSkill
- review-backendSkill
- review-clean-codeSkill
- review-core-boundariesSkill
- review-flow-graphSkill
- review-frontend-conventionsSkill
- review-frontendSkill
- review-greptileSkill
- review-highloadSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Every finding must describe an observable, reproducible defect or a spec gap.
- Very specific: line 69
Run the script to determine BASE_SHA, then collect the diff:
- Distinctive: line 83
Do not review unrelated files.
- Very specific: line 177
When dispatched by review-orchestrator, follow the provided reviewer-input.schema.json payload.
- Very specific: line 208
Every blocker MUST include a concrete reproduction scenario or a spec reference.
- Distinctive: line 209
NEVER flag a style preference (naming, formatting) as a logic bug.
- Very specific: line 210
If in doubt between major and blocker, use major — overstating severity loses credibility.
- Very specific: line 272
When dispatched by review-orchestrator or job-orchestrator, the prompt MAY include:
- Distinctive: line 279
If provided and the file exists, read the context document before the spec compliance gate.
- Distinctive: line 285
If absent, proceed normally — context is optional and non-blocking.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Review Logic
Specialized reviewer for logic correctness and algorithmic soundness.
Inherits from the original code-ai-review + code-boss-review correctness phases
and unifies them into a single focused pass.
This reviewer does not care about formatting, naming, or architecture opinions. Every finding must describe an observable, reproducible defect or a spec gap.
Workflow
Logic Review Progress:
- [ ] Step 1: Read Job Context (if provided)
- [ ] Step 2: Determine git scope (merge-base)
- [ ] Step 3: Collect diff
- [ ] Step 4: Stage 1 — Spec compliance check (if issue/task provided)
- [ ] Step 5: Scan for logic bugs and type contract violations
- [ ] Step 6: Scan for async/race conditions and error handling gaps
- [ ] Step 7: Scan for null/undefined/optional chaining risks
- [ ] Step 8: Scan for edge cases and incorrect algorithm assumptions
- [ ] Step 9: Emit findings in unified formatInput Contract
| Field | Type | Required | Description |
branch | string | no | Branch to review. Defaults to current branch. |
commit_range | string | no | Explicit hash or range. Overrides merge-base detection. |
issue_url | string | no | GitHub issue or task URL. Required for Stage 1 spec compliance gate. |
context_doc | string | no | Path to job context document. |
Scope Detection
See shared script: skills/shared/git-merge-base.md
Run the script to determine BASE_SHA, then collect the diff:
# Committed + local changes (default mode)
git diff --name-status "${BASE_SHA}"
git diff "${BASE_SHA}"
git ls-files --others --exclude-standard
# Committed only (explicit range mode)
git diff --name-status <FROM>..<TO>
git diff <FROM>..<TO>Review scope: changes introduced in the current branch since merge-base only. Do not review unrelated files.
Stage 1 — Spec Compliance (run first when issue/task is provided)
ALWAYS check spec compliance before any quality pass.
- Fetch requirements from
issue_urlorcontext_doc. - For each acceptance criterion, verify it is addressed in the diff.
- Emit an
[F-NNN]finding withseverity: blockerfor every unimplemented criterion. - Record "spec gap" findings separately — they are always blockers.
- Proceed to quality pass regardless of spec gaps found.
Focus Areas and Checklist
Logic Bugs
- Conditions evaluated in wrong order or with wrong operator (
&&/||swap) - Off-by-one errors in loops, slice indices, pagination
- Mutating data that should be immutable (unexpected aliasing)
- Wrong return value (returns before setting state, returns old value)
- Incorrect boolean logic (double negation, De Morgan's law violations)
- Unreachable branches or dead code that hides a bug
Null / Undefined / Optional Chaining
- Accessing property on value that can be
nullorundefinedwithout guard - Optional chaining
?.used where non-null is guaranteed (masking a real missing check) - Non-null assertion
!used without justification - Array index access without bounds check
JSON.parsewithout try/catch on untrusted input
Async / Concurrency
- Missing
awaiton async call — result is aPromise, not the value awaitinside a non-async function (syntax error or no-op)- Parallel async calls that should be sequential (shared mutable state)
- Sequential
awaitcalls that could bePromise.all(performance is a secondary concern here; flag when correctness is affected by ordering assumption) - Race conditions: state updated in one branch before a concurrent operation resolves
- Unhandled promise rejection (no
.catch, notry/catch, noPromise.allSettled) setTimeout/setIntervalwith shared state and no cleanup
Error Handling
- Swallowed
catchblocks (catches error, does nothing) - Error rethrown as generic string, losing stack trace
- Missing error boundary in UI component tree
- HTTP errors not checked (
response.okignored) - Partial success treated as full success (only first item processed, error on rest silently dropped)
Type Contract Violations
- Function called with wrong argument type (widened or narrowed incorrectly)
- Return type of function does not match declared signature
- Type cast (
as X) that hides a genuine mismatch - Generic type parameter inferred as
unknownoranysilently - Interface implementation missing required property
Algorithm Assumptions
- Sort stability assumed but not guaranteed by runtime
- Hash map iteration order assumed to be insertion order
- Float equality comparison (
=== 0.1 + 0.2) - String comparison used for numeric ordering
- Regex without anchors applied to untrusted multi-line input
Edge Cases
- Empty array / empty string not handled
- Single-element collection treated differently from multi-element
- Timezone / locale-sensitive date comparison without normalization
- Large number overflow (safe integer boundary)
- Concurrent execution with zero items (division by count)
Scope Boundaries
| Concern | This skill | Use instead |
| Logic bugs, type contracts, async errors, null safety | YES | — |
| Security vulnerabilities (injection, auth bypass, secrets) | NO | review-security-code |
| Performance profiling (bundle size, query cost, render cycles) | NO | review-performance |
| Style, naming, import organization | NO | review-style |
| Layer violations, SOLID, module coupling | NO | review-architecture |
| React/MobX-specific store patterns | NO | code-mobx-store-review |
Orchestrated Review Contract
When dispatched by review-orchestrator, follow the provided reviewer-input.schema.json payload. Return a REVIEW_RESULT object compatible with skills/review-orchestrator/reviewer-finding.schema.json, then a concise markdown summary. Keep findings evidence-based, include concrete suggested_fix for every blocker/major, and return NEEDS_CONTEXT instead of guessing when required context is missing.
Finding Format
### [F-NNN] Title
- **Severity**: blocker | major | minor | info
- **File**: path/to/file.ts:line
- **Problem**: what is wrong
- **Why it matters**: impact (data corruption / crash / silent wrong result / spec gap)
- **Fix**: concrete suggestion
- **Patch** (optional):
```diff
- old line
+ new line
Severity guide for this reviewer:
| Severity | When to use |
|----------|------------|
| `blocker` | Crash, data corruption, unimplemented acceptance criterion, unhandled promise rejection in critical path |
| `major` | Silent wrong result, race condition, swallowed error, type contract broken |
| `minor` | Edge case not handled but unlikely in practice, non-null assertion without comment |
| `info` | Suggestion to make code more defensive, no current observable defect |
Iron laws:
- Every `blocker` MUST include a concrete reproduction scenario or a spec reference.
- NEVER flag a style preference (naming, formatting) as a logic bug.
- If in doubt between `major` and `blocker`, use `major` — overstating severity loses credibility.
---
## Output Contract
STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
| Status | Meaning |
|--------|---------|
| `DONE` | No blockers or majors found; diff is logically sound |
| `DONE_WITH_CONCERNS` | One or more blocker or major findings present |
| `NEEDS_CONTEXT` | Spec or business logic is ambiguous; reviewer cannot determine correctness without clarification |
| `BLOCKED` | Cannot access diff or required files |
```markdown
## Logic Review
### Review Scope
- Branch: `<BRANCH>`
- Parent ref: `<PARENT>`
- Merge-base: `<BASE_SHA>`
- Scope mode: `<default-with-uncommitted | explicit-hash-range>`
- Spec compliance gate: <ran | skipped — no issue/task provided>
### Summary
<2-3 sentences: what changed, overall correctness verdict.>
### Stats
- blocker: N | major: N | minor: N | info: N
### Spec Gaps (blocker)
<[F-NNN] findings for unimplemented acceptance criteria, or "None detected.">
### Logic Bugs
<[F-NNN] findings or "None detected.">
### Async & Concurrency
<[F-NNN] findings or "None detected.">
### Error Handling
<[F-NNN] findings or "None detected.">
### Null / Undefined Safety
<[F-NNN] findings or "None detected.">
### Type Contract Violations
<[F-NNN] findings or "None detected.">
### Edge Cases
<[F-NNN] findings or "None detected.">
### Suggested Patches
<Minimal unified diffs for straightforward fixes. Omit if no patch is warranted.>Job Context Awareness
When dispatched by review-orchestrator or job-orchestrator, the prompt MAY include:
JOB_NAME: <job-name>
CONTEXT_PATH: <JOBS_ROOT>/<job-name>/ai/context.mdIf provided and the file exists, read the context document before the spec compliance gate. Use it to:
- Understand intentional design decisions (do not flag correct library usage)
- Identify acceptance criteria if no
issue_urlis provided - Calibrate severity for edge cases the team has explicitly accepted
If absent, proceed normally — context is optional and non-blocking.
Red Flags
| Rationalization | Why it is wrong |
| "This style choice looks suspicious, so I'll flag it as a logic bug" | Style is not logic; keep concerns separated by domain |
| "I see a potential security issue" | Security belongs in review-security-code; note it as info and defer |
| "The spec is unclear so I'll skip the gate" | Unclear spec → NEEDS_CONTEXT status + ask for clarification |
| "I'll mark everything blocker to be safe" | Overstated severity makes reports unactionable; calibrate per the severity guide |
| "Async performance is slow, so that's a logic bug" | Performance lives in review-performance unless incorrect ordering changes the result |
| "I didn't reproduce the bug so I won't report it" | Every blocker needs a scenario, not a repro — describe the failing code path |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

