Skip to content

Architecture

agent-rules-kit is content + a tiny composer. The rules live as markdown packs; the CLI selects packs, composes them into one document, and writes it to the target file.

flowchart LR
  R["rules/*.md<br/>(core, testing, security, git, refactoring)"] --> C["composeRules(ids)"]
  SEL["--packs core,testing"] --> C
  C --> DOC["single markdown"]
  T["--target agents|claude|cursor"] --> W["write file"]
  DOC --> W
  W --> OUT["AGENTS.md / CLAUDE.md / .cursorrules"]

Module map

Module Responsibility
rules/*.md The rule packs themselves — reviewable markdown
packs.ts Pack registry + loader that reads the markdown bodies
compose.ts Resolve pack ids (incl. all) and compose the document
targets.ts Map a target to its output filename
cli.ts Argument parsing, init / list commands

Design principles

  • Content first — the value is the rules; the code is a thin composer around them.
  • Reviewable — packs are plain markdown, so improvements are normal PRs.
  • No lock-in — output is a plain file your assistant already reads; regenerate any time.
  • Tiny & dependency-free — pure functions, testable by reading the shipped rules/.