Class-Audit Pattern — wiring artifact-class to workflow stages with canonical disambiguation + drift detector
Class-Audit Pattern
When a class of system artifact (plugins, MCP servers, skills, infra services) gets installed without explicit per-instance integration into the active workflow surface, dormant capability accumulates and ambiguous overlaps create silent behavioral drift across sessions. The Class-Audit Pattern resolves this in a single session via four cohesive layers — applicable to any agent maintaining a multi-artifact intelligence system.
When to invoke
- After a new plugin / MCP / skill bundle lands and the agent realizes mandates haven’t been updated
- After an unexpected upgrade incident exposes that no drift detector exists
- When AJ asks “are we making most of all the available X?” — that’s a class-audit prompt
- Periodically (e.g., quarterly) for any artifact class with >5 instances
The four layers
| Layer | What it produces | Why it’s needed |
|---|---|---|
| 1. Class × Workflow-stage matrix | A table mapping each artifact instance to the workflow stage(s) where it should be dispatched | Makes orchestrators know which primitive to call at which step. Without this, orchestrators reinvent what artifacts already provide → Law 10 (Full Capability) violation. |
| 2. Canonical disambiguation table | For every overlapping capability, the ONE canonical instance + the aliases that must NOT be invoked | Eliminates the “which-do-I-pick” deliberation tax. Without this, different sessions pick differently → Law 2 (Zero Ambiguity) violation. |
| 3. Drift detector cron | Snapshots the artifact inventory, alerts on unannounced version/instance changes | Makes auto-upgrades visible the morning after, not when something breaks. Without this, silent upgrades cause crash loops (e.g., versioned-path systemd ExecStart breaks when plugin auto-upgrades). |
| 4. Orchestrator-skill pointer | Adds a “Plugin Primitive Cohesion” / equivalent principle to the master-orchestrator skill referencing the matrix | Ensures the matrix is LIVE behavior, not just documentation. Every orchestrator dispatch reads the matrix. |
All four must ship in the same session the audit runs. Skipping any one means the gap that triggered the audit will recur.
Reference implementation
2026-04-26 plugin utilization audit on AJ’s developer enterprise (arjtech-dev):
- 9 plugins installed (Superpowers, pr-review-toolkit, engineering, plugin-dev, ralph-loop, hookify, anthropic-skills, playground, skill-creator), pre-audit utilization ~55%
- Layer 1: 12-row Helix Layer × Plugin Primitive Wiring table in
plugin-integration.md(L1-L7 + Meta + session-close + documentation deliverables) - Layer 2:
feedback_plugin_capability_routing.mdfor 9 overlapping capabilities (skill-creation triplet →superpowers:writing-skills, recurring-loops →loop, review →pr-review-toolkit:review-pr, etc.) - Layer 3:
plugin-version-drift-check.shcron at 02:30 IST, snapshotsinstalled_plugins.jsonwith 30-day retention, Telegrams on drift - Layer 4:
master-orchestrator/SKILL.mdPrinciple 6 — Plugin Primitive Cohesion
Trigger event: 25-Apr Superpowers 5.0.5→5.0.7 silent auto-upgrade broke brainstorm.service (versioned-path ExecStart) — 4,300 cold-start failures in 6h. Drift detector (Layer 3) alone wouldn’t have prevented the crash, but combined with the wrapper-everywhere mandate (/usr/local/bin/<service>-launch.sh resolves version at runtime) it makes the failure class extinct.
Anti-patterns
- Adding a plugin and writing a plan to “wire it later” — that “later” never comes; the plugin sits dormant.
- Picking-by-vibe each session (“which excalidraw / schedule / skill-creator do I use this time?“) — silent behavioral drift.
- Documenting the matrix without a pointer in the orchestrator skill — read-only documentation, not enforcement.
- Drift detector that only logs without alerting — silent log files don’t change behavior.
Cross-system applicability
This pattern is class-agnostic. Other classes where it applies:
- MCP servers (Permanent + on-demand split) — already governed by
feedback_mcp_two_tier_model.md - Skills bundle (~150 entries) — periodic audit prevents Law-2 ambiguity as new skills land
- Crons (
/root/.claude/crons/) — drift detection prevents orphan cron accumulation - Infra services in docker-compose — Class × Service Mesh Routing matrix ensures every service has a known consumer
Related
- docker
- 2026-04-04-oracle-001-self-architecture-analysis
- wire-all-installed-plugin-primitives-into-helix-layer-1-7-me
- openclaw
- oracle
- enterprise-backup-syncsh-drift-detector-auto-discovers-optne
- god-grade-quality-audit-cascade-update-sweep-6-parallel-audi
- component-removal-4-artifact-rule-every-eradication-touches
- expanded-agents-architect-skill-from-v10-594-lines-16-sectio