Spec-driven for Laravel projects

From product idea to reviewed Laravel code

Larapilot brings a spec-driven product workflow to Laravel and PHP, integrated with Laravel Boost. Your AI agent gets a disciplined product process and deep Laravel context.

8 skillsFull workflow coverage
20+ commandsAgent-friendly CLI
MCP nativeCursor & Boost ready
larapilot — zsh
# Add Larapilot to your Laravel project
./composer.json has been updated
  - Installing andreapollastri/larapilot
# Create the .larapilot/ workspace
Larapilot installed successfully.
  - .larapilot/config.yaml
  - .larapilot/shared-runtime.md
# Publish guidelines & the /larapilot-* skills via Laravel Boost
Laravel Boost installed successfully.
  - guidelines + 8 skills (/larapilot-inception/larapilot-ship)
✓ Your AI agent now has a product workflow
# In your AI editor — Mark (PM), Jennifer & John run product discovery
→ Interview done: vision, personas, MVP scope drafted
# The agent persists the PRD it wrote
{
  "schema": "larapilot/v1",
  "kind": "write_result",
  "data": { "path": ".larapilot/docs/PRD.md", "bytes": 18240 }
}
✓ PRD.md saved — the single source of truth
# /larapilot-spec — turn the PRD into user stories, then load them
{
  "schema": "larapilot/v1",
  "kind": "spec_add_result",
  "data": {
    "added": 3,
    "summary": { "count": 3, "codes": ["US-001", "US-002", "US-003"] }
  }
}
→ 3 specs in the backlog, all TODO
# /larapilot-plan — pick the top-priority spec…
→ US-001 · "User can sign in with email" · HIGH
# …and save the implementation plan the agent drafted
{
  "schema": "larapilot/v1",
  "kind": "plan_result",
  "data": { "code": "US-001", "task_count": 4 }
}
✓ Plan saved · 4 tasks · status → PLANNED
# /larapilot-implement — Alex & Anne start building…
✓ US-001 → IN PROGRESS
# …and ticks off tasks as they ship
{
  "schema": "larapilot/v1",
  "kind": "task_done_result",
  "data": { "code": "US-001", "task_id": "TASK-01", "status": "DONE" }
}
✓ TASK-01 done · 3 tasks to go
# All tasks done — hand the spec over for code review
✓ US-001 → REVIEW
# /larapilot-review — a human approves. Human-in-the-loop, always.
{
  "schema": "larapilot/v1",
  "kind": "approve_result",
  "data": { "code": "US-001", "status": "DONE" }
}
✓ US-001 shipped — spec-next is already waiting 🔁

Why Larapilot

AI agents are fast, but isolated prompts are not a product process. Larapilot turns your assistant into a disciplined squad.

A workflow, not prompt lore

Discovery → backlog → plan → implement → review. Every phase has clear inputs, outputs, and guardrails enforced by the CLI.

Spec-driven

The spec → plan → implement loop repeats per increment with enforced status transitions.

Persistent artifacts

PRD, backlog, specs, plans, and mockups live in .larapilot/ — version-controlled.

Laravel-native

Artisan commands, Boost docs, schema, Tinker — not a separate toolchain.

Agent-friendly CLI

Structured JSON envelopes with stable exit codes — built for MCP.

How it works

Larapilot is a product process backed by files and a CLI — not a one-shot prompt. Three layers cooperate.

LayerWhat it isRole
Skills/larapilot-* in your AI editor (via Boost)Playbooks: personas, context to load, Artisan commands to run
Artisan CLIphp artisan larapilot:*Validates input, persists artifacts, enforces workflow — JSON envelopes + exit codes
Artifacts.larapilot/ in your repoSource of truth: PRD, backlog, specs, plans, mockups — version-controlled

Your editor connects to two MCP servers: Laravel Boost (docs, schema, Tinker) and Larapilot (backlog and workflow). Skills orchestrate the conversation; the CLI guarantees consistency; artifacts survive between sessions.

The discovery interview

Everything starts with /larapilot-inception. You bring a rough idea — one sentence is enough. Mark (PM), Jennifer (Strategist), and John (Architect) run a guided conversation, not a form to fill in one shot.

What they explore:

  • Market positioning, competitive context, and product risks (Jennifer)
  • Market research and enterprise business perspective (Benjamin)
  • Competitive challenger: integrations and competitor data porting — import paths for users switching from rival products, lock-in-free export (Sebastian)
  • Product scope, personas, and delivery-target trade-offs (Mark)
  • SOLID, scalable, performant architecture within budget (John + Aurora) — Budget Sensitivity can be set to Relaxed to exclude budget evaluation; business validation is loosened, never removed
  • For public websites: SEO, Analytics, tracking, Lighthouse (Emma) and social strategy (Lauren)
  • When personal data is involved: GDPR and privacy (Violet)

