templates/skills/token-budget-check/SKILL.md
Analyze markdown files for token budget compliance. Checks word count, section lengths, and overall file size against documentation guidelines. Use proactively when creating or reviewing documentation files, shared-docs pages, or when a doc might be over-budget for agent context loading.
npx skillsauth add everyone-needs-a-copilot/claude-copilot token-budget-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze markdown files to ensure they comply with token budget guidelines.
Shared-docs files have token budgets to optimize AI ingestion. This skill checks files against those budgets and suggests optimizations when over budget.
| Document Type | Max Tokens | Max Words | |---------------|------------|-----------| | Skill (SKILL.md) | 2,000 | 1,400 | | Product overview | 800 | 560 | | Product architecture | 1,200 | 840 | | Product API summary | 1,000 | 700 | | Product integration | 800 | 560 | | Operational guide | 4,000 | 2,800 | | Agent profile | 2,000 | 1,400 | | Index/navigation | 400 | 280 |
If a specific file is provided, check that file. Otherwise, scan the directory:
find . -name "*.md" -type f | head -20
For each file, estimate tokens (words × 1.4):
file="path/to/file.md"
words=$(wc -w < "$file" | tr -d ' ')
tokens=$((words * 14 / 10))
echo "$file: ~$tokens tokens ($words words)"
Infer type from:
SKILL.md → skill, 00-overview.md → overview02-products/ → product doc, 03-ai-enabling/02-profiles/ → agent profiledoc_type field if present| Status | Condition | Action | |--------|-----------|--------| | OK | Under budget | Report as compliant | | WARNING | 80-100% of budget | Suggest review | | OVER | Exceeds budget | Analyze and suggest cuts |
Identify optimization opportunities:
## Token Budget Report
### Summary
- Files checked: N
- Compliant: N
- Warnings: N
- Over budget: N
### Details
| File | Type | Tokens | Budget | Status |
|------|------|--------|--------|--------|
| path/to/file.md | skill | 1,850 | 2,000 | OK |
| path/to/doc.md | overview | 950 | 800 | OVER (+150) |
### Recommendations
#### path/to/doc.md (950 tokens, budget 800)
- Lines 45-60: Convert feature list to table (-80 tokens)
- Lines 72-85: Remove redundant introduction (-50 tokens)
| Pattern | Token Savings | |---------|---------------| | Tables over prose | 30-50% | | Bullet points over paragraphs | 20-30% | | Omit articles in table cells | 5-10% | | Use abbreviations (env, config, auth) | 5-10% | | Remove redundant headers | 5-10% |
testing
Pytest testing patterns, anti-patterns, and quality rules
testing
STRIDE threat modeling and DREAD severity scoring for security review
development
Python idiomatic patterns and best practices
data-ai
UX patterns for task flows, service blueprints, wireframes, and user interactions with comprehensive state coverage. Covers interaction design, user journeys, error states, empty states, and WCAG accessibility. Use proactively when designing task flows, creating wireframes, mapping user journeys, or reviewing interaction patterns.