Your stack, taught to your AI.
autostackrc detects your tech stack and generates tailored rules & slash-commands for Claude Code, Cursor, GitHub Copilot, and opencode — enriched by your own coder CLI. No API key.
What it does
autostackrc generates guidance specific to your project and writes it in each assistant's native format — so every AI tool in your repo follows the same rules.
How it works
Scan the project
Reads package.json, config files, and file extensions to identify 44 technologies.
Build a baseline
Static, auditable rule & command templates (from templates/) — works fully offline.
Delegate to your coder
Hands the baseline to your installed coder CLI, using its login session. No API key.
Project into every tool
One agent-agnostic result, written to each selected assistant's files.
claude, opencode, or cursor-agent — runs it headless,
and parses the JSON it returns. Whatever session that CLI is logged into does the work.
No CLI found (or --no-llm)? It emits the static templates as-is — never hard-fails.
Output per assistant
Shared files are edited inside an <!-- autostackrc:start/end --> block, so re-runs update only that block and leave your own content untouched.
| Assistant | Rules | Commands |
|---|---|---|
| Claude Code | CLAUDE.md (managed block) |
.claude/commands/*.md |
| Cursor | .cursor/rules/*.mdc (per tech, globs/alwaysApply) |
.cursor/commands/*.md |
| GitHub Copilot | .github/copilot-instructions.md + .github/instructions/*.md |
.github/prompts/*.prompt.md |
| opencode | AGENTS.md (managed block) |
.opencode/command/*.md |
Usage
Run it in your project root. Interactive by default; scriptable with flags.
# detect, generate, write (interactive) npx autostackrc # accept defaults, no prompts npx autostackrc -y # preview without writing npx autostackrc --dry-run # only some assistants npx autostackrc -a claude-code cursor # offline: static templates only npx autostackrc --no-llm # force a specific coder CLI npx autostackrc --coder opencode
| Flag | Effect |
|---|---|
-y, --yes | Skip confirmation prompts |
--dry-run | Show the plan, write nothing |
-a, --agent | Target subset: claude-code cursor copilot opencode |
--no-llm | Skip enrichment, emit static templates only |
--coder <id> | Force coder CLI: claude, opencode, cursor-agent |
--model <id> | Model hint passed to the coder CLI (if supported) |
-v, --verbose | Show traces and error detail |
Supported stack
Frontend, backend, mobile, data, tooling, and infra — extend the catalog to add more.
Extending
The architecture is one intermediate representation projected by per-assistant writers.
# add a technology → create templates/rules/<id>.md + a seed in TECH_SEEDS (catalog.ts) # add a command → create templates/commands/<id>.md (generic: true, or wire into a tech) # add an assistant → add a writer in writers/, register in writer.ts + agents.ts