agent-skills: 5 Patterns That Actually Work
addyosmani/agent-skills (Google Chrome team lead) hit 68K stars in 2 weeks. The repo distills production patterns for AI coding agents.
Pattern 1: “Test-First Agent”
Don’t ask the agent to “build a feature.” Ask it to:
- Write failing tests
- Confirm tests fail
- Implement
- Confirm tests pass
- Refactor
You are writing a feature for a billing system.
1. First, write tests in tests/billing.test.ts
2. Run `npm test` — confirm RED
3. Implement the feature
4. Run `npm test` — confirm GREEN
5. Refactor if needed
Pattern 2: “Constraint Documents”
The agent doesn’t know your project’s hidden rules. Tell it:
# CONSTRAINTS.md
- All API endpoints must return JSON
- No console.log in production code
- All PRs must include migration files
- Tests must run in <30s
Pattern 3: “Read-Before-Edit”
Force the agent to read the file completely before editing:
Before changing any file:
1. cat the file
2. Identify all imports, exports, side effects
3. Write a 1-line summary of what it does
4. THEN propose your edit
Pattern 4: “Diff-First Approval”
Generate the diff first, ask for approval, then apply:
For every code change:
1. Show the diff
2. WAIT for my explicit "apply"
3. Never auto-apply
Pattern 5: “Incremental Rollout”
Don’t ask for 10 files at once:
Make ONE change at a time:
1. First change → verify → commit
2. Second change → verify → commit
3. ...
Sources
- addyosmani/agent-skills: 68K stars
- r/ClaudeAI: 1.4k upvotes
- HN: 2,100 points