skills/ruler-rules-init/SKILL.md
Migrate and bootstrap Ruler-based AI rules across repositories with English-first templates, preset-based project detection, and safe, idempotent setup. Use when creating or standardizing `.ruler/*` files, generating `AGENTS.md`/`CLAUDE.md`, wiring `ruler:apply` into `package.json`, adding generated-file ignores in `.gitignore`, and designing `applyTo` scoping patterns such as `**` and `web/**`.
npx skillsauth add adonis0123/adonis-skills ruler-rules-initInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Migrate a repository to a reusable Ruler rules structure with a safe audit/apply workflow. Keep default templates in English and avoid overwriting existing repository-specific content unless explicitly forced. Support different project types through preset-based template selection.
Collect these inputs before applying changes:
audit or apply mode.auto, base, nextjs, monorepo, or node-lib (default: auto).skills:sync:claude integration.--force).Presets control the content of project-specific template files (10-project-context.md, 20-dev-commands.md, 30-coding-conventions.md). Universal files (ruler.toml, AGENTS.md, 00-core-principles.md) are always sourced from the base directory.
| Preset | Auto-detect Signal | Use Case |
|--------|-------------------|----------|
| base | Fallback | Any project, minimal with placeholders |
| nextjs | next.config.* exists | Next.js App Router projects |
| monorepo | turbo.json or pnpm-workspace.yaml exists | Turborepo / pnpm workspace |
| node-lib | package.json has main or exports, no next.config.* | Node.js libraries |
--preset <name> flag (highest priority).--preset auto or omitted).base if no signals match.audit mode.apply mode to create missing files and safe defaults.apply to confirm idempotency.ruler:apply in the target repo to generate root rule outputs.Need only Ruler integration:
Use default behavior (do not pass --with-optional-sync).
Need optional Claude skills sync as well:
Pass --with-optional-sync to include skills:sync:claude suggestions.
Targeting a specific project type:
Pass --preset nextjs, --preset monorepo, or --preset node-lib.
Or let auto-detection choose the right preset.
Existing files differ from templates:
--force.--force only when intentional template replacement is required.Use these commands from this skill directory:
# Audit (default preset auto-detection)
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode audit
# Apply with auto-detected preset
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply
# Apply with explicit preset
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --preset nextjs
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --preset monorepo
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --preset node-lib
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --preset base
# With optional sync and force
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --preset nextjs --with-optional-sync
node ./scripts/bootstrap-ruler.mjs --target /path/to/repo --mode apply --force
After applying, verify:
.ruler/ruler.toml exists and defines codex + claude outputs..ruler/*.md templates exist..gitignore contains the Ruler generated-files block.package.json contains ruler:apply.is-ci style guard is used, is-ci is installed (pnpm add -D is-ci).postinstall follows the CI-skip recommendation or an explicit local alternative (preserve existing setup commands by chaining with && (...)).ruler:apply succeeds in the target repository.Script:
scripts/bootstrap-ruler.mjs
References:
references/migration-playbook.md
references/applyto-patterns.md
Templates:
assets/templates/base/.ruler/ (universal + fallback)
assets/templates/presets/nextjs/.ruler/ (Next.js overlay)
assets/templates/presets/monorepo/.ruler/ (monorepo overlay)
assets/templates/presets/node-lib/.ruler/ (Node.js library overlay)
tools
Use when the user's pain is "adding/removing one more X means editing N files" and X is a recurring variant kind: popup, banner, modal, ad slot, payment method, AI model/tool, form field type, connector, sub-site, command, menu item, agent, extension point, or data source. Use when they want to design, refactor, review, name, or explain a pluggable mechanism using registry, interface/trait contract, runtime core, and convention folders; mention pluginize, pluggable, plugin architecture, extension point, registry pattern, or extensibility. Use when explaining the first-principles rationale, DDD/SOLID/OCP mapping, or industry analogies behind that structure. Use for cross-stack mapping to VSCode contributes, Webpack/Vite plugins, Rust/Tauri connectors, Python entry_points, or cargo features. Skip one variant's internals/styles/hooks/copy/bugs, and skip register/registry meaning DI container, user signup, or package registry.
development
Use BEFORE heavier workflow skills when route choice matters. Route creative work without a design doc/spec to Brainstorm; destructive or hard-to-reverse work to Discuss; unresolved decisions, Plan/Full fan-out, ship checks, unclear bugs, and fresh-eyes fix-then-re-review need this gate. Skip single-line read-only lookups, pure typo/formatting edits, trivial safe one-line fixes, and clearly safe named-skill requests. Outputs Route, Runtime skill, Fallback alias, and Execution path.
development
Cross-agent code review handoff and review-fix-re-review loop with persistent packet artifacts. Requires a git repo because packet addressing uses git rev-parse --show-toplevel. Use when the user asks for an independent, read-only second pair of eyes on a diff/branch/PR another agent or teammate implemented; asks to verify reviewer feedback before fixing; says a fix is done and wants scoped re-review; asks to continue the latest review packet; or asks for first-principles, DDD, high-cohesion/low-coupling review. Persists each loop under $repo_root/.review-handoff/active/ so agents can resume without copy-paste. Do NOT use for ordinary implementation, generic staged-change review, review-comment copy editing, non-git folders/zips/tarballs/temp dirs, or when the user names a different review skill.
testing
Enforces 'decide then plan' discipline - the pre-planning decision gate. Use when the user asks for a plan or starts a change while key decisions are unresolved: architecture tradeoffs, data flow, public interfaces, unclear requirements, multi-module scope, or roughly 5+ files affected. Also triggers when the user explicitly wants to discuss, compare options, or review architecture before committing. Core job: reduce incorrect-execution cost by confirming decisions before producing executable plans.