Design Spec: /atlas-audit

Date: 2026-04-15 DRAFT Owner: Atlas

Purpose

A single comprehensive skill that audits, measures, restructures, and monitors fleet operational efficiency. This is Atlas's prime directive skill — "how efficient are our fleet ops" expressed as a runnable tool.

The skill produces metrics (writes to SSOT tables), makes structural improvements (rewrites CLAUDE.md, compresses rules, deduplicates memory), and establishes baselines for ongoing monitoring. It replaces /context-diet, /reconcile, and /manifest refresh as the one maintenance skill.


Prerequisites

1. SSOT Guide (docs/ssot/GUIDE.md)

Must exist before the skill can make decisions. Defines:

2. Metrics Tables (Pantheon Supabase)

The skill writes measurements to these tables. Designed by Proteus, owned by Atlas.

fleet_context_metrics

Per-repo context efficiency measurements.

ColumnTypeDescription
iduuidPK
repotextFK to fleet_repositories.name
measured_attimestamptzWhen this measurement was taken
measured_bytextSession/agent that took the measurement
claude_md_charsintCLAUDE.md character count
repo_rules_charsint.claude/rules/ total chars
global_rules_charsint~/.claude/rules/ total chars
memory_index_charsintMEMORY.md index chars
memory_files_charsintTotal memory topic file chars
memory_file_countintNumber of memory topic files
skills_countintNumber of skills in .claude/skills/
skills_frontmatter_charsintTotal skill frontmatter chars (system prompt cost)
agents_countintNumber of agent definitions
agents_charsintTotal agent definition chars
always_loaded_totalintSum of all always-loaded content chars
est_tokensintalways_loaded_total / 4 (rough estimate)
context_files_charsintOn-demand context/ directory total chars
audit_typetext'full' or 'monitor'

fleet_ssot_compliance

Per-repo SSOT alignment scores.

ColumnTypeDescription
iduuidPK
repotextFK to fleet_repositories.name
measured_attimestamptz
hardcoded_factsintFacts found in markdown that should be in fleet tables
ssot_referencesintLines that correctly reference SSOT
duplicate_rulesintRules loaded multiple times (global + repo + memory overlap)
stale_memory_filesintMemory files whose content is now in code/git/tables
unverified_factsintFacts in fleet tables with unverified trust level
compliance_scorenumeric0-100, weighted composite

fleet_tool_efficiency

Session-level tool usage patterns (populated by Argus or session-end hooks).

ColumnTypeDescription
iduuidPK
repotext
session_idtext
measured_attimestamptz
cli_lookupsintfleet/fleet-path calls via Bash
mcp_lookupsintMCP tool calls for SSOT data
toolsearch_callsintToolSearch invocations (overhead indicator)
total_tool_callsintAll tool calls in session
transcript_charsintTotal session transcript size
cli_first_rationumericcli_lookups / (cli_lookups + mcp_lookups)

Operational Model

Full Audit

Run once per repo. Heavy. Produces baseline, makes structural changes.

/atlas-audit <repo-path>
/atlas-audit ~/Dev/_K4120S/constellation-hades

Monitor Check

Lightweight. Measures current state, compares to baseline, flags drift.

/atlas-audit monitor <repo-path>
/atlas-audit monitor --fleet       # all repos

Re-audit Trigger

When a repo's metrics fall behind the fleet average (detected by Argus or the monitor check), a full audit is triggered. The operator decides — Atlas does not auto-audit.


Full Audit Protocol

Phase 1: Measure (read-only)

Baseline everything. Write measurements to fleet_context_metrics.

  1. Always-loaded content: CLAUDE.md + repo rules + global rules + MEMORY.md + memory topic files
  2. On-demand content: context/ directory, skills (frontmatter only), agent definitions
  3. SSOT compliance scan:
  4. Fact/statement classification: For each finding, classify using s6#8

Phase 2: Plan (operator review)

Present findings organized by impact. No changes yet.

FINDING: {description}
Type: fact | statement | duplicate | stale
Location: {file}:{line range}
Impact: {chars saved if fixed}
Action: {move to fleet table | move to Aion | delete | compress | reference SSOT}

Group by action type. Show total projected savings. The operator approves, modifies, or rejects the plan.

