sensei
AGENTS.md58 starsChanged 9 months agoMITView on GitHub
Instructions for AI coding agents working with this repository. This is Sensei, a skill for improving SKILL.md frontmatter compliance. It follows the Agent Skills specification (maintained by Anthropic). The SKILL.md file follows Anthropic's skill specification: ⚠️ "DO NOT USE FOR:" is actively discouraged — causes keyword contamination on Claude Sonnet. Use inline double-quoted strings for descriptions (not >- folded scalars — incompatible with skills.sh). Skills that invoke MCP tools get additional checks: - MCP Tools Used table - Documents tool…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- .ai-team-templates/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- {skill-name}Skill
- senseiSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 86
Low: No triggers, short description
- Very specific: line 105
Keep SKILL.md focused on instructions, not documentation
- Distinctive: line 106
Use references/ for detailed explanations
- Very specific: line 107
Run npm run tokens -- check after changes to verify limits
- Very specific: line 109
Run npm run tokens -- score .
- Distinctive: line 110
Add routing clarity (INVOKES/FOR SINGLE OPERATIONS) for High score
- Distinctive: line 111
Use skill type prefixes when appropriate
- Very specific: line 115
Add README-style content to SKILL.md (use README.md instead)
- Distinctive: line 117
Remove trigger or anti-trigger phrases without replacement
- Very specific: line 173
Run npm run tokens -- check references/new-topic.md to verify limits
- Very specific: line 174
Add link in SKILL.md under "Reference Documentation" section
- Very specific: line 194
Create template in references/test-templates/{framework}.md
- Very specific: line 195
Document usage in references/configuration.md
- Distinctive: line 214
No runtime dependencies for the skill itself
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Instructions for AI coding agents working with this repository.
Overview
This is Sensei, a skill for improving SKILL.md frontmatter compliance. It follows the Agent Skills specification (maintained by Anthropic).
Repository Structure
sensei/
├── SKILL.md # Core skill (DO NOT add README-style content here)
├── README.md # Human documentation
├── AGENTS.md # This file - agent instructions
├── LICENSE.txt # MIT license
├── package.json # Root package for npm run tokens
├── .token-limits.json # Custom token limits configuration
├── references/ # Progressive disclosure docs (loaded on-demand)
│ ├── scoring.md # Scoring algorithm details
│ ├── mcp-integration.md # MCP tool integration patterns
│ ├── loop.md # Ralph loop workflow
│ ├── examples.md # Before/after transformations
│ ├── configuration.md # Project config patterns
│ └── test-templates/ # Framework-specific test templates
│ ├── jest.md # Jest test template
│ ├── pytest.md # pytest test template
│ ├── waza.md # Waza trigger test format
│ └── ...
└── scripts/ # TypeScript token management tools
├── package.json # Dependencies (tsx, vitest, typescript)
├── tsconfig.json
├── vitest.config.ts
└── src/
├── tokens/
│ ├── cli.ts # CLI entry point
│ └── commands/
│ ├── types.ts # Interfaces, constants, utilities
│ ├── utils.ts # Config loading, file discovery
│ ├── count.ts # Token counting
│ ├── check.ts # Limit validation
│ ├── suggest.ts # Optimization suggestions
│ ├── compare.ts # Git-based comparison
│ └── score.ts # Advisory scoring
└── gepa/
├── auto_evaluator.py # GEPA auto-evaluator CLI
└── requirements.txt # Python dependencies (gepa)Key Conventions
SKILL.md Format
The SKILL.md file follows Anthropic's skill specification:
---
name: skill-name # lowercase, hyphens only
description: "**WORKFLOW SKILL** — What the skill does. WHEN: \"trigger 1\", \"trigger 2\", \"trigger 3\". INVOKES: tools/MCP servers used. FOR SINGLE OPERATIONS: when to bypass."
---
# Skill Body (Markdown)
Instructions loaded only after skill triggers.⚠️ "DO NOT USE FOR:" is actively discouraged — causes keyword contamination on Claude Sonnet. Use inline double-quoted strings for descriptions (not
>-folded scalars — incompatible with skills.sh).
Skill Type Prefixes
| Prefix | When to Use |
**WORKFLOW SKILL** | Multi-step orchestration, decisions |
**UTILITY SKILL** | Single-purpose helper |
**ANALYSIS SKILL** | Read-only analysis/reporting |
Token Budgets
| File | Soft Limit | Hard Limit |
| SKILL.md | 500 tokens | 5000 tokens |
| references/*.md | 2000 tokens | — |
Scoring Levels
- Low: No triggers, short description
- Medium: Has triggers, >60 words or missing quoted phrases
- Medium-High: Has WHEN: (preferred) or USE FOR: with ≤60 words ← TARGET
- High: Medium-High + routing clarity (INVOKES/FOR SINGLE OPERATIONS)
MCP Integration (when INVOKES present)
Skills that invoke MCP tools get additional checks:
- MCP Tools Used table - Documents tool dependencies
- Prerequisites section - Lists required tools
- CLI fallback pattern - Fallback when MCP unavailable
- Name collision detection - Warns when skill name matches MCP tool
See references/mcp-integration.md for patterns.
When Modifying This Skill
DO
- Keep SKILL.md focused on instructions, not documentation
- Use references/ for detailed explanations
- Run
npm run tokens -- checkafter changes to verify limits - Maintain the frontmatter format with WHEN: / USE FOR: (prefer positive routing)
- Run
npm run tokens -- score .to check advisory compliance - Add routing clarity (INVOKES/FOR SINGLE OPERATIONS) for High score
- Use skill type prefixes when appropriate
DON'T
- Add README-style content to SKILL.md (use README.md instead)
- Exceed 1024 characters in the description field
- Remove trigger or anti-trigger phrases without replacement
- Omit INVOKES when skill calls MCP tools or other skills
- Embed CLI commands without MCP option when MCP tools exist
Testing Changes
# Install dependencies (first time only)
cd scripts && npm install && cd ..
# Check all files against token limits
npm run tokens -- check
# Count tokens in specific files
npm run tokens -- count SKILL.md references/*.md
# Get optimization suggestions
npm run tokens -- suggest
# Compare with previous commit
npm run tokens -- compare HEAD~1
# Score skill against advisory checks
npm run tokens -- score .
# Run unit tests
cd scripts && npm test
# GEPA: Score a skill (no LLM calls)
python scripts/src/gepa/auto_evaluator.py score --skill my-skill --skills-dir skills --tests-dir tests
# GEPA: Score all skills
python scripts/src/gepa/auto_evaluator.py score-all --skills-dir skills --tests-dir testsToken CLI Reference
npm run tokens -- count [paths...] # Count tokens in markdown files
npm run tokens -- check [paths...] # Check files against token limits
npm run tokens -- suggest [paths...] # Get optimization suggestions
npm run tokens -- compare [refs...] # Compare tokens between git refs
npm run tokens -- score [skillDir] # Advisory checks
# Options
--format=json # Output as JSON instead of table
--strict # Exit with error if limits exceeded (check only)
--sort=tokens # Sort by token count (count only)
--min-tokens=100 # Filter files below threshold (count only)Common Tasks
Adding a New Reference File
- Create
references/new-topic.md - Run
npm run tokens -- check references/new-topic.mdto verify limits - Add link in SKILL.md under "Reference Documentation" section
Updating Token Limits
Edit .token-limits.json:
{
"defaults": {
"SKILL.md": 5000,
"references/*.md": 2000,
"*.md": 4000
},
"overrides": {
"README.md": 4000
}
}Adding Test Framework Support
- Create template in
references/test-templates/{framework}.md - Document usage in
references/configuration.md
Commit Message Format
type: description
Examples:
- feat: add support for vitest test framework
- fix: handle multi-line descriptions in scorer
- docs: clarify token budget in scoring.mdDependencies
- Node.js 18+ (for token management scripts)
- npm (for running scripts)
- Python 3.10+ (for GEPA auto-evaluator, optional)
- gepa package (for GEPA optimization,
pip install gepa) - No runtime dependencies for the skill itself
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

