optimize-agents-md
This skill compresses AGENTS.md and rules files to target 2.5k tokens using Boris Cherny's principles, replacing verbose explanations with tables, bullets…
Identity proven by GitHub's verified organisation badge (youdotcom-oss)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- ISC (permissive)
- Pin
- 84b6aa3pinned Oct 9, 2026
- Context cost
- about 1,100 tokenswhen the skill loads
- GitHub stars
- 5on youdotcom-oss/web-search-agent-evals
- Scripts
- None found
What it does
“Optimize AGENTS.md and rules for token efficiency. Auto-invoked when user asks about improving agent instructions, compressing AGENTS.md, or making rules more effective.”
Generated summary from the skill's own text
This skill compresses AGENTS.md and rules files to target 2.5k tokens using Boris Cherny's principles, replacing verbose explanations with tables, bullets, and verification patterns. It identifies redundancy, adds learnings sections, and ensures rules include verification commands and fixes. The agent applies this workflow when users ask to improve agent instructions or make rules more effective.
When to use it
- Agent instructions feel verbose or contain unnecessary repetition
- Setting up new project agent configuration files
- Rules exist but lack verification patterns or checks
- Compressing existing AGENTS.md to reduce token bloat
When not to
- Project requires detailed explanations for team onboarding
- Agents need extensive tool documentation beyond basics
- Rules intentionally use narrative style for clarity
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add youdotcom-oss/web-search-agent-evals --skill optimize-agents-mdInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install youdotcom-oss/web-search-agent-evals optimize-agents-md@84b6aa3ec2c27d889a70e3bc1ad04c86cf0e3617Installs the commit we checked (84b6aa3).
Copy by hand
Download the folder at 84b6aa3 and put it in .claude/skills/optimize-agents-md for Claude Code and in .agents/skills/optimize-agents-md for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install youdotcom-agent-skills@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "optimize-agents-md" by You.com. Source, pinned to commit 84b6aa3ec2c27d889a70e3bc1ad04c86cf0e3617: https://github.com/youdotcom-oss/web-search-agent-evals/tree/84b6aa3ec2c27d889a70e3bc1ad04c86cf0e3617/.agents/skills/optimize-agents-md 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/optimize-agents-md/ for Claude Code and .agents/skills/optimize-agents-md/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/you-com/optimize-agents-md
SKILL.md at the pin
---
name: optimize-agents-md
description: Optimize AGENTS.md and rules for token efficiency. Auto-invoked when user asks about improving agent instructions, compressing AGENTS.md, or making rules more effective.
license: ISC
---
# Optimize AGENTS.md
Apply Boris Cherny's compression principles to AGENTS.md and rules files.
**Target**: ~2.5k tokens (most are 10k+ unnecessarily)
## When to Use
- User wants to improve their AGENTS.md or CLAUDE.md
- Agent instructions feel verbose or redundant
- Rules exist but lack verification patterns
- Setting up a new project's agent configuration
## Anti-Patterns to Fix
| Anti-Pattern | Problem | Fix |
|--------------|---------|-----|
| Context stuffing | Repeating info agents already know | Delete obvious instructions |
| Static memory | No learnings section | Add `## Learnings` with dates |
| Format drift | Inconsistent structure | Use consistent headers |
| Missing verification | No way to check work | Add `*Verify:*` patterns to rules |
| Verbose rules | Paragraphs instead of patterns | Compress to pattern + verify + fix |
## Workflow
### Phase 1: Analyze Current State
```bash
# Count tokens (rough estimate: words × 1.3)
wc -w AGENTS.md
# Find redundancy with project files
grep -l "bun test" AGENTS.md package.json
```
Look for:
- Instructions duplicating package.json scripts
- Explanations of common tools (git, npm, bun)
- Verbose descriptions that could be tables
- Rules without verification patterns
### Phase 2: Compress AGENTS.md
**Structure target:**
```markdown
# AGENTS.md
## Overview
[1-2 sentences: what this project is]
## Capabilities
[Bullet list of key features/commands]
## Structure
[Brief file tree of key paths]
## Commands
[Essential commands only - not everything in package.json]
## Verification
[How to check work is correct]
## Workflow
[Key constraints: plan first, verify incrementally]
## Rules
[Links to rule files or inline compressed rules]
## Learnings
[Dated entries from actual issues encountered]
```
**Compression techniques:**
- Tables over paragraphs
- Bullets over sentences
- Delete anything in package.json
- Delete tool explanations (agents know git, npm, bun)
- Merge related sections
### Phase 3: Optimize Rules
Transform verbose rules into verification patterns:
**Before (verbose):**
```markdown
## Type Aliases Over Interfaces
In this codebase, we prefer using TypeScript type aliases
instead of interfaces. This provides better consistency
and flexibility when working with unions and intersections.
Example:
// Good
type User = { name: string }
// Bad
interface User { name: string }
```
**After (compressed with verification):**
```markdown
**Type over interface** - `type User = {` instead of `interface User {`
*Verify:* `grep 'interface [A-Z]' src/`
*Fix:* Replace `interface X {` with `type X = {`
```
**Pattern format:**
```
**Rule name** - Brief description with example
*Verify:* Command or tool to check compliance
*Fix:* How to resolve violations
```
### Phase 4: Add Living Document Features
**Learnings section:**
```markdown
## Learnings
- 2024-01-15: Skills use CLI tools, never duplicate logic
- 2024-01-20: Rules need verification patterns for self-checking
```
**Update trigger:** Add learnings when:
- A mistake required correction
- A pattern was discovered
- A constraint was clarified
## Verification
After optimization:
1. **Token count**: `wc -w AGENTS.md` × 1.3 ≈ tokens (target: <2.5k)
2. **No redundancy**: `grep` for duplicated info in package.json
3. **Rules have patterns**: Each rule has `*Verify:*` line
4. **Learnings exist**: `## Learnings` section present
## Example Transformations
### Commands Section
**Before (340 words):**
```markdown
## Development Commands
To install dependencies, run the following command...
[lengthy explanation of bun install]
To run tests, you can use...
[explanation of test runner]
```
**After (40 words):**
```markdown
## Commands
```bash
bun install # Setup
bun run check # Lint/format
bun test # Unit tests
```
```
### Capability Description
**Before:**
```markdown
This package provides TypeScript Language Server Protocol
integration that allows you to get type information, find
symbols across your workspace, locate references to symbols,
and perform batch analysis of files.
```
**After:**
```markdown
**LSP** (`lsp-*`): Type-aware hover, symbol search, references, batch analysis
```
## Related Skills
- **scaffold-rules** - Install optimized rules with verification patterns
- **validate-skill** - Validate skill structure
From youdotcom-oss/web-search-agent-evals at 84b6aa3, shown as plain text under its license: ISC (permissive). The license text is in .agents/skills/optimize-agents-md/SKILL.md.
View SKILL.md on GitHub at 84b6aa3Files
- SKILL.md4.6 KB · bd1d4f9c1f7d
1 file, 4.6 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 84b6aa3More from You.com
grill-me
This skill conducts an intensive interview on a user's plan or design, asking probing questions one at a time to expose gaps and dependencies.
Claude Code, Codex, Cursor +4 · about 92 tokens · pinned 6 days ago
karpathy-guidelines
This skill provides behavioral guidelines to reduce common LLM coding mistakes when writing, reviewing, or refactoring code.
Claude Code, Codex, Cursor +4 · about 560 tokens · pinned 6 days ago
tdd
This skill guides the agent to write tests first, then implement code in red-green-refactor cycles.
Claude Code, Codex, Cursor +4 · about 670 tokens · pinned 6 days ago
you-discover
This skill helps agents plan how to integrate You.com's web search, content extraction, and research APIs by discovering the right integration path for their…
Claude Code, Codex, Cursor +4 · about 1.2K tokens · pinned 6 days ago
you-finance
This skill answers finance and market-data questions using the You.com finance MCP tool, providing stock prices, company financials, earnings reports, and…
Claude Code, Codex, Cursor +4 · about 590 tokens · pinned 6 days ago
you-research
This skill routes research requests between You.com's one-shot managed research tool and an agent-led search pipeline, depending on whether the user needs a…
Claude Code, Codex, Cursor +4 · about 610 tokens · pinned 6 days ago
Related in AI and agents
agent-builder
Agent Builder orchestrates the creation, modification, testing, and publishing of n8n Agents.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.3K tokens · pinned 6 days ago
intent-recognition
Classifies automation requests by determining which primitive owns the top-level control flow (workflow, agent, needs clarification, or out-of-scope) and…
by n8nOfficial publisher
Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago
planned-task-runtime
This skill manages follow-up interactions with a background task execution system, handling task completion synthesis, failure replanning, workflow building…
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 6 days ago
skill-creator
This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.
by GoogleOfficial publisher
Contains scripts
Gemini CLI · about 5K tokens · pinned 6 days ago
-21risk-automation
This skill automates 21risk operations by connecting to the 21risk toolkit through Composio's Rube MCP server.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
-2chat-automation
This skill automates 2chat tasks by integrating with Composio's 2chat toolkit through Rube MCP.
by ComposioOfficial publisher
Agents not labelled yet · about 680 tokens · pinned 6 days ago
Open roles at You.com
No open roles at You.com on the Agent Native jobs board right now.
Browse the jobs board