How the interview behaves:

  • Agents speak in character (💎 Mark:, 🧭 Jennifer:, 📐 John:) so you see which lens is asking
  • Questions appear only when critical — at most 3 per round, grouped in one message; you can skip any of them
  • The agent infers what it can from your codebase and existing artifacts before asking
  • The conversation follows your language; the PRD is written in the same language

When there is enough context, the team drafts a PRD (Elevator Pitch, Vision, Personas, Functional Requirements, MVP Scope, Technical Architecture), saves it via larapilot:prd-write, and validates it with larapilot:validate-prd. Inception does not create the backlog — that is /larapilot-spec.

From PRD to shipped code

After the PRD, each user story follows the same loop:

  1. /larapilot-spec — MVP broken into backlog entries (backlog.yaml + specs/US-XXX.yaml)
  2. /larapilot-plan US-XXX — technical plan with tasks → PLANNED
  3. /larapilot-implement US-XXX — code and tests → REVIEW
  4. /larapilot-review US-XXX — you approve (DONE) or send back (TODO)

The CLI blocks invalid jumps (implement before plan, approve before review). Optional /larapilot-design adds UI mockups before planning.

Up and running in minutes

Install the package, enable MCP servers, and invoke skills in your AI editor.

Requirements

  • PHP ^8.3
  • Laravel ^12 or ^13
  • Laravel Boost ^1.0 or ^2.0 (installed automatically with Larapilot)
  • An AI editor with MCP support (Cursor, etc.)

1. Install

Three commands, run from your Laravel project root. Laravel Boost is installed automatically as a Larapilot dependency — no separate composer require needed.

1a — Add the package:

Terminal
composer require andreapollastri/larapilot --dev

1b — Initialize Larapilot. Creates the .larapilot/ workspace in your repo:

Terminal
php artisan larapilot:install
Expected output
INFO  Larapilot installed successfully.

  - .larapilot/config.yaml
  - .larapilot/shared-runtime.md

Next: run php artisan boost:install (or boost:update --discover) to publish AI skills and guidelines.

1c — Publish skills via Laravel Boost. Makes the eight /larapilot-* skills and the coding guidelines available to your AI editor:

Terminal
php artisan boost:install

Boost's installer asks which editors and agents you use, then publishes guidelines and skills for them. Already running Boost in the project? Use php artisan boost:update --discover instead to pick up the Larapilot skills.

2. Enable MCP servers

Your editor needs both servers: Boost for Laravel context (docs, schema, Tinker) and Larapilot for workflow state.

ServerCommandArgs
laravel-boostphpartisan boost:mcp
larapilotphpartisan mcp:start larapilot

Concrete example for editors with a JSON MCP config (Cursor: .cursor/mcp.json, Claude Code: .mcp.json):

.mcp.json
{
  "mcpServers": {
    "laravel-boost": {
      "command": "php",
      "args": ["artisan", "boost:mcp"]
    },
    "larapilot": {
      "command": "php",
      "args": ["artisan", "mcp:start", "larapilot"]
    }
  }
}

3. Use skills in your AI agent

SkillPurpose
/larapilot-inceptionProduct discovery → .larapilot/docs/PRD.md
/larapilot-designUI mockups → .larapilot/mockups/{spec}/
/larapilot-specBacklog & user stories
/larapilot-plan US-001Technical plan & tasks
/larapilot-implement US-001Code, tests, review
/larapilot-review US-001Human acceptance gate
/larapilot-shipOWASP gate + multi-platform deploy
/larapilot-autopilotBatch plan + implement

4. Example: from idea to done

Start with a fresh Laravel app and this prompt in your AI editor:

