openpaul
    Preparing search index...

    openpaul

    OpenPAUL

    Plan-Apply-Unify Loop โ€” Structured AI-assisted development for OpenCode.

    Coverage

    npm version License GitHub stars Docs


    npx openpaul
    

    Works on Mac, Windows, and Linux.


    "Quality over speed-for-speed's-sake. In-session context over subagent sprawl."


    ๐Ÿ“– Documentation ยท Why OpenPAUL ยท Getting Started ยท The Loop ยท Commands


    OpenPAUL is an OpenCode adaptation of the Plan-Apply-Unify Loop project, originally created by Chris Kahler for Claude Code.

    I build with Claude Code every day. It's incredibly powerful โ€” when you give it the right context.

    The problem? Context rot. As your session fills up, quality degrades. Subagents spawn with fresh context but return ~70% quality work that needs cleanup. Plans get created but never closed. State drifts. You end up debugging AI output instead of shipping features.

    OpenPAUL fixes this with three principles:

    1. Loop integrity โ€” Every plan closes with UNIFY. No orphan plans. UNIFY reconciles what was planned vs what happened, updates state, logs decisions. This is the heartbeat.

    2. In-session context โ€” Subagents are expensive and produce lower quality for implementation work. OpenPAUL keeps development in-session with properly managed context. Subagents are reserved for discovery and research โ€” their job IS to gather context.

    3. Acceptance-driven development โ€” Acceptance criteria are first-class citizens, not afterthoughts. Define done before starting. Every task references its AC. BDD format: Given [precondition] / When [action] / Then [outcome].

    The complexity is in the system, not your workflow. Behind the scenes: structured state management, XML task formatting, loop enforcement. What you see: a few commands that keep you on track.


    AI-assisted developers who want structure without bureaucracy.

    You describe what you want, OpenCode builds it, and OpenPAUL ensures:

    • Plans have clear acceptance criteria
    • Execution stays bounded
    • Every unit of work gets closed properly
    • State persists across sessions
    • Decisions are logged for future reference

    No sprint ceremonies. No story points. No enterprise theater. Just a system that keeps AI-assisted development reliable.


    npx openpaul
    

    This creates two things:

    • .openpaul/state.json โ€” project registry (name, version, timestamps)
    • .opencode/ โ€” OpenCode configuration and preset files

    Then run /openpaul:init inside OpenCode to initialize loop state and create .openpaul/model-config.json and .openpaul/state-phase-1.json.

    Option Description
    -n, --name <name> Project name (defaults to directory name)
    -p, --path <path> Target directory (default: ".")
    --preset <preset> Template preset: minimal or full
    -f, --force Skip prompts and overwrite existing files
    -i, --interactive Force interactive mode
    -v, --verbose Enable verbose output
    npx openpaul                           # Interactive mode
    npx openpaul --name my-project # Skip name prompt
    npx openpaul --path ./app # Target directory
    npx openpaul -n my-project -p ./app # Combined options
    npx openpaul --preset minimal # Minimal template
    npx openpaul --preset full # Full template with examples

    npx openpaul automatically adds "plugin": ["openpaul"] to opencode.json. Just restart OpenCode after scaffolding to load the plugin. /openpaul:* commands will appear in the TUI command list.

    If you need to add it manually, edit opencode.json:

    {
    "$schema": "https://opencode.ai/config.json",
    "plugin": [
    "openpaul"
    ]
    }
    • CLI: Run npx openpaul --version
    • Plugin: Run /openpaul:help inside OpenCode (it should autocomplete in the command list)

    If you are iterating on OpenPAUL locally, load it as a local plugin file (OpenCode only auto-loads local plugins from the plugins directory):

    .opencode/plugins/openpaul.ts
    
    import plugin from "/absolute/path/to/openpaul/dist/index.js"
    export default plugin

    For the best experience, use OpenPAUL with OpenCARL (github.com/KrisGray/opencarl) โ€” a dynamic rule injection system that enforces OpenPAUL workflow discipline automatically.

    # 1. Initialize OpenPAUL
    npx openpaul

    # 2. Initialize OpenCARL
    npx opencarl --local

    OpenCARL auto-loads OpenPAUL rules when it detects .openpaul/ directory.

    # Initialize OpenPAUL in your project
    npx openpaul
    YOU: I want to add a dark mode toggle to my React app

    # OpenCARL auto-loads OpenPAUL rules when it detects .openpaul/

    YOU: /openpaul:plan
    OpenPAUL: Describe what you're building...

    YOU: Dark mode toggle that:
    - Remembers preference in localStorage
    - Defaults to system preference
    - Toggles without page reload

    OpenPAUL: Created PLAN.json with:
    โœ“ Objective: Add persistent dark mode toggle
    โœ“ AC-1: Given user visits, When no preference, Then use system
    โœ“ AC-2: Given user clicks toggle, When in light, Then switch to dark
    โœ“ Task 1: Create ThemeContext
    โœ“ Task 2: Add CSS variables
    โœ“ Task 3: Create ThemeToggle component
    โœ“ Boundary: DO NOT change auth components

    YOU: Looks good. /openpaul:apply

    OpenPAUL:
    โœ“ Task 1: Created ThemeContext (verified: imports work)
    โœ“ Task 2: Added CSS variables (verified: themes render)
    โœ“ Task 3: Created ThemeToggle (verified: toggle works)

    YOU: /openpaul:unify

    OpenPAUL:
    โœ“ Created SUMMARY.json
    โœ“ Updated loop state
    โœ“ Recorded 3 decisions

    Done! Loop complete. State preserved for next session.
    Without OpenCARL With OpenCARL
    Manual workflow discipline Auto-enforced loop rules
    Easy to skip UNIFY Blocked from skipping
    Context bloat Rules load on-demand
    Inconsistent quality Consistent enforcement

    Here's a complete workflow example showing OpenPAUL in action:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ YOU: I need to add user authentication to my app โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 1: Initialize OpenPAUL โ”‚
    โ”‚ โ”‚
    โ”‚ npx openpaul โ”‚
    โ”‚ โ”‚
    โ”‚ Creates: .openpaul/state.json (project registry) and โ”‚
    โ”‚ opencode.json (OpenCode config). Then run /openpaul:init in โ”‚
    โ”‚ OpenCode to create model-config.json and state-phase-1.json โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 2: Plan Your Work โ”‚
    โ”‚ โ”‚
    โ”‚ /openpaul:plan โ”‚
    โ”‚ โ”‚
    โ”‚ OpenPAUL prompts you to describe what you want to build, โ”‚
    โ”‚ then generates a structured PLAN.json with: โ”‚
    โ”‚ - Objective (what & why) โ”‚
    โ”‚ - Acceptance Criteria (Given/When/Then) โ”‚
    โ”‚ - Tasks with files, actions, verification steps โ”‚
    โ”‚ - Boundaries (what NOT to change) โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 3: Review & Approve โ”‚
    โ”‚ โ”‚
    โ”‚ YOU: The plan looks good, let's do it โ”‚
    โ”‚ โ”‚
    โ”‚ (Or: "Actually, I also need password reset" โ†’ plan updated) โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 4: Execute the Plan โ”‚
    โ”‚ โ”‚
    โ”‚ /openpaul:apply โ”‚
    โ”‚ โ”‚
    โ”‚ Tasks execute sequentially: โ”‚
    โ”‚ โœ“ Task 1: Create User model (verified: tests pass) โ”‚
    โ”‚ โœ“ Task 2: Add login endpoint (verified: curl returns 200) โ”‚
    โ”‚ โœ“ Task 3: Create login UI (verified: renders correctly) โ”‚
    โ”‚ โธ Task 4: Checkpoint โ€” Verify login flow manually? โ”‚
    โ”‚ โ”‚
    โ”‚ YOU: approved โ”‚
    โ”‚ โ”‚
    โ”‚ โœ“ Task 5: Add session management โ”‚
    โ”‚ โœ“ All tasks complete โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 5: Close the Loop (REQUIRED!) โ”‚
    โ”‚ โ”‚
    โ”‚ /openpaul:unify โ”‚
    โ”‚ โ”‚
    โ”‚ Writes .openpaul/phases/{N}-{plan}-SUMMARY.json with: โ”‚
    โ”‚ - Task completion status (completed/skipped/failed) โ”‚
    โ”‚ - Plan vs actual comparison โ”‚
    โ”‚ - Criteria results โ”‚
    โ”‚ โ”‚
    โ”‚ Advances state-phase-N.json to UNIFY, then creates โ”‚
    โ”‚ next phase state as UNIFY. Updates loop state (STATE.md if โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ STEP 6: Continue Development โ”‚
    โ”‚ โ”‚
    โ”‚ /openpaul:progress โ”‚
    โ”‚ โ”‚
    โ”‚ Shows: "Phase 1 complete. Next: Phase 2 - User Profile" โ”‚
    โ”‚ Suggests: ONE next action โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    YOU: /openpaul:plan

    OpenPAUL: What would you like to build?

    YOU: I need to add a dark mode toggle to my React app. It should:
    - Remember the user's preference in localStorage
    - Default to system preference on first visit
    - Toggle without page reload

    OpenPAUL: [Creates PLAN.json]

    ## Plan: Dark Mode Toggle

    ### Objective
    Add a persistent dark mode toggle with system preference detection

    ### Acceptance Criteria
    - **AC-1**: Given user visits app, When no preference stored, Then use system preference
    - **AC-2**: Given user clicks toggle, When in light mode, Then switch to dark and save
    - **AC-3**: Given user returns, When preference stored, Then apply saved preference

    ### Tasks
    1. Create ThemeContext with useLocalStorage hook
    2. Add CSS variables for dark/light themes
    3. Create ThemeToggle component
    4. Integrate into App.tsx

    ### Boundaries
    - DO NOT change: auth-related components, API routes

    YOU: Looks good. /openpaul:apply

    OpenPAUL: [Executes tasks one by one with verification...]

    YOU: /openpaul:unify

    OpenPAUL: [Creates SUMMARY.json, updates loop state]

    Done. Loop complete.

    Resume work after a break:

    [New session]

    YOU: /openpaul:resume

    OpenPAUL:
    ## Session Restored

    **Last Session:** 2024-01-15
    **Stopped at:** Phase 2, Plan 3 - User Profile
    **Status:** 2/4 tasks complete

    **What was built:**
    - Profile display component
    - Edit profile form

    **What's next:**
    Task 3: Add avatar upload
    File: src/components/AvatarUpload.tsx
    Action: Create component with drag-drop and crop preview

    **Suggested command:** /openpaul:apply --phase 2 --plan 03

    OpenCARL (github.com/KrisGray/opencarl) is a dynamic rule injection system that loads rules based on context. Together, they create a powerful AI-assisted development experience.

    OpenPAUL OpenCARL
    Structured workflow (PLAN โ†’ APPLY โ†’ UNIFY) Dynamic rule injection
    Guides planning & execution Loads rules based on context
    Ensures loop closure Keeps context lean
    State persistence Preferences persistence

    The synergy: OpenCARL loads OpenPAUL-specific rules when you're working in an OpenPAUL project, enforcing workflow discipline without bloating every session.

    # Initialize OpenPAUL
    npx openpaul

    # Initialize OpenCARL (local or global)
    npx opencarl --local # Current project only
    npx opencarl --global # All projects
    # 1. Initialize OpenPAUL
    npx openpaul

    # 2. OpenCARL detects .openpaul/ directory
    # โ†’ Automatically loads OpenPAUL-specific rules:
    # - "Loop enforcement (PLAN โ†’ APPLY โ†’ UNIFY)"
    # - "Boundary protection for DO NOT CHANGE sections"
    # - "Verification required for every task"

    # 3. Plan your work
    /openpaul:plan

    # OpenCARL injects planning rules:
    # - "Define acceptance criteria before tasks"
    # - "Every task needs files, action, verify, done"
    # - "Set boundaries โ€” what NOT to change"

    # 4. Execute the plan
    /openpaul:apply

    # OpenCARL injects execution rules:
    # - "Run tests after implementation changes"
    # - "Verify each task before moving on"
    # - "Log deviations from plan"

    # 5. Close the loop (required!)
    /openpaul:unify

    # OpenCARL injects closure rules:
    # - "Create SUMMARY.json documenting what was built"
    # - "Compare plan vs actual"
    # - "Record decisions for future sessions"
    YOU: /openpaul:plan

    OpenPAUL: Creates plan structure...
    OpenCARL: [Injects OpenPAUL + Development rules]
    โœ“ DEVELOPMENT_RULE_0: Code over explanation - show, don't tell
    โœ“ DEVELOPMENT_RULE_1: Prefer editing existing files over creating new
    โœ“ OPENPAUL_RULE_0: Loop enforcement - no skipping UNIFY
    โœ“ OPENPAUL_RULE_1: Every task needs verification

    YOU: [Describe the feature you want]

    OpenPAUL: Generates PLAN.json with:
    - Objective
    - Acceptance Criteria (Given/When/Then)
    - Tasks with verification steps
    - Boundaries

    YOU: /openpaul:apply

    OpenPAUL: Executes tasks sequentially...
    OpenCARL: [Injects execution rules + context tracking]
    โœ“ Running tests after changes
    โœ“ Verifying each task
    โœ“ Logging deviations

    [... work happens ...]

    OpenPAUL: Task complete. Checkpoint: Run tests?
    YOU: yes

    OpenPAUL: Tests pass. Next task...
    OpenCARL: [Context depleting โ†’ Injects fresh session rules]

    [... more work ...]

    YOU: /openpaul:unify

    OpenPAUL: Creates SUMMARY.json, updates loop state
    OpenCARL: [Injects closure rules]
    โœ“ Document what was built
    โœ“ Compare plan vs actual
    โœ“ Record decisions

    Done. Loop complete. State preserved for next session.

    When OpenCARL detects you're working in an OpenPAUL project:

    1. Loop Enforcement โ€” No skipping UNIFY. Every plan needs closure.
    2. Boundary Protection โ€” DO NOT CHANGE sections in plans are sacred.
    3. AC-First Development โ€” Acceptance criteria defined before tasks.
    4. Verification Requirements โ€” Every task needs a verify step.
    5. State Consistency โ€” Loop state JSON reflects reality after each phase (STATE.md if present).

    These rules load automatically when you're in .openpaul/ context and disappear when you're not.


    If you have an existing project using .paul/ directory:

    1. Rename .paul/ to .openpaul/
    2. Update any hardcoded paths in your workflow

    OpenPAUL will automatically detect and use .openpaul/ for new files while still reading from .paul/ for backward compatibility.


    Every unit of work follows this cycle:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ PLAN โ”€โ”€โ–ถ APPLY โ”€โ”€โ–ถ UNIFY โ”‚
    โ”‚ โ”‚
    โ”‚ Define Execute Reconcile โ”‚
    โ”‚ work tasks & close โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

    Create an executable plan with:

    • Objective โ€” What you're building and why
    • Acceptance Criteria โ€” Given/When/Then definitions of done
    • Tasks โ€” Specific actions with files, verification, done criteria
    • Boundaries โ€” What NOT to change

    Execute the approved plan:

    • Tasks run sequentially
    • Each task has verification
    • Checkpoints pause for human input when needed
    • Deviations are logged

    Close the loop (required!):

    • Write {N}-{plan}-SUMMARY.json with task results and criteria
    • Compare plan vs actual
    • Advance loop state to ready for next PLAN
    • Update loop state (STATE.md if present)

    Never skip UNIFY. Every plan needs closure. This is what separates structured development from chaos.


    OpenPAUL provides 16 commands organized by purpose. The plugin registers them as OpenCode slash commands, so /openpaul:* appears in the TUI command list. Run /openpaul:help for the complete reference.

    Command What it does
    npx openpaul Initialize OpenPAUL in a project (CLI)
    /openpaul:plan Create an executable plan (TDD wizard)
    /openpaul:apply --phase N --plan NN Execute an approved plan
    /openpaul:unify --phase N --plan NN Reconcile and close the loop
    /openpaul:help Show command reference
    Command What it does
    /openpaul:pause Create handoff for session break
    /openpaul:resume Restore context and continue
    /openpaul:progress Smart status + ONE next action
    /openpaul:handoff Generate comprehensive handoff
    Command What it does
    /openpaul:milestone <name> Create new milestone
    /openpaul:complete-milestone Archive and tag milestone
    Command What it does
    /openpaul:flows Configure skill requirements
    /openpaul:config View/modify OpenPAUL settings
    /openpaul:map-codebase Generate codebase overview
    Command What it does
    /openpaul:verify Guide manual acceptance testing
    /openpaul:plan-fix Plan fixes for UAT issues

    After npx openpaul + /openpaul:init:

    .openpaul/
    โ”œโ”€โ”€ state.json # Project registry (npx openpaul)
    โ”œโ”€โ”€ model-config.json # Model configuration (/openpaul:init)
    โ”œโ”€โ”€ state-phase-N.json # Loop state per phase (/openpaul:init)
    โ”œโ”€โ”€ config.md # Optional integrations
    โ”œโ”€โ”€ SPECIAL-FLOWS.md # Optional skill requirements
    โ”œโ”€โ”€ HANDOFF.md # Session handoff (/openpaul:pause)
    โ””โ”€โ”€ phases/
    โ”œโ”€โ”€ 1-01-PLAN.json # Plan (/openpaul:plan)
    โ”œโ”€โ”€ 1-01-PLAN.md # Plan summary (/openpaul:plan)
    โ””โ”€โ”€ 1-01-SUMMARY.json # Summary (/openpaul:unify)
    opencode.json # OpenCode config (npx openpaul)
    .opencode/
    โ””โ”€โ”€ (preset files) # Commands, rules, agents

    Machine-readable loop state lives in state-phase-N.json (one per phase), tracking the current loop position (PLAN/APPLY/UNIFY), active plan ID, and timestamps.

    If you maintain a human-readable STATE.md, OpenPAUL will update it when present:

    • Current phase and plan
    • Loop position (PLAN/APPLY/UNIFY markers)
    • Session continuity (where you stopped, what's next)
    • Accumulated decisions
    • Blockers and deferred issues

    When you resume work, /openpaul:resume loads your saved session from .openpaul/SESSIONS/ and HANDOFF.md, then suggests exactly ONE next action. No decision fatigue.

    Plans are created via /openpaul:plan and stored as JSON in .openpaul/phases/.

    In the OpenCode TUI, use /openpaul:plan with no flags to run the TDD wizard. It prompts step-by-step for phase, plan ID, criteria, boundaries, and tasks.

    Stored at .openpaul/phases/1-01-PLAN.json and .openpaul/phases/1-01-PLAN.md. Every task has: files, action, verify, done. If you can't specify all four, the task is too vague.

    OpenPAUL has a companion: OpenCARL (Context Augmentation & Reinforcement Layer).

    OpenCARL is a dynamic rule injection system. Instead of bloating your context with static prompts, OpenCARL loads rules just-in-time based on what you're doing:

    Trigger Rules Loaded
    Working in .openpaul/ directory OpenPAUL domain activates
    Writing code DEVELOPMENT rules load
    Managing projects PROJECTS rules load

    OpenPAUL-specific rules OpenCARL enforces:

    • Loop enforcement (PLAN โ†’ APPLY โ†’ UNIFY โ€” no shortcuts)
    • Boundary protection (DO NOT CHANGE sections are real)
    • State consistency checks at phase transitions
    • Verification requirements for every task
    • Skill blocking (required skills must load before APPLY)

    The OpenPAUL domain contains 14 rules that govern structured AI development. They load when you're in an OpenPAUL project, disappear when you're not. Your context stays lean.

    Without OpenCARL: You'd need massive static prompts in every session. With OpenCARL: Rules activate when relevant, disappear when not.


    Acceptance criteria aren't afterthoughts โ€” they're the foundation:

    1. AC defined before tasks โ€” Know what "done" means
    2. Tasks reference AC โ€” Every task links to AC-1, AC-2, etc.
    3. Verification required โ€” Every task needs a verify step
    4. BDD format โ€” Given/When/Then for testability

    Why OpenPAUL minimizes subagents for development work:

    Issue Impact
    Launch cost 2,000-3,000 tokens to spawn
    Context gathering Starts fresh, researches from scratch
    Resynthesis Results must be integrated back
    Quality gap ~70% compared to in-session work
    Rework Subagent output often needs cleanup

    When OpenPAUL does use subagents:

    • Discovery/exploration โ€” Codebase mapping, parallel exploration
    • Research โ€” Web searches, documentation gathering

    For implementation, OpenPAUL keeps everything in-session with proper context management.

    The loop isn't optional:

    PLAN โ”€โ”€โ–ถ APPLY โ”€โ”€โ–ถ UNIFY
    โœ“ โœ“ โœ“ [Loop complete]
    • No orphan plans โ€” Every PLAN gets a SUMMARY
    • State reconciliation โ€” UNIFY catches drift
    • Decision logging โ€” Choices are recorded for future sessions

    OpenPAUL supports modular integrations configured in .openpaul/config.md:

    Integration Purpose
    SonarQube Code quality metrics and issues
    Future Linting, CI/CD, test runners

    For projects with specialized requirements, .openpaul/SPECIAL-FLOWS.md defines skills that must be loaded before execution:

    ## Required Skills
    
    | Skill            | Work Type     | Priority |
    | ---------------- | ------------- | -------- |
    | /frontend-design | UI components | required |
    | /revops-expert   | Landing pages | required |
    

    APPLY blocks until required skills are confirmed loaded.


    Commands not found after install?

    • Restart OpenCode to reload plugins
    • Verify openpaul is listed in the plugin array in opencode.json (npm package)
    • If you are using a local build, verify .opencode/plugins/openpaul.ts exists
    • Run opencode debug config and confirm openpaul is in the resolved plugin list

    Commands not working as expected?

    • Run /openpaul:help to verify installation (it should autocomplete in the TUI)
    • Check the plugin is installed in ~/.cache/opencode/node_modules/openpaul/

    Loop position seems wrong?

    • Check .openpaul/state-phase-N.json for machine-readable loop state (PLAN/APPLY/UNIFY)
    • Check .openpaul/STATE.md if you maintain a human-readable companion
    • Run /openpaul:progress for guided next action

    Resuming after a break?

    • Run /openpaul:resume โ€” it reads state and handoffs automatically

    Ad-hoc OpenPAUL
    No structure Explicit planning gates
    State drifts Loop state JSON tracks everything
    No closure Mandatory UNIFY
    Decisions lost Decisions logged

    OpenPAUL takes a different approach from GSD:

    Aspect GSD OpenPAUL
    Execution Parallel subagents In-session context
    Loop Optional closure Mandatory UNIFY
    Criteria Embedded in tasks First-class AC section
    Rules Static prompts CARL dynamic loading

    Same comprehensive coverage, different philosophy. OpenPAUL prioritizes quality over speed-for-speed's-sake. See OPENPAUL-VS-GSD.md for full comparison.

    Traditional OpenPAUL
    Documentation-first Execution-first
    Human-readable specs AI-executable prompts
    Separate from code Colocated in .openpaul/

    Plan-Apply-Unify Loop was originally created by Chris Kahler for Claude Code.

    OpenPAUL is an OpenCode adaptation, maintained by Kristian Gray.

    The original project can be found on Chris Kahler's GitHub profile.

    MIT License. See LICENSE for details.


    Kristian Gray โ€” OpenPAUL Maintainer

    Original Author โ€” Chris Kahler (Plan-Apply-Unify Loop creator)


    OpenCode is powerful. OpenPAUL makes it reliable.