Init project

From escapeboy/ai-prompts · View interactive version

Init project is an AI agent skill from the GitHub repository escapeboy/ai-prompts. Initialize Claude Code optimization for a new project — detect stack, create memories, generate constitution, configure settings. Use when starting in a fresh/uninitialized project or the user says "init project"/"set up Claude Code here"; skip on an already-initialized project.

How to use this skill

Skill file

/init-project — Project Initialization

Sets up Claude Code optimization for a new project in 10-15 minutes. Detects the tech stack, fetches best practices, creates Serena memories, generates a project constitution, and configures optimization settings.

Run once per project. After init, use /optimize and /ctx load for all subsequent work.

When to Use This Skill (and When NOT to)

| Use this skill for | Use a simpler approach for |

|--------------------|----------------------------|

| A project you'll work in repeatedly and want optimized from the start | A repo you'll touch once — just read what you need and go |

| First-time setup of Serena memories + constitution + optimization config | Re-running work on an already-initialized project — use /ctx load + /optimize instead |

| A codebase whose conventions/architecture Claude should learn once and reuse | Adding a single memory or tweaking one setting — edit the file directly |

| Standing up the .claude/ + .serena/ scaffold in a fresh clone | A throwaway spike or scratch directory |

Start simple. Reach for this skill only when the project is one you'll return to and the up-front setup pays back across many sessions. Run it once per project — it is initialization, not a per-session command.

Usage

/init-project [action] [options]

Quick Examples

/init-project --full            # Complete initialization (recommended)
/init-project detect            # Just detect the stack
/init-project fetch rails       # Fetch best practices for a language/framework
/init-project constitution      # Generate constitution only
/init-project memories          # Initialize Serena memories only
/init-project optimize          # Configure optimization settings only

Quick Start: Full Initialization

/init-project --full

This runs all steps in sequence and produces a fully configured project. Takes 10-15 minutes. After completion you'll have:

Actions

Each action is a step of --full and can also be run on its own. High-level decision core below; deep detail lives in references/ — read the linked file only when running that action.

`detect` — Auto-detect project type and stack

Scans the project directory to identify the tech stack, frameworks, test runner, CI, and conventions, then recommends which memories and constitution rules to create.

/init-project detect

For the full list of files scanned and the sample output format, read references/detection.md.

`fetch [framework]` — Fetch best practices for your stack

Fetches current best practices, conventions, and anti-patterns for the detected or specified framework, summarized into memory-ready format.

/init-project fetch rails

For the supported-stack table, the fetch process, and per-framework CLAUDE.md templates, read references/frameworks.md.

`constitution` — Generate project constitution

Creates .claude/settings/constitution.json with architectural rules tailored to the detected stack.

/init-project constitution
/init-project constitution --framework rails
/init-project constitution --framework nextjs --strict

For the constitution JSON anatomy and the per-framework rule sets, read references/constitution.md.

`memories` — Initialize Serena memories

Creates the initial Serena memories by analyzing the codebase: architecture.md, codebase-conventions.md, and testing-strategy.md in .serena/memories/. Requires Serena MCP.

/init-project memories

For the exact contents of each memory file, read references/memories.md.

`optimize` — Configure project-level optimization settings

Creates .claude/settings/token-optimization.json with project-specific overrides of the global token optimization settings:

/init-project optimize

CLAUDE.md Generation

If no CLAUDE.md exists, --full will create one:

/init-project --full

The generated CLAUDE.md includes:

After Initialization

Once init is complete, start working:

# Load context at the start of every session
/ctx load

# Start work with full optimization
/optimize "your task description"

# Check everything is working
/optimize status

Time Estimate

| Action | Time |

|--------|------|

| detect | ~30 sec |

| fetch [framework] | ~2 min |

| constitution | ~2 min |

| memories (3 files) | ~8 min |

| optimize | ~1 min |

| --full (all steps) | 10-15 min |

Troubleshooting for failed detection, missing Serena, and constitution conflicts: references/troubleshooting.md.

Boundaries

Always

Ask first

Never

See Also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.