ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββββββ βββ ββββββ ββββ βββββββββββββββββββββ βββββββββββββββββ β
β βββββββββββ βββββββββββββ βββββββββββββββββββββββββββββββββββββββ β
β βββββββββββ ββββββββββββββ βββββββββ βββββββββββββββββββ βββ β
β βββββββ βββ ββββββββββββββββββββββββ βββββββββββββββββββ βββ β
β βββ βββββββββββ ββββββ βββββββββ ββββββ βββββββββββ βββ β
β βββ βββββββββββ ββββββ ββββββββ ββββββ βββββββββββ βββ β
β β
β Planning Layer for AI Coding Agents β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A planning layer for AI coding agents - turns your intent into detailed, verifiable implementation plans.
PlanFirst is inspired by Traycer - it acts as an intelligent planning layer that sits between your idea and AI coding agents (like Cursor, Claude Code, GitHub Copilot). Instead of letting AI agents jump straight to code, PlanFirst:
- Analyzes your codebase structure
- Generates detailed, phase-based implementation plans with AI
- Exports plans for any coding agent to execute
- Verifies implementations match the plan
- π Codebase Analysis: Automatically understands your project structure, language, and framework
- π€ AI-Powered Planning: Uses OpenAI or Anthropic to generate detailed implementation plans
- π Phase-Based Approach: Breaks complex tasks into manageable phases
- β Verification: Compares implementations against plans to catch gaps and regressions
- π Agent Agnostic: Works with any coding agent (Cursor, Claude Code, etc.)
- π¦ Export Formats: Markdown, JSON, and agent-specific formats
- Node.js 18 or higher
- npm, yarn, or pnpm
- AI API key (choose one):
- OpenAI API key (recommended) - Get one here
- Anthropic API key - Get one here
npm install -g planfirst-clinpm install planfirst-cliOption 1: OpenAI (Recommended - Easier to Get)
export OPENAI_API_KEY=your_openai_api_key_hereOption 2: Anthropic Claude
export ANTHROPIC_API_KEY=your_anthropic_api_key_hereOption 3: Use .env File
# In your project directory
echo "OPENAI_API_KEY=your_api_key_here" > .envNote: PlanFirst automatically detects which API key you've set and uses it. If both are set, it prefers OpenAI.
cd your-project
planfirst initThis will:
- Analyze your project structure
- Create
.planfirst/configuration directory - Create
plans/directory for generated plans - Detect language, framework, and dependencies
planfirst plan "Add user authentication with JWT"Example output:
βββ Generating Implementation Plan βββ
β Codebase analyzed
β Plan generated
β Plan saved
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β¨ Plan Generated Successfully! β¨ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Plan Summary:
Plan ID: plan-1738483200000
Phases: 3
Files Affected: 5
Complexity: medium
# Export as markdown
planfirst export plan-1738483200000 --format markdown
# Export for Cursor (with checklist)
planfirst export plan-1738483200000 --format cursor
# Export specific phase
planfirst export plan-1738483200000 --phase 1# After implementing with your coding agent
planfirst verify plan-1738483200000# 1. Initialize (if not already done)
planfirst init
# 2. Generate plan
planfirst plan "Add user profile page with edit functionality"
# Output shows:
# Plan ID: plan-001
# Phases: 3
# Phase 1: Create profile route and component
# Phase 2: Add edit form with validation
# Phase 3: Connect to backend API
# 3. Export phase 1 for implementation
planfirst export plan-001 --phase 1 -o phase1.md
# 4. Give phase1.md to your coding agent (Cursor, Claude Code, etc.)
# ... agent implements the code ...
# 5. Verify phase 1
planfirst verify plan-001 --phase 1
# Output shows:
# β UserProfile component created
# β Route added to router
# β Missing prop types definition
# βΉ 2/3 tasks completed
# 6. Continue with next phases...Initialize PlanFirst in your project
Options:
-n, --name <name>- Project name--skip-analysis- Skip initial codebase analysis
Generate implementation plan
Options:
-i, --interactive- Interactive mode with clarifying questions-o, --output <path>- Output file path-f, --format <format>- Output format (markdown, json)
Examples:
planfirst plan "Add REST API for users"
planfirst plan --interactive
planfirst plan "Add search feature" --format jsonVerify implementation against plan
Options:
-p, --phase <number>- Verify specific phase only-t, --task <id>- Verify specific task only-r, --report <path>- Save verification report to file
Examples:
planfirst verify plan-001
planfirst verify plan-001 --phase 1
planfirst verify plan-001 --report report.mdExport plan for coding agents
Options:
-f, --format <format>- Export format (markdown, json, cursor)-o, --output <path>- Output file path-p, --phase <number>- Export specific phase only
Examples:
planfirst export plan-001 --format cursor
planfirst export plan-001 --phase 1 -o phase1.mdList all plans
Options:
-s, --status <status>- Filter by status (draft, ready, in-progress, completed)
Show plan details
Options:
-p, --phase <number>- Show specific phase only
Edit .planfirst/config.json to customize behavior:
{
"version": "0.1.0",
"projectRoot": "/path/to/project",
"plansDirectory": "plans",
"excludePatterns": [
"node_modules/**",
"dist/**",
".git/**"
],
"ai": {
"provider": "openai",
"model": "gpt-4o",
"maxTokens": 4096,
"temperature": 0.7
},
"verification": {
"strictMode": false,
"ignoreWarnings": false
}
}OpenAI:
- Models:
gpt-4o,gpt-4-turbo,gpt-3.5-turbo - Set:
OPENAI_API_KEY
Anthropic:
- Models:
claude-sonnet-4-20250514,claude-opus-4-20250514 - Set:
ANTHROPIC_API_KEY
your-project/
βββ .planfirst/
β βββ config.json # Configuration
β βββ metadata.json # Project metadata
βββ plans/
β βββ plan-001.json # Plan data
β βββ plan-001.md # Plan markdown
βββ ... your project files
# Clone the repository
git clone https://github.com/yourusername/planfirst-cli.git
cd planfirst-cli
# Install dependencies
npm install
# Start development server
npm run dev -- init
# Build for production
npm run build
# Run compiled version
npm startContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Inspired by Traycer
- Powered by OpenAI and Anthropic AI
Made with β€οΈ by Vishal Sharma
Build smarter with AI planning! π