rulesforge
v1.0.0
Published
Analyze any codebase and generate optimized AI coding rules for Claude Code, Cursor, Copilot, and more
Maintainers
Readme
RulesForge
Analyze any codebase and generate optimized AI coding rules for Claude Code, Cursor, Copilot, and more.
Your AI coding assistant is only as good as its context. RulesForge scans your project — frameworks, conventions, patterns, dependencies — and generates tailored rules files that make AI understand your codebase.
One command. Four output formats. Zero configuration.
Quick Start
npx rulesforgeThat's it. RulesForge scans your project and generates:
| File | Tool | Purpose |
|------|------|---------|
| CLAUDE.md | Claude Code | Project context, conventions, and rules |
| .cursorrules | Cursor | AI code generation guidelines |
| AGENTS.md | Multi-agent tools | Agent task patterns and file ownership |
| .github/copilot-instructions.md | GitHub Copilot | Code completion context |
What It Detects
Frameworks: React, Next.js, Remix, Astro, Vue, Nuxt, Svelte, Express, Fastify, NestJS, Django, Flask, FastAPI, and more.
Conventions: naming patterns (camelCase/snake_case), import style (relative/absolute/aliases), file naming, semicolons, quote style.
Tooling: package manager, test framework, linter, formatter.
Structure: source directories, test directories, CI/CD, documentation, entry points.
Why Not Just Use /init?
Claude Code's built-in /init generates a basic CLAUDE.md. RulesForge goes deeper:
| Feature | /init | RulesForge |
|---------|---------|------------|
| Framework detection | Basic | 15+ frameworks with version detection |
| Convention analysis | No | Naming, imports, quotes, semicolons |
| Cross-tool output | CLAUDE.md only | CLAUDE.md + .cursorrules + AGENTS.md + Copilot |
| Framework-specific rules | Generic | React hooks, Next.js App Router, Express middleware, etc. |
| Security rules | No | Stack-specific security best practices |
| Quality score | No | Rate your existing rules coverage |
Options
Usage: rulesforge [path] [options]
Arguments:
path Project directory to scan (default: ".")
Options:
--format <formats> Output formats (comma-separated: claude-md,cursorrules,agents-md,copilot)
--dry-run Preview generated content without writing files
--diff Show what would change in existing files
--output <dir> Output directory (default: project root)
--force Overwrite existing files without asking
--quiet Minimal output
--json Output scan results as JSON
-v, --version Show version
-h, --help Show helpExamples
Generate only CLAUDE.md:
npx rulesforge --format claude-mdPreview without writing:
npx rulesforge --dry-runScan a specific project:
npx rulesforge /path/to/projectGet scan results as JSON (for scripting):
npx rulesforge --jsonSupported Frameworks
| Framework | Detection Method | Specific Rules | |-----------|-----------------|----------------| | React | package.json + JSX files | Hooks, components, keys, state | | Next.js | next.config.* | App Router, server components, metadata | | Express | package.json | Middleware, error handling, routing | | TypeScript | tsconfig.json | Strict types, interfaces, generics | | Python | .py files | Type hints, docstrings, imports | | And more... | Auto-detected | Framework-specific best practices |
How It Works
- Scan — Walks your project tree, reads config files, samples source code
- Analyze — Detects frameworks, infers conventions, maps structure
- Generate — Applies framework-specific rules + convention enforcement + security rules
- Write — Creates rules files in your project root
No AI. No API calls. No data leaves your machine. Pure static analysis.
Contributing
Found a framework we should support? Have better rules for your stack? PRs welcome!
git clone https://github.com/Wittlesus/rulesforge
cd rulesforge
npm install
npm testLicense
MIT
