Project Init Skill
Generate a comprehensive, project-specific CLAUDE.md file that helps Claude understand and work effectively with your codebase.
When to Use
- •Starting work on a new project that lacks a CLAUDE.md
- •User asks to "set up Claude for this project" or "create project instructions"
- •User says "project init" or "/project-init"
- •Onboarding to an existing codebase
Process
Phase 1: Auto-Detection
Scan the project root for configuration files to detect the tech stack:
| File | Indicates |
|---|---|
package.json | Node.js project - check for framework (Next.js, Express, etc.) |
pyproject.toml or setup.py | Python project - check for framework (Django, FastAPI, Flask) |
Cargo.toml | Rust project |
go.mod | Go project |
composer.json | PHP project |
Gemfile | Ruby project |
tsconfig.json | TypeScript enabled |
docker-compose.yml | Docker-based deployment |
Dockerfile | Containerized |
.env.example | Environment variables used |
Also scan for:
- •
src/orapp/structure - •
tests/or__tests__/directory - •Database files (prisma/schema.prisma, alembic/, migrations/)
- •CI/CD files (.github/workflows/, .gitlab-ci.yml)
Phase 2: Extract Information
From detected files, extract:
- •Commands - from package.json scripts, Makefile, pyproject.toml
- •Dependencies - key frameworks and libraries
- •Structure - folder organization
- •Environment - required env vars from .env.example
Phase 3: Fill Gaps (Interactive)
Ask the user about things that can't be auto-detected:
- •Project purpose - "What does this project do in one sentence?"
- •Key patterns - "Any specific patterns or conventions I should follow?"
- •Do's and Don'ts - "Anything I should avoid doing in this codebase?"
- •Deployment - "How is this deployed?" (if not obvious)
Use AskUserQuestion tool for this phase.
Phase 4: Generate CLAUDE.md
Create CLAUDE.md in the project root with these sections:
# [Project Name] ## Overview [Auto-detected or user-provided description] ## Tech Stack | Layer | Technology | |-------|------------| | Language | [detected] | | Framework | [detected] | | Database | [detected or N/A] | | Testing | [detected] | ## Getting Started ```bash # [Commands extracted from package.json/Makefile/etc.]
Commands
| Command | Description |
|---|---|
| [extracted commands] |
Architecture
[Folder structure visualization]
Environment Variables
[From .env.example or ask user]
Key Patterns
[User-provided or common patterns for the stack]
Notes for Claude
Do
- •[Project-specific guidelines]
- •Follow existing code patterns
- •Add tests for new functionality
Don't
- •Hardcode credentials or secrets
- •Skip error handling
- •[User-provided don'ts]
Generated by project-init skill
## Output 1. Show detected information summary 2. Ask clarifying questions (Phase 3) 3. Generate CLAUDE.md 4. Show the user what was created 5. Ask if they want to customize anything ## Examples ### Node.js/TypeScript Project
Detected: Node.js + TypeScript + Next.js + Prisma + PostgreSQL Commands: dev, build, start, test, lint, db:migrate Structure: src/app/, src/components/, src/lib/, prisma/
### Python/FastAPI Project
Detected: Python 3.11 + FastAPI + SQLAlchemy + PostgreSQL Commands: dev (uvicorn), test (pytest), lint (ruff) Structure: app/, tests/, alembic/
### Mixed Full-Stack
Detected: Python backend (FastAPI) + React frontend (Vite) Backend: /backend - Python, FastAPI, SQLAlchemy Frontend: /frontend - TypeScript, React, Vite
## Tips - If the project is a monorepo, detect and document each package/service - Look for README.md for additional context - Check for existing CLAUDE.md and offer to enhance rather than replace - Respect .gitignore patterns when scanning