Recipes¶
Set up a new project¶
cd my-project
npx agent-rules-kit init # AGENTS.md, all packs
npx agent-rules-kit init --target claude # also CLAUDE.md
npx agent-rules-kit init --target cursor # also .cursorrules
git add AGENTS.md && git commit -m "chore: add agent rules"
Only the packs you want¶
Keep AGENTS.md up to date in CI¶
# .github/workflows/agent-rules.yml
- run: npx agent-rules-kit init --stdout > /tmp/AGENTS.md
- run: diff -q /tmp/AGENTS.md AGENTS.md || (echo "AGENTS.md is stale — run agent-rules-kit init" && exit 1)
Compose programmatically + append project rules¶
import { writeFileSync } from 'node:fs';
import { composeRules } from 'agent-rules-kit';
const base = composeRules(['core', 'testing', 'security']);
const project = '\n## This repo\n\n- Use pnpm.\n- API code lives in `apps/api`.\n';
writeFileSync('AGENTS.md', base + project);
Monorepo¶
Generate one file per package where assistants look, e.g.: