@sienklogic/plan-build-run 2.55.0 → 2.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to Plan-Build-Run will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.56.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.55.0...plan-build-run-v2.56.0) (2026-03-02)
9
+
10
+
11
+ ### Features
12
+
13
+ * **58-02:** add Codex manual files (AGENTS.md, config.toml, README) ([c928ea6](https://github.com/SienkLogic/plan-build-run/commit/c928ea6d7170ce5c2b97bf5fe11505046f008396))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **58-02:** correct repo URL in codex-pbr README ([1b13b2a](https://github.com/SienkLogic/plan-build-run/commit/1b13b2a4799fa9827abf82feda4f87c2c65e2880))
19
+
8
20
  ## [2.55.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.54.0...plan-build-run-v2.55.0) (2026-03-02)
9
21
 
10
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.55.0",
3
+ "version": "2.56.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -0,0 +1,101 @@
1
+ # PBR Workflow Configuration for Codex CLI
2
+ # Copy this file to your project's .codex/config.toml and customize as needed.
3
+ #
4
+ # Each [profiles.*] section defines a named agent profile that can be selected
5
+ # when Codex runs PBR skills. Uncomment and adjust the fields you want to change.
6
+ #
7
+ # Reference: https://github.com/openai/codex
8
+
9
+ # ---------------------------------------------------------------------------
10
+ # Sandbox Settings
11
+ # ---------------------------------------------------------------------------
12
+ # Controls which shell commands Codex is allowed to run during builds.
13
+ # Adjust based on your project's build toolchain.
14
+
15
+ [sandbox]
16
+ # allow = ["bash", "git", "npm", "node", "python", "pip", "cargo", "make"]
17
+ # deny = ["curl", "wget", "ssh"]
18
+
19
+ # ---------------------------------------------------------------------------
20
+ # PBR Agent Profiles
21
+ # ---------------------------------------------------------------------------
22
+ # Each profile corresponds to a PBR agent role. Codex selects the appropriate
23
+ # profile based on the active skill. You can override model and instructions
24
+ # per role to tune cost/quality tradeoffs.
25
+
26
+ # Research agent — explores domain, reads docs, summarizes findings.
27
+ # Called by: $pbr-explore, $pbr-begin, $pbr-plan (research phase)
28
+ [profiles.pbr-researcher]
29
+ # description = "Research agent: investigates domain and summarizes findings"
30
+ # model = "o4-mini"
31
+ # instructions = "Focus on gathering factual information. Cite sources."
32
+
33
+ # Planner agent — creates detailed, task-level phase plans.
34
+ # Called by: $pbr-plan, $pbr-begin
35
+ [profiles.pbr-planner]
36
+ # description = "Planner agent: produces structured PLAN.md files"
37
+ # model = "o3"
38
+ # instructions = "Output valid PLAN.md frontmatter. Define must_haves precisely."
39
+
40
+ # Executor agent — implements tasks from a PLAN.md, commits each task.
41
+ # Called by: $pbr-build
42
+ [profiles.pbr-executor]
43
+ # description = "Executor agent: implements plan tasks with atomic commits"
44
+ # model = "o4-mini"
45
+ # instructions = "One task per commit. Follow the plan exactly. No scope creep."
46
+
47
+ # Verifier agent — checks build output against plan must_haves.
48
+ # Called by: $pbr-review
49
+ [profiles.pbr-verifier]
50
+ # description = "Verifier agent: produces VERIFICATION.md with evidence"
51
+ # model = "o4-mini"
52
+ # instructions = "Check evidence in the codebase. Do not assume correctness."
53
+
54
+ # Integration checker agent — validates cross-component integration.
55
+ # Called by: $pbr-health, $pbr-scan
56
+ [profiles.pbr-integration-checker]
57
+ # description = "Integration checker: validates cross-component contracts"
58
+ # model = "o4-mini"
59
+ # instructions = "Focus on interface boundaries and data flow between modules."
60
+
61
+ # Debugger agent — hypothesis-driven bug investigation.
62
+ # Called by: $pbr-debug
63
+ [profiles.pbr-debugger]
64
+ # description = "Debugger agent: systematic hypothesis-driven investigation"
65
+ # model = "o3"
66
+ # instructions = "Form falsifiable hypotheses. Test each before moving on."
67
+
68
+ # Codebase mapper agent — creates ARCHITECTURE.md and related codebase docs.
69
+ # Called by: $pbr-explore, $pbr-begin
70
+ [profiles.pbr-mapper]
71
+ # description = "Mapper agent: documents codebase structure and architecture"
72
+ # model = "o4-mini"
73
+ # instructions = "Be concise. Focus on structure over implementation details."
74
+
75
+ # Synthesizer agent — aggregates research and produces structured summaries.
76
+ # Called by: $pbr-explore, $pbr-discuss
77
+ [profiles.pbr-synthesizer]
78
+ # description = "Synthesizer agent: aggregates findings into structured output"
79
+ # model = "o4-mini"
80
+ # instructions = "Extract key insights. Surface tensions and open questions."
81
+
82
+ # General agent — handles ad-hoc tasks and one-off instructions.
83
+ # Called by: $pbr-do, $pbr-discuss
84
+ [profiles.pbr-general]
85
+ # description = "General agent: flexible agent for miscellaneous PBR tasks"
86
+ # model = "o4-mini"
87
+ # instructions = "Follow PBR workflow rules. Commit with correct format."
88
+
89
+ # Audit agent — analyzes session logs for workflow compliance.
90
+ # Called by: $pbr-audit
91
+ [profiles.pbr-audit]
92
+ # description = "Audit agent: reviews session logs and produces compliance reports"
93
+ # model = "o4-mini"
94
+ # instructions = "Be objective. Report findings without judgment."
95
+
96
+ # Dev-sync agent — synchronizes changes across plugin derivatives.
97
+ # Called internally — not a user-facing skill.
98
+ [profiles.pbr-dev-sync]
99
+ # description = "Dev-sync agent: propagates pbr/ changes to cursor-pbr/ and codex-pbr/"
100
+ # model = "o4-mini"
101
+ # instructions = "Apply diffs exactly. Do not add scope beyond the sync target."
@@ -0,0 +1,653 @@
1
+ # Plan-Build-Run Workflow for Codex
2
+
3
+ > This file teaches Codex the Plan-Build-Run (PBR) development methodology.
4
+ > Place it in your repository root so Codex reads it before starting any task.
5
+ >
6
+ > PBR prevents quality degradation on complex projects by enforcing a
7
+ > disciplined Plan → Build → Review cycle with file-based state tracking.
8
+
9
+ ---
10
+
11
+ ## Core Principle
12
+
13
+ **Never build without a plan. Never ship without a review.**
14
+
15
+ Every meaningful change flows through three stages:
16
+
17
+ 1. **Plan** — Research the problem, design the solution, define success criteria
18
+ 2. **Build** — Execute the plan with atomic commits, one task at a time
19
+ 3. **Review** — Verify the build achieved the plan's goals (goal-backward verification)
20
+
21
+ ---
22
+
23
+ ## Project State Directory
24
+
25
+ All workflow state lives in `.planning/` at the repository root. Codex should
26
+ create and maintain these files as it works:
27
+
28
+ ```
29
+ .planning/
30
+ ├── STATE.md # Current position in the workflow
31
+ ├── ROADMAP.md # Phase structure with goals and dependencies
32
+ ├── config.json # Workflow settings (optional)
33
+ ├── phases/
34
+ │ └── NN-slug/ # One directory per phase
35
+ │ ├── PLAN.md # What to build and how
36
+ │ ├── SUMMARY.md # What was built (written after execution)
37
+ │ └── VERIFICATION.md # Did the build match the plan?
38
+ ├── quick/ # Lightweight tasks outside the full cycle
39
+ │ └── NNN-slug/
40
+ │ ├── PLAN.md
41
+ │ └── SUMMARY.md
42
+ ├── debug/ # Persistent debug sessions
43
+ │ └── slug/
44
+ │ └── HYPOTHESIS.md
45
+ ├── notes/ # Captured ideas and decisions
46
+ ├── todos/
47
+ │ ├── pending/ # Active cross-session backlog
48
+ │ └── done/ # Completed todos
49
+ └── milestones/ # Archived milestone snapshots
50
+ └── v{version}/
51
+ ```
52
+
53
+ ### STATE.md Format
54
+
55
+ ```markdown
56
+ ---
57
+ current_phase: "01-setup"
58
+ current_plan: "01-01"
59
+ status: "Planning" # Planning | Planned | Building | Built | Verified
60
+ updated: "2025-01-15T10:30:00Z"
61
+ ---
62
+
63
+ ## Current Focus
64
+ Brief description of what's happening now.
65
+
66
+ ## Recently Completed
67
+ - Phase 01, Plan 01: Project scaffolding (Verified)
68
+
69
+ ## Next Steps
70
+ 1. Primary: Start planning phase 02
71
+ 2. Alternative: Review phase 01 verification results
72
+ ```
73
+
74
+ Valid status transitions: Planning → Planned → Building → Built → Verified
75
+
76
+ ---
77
+
78
+ ## Skill Invocation
79
+
80
+ PBR skills live in `.agents/skills/{name}/SKILL.md` in the plugin directory.
81
+ Codex discovers and runs them using the `$pbr-{name}` syntax.
82
+
83
+ ### Available Skills
84
+
85
+ | Skill | Command | When to Use |
86
+ |-------|---------|-------------|
87
+ | begin | `$pbr-begin` | Start a new project or onboard PBR to existing codebase |
88
+ | plan | `$pbr-plan` | Plan the next phase or plan item |
89
+ | build | `$pbr-build` | Execute the current plan |
90
+ | review | `$pbr-review` | Verify a completed build against its plan |
91
+ | status | `$pbr-status` | Show current workflow position |
92
+ | quick | `$pbr-quick` | Run a lightweight task outside the full cycle |
93
+ | continue | `$pbr-continue` | Resume from a checkpoint or interrupted session |
94
+ | pause | `$pbr-pause` | Pause with context preservation |
95
+ | resume | `$pbr-resume` | Resume a paused session |
96
+ | debug | `$pbr-debug` | Start or continue a debug investigation |
97
+ | explore | `$pbr-explore` | Research a domain or problem space |
98
+ | discuss | `$pbr-discuss` | Think through a design decision |
99
+ | do | `$pbr-do` | Execute a one-off instruction under PBR rules |
100
+ | scan | `$pbr-scan` | Audit codebase for issues |
101
+ | health | `$pbr-health` | Check project health and workflow hygiene |
102
+ | milestone | `$pbr-milestone` | Manage versioned milestone releases |
103
+ | todo | `$pbr-todo` | Manage cross-session task backlog |
104
+ | note | `$pbr-note` | Capture a decision or observation |
105
+ | import | `$pbr-import` | Import existing work into PBR structure |
106
+ | config | `$pbr-config` | Manage workflow configuration |
107
+ | setup | `$pbr-setup` | Configure or reconfigure PBR for this project |
108
+ | audit | `$pbr-audit` | Analyze session logs for workflow compliance |
109
+ | help | `$pbr-help` | Show available skills and usage |
110
+ | statusline | `$pbr-statusline` | Output a compact status summary |
111
+ | undo | `$pbr-undo` | Roll back the last plan or build step |
112
+
113
+ Skills can be invoked explicitly (`$pbr-plan`) or triggered implicitly when
114
+ your request description matches a skill's purpose. For example, saying
115
+ "plan the authentication phase" may implicitly trigger `$pbr-plan`.
116
+
117
+ ---
118
+
119
+ ## Phase Workflow
120
+
121
+ ### Step 1: Planning a Phase
122
+
123
+ Before writing any code for a phase, create a plan file:
124
+
125
+ **`.planning/phases/NN-slug/PLAN.md`**:
126
+
127
+ ```markdown
128
+ ---
129
+ phase: "01-setup"
130
+ plan: "01-01"
131
+ type: "feature"
132
+ files_modified:
133
+ - "src/config.ts"
134
+ - "src/database.ts"
135
+ must_haves:
136
+ truths:
137
+ - "Database connection is established on startup"
138
+ - "Configuration loads from environment variables"
139
+ artifacts:
140
+ - "src/config.ts: >30 lines, exports loadConfig()"
141
+ - "src/database.ts: >40 lines, exports connectDB()"
142
+ ---
143
+
144
+ ## Tasks
145
+
146
+ ### Task 1: Create configuration loader
147
+ - Read environment variables for DB_HOST, DB_PORT, DB_NAME
148
+ - Export a typed config object
149
+ - Throw on missing required variables
150
+
151
+ ### Task 2: Create database connection module
152
+ - Use the config from Task 1
153
+ - Implement connection pooling
154
+ - Export connectDB() and getDB() functions
155
+
156
+ ### Task 3: Add startup integration
157
+ - Call loadConfig() then connectDB() in main entry point
158
+ - Log connection success/failure
159
+ ```
160
+
161
+ **Planning rules:**
162
+ - Define `must_haves` with concrete, verifiable success criteria
163
+ - List all files that will be created or modified
164
+ - Break work into small, independently committable tasks
165
+ - Each task should produce a working, testable increment
166
+
167
+ ### Step 2: Building (Executing the Plan)
168
+
169
+ When executing a plan:
170
+
171
+ 1. **Read the plan first** — Load `.planning/phases/NN-slug/PLAN.md`
172
+ 2. **Update STATE.md** — Set status to "Building"
173
+ 3. **Execute tasks sequentially** — Follow the plan's task order
174
+ 4. **Commit after each task** — One atomic commit per task
175
+ 5. **Write SUMMARY.md** — Document what was actually built
176
+
177
+ **Commit message format:**
178
+
179
+ ```
180
+ {type}({phase}-{plan}): {description}
181
+ ```
182
+
183
+ Examples:
184
+ - `feat(01-01): implement configuration loader`
185
+ - `fix(01-01): handle missing DB_PORT with default value`
186
+ - `test(01-01): add unit tests for config validation`
187
+ - `refactor(02-01): extract auth middleware into separate module`
188
+
189
+ Types: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
190
+
191
+ **SUMMARY.md format** (written after all tasks complete):
192
+
193
+ ```markdown
194
+ ---
195
+ phase: "01-setup"
196
+ plan: "01-01"
197
+ status: "complete"
198
+ commits:
199
+ - "abc1234: feat(01-01): implement configuration loader"
200
+ - "def5678: feat(01-01): create database connection module"
201
+ key_files:
202
+ - "src/config.ts"
203
+ - "src/database.ts"
204
+ requires:
205
+ - "Node.js 18+"
206
+ - "PostgreSQL 14+"
207
+ deferred:
208
+ - "Connection retry logic (moved to phase 03)"
209
+ ---
210
+
211
+ ## What Was Built
212
+ Brief narrative of what was accomplished and any deviations from the plan.
213
+ ```
214
+
215
+ ### Step 3: Verification
216
+
217
+ After building, verify the work against the plan's `must_haves`:
218
+
219
+ **VERIFICATION.md format:**
220
+
221
+ ```markdown
222
+ ---
223
+ phase: "01-setup"
224
+ plan: "01-01"
225
+ result: "PASS"
226
+ verified_at: "2025-01-15T14:00:00Z"
227
+ ---
228
+
229
+ ## Must-Have Verification
230
+
231
+ | # | Criterion | Status | Evidence |
232
+ |---|-----------|--------|----------|
233
+ | 1 | Database connection established on startup | PASS | `connectDB()` called in `src/index.ts:15` |
234
+ | 2 | Config loads from environment variables | PASS | `loadConfig()` reads DB_HOST, DB_PORT, DB_NAME |
235
+
236
+ ## Artifact Verification
237
+
238
+ | # | Artifact | Status | Evidence |
239
+ |---|----------|--------|----------|
240
+ | 1 | src/config.ts: >30 lines, exports loadConfig() | PASS | 47 lines, exports `loadConfig()` at line 12 |
241
+ | 2 | src/database.ts: >40 lines, exports connectDB() | PASS | 63 lines, exports `connectDB()` at line 28 |
242
+
243
+ ## Deviations
244
+ None — plan executed as written.
245
+ ```
246
+
247
+ ---
248
+
249
+ ## ROADMAP.md Structure
250
+
251
+ The roadmap defines the full project as a sequence of phases:
252
+
253
+ ```markdown
254
+ # Project Roadmap
255
+
256
+ ## Phase 01: Project Setup
257
+ **Goal:** Establish project foundation with configuration and database connectivity.
258
+ **Status:** Verified
259
+ **Depends on:** (none)
260
+
261
+ ## Phase 02: Authentication
262
+ **Goal:** Users can sign in via OAuth and receive a session token.
263
+ **Status:** Planning
264
+ **Depends on:** Phase 01
265
+
266
+ ## Phase 03: Core Features
267
+ **Goal:** Implement the primary user-facing features.
268
+ **Status:** Pending
269
+ **Depends on:** Phase 01, Phase 02
270
+ ```
271
+
272
+ **Rules:**
273
+ - Phases are numbered sequentially (`01`, `02`, `03`, ...)
274
+ - Each phase has a clear, measurable goal
275
+ - Dependencies between phases are explicit
276
+ - Status tracks the highest completed stage for that phase
277
+
278
+ ---
279
+
280
+ ## Enforcement Rules
281
+
282
+ Codex has no hook system, so these rules are self-enforced checkpoints.
283
+ Run through this checklist at every stage transition.
284
+
285
+ ### Gate 1: Commit Format
286
+
287
+ Before any `git commit`, verify the message matches:
288
+
289
+ ```
290
+ {type}({scope}): {description}
291
+ ```
292
+
293
+ - **Valid types**: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
294
+ - **Valid scopes**: `NN-MM` (phase-plan), `quick-NNN`, `planning`, or a descriptive word
295
+ - **Block the commit** if the format doesn't match — fix the message first
296
+
297
+ ### Gate 2: Plan-Before-Build
298
+
299
+ Before writing any source code for a phase:
300
+
301
+ - Confirm `.planning/phases/NN-slug/PLAN.md` exists
302
+ - Confirm the plan has `must_haves` with at least one truth and one artifact
303
+ - **Never write production code without an approved plan**
304
+
305
+ ### Gate 3: Phase Boundary
306
+
307
+ Only modify `.planning/phases/NN-*/` files for the phase shown in `STATE.md`.
308
+
309
+ - Cross-phase edits require explicit justification in the commit body
310
+ - Don't refactor an old phase while building a new one
311
+
312
+ ### Gate 4: Format Validation
313
+
314
+ After writing any planning artifact, verify required frontmatter fields:
315
+
316
+ | File | Required fields |
317
+ |------|----------------|
318
+ | PLAN.md | `phase`, `plan`, `must_haves` (with `truths` and `artifacts`) |
319
+ | SUMMARY.md | `phase`, `plan`, `status`, `requires`, `key_files`, `deferred` |
320
+ | VERIFICATION.md | `phase`, `plan`, `result` (must be `PASS`, `FAIL`, `BLOCKED`, or `DEFERRED`) |
321
+
322
+ ### Gate 5: State Sync
323
+
324
+ After writing SUMMARY.md or VERIFICATION.md:
325
+
326
+ 1. Update `STATE.md` — set `status` to the new stage, update `updated` timestamp
327
+ 2. Update `ROADMAP.md` — update the phase's `**Status:**` line to match
328
+
329
+ Both files must stay in sync. Stale state causes confusion across sessions.
330
+
331
+ ---
332
+
333
+ ## Stage Transition Checkpoints
334
+
335
+ Use these checklists at each stage boundary.
336
+
337
+ ### Before Planning
338
+
339
+ - [ ] Read `.planning/STATE.md` — confirm current phase and status
340
+ - [ ] Read `.planning/ROADMAP.md` — confirm phase goal and dependencies
341
+ - [ ] Verify dependent phases are "Verified" before starting this phase
342
+ - [ ] Create `.planning/phases/NN-slug/` directory if it doesn't exist
343
+
344
+ ### After Planning (Before Building)
345
+
346
+ - [ ] PLAN.md has valid frontmatter (Gate 4)
347
+ - [ ] `must_haves.truths` are observable facts (not implementation notes)
348
+ - [ ] `must_haves.artifacts` specify file path, minimum size, and key exports
349
+ - [ ] Update STATE.md status to "Planned"
350
+
351
+ ### Before Building
352
+
353
+ - [ ] PLAN.md exists and is readable (Gate 2)
354
+ - [ ] Update STATE.md status to "Building"
355
+ - [ ] Note any pre-existing test failures — don't fix them unless the plan says to
356
+
357
+ ### After Each Commit
358
+
359
+ - [ ] Commit message matches `{type}({scope}): {description}` (Gate 1)
360
+ - [ ] Only files listed in the plan's `files_modified` were staged
361
+ - [ ] The commit represents a single logical change
362
+
363
+ ### After Building
364
+
365
+ - [ ] SUMMARY.md written with all required frontmatter fields (Gate 4)
366
+ - [ ] Every file listed in `key_files` exists on disk
367
+ - [ ] All commits listed in `commits` frontmatter actually exist in git log
368
+ - [ ] Update STATE.md status to "Built"
369
+ - [ ] Check `.planning/todos/pending/` — auto-close any todos satisfied by this work
370
+
371
+ ### After Verification
372
+
373
+ - [ ] VERIFICATION.md written with `result: PASS` or `result: FAIL`
374
+ - [ ] Every must-have has a row in the verification table with evidence
375
+ - [ ] Update STATE.md status to "Verified"
376
+ - [ ] Update ROADMAP.md phase status to "Verified" (Gate 5)
377
+ - [ ] Suggest next phase to the user
378
+
379
+ ---
380
+
381
+ ## Supplementary Workflows
382
+
383
+ ### Quick Tasks
384
+
385
+ For small changes that don't justify the full Plan-Build-Review cycle:
386
+
387
+ **Use quick tasks for:**
388
+ - Single-file changes
389
+ - Bug fixes with obvious solutions
390
+ - Documentation updates
391
+ - Configuration tweaks
392
+
393
+ **Use the full cycle for:**
394
+ - Changes spanning 3+ files
395
+ - New features requiring design decisions
396
+ - Anything that will take more than one commit
397
+
398
+ **Quick task structure:**
399
+
400
+ ```
401
+ .planning/quick/
402
+ └── NNN-slug/
403
+ ├── PLAN.md # Brief: what, why, files
404
+ └── SUMMARY.md # What was done, commit SHA
405
+ ```
406
+
407
+ Commit scope for quick tasks: `quick-NNN` (e.g., `fix(quick-001): correct typo in README`).
408
+
409
+ Quick PLAN.md only needs: one-sentence goal, files to touch, and definition of done.
410
+ Quick SUMMARY.md only needs: what was done and the commit hash.
411
+
412
+ ### Milestones
413
+
414
+ Milestones group phases into versioned releases.
415
+
416
+ **ROADMAP.md milestone syntax:**
417
+
418
+ ```markdown
419
+ ## Milestone v1.0: Initial Release
420
+ **Phases:** 01, 02, 03
421
+ **Status:** In Progress
422
+ ```
423
+
424
+ **Completing a milestone:**
425
+
426
+ 1. Verify all included phases have `status: Verified`
427
+ 2. Create `.planning/milestones/v{version}/`
428
+ 3. Copy (archive) `ROADMAP.md` and phase directories into it
429
+ 4. Create `STATS.md` with completion date, total commits, and phase count
430
+ 5. Collapse the milestone section in active ROADMAP.md to a single "COMPLETED" line
431
+ 6. Tag the commit: `git tag v{version}`
432
+
433
+ Archive structure:
434
+
435
+ ```
436
+ .planning/milestones/v1.0/
437
+ ├── ROADMAP.md # Snapshot of roadmap at completion
438
+ ├── STATS.md # Summary stats
439
+ └── phases/
440
+ ├── 01-setup/
441
+ └── 02-auth/
442
+ ```
443
+
444
+ ### Debug Workflow
445
+
446
+ For bugs requiring systematic investigation across sessions:
447
+
448
+ **Create a debug session:**
449
+
450
+ ```
451
+ .planning/debug/{slug}/
452
+ └── HYPOTHESIS.md
453
+ ```
454
+
455
+ **HYPOTHESIS.md format:**
456
+
457
+ ```markdown
458
+ ---
459
+ bug: "Brief bug description"
460
+ created: "2025-01-15"
461
+ status: "investigating" # investigating | confirmed | resolved
462
+ ---
463
+
464
+ ## Symptoms
465
+ What the user observes. Include error messages, reproduction steps.
466
+
467
+ ## Hypotheses
468
+
469
+ ### H1: [Hypothesis name]
470
+ **Test:** How to confirm or deny this
471
+ **Result:** (fill in after testing)
472
+ **Conclusion:** CONFIRMED / RULED OUT
473
+
474
+ ### H2: [Hypothesis name]
475
+ **Test:** ...
476
+ **Result:** ...
477
+ **Conclusion:** ...
478
+
479
+ ## Root Cause
480
+ (fill in when found)
481
+
482
+ ## Fix Applied
483
+ (fill in after resolution — commit SHA and description)
484
+ ```
485
+
486
+ Update `status` to `resolved` and record the fix. The file persists across sessions
487
+ so you never re-investigate the same root cause.
488
+
489
+ ### Notes System
490
+
491
+ Capture decisions, observations, and ideas between sessions:
492
+
493
+ ```
494
+ .planning/notes/{YYYY-MM-DD}-{slug}.md
495
+ ```
496
+
497
+ **Note frontmatter:**
498
+
499
+ ```markdown
500
+ ---
501
+ date: "2025-01-15"
502
+ promoted: false
503
+ ---
504
+
505
+ The note body goes here. Free-form markdown.
506
+ ```
507
+
508
+ Use `promoted: true` when a note has been acted on (turned into a phase or todo).
509
+ Notes are append-only — add new files rather than editing old ones.
510
+
511
+ ### Todo Management
512
+
513
+ Cross-session task backlog for items that don't yet have a phase:
514
+
515
+ ```
516
+ .planning/todos/pending/{NNN}-{slug}.md # Active
517
+ .planning/todos/done/{NNN}-{slug}.md # Completed
518
+ ```
519
+
520
+ **Todo format:**
521
+
522
+ ```markdown
523
+ ---
524
+ id: "001"
525
+ created: "2025-01-15"
526
+ priority: medium # high | medium | low
527
+ ---
528
+
529
+ What needs to be done and why.
530
+ ```
531
+
532
+ After completing any phase or quick task, check `.planning/todos/pending/` and
533
+ move satisfied todos to `done/` by renaming the file.
534
+
535
+ ### Session Continuity
536
+
537
+ Use `.planning/.continue-here.md` to preserve context between Codex sessions.
538
+
539
+ **When pausing (write `.planning/.continue-here.md`):**
540
+
541
+ ```markdown
542
+ ---
543
+ paused_at: "2025-01-15T16:00:00Z"
544
+ current_phase: "02-auth"
545
+ current_plan: "02-01"
546
+ ---
547
+
548
+ ## What Was In Progress
549
+ Which task was active, what had been done, what remained.
550
+
551
+ ## Blockers
552
+ Any external dependencies or decisions needed before resuming.
553
+
554
+ ## Next Action
555
+ The single most important thing to do when resuming. Be specific.
556
+
557
+ ## Context Notes
558
+ Anything Codex would need to know that isn't obvious from the files.
559
+ ```
560
+
561
+ **When resuming:**
562
+
563
+ 1. Read `.planning/.continue-here.md` first
564
+ 2. Read `STATE.md` to confirm current position
565
+ 3. Execute the "Next Action" listed
566
+ 4. Delete `.planning/.continue-here.md` once work resumes normally
567
+
568
+ ### Brownfield Onboarding
569
+
570
+ Introducing PBR to an existing project without a `.planning/` directory:
571
+
572
+ 1. **Scan the codebase** — understand the current structure, tech stack, and any existing docs
573
+ 2. **Create `.planning/`** — initialize the directory structure
574
+ 3. **Write ROADMAP.md** — identify logical phases based on what already exists
575
+ - Phase 01 is often "Baseline" — mark it Verified to acknowledge existing work
576
+ - Subsequent phases are planned work
577
+ 4. **Write STATE.md** — set `current_phase` to the first active phase, status "Planning"
578
+ 5. **Create PLAN.md for Phase 01 (if not trivial)** — document what exists as baseline
579
+ 6. **Proceed normally** — the next feature or bug fix becomes Phase 02+
580
+
581
+ Don't try to retroactively document every historical decision. A lightweight ROADMAP.md
582
+ that captures the current state is enough to enable PBR going forward.
583
+
584
+ ---
585
+
586
+ ## Configuration
587
+
588
+ PBR behavior can be customized via `.codex/config.toml` in your project.
589
+ See the sample config at `plugins/codex-pbr/.codex/config.toml` for all options.
590
+
591
+ Key configuration areas:
592
+ - **Agent profiles** — model selection per PBR agent role
593
+ - **Sandbox** — which commands are allowed during builds
594
+ - **Workflow** — timeouts and context limits
595
+
596
+ ---
597
+
598
+ ## Working Rules for Codex
599
+
600
+ ### Before Starting Any Task
601
+
602
+ 1. Check if `.planning/STATE.md` exists — if so, read it to understand current position
603
+ 2. Check if `.planning/ROADMAP.md` exists — if so, read it to understand phase structure
604
+ 3. If the user's request maps to an existing phase, follow the Plan-Build-Review cycle
605
+ 4. If no `.planning/` directory exists and the task is non-trivial, offer to create one
606
+ 5. Check `.planning/.continue-here.md` — if it exists, resume from there
607
+
608
+ ### During Execution
609
+
610
+ - **One task, one commit** — never bundle unrelated changes
611
+ - **Stage specific files** — never use `git add .` or `git add -A`
612
+ - **Follow the plan** — if you need to deviate, document why in SUMMARY.md
613
+ - **Update STATE.md** — keep it current as you transition between stages
614
+ - **Don't over-engineer** — build exactly what the plan specifies, nothing more
615
+
616
+ ### After Completing Work
617
+
618
+ - Write SUMMARY.md documenting what was built
619
+ - Run verification against the plan's must_haves
620
+ - Write VERIFICATION.md with pass/fail results and evidence
621
+ - Update STATE.md status to "Built" or "Verified"
622
+ - Check `.planning/todos/pending/` for any todos to close
623
+ - Suggest the next logical step to the user
624
+
625
+ ---
626
+
627
+ ## Context Management
628
+
629
+ Codex operates in interactive CLI sessions, so context management matters:
630
+
631
+ - **Write decisions to disk** — don't rely on conversation memory
632
+ - **STATE.md is the source of truth** — always read it at task start
633
+ - **Plans are contracts** — they define what "done" means
634
+ - **Summaries close the loop** — they record what actually happened
635
+ - **Use `.continue-here.md`** — for deliberate pauses between sessions
636
+
637
+ If a task is complex enough to span multiple sessions, the
638
+ `.planning/` directory ensures continuity between them.
639
+
640
+ ---
641
+
642
+ ## Anti-Patterns to Avoid
643
+
644
+ 1. **Building without a plan** — leads to scope creep and rework
645
+ 2. **Skipping verification** — you don't know if you succeeded
646
+ 3. **Giant commits** — impossible to review or revert
647
+ 4. **Modifying files outside the plan's scope** — creates hidden dependencies
648
+ 5. **Ignoring must_haves** — they exist to define "done" objectively
649
+ 6. **Re-reading entire files when summaries exist** — wastes context
650
+ 7. **Creating artifacts the user didn't approve** — always confirm first
651
+ 8. **Using `git add .`** — stages unintended files; always stage explicitly
652
+ 9. **Skipping STATE.md updates** — stale state causes confusion across sessions
653
+ 10. **Fixing pre-existing bugs while building a phase** — log to todos, stay focused
@@ -0,0 +1,116 @@
1
+ # Plan-Build-Run for Codex CLI
2
+
3
+ Plan-Build-Run (PBR) is a structured development workflow plugin for Codex CLI that prevents
4
+ quality degradation on complex projects. It enforces a disciplined Plan → Build → Review cycle
5
+ using file-based state tracking in a `.planning/` directory — ensuring that every meaningful
6
+ change is planned before it's coded, committed atomically, and verified against concrete
7
+ success criteria.
8
+
9
+ ---
10
+
11
+ ## Installation
12
+
13
+ ### 1. Copy skills to your project
14
+
15
+ Copy (or symlink) the `skills/` directory into your project's agent skills folder:
16
+
17
+ ```bash
18
+ # Copy
19
+ cp -r plugins/codex-pbr/skills/ /path/to/your-project/.agents/skills/
20
+
21
+ # Or symlink (for active development)
22
+ ln -s /path/to/plan-build-run/plugins/codex-pbr/skills /path/to/your-project/.agents/skills
23
+ ```
24
+
25
+ ### 2. Copy AGENTS.md to your project root
26
+
27
+ ```bash
28
+ cp plugins/codex-pbr/AGENTS.md /path/to/your-project/AGENTS.md
29
+ ```
30
+
31
+ Codex reads `AGENTS.md` from the repository root automatically. This file teaches Codex
32
+ the PBR workflow rules, file formats, and enforcement gates.
33
+
34
+ ### 3. (Optional) Copy sample config
35
+
36
+ ```bash
37
+ cp plugins/codex-pbr/.codex/config.toml /path/to/your-project/.codex/config.toml
38
+ ```
39
+
40
+ Edit the config to customize model selection per agent role and sandbox permissions.
41
+ All settings are commented out by default — uncomment only what you need.
42
+
43
+ ---
44
+
45
+ ## Skill Reference
46
+
47
+ Invoke skills using `$pbr-{name}` syntax in your Codex session.
48
+
49
+ | Skill | Command | Description |
50
+ |-------|---------|-------------|
51
+ | begin | `$pbr-begin` | Onboard PBR to a new or existing project |
52
+ | plan | `$pbr-plan` | Plan the next phase with must-haves and tasks |
53
+ | build | `$pbr-build` | Execute the current PLAN.md with atomic commits |
54
+ | review | `$pbr-review` | Verify a completed build against plan criteria |
55
+ | status | `$pbr-status` | Show current workflow position and phase state |
56
+ | quick | `$pbr-quick` | Run a lightweight task outside the full cycle |
57
+ | continue | `$pbr-continue` | Resume from a checkpoint or interrupted session |
58
+ | pause | `$pbr-pause` | Pause with context preservation to .continue-here.md |
59
+ | resume | `$pbr-resume` | Resume a previously paused session |
60
+ | debug | `$pbr-debug` | Start or continue a hypothesis-driven debug session |
61
+ | explore | `$pbr-explore` | Research a domain, library, or problem space |
62
+ | discuss | `$pbr-discuss` | Think through a design decision interactively |
63
+ | do | `$pbr-do` | Execute a one-off instruction under PBR rules |
64
+ | scan | `$pbr-scan` | Audit the codebase for issues and tech debt |
65
+ | health | `$pbr-health` | Check overall project health and workflow hygiene |
66
+ | milestone | `$pbr-milestone` | Manage versioned milestone releases |
67
+ | todo | `$pbr-todo` | Manage the cross-session task backlog |
68
+ | note | `$pbr-note` | Capture a decision, observation, or idea |
69
+ | import | `$pbr-import` | Import existing work into PBR phase structure |
70
+ | config | `$pbr-config` | View or update workflow configuration |
71
+ | setup | `$pbr-setup` | Configure or reconfigure PBR for this project |
72
+ | audit | `$pbr-audit` | Analyze Codex sessions for workflow compliance |
73
+ | help | `$pbr-help` | Show available skills and usage |
74
+ | statusline | `$pbr-statusline` | Output a compact one-line status summary |
75
+ | undo | `$pbr-undo` | Roll back the last plan or build step |
76
+
77
+ ---
78
+
79
+ ## File Structure Notes
80
+
81
+ ### Auto-generated files
82
+
83
+ The following are generated from the main `plugins/pbr/` source and should not be edited
84
+ manually. Re-run the generator script to update them:
85
+
86
+ - `skills/` — all 25 skill prompts
87
+ - `agents/` — all 11 agent definitions
88
+ - `references/` — all reference documents
89
+ - `templates/` — all EJS-style output templates
90
+ - `commands/` — command registration files
91
+
92
+ To regenerate:
93
+
94
+ ```bash
95
+ node scripts/generate-derivatives.js codex
96
+ ```
97
+
98
+ ### Manual files
99
+
100
+ These files cannot be auto-generated and must be maintained by hand:
101
+
102
+ | File | Purpose |
103
+ |------|---------|
104
+ | `AGENTS.md` | PBR workflow guide read by Codex at session start |
105
+ | `.codex/config.toml` | Sample Codex config with PBR agent profiles |
106
+ | `README.md` | This file |
107
+
108
+ ---
109
+
110
+ ## More Information
111
+
112
+ - Main PBR repository: [plan-build-run](https://github.com/SienkLogic/plan-build-run)
113
+ - Codex CLI documentation: [openai/codex](https://github.com/openai/codex)
114
+ - Claude Code plugin (`plugins/pbr/`) — the canonical source for all skills and agents
115
+ - Cursor plugin (`plugins/cursor-pbr/`) — Cursor IDE derivative
116
+ - Copilot plugin (`plugins/copilot-pbr/`) — GitHub Copilot derivative
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.55.0",
4
+ "version": "2.56.0",
5
5
  "description": "Plan-Build-Run — Structured development workflow for GitHub Copilot CLI. Solves context rot through disciplined agent delegation, structured planning, atomic execution, and goal-backward verification.",
6
6
  "author": {
7
7
  "name": "SienkLogic",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.55.0",
4
+ "version": "2.56.0",
5
5
  "description": "Plan-Build-Run — Structured development workflow for Cursor. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
6
6
  "author": {
7
7
  "name": "SienkLogic",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pbr",
3
- "version": "2.55.0",
3
+ "version": "2.56.0",
4
4
  "description": "Plan-Build-Run — Structured development workflow for Claude Code. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
5
5
  "author": {
6
6
  "name": "SienkLogic",