Guides garbage collection rules to fight codebase entropy: dead code detection, documentation staleness, convention drift, frequencies, enforcement, and auto-fixes per HARNESS.md.
npx claudepluginhub habitat-thinking/ai-literacy-superpowers --plugin ai-literacy-superpowersThis skill uses the workspace's default tool permissions.
Garbage collection in a harness context means periodic checks that fight
Scans codebase for architecture drift, outdated docs, low-quality code, and technical debt accumulation. Runs automated sensors, performs reasoning checks, fixes issues, and encodes constraints as hooks/checks. Trigger after 5+ tasks, repeated review failures, or user request.
Scans codebase to discover coding patterns, learns conventions (skip in future) and anti-patterns (always flag), and updates draft/guardrails.md. Supports workflow.md migration and pattern promotion.
Explains harness engineering framework for AI code quality: context engineering, architectural constraints, and garbage collection via living HARNESS.md documents.
Share bugs, ideas, or general feedback.
Garbage collection in a harness context means periodic checks that fight entropy — the slow drift that neither real-time hooks nor PR gates catch. Documentation goes stale, conventions erode, dead code accumulates, dependencies fall behind.
This is Boeckeler's third harness component: agents that run periodically to find inconsistencies and violations, actively fighting decay.
Every GC rule in HARNESS.md has five fields:
daily, weekly, or manualdeterministic or agenttrue (GC agent fixes it) or false (create an
issue instead)| Frequency | Use for |
|---|---|
| daily | Fast checks with high entropy rate (style drift in active codebases) |
| weekly | Most GC rules — documentation, dependencies, dead code |
| manual | Exploratory checks not yet calibrated for automation |
Start with weekly for most rules. Only move to daily if the entropy rate justifies the cost.
Auto-fix is safe when the fix is deterministic, local, verifiable, and reversible. It is not safe when the fix requires judgement, has ripple effects, cannot be verified, or is destructive.
For the full safety rubric and detailed examples, consult
references/gc-catalogue.md.
When auto-fix is true: The harness-gc agent applies the fix
directly (with user confirmation in interactive mode) and commits the
result.
When auto-fix is false: The agent creates a GitHub issue describing the finding, with file:line references and a suggested fix.
| Category | Examples | Typical frequency |
|---|---|---|
| Documentation entropy | Stale references, outdated versions | weekly |
| Convention drift | Naming violations, style drift | weekly |
| Dead code | Orphaned files, unused exports | weekly |
| Dependency entropy | Known CVEs, major version lag | weekly |
| Harness entropy | Missing tools, broken hooks | weekly |
| Architectural fitness | Layer violations, coupling trends, complexity hotspots | weekly |
| Learning-driven | Reflection regression detection, assessment gap analysis | weekly |
| Memory entropy | Stale reflections, duplicate entries, contradicted memory | weekly |
For a full catalogue of GC patterns with HARNESS.md entry examples,
consult references/gc-catalogue.md.
Fitness functions are GC rules that measure architectural properties rather than fighting entropy in individual files. Where documentation staleness or dead code checks look at the state of specific files, fitness functions assess system-wide properties: layer boundaries, coupling trends, complexity hotspots.
The concept comes from Ford, Parsons, Kua & Sadalage's Building Evolutionary Architectures. Architecture degrades through accumulated small violations that no single constraint catches. Fitness functions detect the accumulation on a weekly cadence.
For the full framework, tool catalogue, and guidance on writing fitness
function GC rules, consult the dedicated skill at
../fitness-functions/SKILL.md.
Most GC rules scan code or configuration for entropy — stale docs, dead code, drifting conventions. Learning-driven GC rules take a different input: compound learning artifacts such as reflections and assessments. Instead of asking "has the code drifted?", they ask "has the team learned something that the harness hasn't absorbed yet?"
This category exists because the harness should grow from experience. When REFLECTION_LOG.md records the same type of surprise repeatedly, that pattern is a missing constraint. A learning-driven GC rule detects the gap and proposes the constraint — closing the loop between compound learning and harness evolution.
The primary example of learning-driven GC. This rule reads REFLECTION_LOG.md, groups surprises by theme, and flags any theme appearing in 2+ entries that is not already covered by a HARNESS.md constraint. When an uncovered pattern is found, the GC agent creates a GitHub issue proposing a new constraint with evidence (reflection dates and quotes), suggested enforcement type, and suggested scope.
See the HARNESS.md template for the rule entry and
references/gc-catalogue.md for the full catalogue entry.
Compound learning artifacts accumulate their own entropy. REFLECTION_LOG.md grows with duplicates. AGENTS.md collects entries that contradict later experience. Convention files drift from the codebase they describe. Memory that is never pruned becomes noise — the agent loads context that contradicts current practice or references reversed decisions.
Dream Consolidation (from the framework's Appendix J) addresses this at two timescales:
A memory entropy GC rule in HARNESS.md:
references/gc-catalogue.md — Complete catalogue of common GC
patterns with HARNESS.md entry examples, detection approaches, and
the auto-fix safety rubric../fitness-functions/SKILL.md — Architectural fitness functions
skill with framework, tool catalogue, and GC rule mapping guidance../fitness-functions/references/fitness-catalogue.md — Concrete
HARNESS.md GC rule entries for each fitness function typeThe plugin ships two related GC rules that share a schema (the
Promoted line per reflection entry) but differ in safety profile:
Reflection log archival of promoted entriesgc.yml.Promoted line.Promoted line) is explicit
AND verified against current tree state.Reflection log aged-out reviewPromoted line.Promoted line is
ambiguous — the entry might still be relevant or might warrant
promotion the curator hasn't got around to.The asymmetry is deliberate: explicit signal + verification → safe to
auto-act; absence of signal → human judgement gates the move. See
docs/superpowers/specs/2026-04-30-reflection-log-archival-design.md
for the full design rationale.
Independent of archival, every reader of REFLECTION_LOG.md should
bound its default intake. See the HARNESS.md ## Read-side filtering
section for the configured defaults and the per-reader policy.