I want a simple team task board: user registration, projects, and assignable tasks.
StepYou invokeWhat happensOutput / status
1. Discovery/larapilot-inceptionGuided interview: problem, users, MVP scope, stack — then PRD written and validated.larapilot/docs/PRD.md
2. Backlog/larapilot-specUser stories extracted from the PRD MVP scopebacklog.yaml, specs/US-001.yamlTODO
3. Design (optional)/larapilot-design US-001Elise builds a registration screen mockup.larapilot/mockups/US-001//mockups/US-001
4. Plan/larapilot-plan US-001John and Alex break down migrations, routes, testsplans/US-001-plan.yamlPLANNED
5. Implement/larapilot-implement US-001Alex implements, Anne tests, Robert and Lars reviewLaravel code + Pest tests → REVIEW
6. Accept/larapilot-review US-001You approve or request changesDONE — or back to TODO
7. Ship (optional)/larapilot-shipLars OWASP gate; Jack deploys (Cipi preferred, or Forge, Cloud, Ploi, K8s, custom); Emma & Lauren for public sitesProduction release
8. Next spec/larapilot-plan US-002Repeat plan → implement → review for each storyuntil the backlog is complete

After step 6, your repo might look like this:

.larapilot/
├── docs/
│   └── PRD.md
├── backlog.yaml
├── specs/
│   ├── US-001.yaml
│   └── US-002.yaml
├── plans/
│   └── US-001-plan.yaml
└── mockups/
    └── US-001/
        └── index.html

Use /larapilot-autopilot to batch-plan and implement multiple specs when the backlog is stable.

Check progress
php artisan larapilot:metrics  # backlog progress

5. Verify installation

Terminal
php artisan larapilot:doctor
Expected output
{
  "schema": "larapilot/v1",
  "kind": "doctor",
  "data": {
    "healthy": true,
    "checks": {
      "config": true,
      "shared_runtime": true,
      "backlog": false,
      "prd": false,
      "boost": true
    },
    "project_root": "/path/to/your-app"
  }
}

data.healthy is true when config, shared runtime, and Boost are all in place. On a fresh install backlog and prd are still false — that's expected: they turn true after /larapilot-inception (PRD) and /larapilot-spec (backlog).

6. Keep it updated

Boost publishes guidelines and skills as copies into your editor directories, so after upgrading the package one command brings everything current — the shared runtime doc, the Larapilot guidelines, and the /larapilot-* skills:

Terminal
composer update andreapollastri/larapilot
php artisan larapilot:update

larapilot:update never touches .larapilot/config.yaml — your project customizations survive — and re-runs boost:update with the editor and agent choices you already made during boost:install (no questions asked). Pass --skip-boost to refresh only the shared runtime and manage Boost publishing yourself.

To keep the project aligned automatically, hook it into Composer in your app's composer.json:

composer.json
"scripts": {
    "post-update-cmd": [
        "@php artisan larapilot:update --ansi"
    ]
}

From then on every composer update republishes runtime, guidelines, and skills — nothing goes stale silently. Run php artisan larapilot:doctor anytime to confirm the install is healthy.

Spec-driven loop

Inception produces the PRD through a guided interview; optional design creates mockups; then each user story cycles through plan → implement → review. Optional ship releases to production on any Laravel hosting target.

1
InceptionPRD.md
2
Specbacklog.yaml
3
Planplans/
4
Implementcode + tests
5
Reviewhuman gate
6
Shipany platform

Workflow states

StatusMeaningNext step
TODOSpec exists, not yet planned/larapilot-plan
PLANNEDTechnical plan complete/larapilot-implement
IN PROGRESSImplementation startedComplete tasks → review
REVIEWReady for human review/larapilot-review
DONEAccepted (human-gated)Next spec or /larapilot-ship

Transition guards

Invalid transitions fail with E_PRECONDITION and exit code 4:

  • spec-plan — refuses specs in REVIEW or DONE
  • spec-start — requires PLANNED
  • spec-review — requires IN PROGRESS
  • spec-approve / spec-request-changes — require REVIEW

Eight skills, full coverage

Published via Laravel Boost and invoked in your AI agent. Each orchestrates a workflow phase via Artisan commands.

/larapilot-inception

Product Inception

Guided discovery interview — not a one-shot form. The team explores your idea conversationally, then writes and validates the PRD.

  • Team: Mark, Jennifer, Benjamin, Sebastian, John, Aurora; Emma, Lauren, Violet join when relevant
  • Explores: positioning, enterprise research, competitor data porting & integrations, MVP scope, budget-aligned architecture (Budget Sensitivity: Tracked or Relaxed)
  • Interview rules: max 3 questions per round, skippable; infers from codebase first
  • Output: .larapilot/docs/PRD.md (backlog comes later via /larapilot-spec)
/larapilot-design

UI Design

Static HTML/CSS mockups with user flows and accessible markup, previewable via dev-only route.

  • Team: Elise (UX); Emma & Lauren for public pages
  • Preview: /mockups/{spec} (matches folder under .larapilot/mockups/)
