Generate a CLAUDE.md and .cursorrules pair that match the actual patterns in your monorepo.
Emit per-pattern slash commands so Claude Code can scaffold new resources without prompting.
Produce a plopfile and Handlebars templates for zero-token local scaffolding of repeated file types.
Refresh existing rule files in place after a refactor without overwriting hand-edited sections.
Requires Node 18 or newer and an existing subscription to Claude Code, Cursor, Windsurf, Copilot, or Cline.
mirrorai is a command-line tool that reads your existing codebase and writes out instruction files for the popular AI coding assistants. The point is that the AI tool then follows the conventions already living in your code, rather than inventing its own style. The files it can produce include CLAUDE.md for Claude Code.cursorrules for Cursor.windsurfrules for Windsurf, a Copilot instructions file for GitHub Copilot, and .clinerules for Cline. The project is described as language and stack agnostic. The README mentions Vue and React frontends, Go and Node backends, Python pipelines, Rust command-line tools, and Flutter apps as examples of codebases it will work on, as long as there are discoverable patterns to extract. There is no API key required, because the analysis runs inside your AI tool of choice using your existing subscription. Installation is a single npx command, which copies a file called mirror-init.md into a .claude/commands/ folder as a Claude Code slash command. If you do not use Claude Code, you can paste the contents of that file into Cursor, Windsurf, Copilot Chat, Cline, or any other AI tool and run the same flow. When you invoke /mirror-init, you are asked which AI tools to target and whether to also emit a plopfile and Handlebars templates for local scaffolding. Under the hood, mirrorai detects the language and framework from manifest files such as package.json, go.mod, or pyproject.toml. It then scans the business code, groups files into clusters by type, and only keeps clusters that have at least three instances, at least 50 lines, and at least 80 percent structural similarity. From the matched clusters it can produce up to four kinds of artifact: the rule files for each selected tool, one slash command per pattern for Claude Code, an optional plopfile with one generator per pattern, and optional Handlebars templates extracted from a seed file. The generators are validated by syntax check, load check, trial run, and a semantic comparison against the seed, with broken ones auto-repaired or removed. The command is idempotent. On a re-run it detects existing files, marks each as either mirrorai-generated or user-authored, and offers three options: regenerate everything, refresh existing files in place, or regenerate only specific named patterns. User-authored files get a per-file merge, overwrite, or skip prompt. Node 18 or newer is required, and the project is MIT-licensed.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.