Loading...
Loading...
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.
npx skill4agent add plaited/development-skills optimize-agents-md| Anti-Pattern | Problem | Fix |
|---|---|---|
| Context stuffing | Repeating info agents already know | Delete obvious instructions |
| Static memory | No learnings section | Add |
| Format drift | Inconsistent structure | Use consistent headers |
| Missing verification | No way to check work | Add |
| Verbose rules | Paragraphs instead of patterns | Compress to pattern + verify + fix |
# Count tokens (rough estimate: words × 1.3)
wc -w AGENTS.md
# Find redundancy with project files
grep -l "bun test" AGENTS.md package.json# 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]## 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 }**Type over interface** - `type User = {` instead of `interface User {`
*Verify:* `grep 'interface [A-Z]' src/`
*Fix:* Replace `interface X {` with `type X = {`**Rule name** - Brief description with example
*Verify:* Command or tool to check compliance
*Fix:* How to resolve violations## Learnings
- 2024-01-15: Skills use CLI tools, never duplicate logic
- 2024-01-20: Rules need verification patterns for self-checkingwc -w AGENTS.mdgrep*Verify:*## Learnings## Development Commands
To install dependencies, run the following command...
[lengthy explanation of bun install]
To run tests, you can use...
[explanation of test runner]## 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.**LSP** (`lsp-*`): Type-aware hover, symbol search, references, batch analysis