Project initialization for AI coding agents.
pi-init is a pi plugin that adds the /init command. It reads your project's development standards (CLAUDE.md), scans the codebase, generates an AI-readable project guide (AGENTS.md), audits every file against the standards, and auto-fixes violations.
| File | Author | Purpose | .gitignore? |
|---|---|---|---|
CLAUDE.md |
You | Development standards: coding conventions, tooling, architecture rules | ✅ Yes |
AGENTS.md |
AI (/init) | Project map: structure, entry points, key modules — helps AIs navigate your codebase | ❌ No |
README.md |
You | For humans: introduction, quick start, contribution guide | ❌ No |
CLAUDE.md is the law. AGENTS.md is the map. You write the law.
/initdraws the map and enforces compliance.
# From npm (once published)
pi install npm:pi-init
# From git
pi install git:github.com/user/pi-init
# Local development
pi install ./path/to/pi-initIn pi, run:
/init # Full: AGENTS.md + audit + auto-fix
/init --quick # Fast: regenerate AGENTS.md only, skip audit
- Reads
CLAUDE.md— parses your development standards into structured rules - Scans the project — detects language, framework, entry points, key modules, config files (pure Node.js, zero LLM tokens)
- Generates
AGENTS.md— a structured project guide optimized for AI consumption - Audits the project — checks every relevant file against each rule from
CLAUDE.md - Auto-fixes violations — fixes everything that can be mechanically fixed
- Ensures
.gitignore— addsCLAUDE.mdto.gitignoreif not already there
- First time setting up a project with pi
- After changing
CLAUDE.md(new rules need to be enforced) - After significant codebase changes (AGENTS.md needs updating)
Write your development standards. Examples:
## Build & Test
Run `pnpm dev` to start, `pnpm build` to build, `pnpm test` to test.
## Coding standards
- Use kebab-case for file names, PascalCase for components.
- Every directory must have an AGENTS.md.
- Keep changes surgical — read the local AGENTS.md before editing.
## Architecture
- `app/` is the Next.js App Router. Each route is a folder with `page.tsx`.
- `lib/` contains shared utilities. No React imports allowed in `lib/`.
- Data fetching happens server-side only. Use Server Components by default.
## Tooling
- Use `eslint` for linting. Config is in `eslint.config.mjs`.
- Use `prettier` for formatting. Run `pnpm format` before committing./init will parse these into actionable rules and enforce them.
# Clone and link
git clone <repo-url>
cd pi-init
pi install .
# Test in any project
cd /path/to/your/project
pi
# then run /initMIT