context-audit
Audit current context composition and identify optimization opportunities. Use when context window is overloaded, agents are underperforming, or applying the R&D framework to optimize token usage.
What this skill does
# Context Audit Skill
Audit a codebase's context engineering health and identify optimization opportunities.
## Purpose
A focused agent is a performant agent. This skill helps you understand what's consuming your context window and where to apply the R&D framework.
## When to Use
- Starting work on a new codebase
- Agent performance feels sluggish
- Context warnings appearing
- Before optimizing context strategy
- Periodic context health checks
## Audit Process
### 1. Memory File Analysis
Scan for CLAUDE.md and related memory files:
```text
Check:
- Root CLAUDE.md size (target: <2KB)
- Number of imports
- Per-directory CLAUDE.md files
- Total memory file tokens
```
Score memory health:
| Size | Score | Assessment |
| --- | --- | --- |
| <1KB | Excellent | Minimal and focused |
| 1-2KB | Good | Within target range |
| 2-5KB | Needs Review | Growing, audit content |
| >5KB | Action Required | Bloated, needs R&D |
### 2. MCP Server Analysis
Check MCP configurations:
```text
Check:
- .mcp.json existence
- Number of MCP servers configured
- Per-server token estimate (2-5% each)
- Active vs unused servers
```
Score MCP health:
| Servers | Score | Assessment |
| --- | --- | --- |
| 0 | Excellent | No MCP bloat |
| 1-2 | Good | Targeted usage |
| 3-5 | Review | May be over-provisioned |
| >5 | Action Required | Likely consuming 15%+ |
### 3. Commands Analysis
Review .claude/commands/:
```text
Check:
- Number of commands
- Command complexity (simple vs complex)
- Priming commands present?
- Task-type coverage
```
Score command health:
| Commands | Score | Assessment |
| --- | --- | --- |
| Has priming | Excellent | Dynamic context loading |
| No priming | Needs Attention | Relying on static memory |
### 4. Hooks Analysis
Check for context-consuming hooks:
```text
Check:
- Number of hooks
- Hook event types
- Potential context injection
```
### 5. Overall Context Score
Calculate overall context engineering score:
| Component | Weight | Max Points |
| --- | --- | --- |
| Memory Files | 30% | 30 |
| MCP Configuration | 25% | 25 |
| Command Infrastructure | 25% | 25 |
| Context Patterns | 20% | 20 |
## Output Format
```json
{
"score": 75,
"grade": "B",
"components": {
"memory": {
"score": 20,
"max": 30,
"files_found": ["CLAUDE.md"],
"total_tokens": 1500,
"issues": ["No priming commands detected"]
},
"mcp": {
"score": 25,
"max": 25,
"servers_found": 0,
"estimated_consumption": "0%"
},
"commands": {
"score": 15,
"max": 25,
"count": 5,
"has_priming": false,
"issues": ["Missing /prime command"]
},
"patterns": {
"score": 15,
"max": 20,
"issues": ["No output styles defined"]
}
},
"recommendations": [
"Create /prime command for dynamic context loading",
"Reduce CLAUDE.md size by delegating to priming",
"Consider output styles for token efficiency"
]
}
```
## Grading Scale
| Score | Grade | Status |
| --- | --- | --- |
| 90-100 | A | Elite context engineering |
| 80-89 | B | Good practices, minor optimizations |
| 70-79 | C | Functional, needs attention |
| 60-69 | D | Significant issues |
| <60 | F | Context bloat, major rework needed |
## Recommendations Framework
Based on findings, recommend:
### For Memory Bloat (Reduce)
- Identify content that can move to priming commands
- Flag outdated or contradictory guidance
- Suggest minimal CLAUDE.md structure
### For Missing Infrastructure (Delegate)
- Recommend priming command creation
- Suggest output styles for verbosity control
- Propose agent expert patterns
## Cross-References
- @rd-framework.md - Reduce and Delegate strategies
- @context-layers.md - Understanding context composition
- @context-rot-vs-pollution.md - Diagnosing context problems
- @context-priming-patterns.md - Dynamic context loading
## Version History
- **v1.0.0** (2025-12-26): Initial release
---
## Last Updated
**Date:** 2025-12-26
**Model:** claude-opus-4-5-20251101
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.