Early access — PHP 8.4+
Directive

A PHP framework for
AI-assisted development

A structured way to build software with a language model as your co-developer — working from specs rather than vibes.

The Directive Ecosystem

Two tools, one philosophy. Directive provides the foundation; Directive CLI provides the workflow.

Directive

directive/framework

A pure-backend PHP REST framework built around hexagonal architecture. Designed to be understood and driven by a language model — every layer has an explicit contract, no magic, no hidden wiring.

  • PHP 8.4+ with strict types, Slim 4, PSR-15
  • Explicit Policy → Api → Response contract
  • Hexagonal architecture native — domain, application, infrastructure clearly separated
  • Designed for AI predictability, not developer convenience
  • phpstan level 8, zero magic, fully typed
View on GitHub

Directive CLI

directive/cli

The developer experience layer: the terminal tool and IDE workflow that make spec-driven development possible. Scaffolds projects, manages changes, and generates IDE context for your AI.

  • Spec-driven workflow: brainstorm → proposal → design → specs → tasks
  • IDE slash commands for GitHub Copilot, Cursor, Windsurf & more
  • Global Composer install, works in any project
  • The AI workflow is portable — not locked to one IDE or model
View on GitHub

How it works

Five steps from idea to production. No guessing, no drift.

1

Brainstorm

Explore the idea with the AI before committing to anything. Clarify goals, surface constraints, identify unknowns.

2

Write Spec

Formalise the proposal, requirements, and scenarios. The spec is the contract between you and the AI.

3

Design

Document technical decisions before writing code. Architecture, trade-offs, dependencies. The design gives the AI a stable ground to work from.

4

Generate Code

The AI implements tasks from the spec. Each task is scoped, verifiable, and traceable back to a requirement. No hallucinations in the dark.

5

Ship

Archive the change. Specs become the living documentation of your codebase — not comments that drift, but requirements that were actually implemented.

Why I built this

I've been building with AI assistants since they became useful. The tooling got good fast — but the workflows didn't follow. Every session started from scratch. Context evaporated. The AI produced code that worked but lived in the wrong place. We were building on vibes and hoping for coherence. I wanted something different: a spec-driven approach where the AI knows exactly what it's building and why, before writing a single line.

I chose PHP because it's what I know, and because the AI-assisted development problem is language-agnostic. The ideas in Directive — explicit contracts, structured workflow, transparent architecture — translate to any stack. PHP just happens to be where I'm solving it first. The workflow embedded in Directive CLI is portable by design: it works with GitHub Copilot, Cursor, Windsurf, or any tool that can read a file.

The core bet is simple: transparency beats magic. Frameworks that do too much implicitly are hard for humans to debug and impossible for AIs to predict. Directive makes every layer explicit — every contract visible, every decision documented. When the AI writes code in a Directive project, it knows where it is in the architecture. That predictability is the point. Not convenience for the developer, but correctness for the system.