Open Source

agent-rules

What it is

Modular, production-grade instructions for AI coding agents. One source of rules rendered into AGENTS.md, CLAUDE.md, Cursor, Copilot, Claude skills and Windsurf/Devin formats.

I built agent-rules (package name `agentkit-rules`), a set of modular, production-grade instructions for AI coding agents with an installer that writes each tool's current file format. You pick the stacks you actually use, and one `.mdc` source per rule is rendered into every format so they don't drift.

Problem

Every coding agent wants its own rules file: `AGENTS.md`, `CLAUDE.md`, Cursor `.mdc`, Copilot instructions, Claude Code skills, Windsurf and Devin rules. Keeping the same guidance in sync across all of them by hand is tedious, and each format has its own frontmatter and loading rules.

What I built

  • Source rules for TypeScript, Next.js (App Router, server actions, caching), React, Node.js, NestJS, Prisma, Drizzle, Tailwind CSS and shadcn/ui, plus core rules for git, security, testing, accessibility and performance.
  • A CLI that detects stacks from `package.json` and `components.json`, then writes `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/*.mdc`, `.github/copilot-instructions.md` and path-specific instructions, `.claude/skills/<name>/SKILL.md`, and `.devin/rules` / `.windsurf/rules`.
  • Merged documents use marker blocks, so re-running the installer updates its sections and leaves your own text alone. `--dry-run`, `--force` with backups, `list` and `validate` commands are included.
  • A validator that checks Cursor keys, Copilot `applyTo`, skill `name`/`description`, Windsurf `trigger` and the 12,000-character workspace rule limit, run in CI with the test suite and `tsc`.
  • Committed example output for a Next.js SaaS stack and a NestJS API stack.

Stack

TypeScript on Node.js 20.19+, with no runtime dependencies beyond Node itself. Tests use the built-in node --test runner.

Stack

  • TypeScript
  • Node.js
  • AI Agents
  • AGENTS.md
  • Cursor
  • Claude Code
  • Open Source

Gallery