Ql review
Part of the quantum-loop autonomous development pipeline (brainstorm \u2192 spec \u2192 plan \u2192 execute \u2192 review \u2192 verify). Two-stage code review. Spec compliance first, then code quality. Use after implementation or before merge. Triggers on: review code, code review, check implementation, ql-review.From its SKILL.md
npx -y skills add andyzengmath/quantum-loop --skill ql-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 24 stars24 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.
- runs commandsInstructs the agent to run 3 commands, including `git merge-base HEAD main` and 2 more.
SKILL.md
6.5 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it
Quantum-Loop: Review
You orchestrate a two-stage code review. Stage 1 (spec compliance) MUST pass before Stage 2 (code quality) begins. This order is absolute.
Why Two Stages?
Code that doesn't match the spec is waste -- no matter how well-written. Checking spec compliance first prevents spending review effort on code that needs to be rewritten anyway.
Usage Modes
Mode 1: Within /quantum-loop:execute (automated)
Called automatically by the execution loop after a story's quality checks pass. Receives story context from quantum.json.
Mode 2: Standalone (user-invoked)
User invokes /quantum-loop:review directly to review recent changes.
Standalone Workflow
Step 1: Determine Review Scope
If the user specifies a story ID, use it. Otherwise:
- Check for
quantum.json-- if exists, identify the most recentin_progressstory - If no quantum.json, use the current branch's diff from main/master:
git merge-base HEAD main
Determine BASE_SHA and HEAD_SHA for the review range.
Step 2: Identify the Spec
- If quantum.json exists: read the PRD path and story acceptance criteria
- If no quantum.json: ask the user what requirements this code should meet
- If no spec exists at all: skip Stage 1, proceed directly to Stage 2 with a warning
Step 3: Stage 1 -- Spec Compliance Review
Dispatch the spec-reviewer agent with:
- STORY_ID
- PRD_PATH
- BASE_SHA
- HEAD_SHA
Wait for the review result.
If Stage 1 PASSES:
- Log result to quantum.json (if available)
- Proceed to Stage 2
If Stage 1 FAILS:
- Present the issues to the user (or to the execution loop)
- List every unsatisfied acceptance criterion with evidence
- Do NOT proceed to Stage 2
- If within /quantum-loop:execute: return failure with issues list
Step 4: Stage 2 -- Code Quality Review
Only reached if Stage 1 passed.
Dispatch the quality-reviewer agent with:
- STORY_ID
- BASE_SHA
- HEAD_SHA
- DESCRIPTION (brief summary of what was implemented)
Wait for the review result.
If Stage 2 PASSES:
- Log result to quantum.json (if available)
- Report success
If Stage 2 FAILS:
- Present categorized issues (Critical / Important / Minor)
- Critical issues must be fixed
- 3+ Important issues must be fixed
- Minor issues are noted but don't block
Handling Review Feedback
Within /quantum-loop:execute (automated)
- If review fails, the implementer gets ONE attempt to fix the issues
- After fixing, both review stages run again from scratch
- If second attempt also fails, story is marked as failed
Standalone (user-invoked)
- Present the full review report
- User decides which issues to fix
- User can re-invoke
/quantum-loop:reviewafter fixing
Output Format
Present the combined review report:
## Review Report: [Story ID or Branch Name]
### Stage 1: Spec Compliance
**Status:** PASSED / FAILED
[If failed: list unsatisfied criteria]
[If passed: "All N acceptance criteria satisfied."]
### Stage 2: Code Quality
**Status:** PASSED / FAILED / SKIPPED (if Stage 1 failed)
**Strengths:**
- [List from quality reviewer]
**Issues:**
- [Critical] [description] -- [file:line]
- [Important] [description] -- [file:line]
- [Minor] [description] -- [file:line]
### Recommendation
[Pass / Fix and re-review / specific guidance]
Stage 3: Cross-Story Integration Review
This stage runs when:
- All stories in a dependency chain have passed Stages 1 and 2
- OR when all stories are complete (final gate before COMPLETE)
- OR when explicitly invoked:
/quantum-loop:ql-review --integration
Checks (use LSP tools when available, fall back to grep)
-
Call chain tracing: For every function created by an upstream story, verify it is called (not just imported) in downstream stories.
- PREFERRED: LSP "Find References" — returns only actual call sites
- FALLBACK:
grep -rn "function_name" --include="*.py" | grep -v test - Must appear in at least one non-test call site outside its defining file
-
Type consistency: Check that return types from upstream stories match parameter types expected downstream.
- PREFERRED: LSP "Hover" on call sites to verify argument types
- FALLBACK: Read source of caller and callee, compare manually
- Flag: list-vs-string, Optional-vs-required, scalar-vs-collection mismatches
-
Dead code scan: Every new export must have a caller outside its own file and tests.
- PREFERRED: LSP "Find References" returns 0 results = dead code
- FALLBACK: grep for function name, exclude test files
-
Import resolution: Verify every import statement resolves to an actual file/module.
- PREFERRED: LSP diagnostics for "unresolved import" errors (instant)
- FALLBACK:
python -c "import main_module"or equivalent runtime test
On Integration Failure
- List specific unwired functions and type mismatches
- Suggest the exact wiring fix (which file, which line, what call to add)
- The orchestrator or user implements the fix
Output Format (Stage 3)
### Stage 3: Cross-Story Integration
**Status:** PASSED / FAILED
**Call chains verified:**
- US-007 validate_plan_item() → called in pipeline.py:45 ✓
- US-008 generate_stage2() → called in pipeline.py:78 ✓
**Unwired functions:**
- US-007 validate_plan_item() → NOT called in any pipeline code ✗
Fix: Add `validated = validate_plan_item(item, schema)` to pipeline.py:52
**Type mismatches:**
- US-009 returns List[str] but US-013 expects JSON string at pipeline.py:90
Anti-Rationalization Guards
| Excuse | Reality |
|---|---|
| "Skip Stage 1, the code clearly matches the spec" | You don't know until you check systematically. Run Stage 1. |
| "Skip Stage 2, it's a small change" | Small changes are where subtle bugs hide. Run Stage 2. |
| "Run both stages in parallel to save time" | Stage 2 is wasted effort if Stage 1 fails. Sequential is correct. |
| "The Critical issue isn't really critical" | If it's security, data loss, or crashes, it's Critical. Period. |
| "Three Important issues is harsh" | Quality compounds. Three Important issues signal a pattern problem. |
| "The reviewer is wrong" | Verify their claim against the code. If they're wrong, explain why with evidence. Don't dismiss. |
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most quality gates skills give in ~1.5k tokens
Counted across 1,524 of the 2,830 authors here whose files we hold, read 2026-09-06
- Read full output and check exit codein 45 of 1524, across 40 files
- Verify output confirms the claimin 44 of 1524, across 39 files
- Identify the command that proves the claimin 43 of 1524, across 39 files
- Execute the full verification commandin 36 of 1524, across 30 files
- Produce a verification reportin 34 of 1524, across 18 files
- Review git diff changesin 30 of 1524, across 16 files
- Fix build failures immediatelyin 29 of 1524, across 9 files
- Group findings by severityin 28 of 1524
- State claim only with evidencein 27 of 1524, across 22 files
- Verify regression tests with red-green cyclein 26 of 1524, across 22 files
- Run the full test suitein 26 of 1524, across 25 files
- Run test suite with coveragein 25 of 1524, across 10 files
Said here and by no other author read
- Run spec compliance review before code quality review
- Determine review scope using story ID or branch diff
- Dispatch spec-reviewer agent with story and path details
- Dispatch quality-reviewer agent after spec compliance passes
- Fix critical issues and three or more important issues
- Run integration review for dependency chains or final completion
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.