aiconfig-gen
v0.1.0
Published
Generate AI coding config from your codebase — one command, all tools
Maintainers
Readme
Every AI coding tool works better with context. But writing CLAUDE.md, .cursorrules, or copilot-instructions.md by hand is tedious — and keeping them in sync is worse.
aiconfig-gen analyzes your project and generates config files for all major AI coding tools in seconds.
npx aiconfig-genWhat it generates
| File | Tool | Description |
|------|------|-------------|
| CLAUDE.md | Claude Code | Project context, conventions, commands, structure |
| .cursorrules | Cursor | Editor rules with framework-specific guidelines |
| .github/copilot-instructions.md | GitHub Copilot | Coding conventions and project context |
| .windsurfrules | Windsurf | Project rules and conventions |
| MEMORY.md | All tools | Persistent AI memory (stack, decisions, patterns) |
Why?
- You use AI coding tools but they don't know your project conventions
- You've written a
CLAUDE.mdbefore but it was incomplete or outdated - You switched from Cursor to Claude Code (or vice versa) and need new config files
- You maintain multiple projects and don't want to write config files for each one
- You want AI tools to follow your naming conventions, path aliases, and commit style — without explaining it every time
Quick Start
# Analyze current directory, generate all config files
npx aiconfig-gen
# Only generate for specific tools
npx aiconfig-gen --only claude
npx aiconfig-gen --only cursor
# Preview without writing files
npx aiconfig-gen --dry-run
# Overwrite existing config files
npx aiconfig-gen --force
# Analyze a different directory
npx aiconfig-gen --path ./my-project
# Interactive mode — choose which files to generate
npx aiconfig-gen --interactiveWhat it detects
aiconfig-gen reads your project files and extracts everything an AI coding tool needs to know:
| Category | Detected From | Examples |
|----------|--------------|----------|
| Framework | package.json, pyproject.toml, go.mod | Next.js, React, Expo, Vue, Nuxt, Svelte, Angular, Express, Fastify, NestJS, Astro, Remix, SvelteKit, Hono, and more |
| Language | Dependencies, config files | TypeScript, JavaScript, Python, Go, Rust |
| Styling | Dependencies | Tailwind CSS, styled-components, Emotion, Chakra UI, Material UI, Sass |
| Testing | Dependencies | Vitest, Jest, Playwright, Cypress, Mocha |
| Database | Dependencies | PostgreSQL, MySQL, SQLite, MongoDB, Redis, Firebase, Supabase |
| ORM | Dependencies | Prisma, Drizzle, TypeORM, Sequelize, Mongoose, Kysely |
| Auth | Dependencies | NextAuth.js, Clerk, Passport.js, Lucia, Supabase Auth, Firebase Auth |
| State Management | Dependencies | Zustand, Redux Toolkit, Jotai, TanStack Query, SWR, Pinia |
| Linter/Formatter | Config files | ESLint, Prettier, Biome |
| File naming | Source files scan | kebab-case, camelCase, PascalCase, snake_case |
| Path aliases | tsconfig.json | @/ imports |
| Test location | File structure | Co-located or separate directory |
| Monorepo | package.json, directory structure | Workspaces, packages/, apps/ |
| Commit style | Git history (last 50 commits) | Conventional Commits or freeform |
| Entry points | File structure | src/index.ts, app/page.tsx, main.go, etc. |
| Docker | Root files | Dockerfile, docker-compose.yml |
| CI/CD | Config directories | GitHub Actions, GitLab CI, CircleCI |
| Env variables | .env.example | Variable names for documentation |
Example Output
For a Next.js + Tailwind + TypeScript project, aiconfig-gen generates:
CLAUDE.md
# my-project
## Tech Stack
- **Framework:** Next.js
- **Language:** TypeScript
- **Styling:** Tailwind CSS
- **Testing:** Vitest
- **Linter:** ESLint
- **Package Manager:** pnpm
## Conventions
- Path alias `@/` for imports
- File naming: kebab-case
- TypeScript strict mode enabled
- Tests co-located with source files (e.g. `Button.tsx` → `Button.test.tsx`)
- Commit messages: Conventional Commits (feat:, fix:, refactor:, etc.)
## Guidelines
- Use the App Router (`app/` directory). Use Server Components by default, add `"use client"` only when needed.
- Place API routes in `app/api/`.
- Use `next/image` for images, `next/link` for navigation.
- Use Tailwind utility classes. Avoid custom CSS unless absolutely necessary.
## Commands
- `pnpm dev` — Start dev server
- `pnpm build` — Production build
- `pnpm test` — Run tests
- `pnpm lint` — Lint code
## Project Structure
- `public/`
- `src/`
- `src/app/`
- `src/components/`
- `src/hooks/`
- `src/lib/`.cursorrules
You are working on "my-project".
Tech stack: Next.js, TypeScript, Tailwind CSS, Vitest.
Package manager: pnpm.
## General Rules
- Use the path alias `@/` for imports.
- Use kebab-case for file names.
- TypeScript strict mode is enabled. Do not use `any`. Type everything explicitly.
- Place tests next to source files (e.g. `Button.tsx` → `Button.test.tsx`).
- Use conventional commit messages (feat:, fix:, refactor:, etc.).
- Code must pass ESLint checks.
## Framework Guidelines
- Use the App Router pattern (`app/` directory) unless the project uses Pages Router.
- Use Server Components by default. Add `"use client"` only when needed (hooks, interactivity).
- Use `next/image` for images and `next/link` for navigation.
- Place API routes in `app/api/`.
- Use Tailwind utility classes. Avoid custom CSS unless absolutely necessary.
- Extract repeated class combinations into components, not `@apply`.CLI Options
| Flag | Description |
|------|-------------|
| --path <dir> | Project directory to analyze (default: .) |
| --only <tools> | Only generate specific files: claude, cursor, copilot, windsurf, memory |
| --dry-run | Preview what would be generated without writing files |
| --force | Overwrite existing config files |
| --interactive | Choose which files to generate interactively |
Supported Languages
| Language | Package File |
|----------|-------------|
| TypeScript / JavaScript | package.json |
| Python | pyproject.toml |
| Go | go.mod |
| Rust | Cargo.toml |
Full dependency detection (frameworks, ORMs, etc.) is currently supported for JavaScript/TypeScript projects. Other languages get basic language detection.
Contributing
Contributions are welcome! Here's how to get started:
git clone https://github.com/philippsnl2/aiconfig-gen.git
cd aiconfig-gen
pnpm install
pnpm dev # Watch mode
pnpm test # Run testsIdeas for contributions:
- Add detection for more frameworks/tools
- Improve generated rules for specific frameworks
- Add support for more AI coding tools
- Better Python/Go/Rust ecosystem detection
License
MIT
