agent-skills
CLAUDE.md20 starsChanged 11 months agoMITView on GitHub
This is a pnpm monorepo containing Claude Code extensions: TypeScript packages following MCP SDK patterns: Tool implementations follow this pattern: Agent Skills Specification (agentskills.io) compliant format: Node.js scripts triggered by Claude Code lifecycle events:
In this repository3 other files it gives its agents.
- code-reviewSkill
- code-reviewSkill
- code-reviewSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
29 rules. About 0 are common, 10 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 81
Critical: Use absolute paths in hooks.json command field (cwd resets between invocations)
- Very specific: line 82
State: No in-memory persistence - load/save from files (e.g., ~/.claude/usage.json)
- Very specific: line 87
Shell injection prevention: Use execFile not exec (see gh-cli.ts)
- Very specific: line 93
Progressive disclosure: Keep SKILL.md body <5000 tokens, use references/ for detail
- Very specific: line 99
Imports: Use .js extensions in TypeScript imports (ES modules requirement)
- Very specific: line 105
Add package.json with "type": "module" and @modelcontextprotocol/sdk dependency
- Very specific: line 106
Create src/index.ts with Server setup
- Very specific: line 107
Create src/tools/*.ts for each tool
- Very specific: line 108
Add tsconfig.json extending ../../tsconfig.base.json
- Very specific: line 110
Test by adding to ~/.claude/settings.json mcpServers config
- Very specific: line 114
Create SKILL.md with frontmatter (name, description) and markdown body
- Very specific: line 121
Create hooks.json with matcher and absolute path to script
- Very specific: line 122
Create Node.js script that reads stdin, performs action
- Distinctive: line 123
Use absolute paths for file operations (cwd is unstable)
- Distinctive: line 135
When creating or modifying skills, ensure compatibility:
- Very specific: line 144
Every SKILL.md must include YAML frontmatter with:
- Very specific: line 174
Keep SKILL.md under 500 lines.
- Very specific: line 199
Keep references one level deep: - avoid deep nesting like references/sub/deep/file.md.
- Very specific: line 202
Use semantic tags in SKILL.md body for clarity:
- Distinctive: line 244
Use standard CLI tools (git, grep, sed)
- Distinctive: line 245
Write markdown instructions, not platform APIs
- Distinctive: line 246
Keep scripts in common languages (bash, python, node)
- Very specific: line 257
When to add scripts/:
- Distinctive: line 263
Self-contained: Document dependencies at top
- Distinctive: line 290
Missing version: No version field → Add semver for change tracking
- Distinctive: line 296
Inline everything: No references/ → Use progressive disclosure
- Distinctive: line 300
Before publishing a skill:
- Distinctive: line 306
No secrets: No API keys, tokens, or credentials in files
- Very specific: line 308
Use skills-ref validation tool (from agentskills/agentskills repo) if available.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build Commands
- Build all packages:
pnpm build - Build specific package:
cd packages/<name> && pnpm build - Dev mode (watch):
pnpm devorcd packages/<name> && pnpm dev - Type check:
pnpm typecheck - Lint:
pnpm lint - Test:
pnpm test - Clean:
pnpm clean
Project Structure
This is a pnpm monorepo containing Claude Code extensions:
claude-skills/
├── packages/ # MCP servers (TypeScript, builds to dist/)
│ ├── mcp-github-issues/
│ └── mcp-debug-cycle/
├── skills/ # Agent Skills (SKILL.md format)
│ └── code-review/
└── hooks/ # Claude Code hooks (Node.js scripts)
├── cost-monitor/
├── notify-complete/
└── tdd-enforcement/Architecture
MCP Servers (packages/)
TypeScript packages following MCP SDK patterns:
- Entry:
src/index.tsexportsServerfrom@modelcontextprotocol/sdk/server/index.js - Tools:
src/tools/*.tsexportTooldefinitions and implementation functions - Utils:
src/utils/*.tsfor shared logic (e.g.,gh-cli.tswraps GitHub CLI) - Build: TypeScript compiles
src/→dist/, usingtsconfig.base.json+ package-leveltsconfig.json - Execution:
dist/index.jsis the MCP server entry point (runs vianode)
Tool implementations follow this pattern:
export const toolName: Tool = {
name: "mcp_tool_name",
description: "...",
inputSchema: { /* Zod or JSON Schema */ }
}
export async function toolName(args: ArgsType): Promise<ToolResponse> {
// Implementation
}Agent Skills (skills/)
Agent Skills Specification (agentskills.io) compliant format:
- Structure: Each skill is a directory with
SKILL.mdas the manifest - Frontmatter: YAML with required fields
name(lowercase-hyphen only) anddescription - Content: Markdown body with skill instructions, using XML-style tags for structure:
<essential_principles>- Core philosophy and rules<intake>- User-facing prompt for skill invocation<routing>- Pattern matching to workflow files<reference_index>- Links to reference docs<workflows_index>- Available workflow files
- Supporting files:
references/- On-demand docs (e.g., checklists, common issues)workflows/- Step-by-step procedures (e.g., review-diff.md)scripts/- Executable code (if needed)assets/- Templates, data files
Hooks (hooks/)
Node.js scripts triggered by Claude Code lifecycle events:
- Structure: Each hook is a directory with
hooks.json(config) +.js(implementation) - Config:
hooks.jsondefines matcher (e.g.,"PostToolUse","Stop","PreToolUse") - Implementation: Node.js script receives stdin with event data, performs action
- Critical: Use absolute paths in
hooks.jsoncommand field (cwd resets between invocations) - State: No in-memory persistence - load/save from files (e.g.,
~/.claude/usage.json)
Key Patterns
MCP Tool Safety
- Shell injection prevention: Use
execFilenotexec(seegh-cli.ts) - Input validation: Zod schemas in tool definitions
- Error handling: Return
{ content: [...], isError: true }for errors
Agent Skills Compatibility
- Naming: Skill names must match directory name, lowercase-hyphen only
- Progressive disclosure: Keep SKILL.md body <5000 tokens, use
references/for detail - Cross-agent: SKILL.md format works across different AI agents (Claude, GPT, etc.)
TypeScript Configuration
- Base config:
tsconfig.base.jsonhas strict mode, ES2022 target, NodeNext modules - Package configs: Extend base, set
outDir: "dist"androotDir: "src" - Imports: Use
.jsextensions in TypeScript imports (ES modules requirement)
Development Workflow
Adding a New MCP Server
- Create
packages/mcp-<name>/directory - Add
package.jsonwith"type": "module"and@modelcontextprotocol/sdkdependency - Create
src/index.tswith Server setup - Create
src/tools/*.tsfor each tool - Add
tsconfig.jsonextending../../tsconfig.base.json - Build with
pnpm build - Test by adding to
~/.claude/settings.jsonmcpServers config
Adding a New Skill
- Create
skills/<skill-name>/directory - Create
SKILL.mdwith frontmatter (name, description) and markdown body - Optional: Add
references/,workflows/,scripts/subdirectories - Validate naming: lowercase-hyphen only, no consecutive hyphens
- Install with
cp -r skills/<skill-name> ~/.claude/skills/
Adding a New Hook
- Create
hooks/<hook-name>/directory - Create
hooks.jsonwith matcher and absolute path to script - Create Node.js script that reads stdin, performs action
- Use absolute paths for file operations (cwd is unstable)
- Install by merging
hooks.jsoninto~/.claude/hooks.json
Cross-Agent Compatibility
Skills in this repo follow the Agent Skills Specification (agentskills.io):
- Portable format: SKILL.md works across Claude, GPT, Gemini, etc.
- No lock-in: Markdown + YAML frontmatter, no proprietary JSON
- Validation: Can be validated with
skills-reftool - Distribution: Can be shared via git, npm, or skill registries
When creating or modifying skills, ensure compatibility:
- Name matches directory (lowercase-hyphen)
- Description is clear and concise (<1024 chars)
- SKILL.md body uses semantic XML tags for structure
- References loaded on-demand, not inline
Agent Skills Best Practices
Required Fields
Every SKILL.md must include YAML frontmatter with:
---
name: skill-name # Required: lowercase-hyphen, matches directory
description: Clear description # Required: <1024 chars, what + when to use
---Optional but Recommended Fields
---
name: skill-name
description: Clear description
version: 1.0.0 # Semver for version tracking
compatibility: Requires git CLI # Dependencies/requirements
metadata:
category: development # Classification (development, creative, etc.)
requires: git,node # Tool dependencies
platforms: claude-code,cursor,vscode # Tested platforms
---Progressive Disclosure Model
Optimize for agent context efficiency:
- Metadata (~100 tokens): Loaded at agent startup for discovery
- SKILL.md body (<5000 tokens): Loaded when skill activates
- References (on-demand): Loaded only when referenced
- Scripts (as-needed): Executed when called
Keep SKILL.md under 500 lines; move details to references/.
Directory Structure Best Practices
Minimal (required):
skill-name/
└── SKILL.mdRecommended:
skill-name/
├── SKILL.md # Core instructions (<500 lines)
├── references/ # On-demand documentation
│ ├── checklist.md # Detailed checklists
│ └── examples.md # Usage examples
├── workflows/ # Step-by-step procedures
│ ├── workflow-1.md
│ └── workflow-2.md
└── scripts/ # Optional automation
├── helper.sh
└── formatter.jsKeep references one level deep - avoid deep nesting like references/sub/deep/file.md.
XML-Style Structure Tags
Use semantic tags in SKILL.md body for clarity:
<essential_principles>- Core philosophy and non-negotiable rules<intake>- User-facing prompt when skill invoked<routing>- Pattern matching to workflow files<reference_index>- Available reference docs<workflows_index>- Available workflow procedures<scripts_index>- Automation scripts (if any)<anti_patterns>- Common mistakes to avoid<success_criteria>- Checklist for completion
What Makes a Good Skill
Domain expertise: Package specialized knowledge
# Good: Specific, actionable domain knowledge
name: code-review
description: Automated code review against CLAUDE.md conventions
# Bad: Too generic, no clear domain
name: helper
description: Helps with stuffRepeatable workflows: Enable consistent execution
<process>
<step name="gather-context">
## Step 1: Gather Context
[Clear, numbered instructions]
</step>
</process>New capabilities: Extend agent abilities
- Provide procedural knowledge agents lack
- Integrate external tools via scripts
- Capture organizational conventions
Platform-Agnostic Design
Do:
- Use standard CLI tools (git, grep, sed)
- Write markdown instructions, not platform APIs
- Keep scripts in common languages (bash, python, node)
- Reference generic file paths (
./references/, not/Users/specific/path)
Don't:
- Hardcode Claude-specific features
- Use proprietary APIs
- Assume specific IDE extensions
- Include absolute paths in skill files
Scripts Directory (Optional)
When to add scripts/:
- Automating repetitive tasks (diff formatting, report generation)
- Integrating external tools (API calls, DB queries)
- Complex data transformations
Script guidelines:
- Self-contained: Document dependencies at top
- Safe inputs: Validate args, prevent injection
- Clear output: Structured, parseable results
- Error handling: Exit codes and messages
Example structure:
#!/usr/bin/env bash
# Description: What this script does
# Dependencies: git, jq
# Usage: ./script.sh <arg1> <arg2>
set -euo pipefail # Fail fast
# Validate inputs
if [ $# -lt 2 ]; then
echo "Usage: $0 <arg1> <arg2>"
exit 1
fi
# Do work
# ...Common Mistakes to Avoid
- Generic names:
helper,utils,misc→ Use specific, descriptive names - Missing version: No version field → Add semver for change tracking
- Platform lock-in: Claude-specific code → Keep platform-agnostic
- Monolithic SKILL.md: 1000+ lines → Split into references/workflows
- Deep nesting:
references/sub/deep/file.md→ Keep one level deep - Vague descriptions: "Helps with code" → Specific what + when
- No compatibility info: Unknown dependencies → Document requirements
- Inline everything: No references/ → Use progressive disclosure
Validation
Before publishing a skill:
- Name check: Lowercase-hyphen, matches directory, no consecutive hyphens
- Frontmatter: Valid YAML, required fields present
- Length: SKILL.md <500 lines, description <1024 chars
- References: One level deep, clear index in SKILL.md
- Platform test: Works in Claude Code, Cursor, or VS Code
- No secrets: No API keys, tokens, or credentials in files
Use skills-ref validation tool (from agentskills/agentskills repo) if available.
Distribution
Skills are portable and can be shared via:
- Git: Version control, easy cloning
- NPM: Package for
npm install - Skill registries: Future centralized discovery
- Direct copy:
cp -r skill-name ~/.claude/skills/
Include a README.md for installation instructions and examples.
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.