/larapilot-spec

Backlog & Specs

Creates or extends the backlog with user stories from the PRD.

  • Team: Tom (Requirements Analyst), Mark (PM)
  • Output: backlog.yaml + specs/US-XXX.yaml
/larapilot-plan

Technical Planning

Detailed implementation plan with tasks, file changes, and test strategy → PLANNED.

  • Team: Tom, John, Sebastian, Aurora, Violet, Alex, Anne; Emma & Lauren for public-facing specs
  • Vendor policy: Laravel first-party → SpatieFilament & plugins for admin panels → other vetted vendors — always maintained and secure
/larapilot-implement

Implementation

Executes the plan: code, tests, task tracking, handoff to REVIEW.

  • Team: Alex, Anne, Robert, Lars
/larapilot-review

Human Review

Acceptance gate — Robert presents the increment and residual risks; you approve to DONE or request changes back to TODO.

  • Team: Robert (Code Reviewer)
/larapilot-ship

Ship & Deploy

OWASP security gate and production release. Cipi + cipi/agent is the preferred path; also supports Forge, Laravel Cloud, Ploi, Kubernetes, and custom VPS.

  • Team: Lars, Jack, Aurora, Violet, Emma & Lauren (public sites)
  • Gate: OWASP Top 10 assessment → .larapilot/docs/security/
  • Launch: SEO, Analytics, Lighthouse, GDPR, social → .larapilot/docs/launch/
  • Deploy: platform-specific runbook (Cipi webhook, Forge push, K8s rollout, …)
/larapilot-autopilot

Autopilot

Batch mode: automatically plans and implements multiple specs in sequence.

The AI squad

Personas that make the process visible during discovery and implementation.

💎
Mark
Product Manager
🧭
Jennifer
Business Strategist
🏢
Benjamin
Business Consultant
💡
Sebastian
Innovator
🔎
Tom
Requirements Analyst
📐
John
Architect
🔧
Alex
Full-Stack Developer
🧪
Anne
Test Architect
🛡️
Robert
Code Reviewer
🔐
Lars
Security Expert
🚀
Jack
DevOps Engineer
💰
Aurora
FinOps Expert
⚖️
Violet
Legal Expert
📈
Emma
SEO & Web Performance
💬
Lauren
Social Media Manager
🎨
Elise
UX Designer

Artisan CLI

Skills call these commands. All emit JSON envelopes with schema larapilot/v1.

Setup & diagnostics

CommandDescription
larapilot:installInitialize project
larapilot:updateRefresh runtime + skills after upgrade
larapilot:doctorDiagnose installation
larapilot:config-showProject metadata (JSON envelope)
larapilot:metricsBacklog progress

PRD

CommandDescription
larapilot:prd-writeSave PRD
larapilot:validate-prdValidate PRD structure

Backlog & specs

CommandDescription
larapilot:spec-listList backlog
larapilot:spec-addAdd specs
larapilot:spec-show {code}Show spec + tasks
larapilot:spec-nextAuto-select next spec
larapilot:validate-specValidate spec payload
larapilot:spec-delete {code}Remove spec + plan files

Planning & implementation

CommandDescription
larapilot:validate-plan {code}Validate plan payload
larapilot:spec-plan {code}Save plan → PLANNED
larapilot:spec-start {code}→ IN PROGRESS
larapilot:task-done {code} {taskId}Mark task complete
larapilot:spec-review {code}→ REVIEW

Review & approval

CommandDescription
larapilot:spec-approve {code}→ DONE
larapilot:spec-request-changes {code}→ TODO with feedback

JSON Envelope

Structured JSON on stdout (success) or stderr (error). Branch on error.code, never on message text.

Success envelope

JSON
{
  "schema": "larapilot/v1",
  "kind": "spec_show",
  "data": {
    "code": "US-001",
    "status": "PLANNED",
    "workdir": "/absolute/path/to/project",
    "tasks": [...]
  }
}

Error envelope

JSON
{
  "schema": "larapilot/v1",
  "kind": "error",
  "error": {
    "code": "E_PRECONDITION",
    "message": "Spec US-001 is TODO, expected PLANNED",
    "hint": "Run larapilot:spec-plan US-001 first"
  }
}

Error codes

CodeMeaning
E_INVALID_INPUTMalformed payload or validation failure
E_PRECONDITIONInvalid workflow transition
E_NOT_FOUNDSpec, plan, or file not found
E_CONNECTORBackend/connector failure

Exit Codes

