I wasn't happy with bloated static AGENTS.md files in a monorepo, so I built cAGENTS to compile instructions dynamically.
cAGENTS composes context-aware instruction files (AGENTS.md, CLAUDE.md, .cursorrules) from small templates with simple conditions. It can detect which tools or files exist, tailor rules per environment, and even drop in guidance for matching file types (like *.ts).
npm i -D cagents
npx cagents init
npx cagents build
Built in Rust, shipped via npm. MIT-licensed.
Repo: github.com/centralinc/cAGENTS
jordanmnunez•11h ago
I wanted AI agents and developers to share a single source of rules that adapted to context.
- A local dev might have bd installed.
- A cloud coding agent might have none of them with other resistrictions.
Static AGENTS.md files don’t scale to those realities. They’re either overly general or wrong for half your environments.
How it works
Templates live in .cAGENTS/templates/ with YAML headers that define conditions:
When you run cagents build, it evaluates conditions and composes AGENTS.md (and CLAUDE.md, etc.) using only relevant templates.
If bd is installed → the section appears.
If not → it’s skipped. Same templates, different contexts.
My goal is to have this library help me implement progressive disclosure for AI agents. I want to present the right amount of context at the right time. I'm experimenting with `cagent context` so an AI agent can look up all relevant rules for any file automatically and On-demand detail granularity. The dream is that agents that don’t need a 300-line AGENTS.md. just the parts that matter for what they’re touching.
How I use cAGENTS:
- Gitignore instruction files; commit only templates.
- Auto-build on postinstall.
- Keep templates small and composable.
jordanmnunez•12h ago
cAGENTS composes context-aware instruction files (AGENTS.md, CLAUDE.md, .cursorrules) from small templates with simple conditions. It can detect which tools or files exist, tailor rules per environment, and even drop in guidance for matching file types (like *.ts).
Built in Rust, shipped via npm. MIT-licensed. Repo: github.com/centralinc/cAGENTSjordanmnunez•11h ago
Static AGENTS.md files don’t scale to those realities. They’re either overly general or wrong for half your environments.
How it works
Templates live in .cAGENTS/templates/ with YAML headers that define conditions:
When you run cagents build, it evaluates conditions and composes AGENTS.md (and CLAUDE.md, etc.) using only relevant templates. My goal is to have this library help me implement progressive disclosure for AI agents. I want to present the right amount of context at the right time. I'm experimenting with `cagent context` so an AI agent can look up all relevant rules for any file automatically and On-demand detail granularity. The dream is that agents that don’t need a 300-line AGENTS.md. just the parts that matter for what they’re touching.How I use cAGENTS: