.claude/skills/init-project/SKILL.md
Bootstrap project-specific Claude Code rules and product documentation by analyzing the codebase structure, dependencies, and conventions. Use when setting up Claude Code for a new project, or when the user asks to initialize rules, configure Claude for a project, or bootstrap project settings.
npx skillsauth add JLighter/dotfiles init-projectInstall 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.
You are a project configuration specialist. Your job is to analyze a codebase and generate project-specific .claude/rules/ files that reflect the actual structure, libraries, and conventions of the project.
domain.md rule if there is no domain layer. Do not create an api.md rule if there is no API.Read the following (skip what does not exist):
Package/dependency files:
package.json, package-lock.json, bun.lockb, yarn.lockgo.mod, go.sumCargo.tomlpyproject.toml, requirements.txt, Pipfilecomposer.jsonGemfilemix.exs*.csproj, *.slnbuild.gradle, pom.xmlConfig files:
tsconfig.json, jsconfig.jsontailwind.config.*, postcss.config.*biome.json, .prettierrc*, .eslintrc*, dprint.json.editorconfigDockerfile, docker-compose.*openapi.*, swagger.*.env.exampleProject structure:
find . -type f -name '*.ts' -o -name '*.tsx' -o -name '*.go' -o -name '*.py' -o -name '*.rs' -o -name '*.java' -o -name '*.vue' -o -name '*.svelte' | head -80 to understand the file layout.ls -la at root and key subdirectories to map the structure.Existing Claude config:
.claude/rules/ already exists..claude/CLAUDE.md exists.docs/ exists.From the analysis, determine:
| Aspect | Detection | |--------|-----------| | Language(s) | File extensions, dependency files | | Framework | Dependencies (Next.js, Nuxt, SvelteKit, Django, Rails, Gin, Axum, Spring...) | | Framework version | Lock file or dependency version | | CSS approach | Tailwind, CSS modules, styled-components, Sass, plain CSS | | State management | Redux, Zustand, Pinia, Jotai, signals... | | API style | REST, GraphQL, gRPC, tRPC | | ORM/DB | Prisma, Drizzle, TypeORM, GORM, SQLAlchemy, Diesel... | | Testing | Vitest, Jest, pytest, go test, RSpec... | | Monorepo | Turborepo, Nx, pnpm workspaces, Lerna | | Architecture | Layered, hexagonal, feature-based, module-based |
Present the detected stack to the user for confirmation before generating rules.
For each detected framework/library, identify the community-recommended conventions:
Directory structure: Use the official docs' recommended structure. Examples:
app/, app/api/, components/, lib/pages/, pages/api/, components/, lib/pages/, components/, composables/, server/api/src/routes/, src/lib/, src/lib/components/<app>/models.py, <app>/views.py, <app>/urls.pyapp/models/, app/controllers/, app/views/cmd/, internal/, pkg/src/, src/lib.rs, src/main.rsNaming conventions: Use what the framework recommends (kebab-case files in Next.js, PascalCase in Angular, etc.).
Import patterns: Follow the framework's recommended import order and aliasing.
If you are not 100% certain of the current convention for a specific version, use the context7 MCP tool to fetch the latest documentation.
Create .claude/rules/ files in the project directory. Each rule file:
---
paths:
- "actual/paths/from/this/project/**"
- "other/actual/path/**"
---
# [Layer/Concern] Rules — [Framework] [Version]
## [Category]
- [Rule based on community convention for this version]
- [Rule specific to this project's structure]
domain.md — If a domain/core layer exists:
docs/domain/glossary.md if it exists).api.md — If API endpoints exist:
database.md — If an ORM/database layer exists:
testing.md — If tests exist:
config.md — If infra/config layer exists:
If .claude/CLAUDE.md does not exist, create it with:
# Project: [name from package.json or directory]
## Stack
- [Language] [version]
- [Framework] [version]
- [Key libraries with versions]
## Commands
- `[detected build command]` — build the project
- `[detected test command]` — run tests
- `[detected lint command]` — lint code
- `[detected dev command]` — start dev server
## Structure
- `[actual path]` — [purpose]
- `[actual path]` — [purpose]
## Conventions
- [Any conventions detected from existing code, linter config, or editorconfig]
Present a summary:
| File created | Scope | Paths covered |
|-------------|-------|---------------|
| .claude/rules/domain.md | DDD layer isolation | src/domain/** |
| .claude/rules/api.md | API conventions | src/api/**, app/api/** |
| .claude/CLAUDE.md | Project context | — |
Flag anything that could not be determined automatically and ask the user.
Ask the user: "Do you want me to initialize the product documentation in docs/?"
If yes (or if docs/ does not exist and the project has substantial code):
Launch the pm-review agent in init mode: "Analyze this codebase and create the documentation structure in docs/. The project uses [detected stack]. The structure is [detected structure]."
This will:
docs/ structure (glossary, business rules, context map, design system spec, etc.).If the user declines, skip this step and mention they can run /pm-review init later.
Present the complete initialization summary:
| Category | Files created | Status |
|----------|-------------|--------|
| Project rules | .claude/rules/*.md | list |
| Project CLAUDE.md | .claude/CLAUDE.md | created / already existed |
| Product documentation | docs/** | initialized / skipped |
Suggest next steps:
/new-feature [description] to spec the first feature./adr to formalize a pending architectural decision./review-all to run a comprehensive review of existing code.~/.claude/rules/ (global backend, frontend, styles rules).$ARGUMENTS
development
Launch UX review (visual hierarchy, interaction, user flow). Use when the user asks to review UX, check UI, or after writing frontend components.
development
Deep security audit of the codebase. Traces data flows, validates findings adversarially, and proposes patches. Use for dedicated security audits, pen-test preparation, or when the user asks to scan for vulnerabilities.
data-ai
Smart review that detects file types and launches the right review agents. Use when the user asks to review a feature, review changes, or after implementing a feature.
development
Audit product documentation coherence against the codebase. Use when the user asks to check docs, verify documentation, or ensure docs are up to date.