/quantum-loop:ql-housekeepfrom quantum-loop
Detects repo-hygiene issues from long-running autonomous development: merge-conflict markers, orphan worktrees, CPC-variant duplicates, stale branches, and version-manifest drift. Reports findings without modifying anything.
Ships in quantum-loop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ql-housekeep surfaces the hygiene failures that accumulate when an autonomous development pipeline runs for weeks without human sweep. It is a detector, not an actuator. Auto-fix is explicitly out of scope.
This skill exists because idea-stage/AUDIT_QL.md catalogued eight categories of hygiene failure on master. The first job of the next pipeline iteration is to not produce that state again.
/ql-brainstorm cycle on a repo that has been running parallel execution for weeks.ql-execute between waves if you suspect accumulated drift.Pattern: ^<<<<<<< or ^=======$ or ^>>>>>>>. These are the signature of an abandoned git merge that was committed without resolution.
Note: the ^=======$ pattern can theoretically false-positive on Markdown setext-heading underlines (e.g., a heading followed by exactly seven = chars at column 1). In practice this is rare, and the <<<<<<< + >>>>>>> siblings are required for a real conflict block, so false positives are self-limiting.
Command:
grep -rn --include='*.md' --include='*.sh' --include='*.ts' --include='*.js' \
--include='*.py' --include='*.json' --include='*.yml' --include='*.yaml' \
-E '^<<<<<<<|^=======$|^>>>>>>>' .
Directories under .claude/worktrees/agent-* or .ql-wt/<story-id>/ that git no longer tracks.
Command:
for d in .claude/worktrees/agent-* .ql-wt/*; do
[ -d "$d" ] || continue
git worktree list | grep -q "$d" || echo "$d"
done
Pattern: files matching *-CPC-andyz-ZH84K.*. These are OneDrive-renamed copies that indicate a parallel-hardening fork. If detected, the project likely has two pipelines coexisting — see idea-stage/AUDIT_QL.md for promotion protocol.
Command:
find . -path ./node_modules -prune -o -name '*-CPC-andyz-*' -print
Files whose header docstring says "supersedes X" where X still exists. Currently catches:
lib/crash-recovery.sh (superseded by lib/resilience.sh:3)Command (case-insensitive Supersedes / supersedes):
for f in lib/*.sh; do
sup=$(grep -oiE 'supersedes lib/[a-z_-]+\.sh' "$f" 2>/dev/null | head -1 | awk '{print $NF}')
[ -n "$sup" ] && [ -f "$sup" ] && echo "DEAD: $sup (superseded by $f)"
done
worktree-agent-* branches that are no longer referenced by any live worktree.ql/* and fix/* branches whose tip commits are strict ancestors of master OR have been inactive > 90 days.Command:
git branch -a --format='%(refname:short) %(committerdate:short) %(upstream:track)' \
| awk '$1 ~ /^(ql|fix|worktree-agent)/' \
| sort -k2
.claude-plugin/plugin.json.version must match .claude-plugin/marketplace.json.version and must have a corresponding entry in CHANGELOG.md.
Command:
plugin_v=$(jq -r .version .claude-plugin/plugin.json 2>/dev/null)
market_v=$(jq -r '.plugins[0].version // .version' .claude-plugin/marketplace.json 2>/dev/null)
[ "$plugin_v" = "$market_v" ] || echo "version mismatch: plugin=$plugin_v market=$market_v"
grep -q "^## \[$plugin_v\]" CHANGELOG.md 2>/dev/null || echo "CHANGELOG missing entry for v$plugin_v"
quantum.jsonquantum.json.updatedAt older than 30 days with the project in active development suggests the team isn't dogfooding.
Command (cross-platform: GNU date, macOS date, Git Bash):
last=$(jq -r '.updatedAt // empty' quantum.json 2>/dev/null)
if [ -n "$last" ]; then
# Portable ISO-8601 → epoch via python3 (GNU date -d is not on macOS/BSD)
age_days=$(python3 -c "
import datetime,sys
t = datetime.datetime.fromisoformat('$last'.replace('Z', '+00:00'))
now = datetime.datetime.now(datetime.timezone.utc)
print(int((now - t).total_seconds() // 86400))
" 2>/dev/null)
[ -n "$age_days" ] && [ "$age_days" -gt 30 ] && echo "quantum.json not updated in $age_days days"
fi
Fallback when python3 is unavailable: compare $last lexicographically against a pre-computed $threshold = "$(TZ=UTC date -u +%Y-%m-%d)" minus 30 days (date-string compare works because ISO-8601 is lexicographic-sortable); implementer should prefer python3.
Pattern: two test files whose paths differ only by a suffix that indicates a fork (-CPC-*, .bak, .old, copy).
Command:
find tests -type f -name '*.sh' \
| sed -E 's/(-CPC-[^/]+|\.bak|\.old| copy)?\.sh$//' \
| sort | uniq -d
| The agent says… | The truth is… |
|---|---|
| "These orphan worktrees must be live runs" | Live worktrees appear in git worktree list. If they don't, they're orphans. |
| "Deleting the CPC-variant could lose work" | That's why this skill does NOT delete. It REPORTS. Promotion is a separate user-confirmed action (see docs/plans/2026-04-21-p0-consolidation-design.md). |
| "The merge-conflict markers are inside a docstring example" | Then they wouldn't pass lint or test. The code is not doing conditional-skip. |
| "The supersedes comment is ambiguous" | Read the file, confirm, then report. Never silently swallow detection. |
| "CHANGELOG is a nice-to-have" | Users rely on CHANGELOG to know what changed between versions. An empty CHANGELOG means the team has abandoned the compact with downstream. |
The skill produces a structured report to stdout. No flags required.
# In Claude Code:
/quantum-loop:ql-housekeep
The skill will:
findings[] JSON block at the end.Fixes are the user's job, potentially driven by the consolidation design in docs/plans/2026-04-21-p0-consolidation-design.md.
{
"timestamp": "<ISO 8601>",
"branch": "<current branch>",
"summary": {
"conflict_markers": 0,
"orphan_worktrees": 0,
"cpc_variants": 0,
"superseded_files": 0,
"stale_branches": 0,
"version_drift": false,
"stale_quantum_json": false,
"duplicate_test_files": 0
},
"findings": [
{
"category": "conflict_markers",
"severity": "high",
"file": "README.md",
"lines": [368, 372, 399],
"detail": "<content snippet>"
}
],
"recommended_next_steps": [
"Review idea-stage/AUDIT_QL.md before taking action",
"Do not delete anything without user confirmation",
"See docs/plans/2026-04-21-p0-consolidation-design.md for a full consolidation protocol"
]
}
ql-brainstorm: Reads prior ql-housekeep output to warn about hygiene before inviting new design work.ql-execute: Between waves, runs ql-housekeep as a lightweight check; warns user but does not auto-fix.ql-review: Post-merge review phase inspects whether the merge introduced any of categories 1, 3, 4, 8.agents/duplication-detector.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/ql-brainstormPart of the quantum-loop autonomous development pipeline (brainstorm → spec → plan → execute → review → verify). Deep Socratic exploration of a feature idea before implementation. Asks questions one at a time, proposes 2-3 alternative approaches with trade-offs, presents design section-by-section for approval, and saves an approved design document. Use when starting a new feature, exploring an idea, or before writing a spec. Triggers on: brainstorm, explore idea, design this, think through, ql-brainstorm./ql-deep-reviewMulti-perspective post-implementation review aggregator for quantum-loop. Invokes 2-7 reviewer agents in parallel based on risk score, applies actionability filter, dedups, aggregates with evidence requirements. Use AFTER the per-story two-stage review gates pass and before merging a whole-feature PR to master. Complements ql-review (per-story) with whole-feature review./ql-deslopPost-review AI-slop cleanup pass. After quality review approves a story/feature, scans only the changed files for: duplicate code, dead code, needless abstraction, boundary violations, missing tests. Proposes deletions with regression-test gate — rolls back on regression. Mandatory unless explicitly skipped via --no-deslop. Borrowed from OMC Ralph 7.5 + 7.6./ql-executePart of the quantum-loop autonomous development pipeline (brainstorm → spec → plan → execute → review → verify). Run the autonomous execution loop. Reads quantum.json, queries the dependency DAG, implements stories with TDD and two-stage review gates. Supports parallel execution via native worktree isolation. Use after /quantum-loop:plan has created quantum.json. Triggers on: execute, run loop, start building, ql-execute./ql-intent-checkIntent-drift audit for quantum-loop. Compares the user's original intent (immutable snapshot) against downstream artifacts (design.md → PRD → quantum.json ACs → implementation) to detect semantic divergence. Flags drift with file:line evidence. Use before merge or when specs feel "rewritten."/ql-planPart of the quantum-loop autonomous development pipeline (brainstorm → spec → plan → execute → review → verify). Convert a PRD into machine-readable quantum.json with dependency DAG, granular 2-5 minute tasks, and execution metadata. Use after creating a spec with /quantum-loop:spec. Triggers on: create plan, convert to json, plan tasks, generate quantum json, ql-plan.npx claudepluginhub andyzengmath/quantum-loop --plugin quantum-loopOther plugins' skills for the same job