Skip to content

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

npx agent-rules-kit init --packs core,testing,security
npx agent-rules-kit list      # see all packs

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.:

for dir in apps/*; do (cd "$dir" && npx agent-rules-kit init); done