Detect your tech stack → generate tailored rules & commands for your AI code assistants.
autostackrc generates rules and slash-commands specific to your stack and writes them in the native
format of each assistant — Claude Code, Cursor, GitHub Copilot, and opencode.
📖 Docs & portal: https://cesarzuniga.github.io/autostackrc (deployed via GitHub Pages from docs/).
npx autostackrc- Detect — scans
package.json, config files, and file extensions to identify your stack. - Assemble — builds a baseline of rules + commands from static templates (offline, auditable).
- Enrich — hands the baseline to your installed AI coder CLI (using its existing login session, no API key) to make the rules specific and correct for your stack.
- Write — projects one agent-agnostic result into every selected assistant's files.
If no coder CLI is found (or --no-llm), it emits the static templates as-is — never hard-fails.
| Assistant | Rules | Commands |
|---|---|---|
| Claude Code | CLAUDE.md (managed block) |
.claude/commands/*.md |
| Cursor | .cursor/rules/*.mdc (one 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 |
Shared files (CLAUDE.md, AGENTS.md, copilot-instructions.md) are edited inside an
<!-- autostackrc:start -->…<!-- autostackrc:end --> block, so re-runs update only that block and leave your
own content untouched. A autostackrc-lock.json records every file written.
autostackrc does not call any API directly. It detects an installed coder CLI in this order and runs
it headless, feeding the prompt on stdin and parsing the JSON it returns:
claude(Claude Code) —claude -popencode—opencode runcursor-agent(Cursor) —cursor-agent -p
Whatever session that CLI is already logged into is what does the work. Force one with --coder.
npx autostackrc Detect, generate, write (interactive)
-y, --yes Skip confirmation prompts
--dry-run Show 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
-h, --help Show this help
Node.js >= 22.6.0 (uses native TypeScript type-stripping).
- Add a technology: create
templates/rules/<id>.md(frontmatter + rule body) and add a seed (detect rules + command ids) toTECH_SEEDSincatalog.ts. - Add a command: create
templates/commands/<id>.md(frontmatter + prompt body); mark itgeneric: trueto emit for every stack, or wire its id into a tech'scommandsincatalog.ts. - Add an assistant: add a writer in
writers/and register it inwriter.ts+agents.ts.