{"id":"14c0d4e5-74f4-46f7-a674-e4bb17917a56","shortId":"my3jf4","kind":"skill","title":"ql-review","tagline":"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 revi","description":"# Quantum-Loop: Review\n\nYou orchestrate a two-stage code review. Stage 1 (spec compliance) MUST pass before Stage 2 (code quality) begins. This order is absolute.\n\n## Why Two Stages?\n\nCode 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.\n\n## Usage Modes\n\n### Mode 1: Within /quantum-loop:execute (automated)\nCalled automatically by the execution loop after a story's quality checks pass.\nReceives story context from quantum.json.\n\n### Mode 2: Standalone (user-invoked)\nUser invokes `/quantum-loop:review` directly to review recent changes.\n\n## Standalone Workflow\n\n### Step 1: Determine Review Scope\n\nIf the user specifies a story ID, use it. Otherwise:\n\n1. Check for `quantum.json` -- if exists, identify the most recent `in_progress` story\n2. If no quantum.json, use the current branch's diff from main/master:\n   ```bash\n   git merge-base HEAD main\n   ```\n\nDetermine BASE_SHA and HEAD_SHA for the review range.\n\n### Step 2: Identify the Spec\n\n1. If quantum.json exists: read the PRD path and story acceptance criteria\n2. If no quantum.json: ask the user what requirements this code should meet\n3. If no spec exists at all: skip Stage 1, proceed directly to Stage 2 with a warning\n\n### Step 3: Stage 1 -- Spec Compliance Review\n\nDispatch the `spec-reviewer` agent with:\n- STORY_ID\n- PRD_PATH\n- BASE_SHA\n- HEAD_SHA\n\nWait for the review result.\n\n**If Stage 1 PASSES:**\n- Log result to quantum.json (if available)\n- Proceed to Stage 2\n\n**If Stage 1 FAILS:**\n- Present the issues to the user (or to the execution loop)\n- List every unsatisfied acceptance criterion with evidence\n- Do NOT proceed to Stage 2\n- If within /quantum-loop:execute: return failure with issues list\n\n### Step 4: Stage 2 -- Code Quality Review\n\nOnly reached if Stage 1 passed.\n\nDispatch the `quality-reviewer` agent with:\n- STORY_ID\n- BASE_SHA\n- HEAD_SHA\n- DESCRIPTION (brief summary of what was implemented)\n\nWait for the review result.\n\n**If Stage 2 PASSES:**\n- Log result to quantum.json (if available)\n- Report success\n\n**If Stage 2 FAILS:**\n- Present categorized issues (Critical / Important / Minor)\n- Critical issues must be fixed\n- 3+ Important issues must be fixed\n- Minor issues are noted but don't block\n\n## Handling Review Feedback\n\n### Within /quantum-loop:execute (automated)\n1. If review fails, the implementer gets ONE attempt to fix the issues\n2. After fixing, both review stages run again from scratch\n3. If second attempt also fails, story is marked as failed\n\n### Standalone (user-invoked)\n1. Present the full review report\n2. User decides which issues to fix\n3. User can re-invoke `/quantum-loop:review` after fixing\n\n## Output Format\n\nPresent the combined review report:\n\n```markdown\n## Review Report: [Story ID or Branch Name]\n\n### Stage 1: Spec Compliance\n**Status:** PASSED / FAILED\n\n[If failed: list unsatisfied criteria]\n[If passed: \"All N acceptance criteria satisfied.\"]\n\n### Stage 2: Code Quality\n**Status:** PASSED / FAILED / SKIPPED (if Stage 1 failed)\n\n**Strengths:**\n- [List from quality reviewer]\n\n**Issues:**\n- [Critical] [description] -- [file:line]\n- [Important] [description] -- [file:line]\n- [Minor] [description] -- [file:line]\n\n### Recommendation\n[Pass / Fix and re-review / specific guidance]\n```\n\n## Stage 3: Cross-Story Integration Review\n\nThis stage runs when:\n- All stories in a dependency chain have passed Stages 1 and 2\n- OR when all stories are complete (final gate before COMPLETE)\n- OR when explicitly invoked: `/quantum-loop:ql-review --integration`\n\n### Checks (use LSP tools when available, fall back to grep)\n\n1. **Call chain tracing:** For every function created by an upstream story, verify it is **called** (not just imported) in downstream stories.\n   - PREFERRED: LSP \"Find References\" — returns only actual call sites\n   - FALLBACK: `grep -rn \"function_name\" --include=\"*.py\" | grep -v test`\n   - Must appear in at least one non-test call site outside its defining file\n\n2. **Type consistency:** Check that return types from upstream stories match parameter types expected downstream.\n   - PREFERRED: LSP \"Hover\" on call sites to verify argument types\n   - FALLBACK: Read source of caller and callee, compare manually\n   - Flag: list-vs-string, Optional-vs-required, scalar-vs-collection mismatches\n\n3. **Dead code scan:** Every new export must have a caller outside its own file and tests.\n   - PREFERRED: LSP \"Find References\" returns 0 results = dead code\n   - FALLBACK: grep for function name, exclude test files\n\n4. **Import resolution:** Verify every import statement resolves to an actual file/module.\n   - PREFERRED: LSP diagnostics for \"unresolved import\" errors (instant)\n   - FALLBACK: `python -c \"import main_module\"` or equivalent runtime test\n\n### On Integration Failure\n- List specific unwired functions and type mismatches\n- Suggest the exact wiring fix (which file, which line, what call to add)\n- The orchestrator or user implements the fix\n\n### Output Format (Stage 3)\n```markdown\n### Stage 3: Cross-Story Integration\n**Status:** PASSED / FAILED\n\n**Call chains verified:**\n- US-007 validate_plan_item() → called in pipeline.py:45 ✓\n- US-008 generate_stage2() → called in pipeline.py:78 ✓\n\n**Unwired functions:**\n- US-007 validate_plan_item() → NOT called in any pipeline code ✗\n  Fix: Add `validated = validate_plan_item(item, schema)` to pipeline.py:52\n\n**Type mismatches:**\n- US-009 returns List[str] but US-013 expects JSON string at pipeline.py:90\n```\n\n## Anti-Rationalization Guards\n\n| Excuse | Reality |\n|--------|---------|\n| \"Skip Stage 1, the code clearly matches the spec\" | You don't know until you check systematically. Run Stage 1. |\n| \"Skip Stage 2, it's a small change\" | Small changes are where subtle bugs hide. Run Stage 2. |\n| \"Run both stages in parallel to save time\" | Stage 2 is wasted effort if Stage 1 fails. Sequential is correct. |\n| \"The Critical issue isn't really critical\" | If it's security, data loss, or crashes, it's Critical. Period. |\n| \"Three Important issues is harsh\" | Quality compounds. Three Important issues signal a pattern problem. |\n| \"The reviewer is wrong\" | Verify their claim against the code. If they're wrong, explain why with evidence. Don't dismiss. |","tags":["review","quantum","loop","andyzengmath","agent-skills","agentskills","claude-code","claude-code-plugin","claude-code-skill","skillsmp"],"capabilities":["skill","source-andyzengmath","skill-ql-review","topic-agent-skills","topic-agentskills","topic-claude-code","topic-claude-code-plugin","topic-claude-code-skill","topic-skillsmp"],"categories":["quantum-loop"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/andyzengmath/quantum-loop/ql-review","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add andyzengmath/quantum-loop","source_repo":"https://github.com/andyzengmath/quantum-loop","install_from":"skills.sh"}},"qualityScore":"0.461","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 22 github stars · SKILL.md body (6,285 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T13:02:29.442Z","embedding":null,"createdAt":"2026-04-18T23:04:47.147Z","updatedAt":"2026-04-24T13:02:29.442Z","lastSeenAt":"2026-04-24T13:02:29.442Z","tsv":"'-007':823,840 '-008':831 '-009':863 '-013':869 '/quantum-loop':114,143,328,418,478,592 '0':733 '1':60,112,153,167,214,248,260,286,300,346,421,459,498,526,575,607,883,900,934 '2':67,136,180,210,226,253,297,325,338,375,387,434,465,517,577,663,903,918,928 '3':239,258,400,444,472,556,711,808,811 '4':336,745 'absolut':74 'accept':224,316,513 'actual':635,755 'add':797,851 'agent':269,353 'also':448 'anti':876 'anti-ration':875 'anyway':108 'appear':649 'argument':686 'ask':230 'attempt':429,447 'autom':116,420 'automat':118 'autonom':10 'avail':293,382,602 'back':604 'base':196,200,275,357 'bash':192 'begin':70 'block':413 'brainstorm':13 'branch':187,495 'brief':362 'bug':914 'c':767 'call':117,608,622,636,657,682,795,819,827,834,845 'calle':694 'caller':692,721 'categor':390 'chain':571,609,820 'chang':149,908,910 'check':93,128,168,597,666,896 'claim':978 'clear':886 'code':27,33,44,45,57,68,78,102,236,339,518,713,736,849,885,981 'collect':709 'combin':486 'compar':695 'complet':583,587 'complianc':30,62,95,262,500 'compound':964 'consist':665 'context':132 'correct':938 'crash':953 'creat':614 'criteria':225,508,514 'criterion':317 'critic':392,395,534,940,945,956 'cross':558,813 'cross-stori':557,812 'current':186 'data':950 'dead':712,735 'decid':467 'defin':661 'depend':570 'descript':361,535,539,543 'determin':154,199 'develop':11 'diagnost':759 'diff':189 'direct':145,250 'dismiss':992 'dispatch':264,348 'doesn':80 'downstream':627,677 'effort':100,931 'equival':772 'error':763 'everi':314,612,715,749 'evid':319,989 'exact':787 'exclud':742 'excus':879 'execut':19,115,121,311,329,419 'exist':172,217,243 'expect':676,870 'explain':986 'explicit':590 'export':717 'fail':301,388,424,449,454,503,505,522,527,818,935 'failur':331,777 'fall':603 'fallback':638,688,737,765 'feedback':416 'file':536,540,544,662,725,744,791 'file/module':756 'final':584 'find':631,730 'first':31,96 'fix':399,405,431,436,471,481,548,789,804,850 'flag':697 'format':483,806 'full':462 'function':613,641,740,781,838 'gate':585 'generat':832 'get':427 'git':193 'grep':606,639,645,738 'guard':878 'guidanc':554 'handl':414 'harsh':962 'head':197,203,277,359 'hide':915 'hover':680 'id':163,272,356,493 'identifi':173,211 'implement':37,367,426,802 'import':393,401,538,625,746,750,762,768,959,966 'includ':643 'instant':764 'integr':560,596,776,815 'invok':140,142,458,477,591 'isn':942 'issu':304,333,391,396,402,407,433,469,533,941,960,967 'item':826,843,855,856 'json':871 'know':893 'least':652 'line':537,541,545,793 'list':313,334,506,529,699,778,865 'list-vs-str':698 'log':288,377 'loop':9,49,122,312 'loss':951 'lsp':599,630,679,729,758 'main':198,769 'main/master':191 'manual':696 'mark':452 'markdown':489,809 'match':82,673,887 'matter':88 'meet':238 'merg':40,195 'merge-bas':194 'minor':394,406,542 'mismatch':710,784,861 'mode':110,111,135 'modul':770 'must':63,397,403,648,718 'n':512 'name':496,642,741 'need':104 'new':716 'non':655 'non-test':654 'note':409 'one':428,653 'option':703 'optional-vs-requir':702 'orchestr':52,799 'order':72 'otherwis':166 'output':482,805 'outsid':659,722 'parallel':923 'paramet':674 'part':4 'pass':64,129,287,347,376,502,510,521,547,573,817 'path':221,274 'pattern':970 'period':957 'pipelin':12,848 'pipeline.py:45':829 'pipeline.py:52':859 'pipeline.py:78':836 'pipeline.py:90':874 'plan':17,825,842,854 'prd':220,273 'prefer':629,678,728,757 'present':302,389,460,484 'prevent':97 'problem':971 'proceed':249,294,322 'progress':178 'py':644 'python':766 'ql':2,594 'ql-review':1,593 'qualiti':34,69,127,340,351,519,531,963 'quality-review':350 'quantum':8,48 'quantum-loop':7,47 'quantum.json':134,170,183,216,229,291,380 'rang':208 'ration':877 're':476,551,984 're-invok':475 're-review':550 'reach':343 'read':218,689 'realiti':880 'realli':944 'receiv':130 'recent':148,176 'recommend':546 'refer':632,731 'report':383,464,488,491 'requir':234,705 'resolut':747 'resolv':752 'result':283,289,372,378,734 'return':330,633,668,732,864 'revi':46 'review':3,21,28,43,50,58,99,144,147,155,207,263,268,282,341,352,371,415,423,438,463,479,487,490,532,552,561,595,973 'rewritten':107 'rn':640 'run':440,564,898,916,919 'runtim':773 'satisfi':515 'save':925 'scalar':707 'scalar-vs-collect':706 'scan':714 'schema':857 'scope':156 'scratch':443 'second':446 'secur':949 'sequenti':936 'sha':201,204,276,278,358,360 'signal':968 'site':637,658,683 'skill' 'skill-ql-review' 'skip':246,523,881,901 'small':907,909 'sourc':690 'source-andyzengmath' 'spec':15,29,61,84,94,213,242,261,267,499,889 'spec-review':266 'specif':553,779 'specifi':160 'spend':98 'stage':26,56,59,66,77,247,252,259,285,296,299,324,337,345,374,386,439,497,516,525,555,563,574,807,810,882,899,902,917,921,927,933 'stage2':833 'standalon':137,150,455 'statement':751 'status':501,520,816 'step':152,209,257,335 'stori':125,131,162,179,223,271,355,450,492,559,567,581,618,628,672,814 'str':866 'strength':528 'string':701,872 'subtl':913 'success':384 'suggest':785 'summari':363 'systemat':897 'test':647,656,727,743,774 'three':958,965 'time':926 'tool':600 'topic-agent-skills' 'topic-agentskills' 'topic-claude-code' 'topic-claude-code-plugin' 'topic-claude-code-skill' 'topic-skillsmp' 'trace':610 'trigger':41 'two':25,55,76 'two-stag':24,54 'type':664,669,675,687,783,860 'u2192':14,16,18,20,22 'unresolv':761 'unsatisfi':315,507 'unwir':780,837 'upstream':617,671 'us':822,830,839,862,868 'usag':109 'use':35,164,184,598 'user':139,141,159,232,307,457,466,473,801 'user-invok':138,456 'v':646 'valid':824,841,852,853 'verifi':23,619,685,748,821,976 'vs':700,704,708 'wait':279,368 'warn':256 'wast':86,930 'well':91 'well-written':90 'wire':788 'within':113,327,417 'workflow':151 'written':92 'wrong':975,985","prices":[{"id":"397854f0-84ae-425a-9490-cad12b402ccc","listingId":"14c0d4e5-74f4-46f7-a674-e4bb17917a56","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"andyzengmath","category":"quantum-loop","install_from":"skills.sh"},"createdAt":"2026-04-18T23:04:47.147Z"}],"sources":[{"listingId":"14c0d4e5-74f4-46f7-a674-e4bb17917a56","source":"github","sourceId":"andyzengmath/quantum-loop/ql-review","sourceUrl":"https://github.com/andyzengmath/quantum-loop/tree/master/skills/ql-review","isPrimary":false,"firstSeenAt":"2026-04-18T23:04:47.147Z","lastSeenAt":"2026-04-24T13:02:29.442Z"}],"details":{"listingId":"14c0d4e5-74f4-46f7-a674-e4bb17917a56","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"andyzengmath","slug":"ql-review","github":{"repo":"andyzengmath/quantum-loop","stars":22,"topics":["agent-skills","agentskills","claude-code","claude-code-plugin","claude-code-skill","skillsmp"],"license":"mit","html_url":"https://github.com/andyzengmath/quantum-loop","pushed_at":"2026-04-24T12:53:22Z","description":"Spec-driven autonomous development loop for Claude Code. Combines structured PRD generation, dependency DAG execution, two-stage review gates, and Iron Law verification.","skill_md_sha":"2e38f72eb611958d7625910b1f1f0f6ed38edb45","skill_md_path":"skills/ql-review/SKILL.md","default_branch":"master","skill_tree_url":"https://github.com/andyzengmath/quantum-loop/tree/master/skills/ql-review"},"layout":"multi","source":"github","category":"quantum-loop","frontmatter":{"name":"ql-review","description":"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."},"skills_sh_url":"https://skills.sh/andyzengmath/quantum-loop/ql-review"},"updatedAt":"2026-04-24T13:02:29.442Z"}}