Phase 3: Execute (structural changes)

Apply approved changes:

  1. Facts in markdown → Verify fact exists in fleet table. If yes, replace markdown with fleet CLI reference. If no, INSERT as unverified and replace.
  2. Statements in CLAUDE.md → Move to Aion wiki via aion_capture or to context/ as deferrable reference.
  3. Duplicate rules → Remove duplicate, keep highest-authority source (fleet_rules > global rules > repo rules > memory).
  4. Stale memory → Archive (never delete without operator confirmation).
  5. Bloated sections → Compress. Verbose violation rules become table rows.
  6. Missing SSOT references → Add fleet CLI commands where agents need to look up facts.

Phase 4: Verify

Re-measure everything. Write post-audit measurements. Compute delta:

Before: {N} chars ({T} est. tokens) always-loaded
After:  {N2} chars ({T2} est. tokens) always-loaded
Saved:  {delta} chars ({pct}% reduction)

SSOT compliance: {before_score} → {after_score}
Hardcoded facts: {before} → {after}
Duplicate rules: {before} → {after}

Monitor Protocol

Lightweight check. No structural changes. Runs in < 30 seconds.

  1. Measure always-loaded chars for target repo(s)
  2. Compare to most recent fleet_context_metrics row
  3. If delta > 10% growth since last audit: flag for re-audit
  4. If any new hardcoded facts detected: flag
  5. Write monitor measurement with audit_type = 'monitor'

Atlas KPIs

Displayed on the Atlas page in the Pantheon web app.

Context Efficiency

SSOT Compliance

Tool Call Efficiency

Session Cost

Skill & Rule Health


Integration Points

SystemHow atlas-audit connects
ArgusMonitor check as Argus probe. Argus flags repos that drift.
fleet_rulesReads rules to classify facts vs statements. Writes newly discovered facts.
AionStatements found in markdown captured to wiki. Audit rationale captured.
ArsenalChecks skill symlink health. Reports broken distributions.
Atlas UIUI reads fleet_context_metrics, fleet_ssot_compliance, fleet_tool_efficiency.
fleet CLIAll SSOT lookups use fleet commands (CLI-first).
/startSession start includes quick monitor check if repo hasn't been measured in N days.

What This Replaces

Old SkillWhat atlas-audit absorbs
/context-dietPhase 3 pruning (but SSOT-aware, not just size-based)
/reconcilePhase 1 SSOT compliance scan (with metrics, not just drift detection)
/manifest refreshPhase 1 structural measurement (writes to fleet tables, not markdown)
/domain-architectPhase 3 restructuring (driven by measurements, not ad-hoc)

Design Decisions

DecisionChoiceRationale
OwnershipAtlas onlyOne authoritative voice prevents conflicting self-optimization
CLI-first for SSOTfleet CLI, not MCP~7x more token-efficient, 1 tool call vs 2+
Fact/statement classificationfleet_rules s6#8Operator-defined: "if wrong value causes wrong agent behavior, it's a fact"
Metrics storageSupabase tablesSSOT principle: metrics are facts about the fleet
Operator approvalPhase 2 plan reviewStructural changes to agent harnesses are high-impact
Monitor as separate modeLightweight, no changesFull audit is expensive; monitoring should be cheap
Archive, never deleteMove to archive dirsReversibility; operator can review

Open Questions

1. Argus probe integration
Should the monitor check become an official Argus probe (e.g., P24)? This would make it automated on the 6-hour Argus cycle.
2. Session cost metering
stats-cache.json is 33 days stale. No API token metering exists. The tool efficiency table can only be populated if we build a metering layer or scrape the Anthropic Console. What's the path here?
3. fleet_tool_efficiency population
This table requires parsing session transcripts for tool call patterns. Should this be a session-end hook, an Argus probe, or part of the JSONL parsing pipeline that Mnemosyne is designing?
4. Old skill deprecation
Should /context-diet, /reconcile, /manifest refresh be removed from Arsenal distribution, or kept as lightweight shortcuts that call into atlas-audit phases?
5. Cross-repo execution
atlas-audit targets other repos. Should it read their files directly (simple, but crosses domain boundaries), or dispatch measurements to the owning agent and collect results?

Generated by Atlas · constellation-atlas · War Room Session 2026-04-15