ql-execute
Part of the quantum-loop autonomous development pipeline (brainstorm \u2192 spec \u2192 plan \u2192 execute \u2192 review \u2192 verify). Run the autonomous execution loop. Reads quantum.json, queries the dependency DAG, implements stories with TDD and two-stage review gates. Sup
What it does
Quantum-Loop: Execute
Run the autonomous execution loop to implement all stories in quantum.json.
Prerequisites
Before starting:
quantum.jsonmust exist (created by/quantum-loop:plan)- The project must be a git repository
- Project build tools must be available (npm, pip, cargo, etc.)
If prerequisites are not met, inform the user and stop.
Execution
Read and follow the orchestrator agent instructions in agents/orchestrator.md.
The orchestrator will:
- Read quantum.json state and validate the dependency DAG
- Query for eligible stories (pending/retriable with all dependencies passed)
- If 1 story eligible: execute it sequentially (implement, quality checks, review, commit)
- If 2+ stories eligible: spawn parallel implementer subagents in isolated worktrees
- Handle retries, cascade blocking, and error recovery
- Loop until all stories pass (COMPLETE) or no stories are executable (BLOCKED)
Autonomous CLI Alternative
For unattended execution outside Claude Code (Linux/Mac):
./quantum-loop.sh --max-iterations 20
./quantum-loop.sh --parallel --max-parallel 4
On Windows, use /ql-execute instead of the shell script for reliable execution.
Signals
| Signal | Meaning |
|---|---|
<quantum>COMPLETE</quantum> | All stories passed |
<quantum>BLOCKED</quantum> | No executable stories remain |
<quantum>STORY_PASSED</quantum> | One story completed (more remain) |
<quantum>STORY_FAILED</quantum> | One story failed (will retry if attempts remain) |
Post-review slop-cleanup hook (Phase 9 / P1.6)
After each story's two-stage review gate PASSES but BEFORE the merge to the feature branch, the orchestrator SHOULD invoke /quantum-loop:ql-deslop on the story's changed files. Opt-out via --no-deslop (record the reason in commit trailer Deslop: skipped | <reason>).
Mandatory safety rails, enforced by lib/deslop.sh:
validate_scope <file> BASE HEAD— rejects any edit to a file outside the story's diff. Prevents "adjacent cleanup" scope creep.take_baseline <before.json>— snapshots test / lint / typecheck exit codes.- Run ONE deslop pass at a time from the 4-pass taxonomy in
skills/ql-deslop/SKILL.md(dead-code → duplication → consistency → test-reinforcement). take_baseline <after.json>+compare_baseline before.json after.json. Any regression triggers:rollback_pass BASE <files>and emits<quantum>DESLOP_ROLLED_BACK</quantum>. The next pass does NOT start until the user inspects.- Persist per-pass report into
quantum.deslop[<story-id>].pass_<n>.
Language detection: bash lib/deslop.sh detect-language dispatches to the appropriate dead-code detector (knip / ts-prune / vulture / staticcheck / cargo-udeps). When tooling is missing, the step is skipped cleanly rather than failing the pipeline.
Post-pipeline review hook (Phase 8 / P1.1 + P1.2)
After COMPLETE fires, the orchestrator SHOULD invoke /quantum-loop:ql-deep-review before handing the merged branch back to the user. Opt-in via --deep-review (or mandatory when the feature's risk tier is HIGH / CRITICAL per lib/deep-review.sh compute_risk_score).
Gate steps:
- Run the wave-boundary checks on the final commit range (
BASE_SHA..HEAD_SHA):- Cross-story constant scan —
bash lib/wave-boundary.sh scan BASE HEADemits JSON findings for literals that canonicalize to the same key across ≥2 stories (e.g.'google'vs'google-api-key'; the Math-Research regression class). Gate viabash lib/wave-boundary.sh gate BASE HEAD— exit 0 = divergence found, exit 1 = clean. Non-empty findings are treated as amedium(2 variants) orhigh(3+ variants) severity input to the reviewer-set dispatch. - Wave-wide typecheck (
lib/resilience.shrun_typecheck). - Full test suite.
- Barrel + dep-manifest regeneration (
lib/barrel-regen.sh,lib/dep-manifest.sh).
- Cross-story constant scan —
- Compute risk tier:
bash lib/deep-review.sh score BASE HEAD→ thenbash lib/deep-review.sh tier <score>. - Dispatch the reviewer-set specified in
skills/ql-deep-review/SKILL.md §"Risk scoring". - Apply
lib/deep-review.sh actionability / dedup / hallucination / verdictin sequence to aggregate findings. - Persist the final review object into
quantum.reviews[<feature-id>].deepReview. - Verdicts:
BLOCKS_MERGE→ refuse handoff; emitSTORY_FAILEDwith blockers in the failureLog.REQUEST_CHANGES→ route to a targeted fix-story in the next wave.APPROVE_WITH_COMMENTS→ proceed but log comments intocodebasePatterns.APPROVE→ proceed cleanly.
For legacy pipelines that predate this hook, /quantum-loop:ql-deep-review can be invoked manually post-merge.
Capabilities
Install
Quality
deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 22 github stars · SKILL.md body (4,734 chars)