ctx alignment audit

From ActiveMemory/ctx · View interactive version

ctx alignment audit is an AI agent skill from the GitHub repository ActiveMemory/ctx. Audit alignment between docs and agent instructions. Use when recipes or docs make claims about agent behavior that may not be backed by the playbook or skills.

How to use this skill

Skill file

Audit whether behavioral claims in documentation are backed by

actual agent instructions in the playbook and skills. Identify

gaps between what the docs promise and what the agent is taught

to do.

When to Use

When NOT to Use

What to Audit

Behavioral claims are statements in docs that describe what an

agent will do, may do, or offers to do. They appear in:

"proactively", "without being asked", "automatically"

Process

Step 1: Collect Claims

Read the target documentation file(s). Extract every behavioral

claim: each statement that describes agent behavior the user

should expect. Record:

Step 2: Trace Each Claim

For each claim, search for matching instructions in:

  1. AGENT_PLAYBOOK.md (in the context directory): the primary

behavioral source; the agent reads this at session start

  1. .claude/skills/*/SKILL.md: skill-specific instructions

loaded when a skill is invoked

  1. CLAUDE.md: project-level instructions always in context

For each claim, determine:

the described behavior

the claim (e.g., the playbook says "persist at milestones" but

the recipe claims the agent identifies specific follow-up tasks)

Step 3: Report

Present findings as a table:

| Claim (file:line) | Status | Backing instruction | Gap description |

|--------------------------------------------------|---------|------------------------------------------|------------------------------------------------------|

| "agent creates follow-up tasks" (task-mgmt:57) | Gap | None | Playbook doesn't teach follow-up task identification |

| "agent offers to save learnings" (knowledge:237) | Covered | Playbook: Proactive Behavior During Work | - |

Step 4: Fix (if requested)

For each gap, propose a fix:

across all sessions (add to AGENT_PLAYBOOK.md)

(add to the relevant SKILL.md)

toned down

Always update both the live copy (AGENT_PLAYBOOK.md in the

context directory, or .claude/skills/) AND the template copy

(internal/assets/context/AGENT_PLAYBOOK.md or

internal/assets/claude/skills/) to keep them in sync.

What Makes a Claim "Covered"

A claim is covered when the agent instructions would **reliably

produce** the described behavior. Check:

is vague. "After completing a task, offer to add follow-up

tasks" is specific.

not just WHAT to do.

or check a file, is that stated?

follow examples more reliably than abstract rules.

Common Gap Patterns

to do X when asked → add proactive trigger

mapping exists → add to triggers table

independently → add chained flow instruction

doesn't teach that flow → update the skill

is described → add HOW to detect, not just WHAT to notice

Instruction File Health

After auditing alignment, check that instruction files are still

a healthy size for agent consumption. Bloated instruction files

get ignored: agents stop following rules buried deep in long

documents.

Size Heuristics

| File | Healthy | Warning | Danger |

|---------------------|--------------|---------------|--------------|

| AGENT_PLAYBOOK.md | < 5k tokens | 5-8k tokens | > 8k tokens |

| Individual SKILL.md | < 2k tokens | 2-3k tokens | > 3k tokens |

| CLAUDE.md | < 2k tokens | 2-3k tokens | > 3k tokens |

| Total context dir | < 25k tokens | 25-40k tokens | > 40k tokens |

How to Measure

# Total context token estimate
ctx status | grep "Token Estimate"

# Rough per-file estimate (~4 chars per token)
wc -c AGENT_PLAYBOOK.md  # divide by 4 (run from context dir)
wc -c .claude/skills/*/SKILL.md   # divide by 4

When Files Are Too Large

(Pre-Flight Checklist, Go Documentation Standard) into

CONVENTIONS.md where they belong. The playbook should teach

behavior, not coding standards.

reference doc. The skill teaches WHEN and HOW; reference

docs provide details the agent can look up if needed.

completed tasks and deduplicate learnings.

Signs of Instruction Bloat

skill AND CLAUDE.md)

shorter

Quality Checklist

After completing the audit:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.