CodeMeaning
0Success
1Generic error
2Invalid input / validation failed
3Connector error
4Precondition failed or not found

Configuration

Project config in .larapilot/config.yaml. Built-in defaults apply when absent.

.larapilot/config.yaml
connector: file

paths:
  prd: .larapilot/docs/PRD.md
  mockups: .larapilot/mockups/
  test_results: .larapilot/docs/test-results/

workflow:
  statuses:
    todo: TODO
    planned: PLANNED
    in_progress: IN PROGRESS
    review: REVIEW
    done: DONE

file:
  backlog: .larapilot/backlog.yaml
  specs: .larapilot/specs/
  planning: .larapilot/plans/

Environment variables

VariableDefaultDescription
LARAPILOT_ENABLEDtrueDisable MCP and mockup route when false
LARAPILOT_CONNECTORfileStorage connector
LARAPILOT_MOCKUPS_ROUTEtrueSet false to disable mockup route

Worktree support

spec-show and spec-next return data.workdir for per-spec codebase work. Connector commands run from data.project_root.

MCP Setup

Three tools designed to work alongside Laravel Boost.

ToolDescription
backlog_listList all specs with status
spec_showSpec details, plan tasks, workdir
run_artisanRun any larapilot:* command

Cursor configuration

mcp.json
{
  "mcpServers": {
    "laravel-boost": {
      "command": "php",
      "args": ["artisan", "boost:mcp"]
    },
    "larapilot": {
      "command": "php",
      "args": ["artisan", "mcp:start", "larapilot"]
    }
  }
}

Project Artifacts

All artifacts stored under .larapilot/ in your repository.

.larapilot/
├── config.yaml
├── shared-runtime.md
├── backlog.yaml
├── docs/
│   ├── PRD.md
│   └── test-results/
├── specs/
│   ├── US-001.yaml
│   └── US-002.yaml
├── plans/
│   ├── US-001-plan.yaml
│   └── US-002-plan.yaml
└── mockups/
    └── US-001/
        └── index.html

Spec format

US-001.yaml body
#### US-001: User Registration

**Epic:** EP-001 | **Priority:** HIGH | **Points:** 5 | **Status:** TODO

**User Story**
As a new visitor,
I want to create an account,
So that I can access protected features.

**Acceptance Criteria**
- [ ] AC-001: Email validation enforced
- [ ] AC-002: Password minimum 8 characters

Language & validation

Artifacts can be in any language. The structure is fixed — only labels and content are translated.

Every section must use a markdown heading (## Title or **Title**). Plain prose that mentions “User Story” without a heading does not count.

ArtifactRequired sectionsExample (EN → IT)
PRD6 level-2 headings## Elevator Pitch## Sintesi
Spec bodyUser Story, Demonstrates, Acceptance Criteria**User Story****Storia Utente**
Plan taskDescription## Description## Descrizione

The validator first looks for known translations of these section names. If a heading is in another language, validation still passes when there are enough marked headings:

  • PRD — 6 headings with ## …
  • Spec body — 3 headings with ## … or **…**
  • Plan task — 1 heading with ## … per task

Mockup Preview Route

Served via dynamic route only outside production.

Mockups live in .larapilot/mockups/{spec}/. The {spec} segment must match the folder name — typically a backlog code like US-001.

EnvironmentURL patternAccess
local, staging, testing/mockups/{spec}✅ Browsable
production❌ Disabled (404)

Examples: .larapilot/mockups/US-001/index.html/mockups/US-001 (default file). Nested assets: /mockups/US-001/css/app.css.

Disable with LARAPILOT_MOCKUPS_ROUTE=false in .env.

Larapilot + Boost

Complementary tools — use both together.

ConcernLarapilotLaravel Boost
Product workflow
PRD, backlog, plans
Laravel docs search
Database schema/query
Tinker, logs, routes
Coding guidelinespartial

Troubleshooting

Run the doctor

Terminal
php artisan larapilot:doctor

Common issues

  • Missing config — Run php artisan larapilot:install
  • Skills not found — Run php artisan boost:install
  • Invalid transition — Check status with larapilot:spec-show {code}
  • Validation failures — Fix data.findings from validate-*
  • MCP not connecting — Register both servers from project root
  • Mockups 404 — Check environment and LARAPILOT_MOCKUPS_ROUTE

Disabled mode

When LARAPILOT_ENABLED=false, MCP and mockup route are gated off. Artisan commands and doctor remain available.

Ready to ship with AI?

Install Larapilot and give your agent a real product process.

Get started →