@benzotti/jedi 0.1.28 → 0.1.30

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/README.md CHANGED
@@ -1,30 +1,4 @@
1
- ```
2
- ⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
3
- ⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
4
- ⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
5
- ⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
6
- ⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
7
- ⠀⠀⠀⠀⠠⠀⠀⠀⡇⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
8
- ⠀⠀⠀⠀⠀⠈⠳⣴⣿⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
9
- ⠀⠒⠒⠒⠒⠒⢺⢿⣿⢗⠒⠒⠒⠒⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
10
- ⠀⠀⠀⠀⠀⠀⠁⣸⣿⣦⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
11
- ⠀⠀⠀⠀⠀⢀⣾⡟⠋⢹⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
12
- ⠀⠀⠀⠀⢀⣿⡟⣴⣶⡄⣿⣧⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
13
- ⠀⠀⠀⢰⣿⣿⣧⢻⣿⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
14
- ⠀⠀⠀⠈⢻⣿⣿⣷⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
15
- ⠀⠀⠀⠀⢸⠿⣿⣿⣿⣿⣿⣿⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
16
- ⠀⠀⠀⠀⣾⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀
17
- ⠀⠀⠀⠀⣿⣏⣻⣿⣿⣿⣿⣿⠋⣿⣿⣿⣿⣿⠙⣿⣷⣶⣤⣤⡄
18
- ⠀⠀⠀⠀⢻⢇⣿⣿⣿⣿⣿⠹⠀⢹⣿⣿⣿⡇⠀⢟⣿⣿⡿⠋⠀
19
- ⠀⠀⠀⠀⢘⣼⣿⣿⣿⣿⣿⡆⠀⢸⣿⠛⣿⡇⠀⢸⡿⠋⠀⠀⠀
20
- ⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣦⣈⠻⠴⠟⣁⣴⣿⣿⠗⠀⠀⠀
21
- ⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀
22
- ⠀⠀⢀⣿⣿⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀
23
- ⠀⠀⣾⣿⡏⠀⠹⣿⠿⠿⠿⠿⣿⣿⣿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀
24
- ⠀⢰⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀
25
- ⠀⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
26
- ⣰⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀
27
- ⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀
1
+ ```
28
2
  ██╗███████╗██████╗ ██╗
29
3
  ██║██╔════╝██╔══██╗██║
30
4
  ██║█████╗ ██║ ██║██║
@@ -33,281 +7,262 @@
33
7
  ╚════╝ ╚══════╝╚═════╝ ╚═╝
34
8
  ```
35
9
 
36
- # JDI Framework
10
+ **Context-efficient AI development framework for Claude Code.**
11
+
12
+ [![npm version](https://img.shields.io/npm/v/@benzotti/jedi)](https://www.npmjs.com/package/@benzotti/jedi) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
37
13
 
38
- A componentised, context-efficient AI development framework for Claude Code. JDI orchestrates specialised agents to plan, implement, review, and ship features — from single-file fixes to full-stack multi-wave implementations.
14
+ Jedi orchestrates specialised agents to plan, implement, review, and ship features — from single-file fixes to full-stack multi-wave implementations. It runs in three modes: **Claude Code app**, **CLI**, and **GitHub Actions**.
39
15
 
40
16
  ---
41
17
 
42
18
  ## Table of Contents
43
19
 
20
+ - [Usage Modes](#usage-modes)
44
21
  - [Getting Started](#getting-started)
45
22
  - [Commands](#commands)
23
+ - [GitHub Actions Setup](#github-actions-setup)
46
24
  - [Features](#features)
47
- - [Planning and Implementation](#planning-and-implementation)
48
- - [Git Worktrees](#git-worktrees)
49
- - [Agent Teams](#agent-teams)
50
- - [Complexity Router](#complexity-router)
51
- - [PR Workflow](#pr-workflow)
52
- - [Verification and Quality Gates](#verification-and-quality-gates)
53
- - [Component System](#component-system)
54
- - [Model Routing](#model-routing)
55
- - [State Management](#state-management)
56
- - [PR Feedback Learning](#pr-feedback-learning)
57
25
  - [Agents](#agents)
58
26
  - [Teams](#teams)
59
27
  - [Configuration](#configuration)
28
+ - [Security](#security)
60
29
  - [Directory Structure](#directory-structure)
61
30
  - [Architecture](#architecture)
62
31
 
63
32
  ---
64
33
 
65
- ## Getting Started
66
-
67
- ### 1. Install JDI
68
-
69
- ```bash
70
- bun install -g @benzotti/jedi
71
- ```
72
-
73
- Then initialise in your project:
34
+ ## Usage Modes
74
35
 
75
- ```bash
76
- jdi init
77
- ```
78
-
79
- Or run the init command directly inside Claude Code:
36
+ Jedi runs in three modes with identical capabilities:
80
37
 
81
- ```
82
- /jdi:init
83
- ```
38
+ | Mode | How | Best For |
39
+ |------|-----|----------|
40
+ | **Claude Code App** | `/jdi:create-plan`, `/jdi:implement-plan`, etc. | Interactive development with Claude Code |
41
+ | **CLI** | `jdi plan`, `jdi implement`, `jdi quick`, etc. | Terminal workflows, scripting, CI |
42
+ | **GitHub Actions** | Comment `Hey Jedi plan ...` on issues/PRs | Autonomous code generation from issue comments |
84
43
 
85
- This creates:
86
- - `.jdi/framework/` — Framework files (agents, components, teams, etc.)
87
- - `.claude/commands/jdi/` — Slash command stubs for all JDI commands
88
- - `.jdi/` — Project state directory with plans, config, and research
44
+ ---
89
45
 
90
- Use `--force` to regenerate all files (overwrites existing).
46
+ ## Getting Started
91
47
 
92
- ### 2. Plan a Feature
48
+ ### Claude Code App
93
49
 
94
- ```
95
- /jdi:create-plan "PROJ-1234 Add user authentication"
50
+ ```bash
51
+ bun install -g @benzotti/jedi
52
+ jdi init
96
53
  ```
97
54
 
98
- JDI spawns a planner agent that researches your codebase, then produces a structured implementation plan at `.jdi/plans/`.
99
-
100
- ### 3. Implement the Plan
101
-
55
+ Then inside Claude Code:
102
56
  ```
57
+ /jdi:create-plan "Add user authentication"
103
58
  /jdi:implement-plan
59
+ /jdi:commit
60
+ /jdi:generate-pr
104
61
  ```
105
62
 
106
- JDI evaluates the plan's complexity and routes it accordingly — a single agent for small changes, or a full Agent Teams swarm for multi-stack multi-wave work.
63
+ ### CLI
107
64
 
108
- ### 4. Commit and Ship
65
+ ```bash
66
+ bun install -g @benzotti/jedi
67
+ jdi init
109
68
 
69
+ jdi plan "Add user authentication"
70
+ jdi implement
71
+ jdi quick "fix the broken quote calculator"
72
+ jdi review 42
73
+ jdi pr
110
74
  ```
111
- /jdi:commit
112
- /jdi:generate-pr
113
- ```
114
-
115
- Create conventional commits and generate a PR with a structured description.
116
75
 
117
- ### Quick Changes
76
+ ### GitHub Actions
118
77
 
119
- For small, focused changes that don't need full orchestration:
78
+ ```bash
79
+ jdi setup-action
80
+ ```
120
81
 
82
+ Then on any issue or PR, comment:
121
83
  ```
122
- /jdi:quick "fix the broken quote calculator"
84
+ Hey Jedi plan Add user authentication
85
+ Hey Jedi implement
86
+ Hey Jedi quick fix the broken login button
123
87
  ```
124
88
 
125
- Executes directly in the main context — no agent spawn, no team, no waves.
89
+ See [GitHub Actions Setup](#github-actions-setup) for details.
126
90
 
127
91
  ---
128
92
 
129
93
  ## Commands
130
94
 
131
- All commands are invoked as slash commands inside Claude Code.
132
-
133
- | Command | Type | Description |
134
- |---------|------|-------------|
135
- | `/jdi:init` | Direct | Initialise JDI in the current project |
136
- | `/jdi:create-plan` | Agent | Create an implementation plan (includes codebase research) |
137
- | `/jdi:implement-plan` | Agent | Execute a plan (single-agent or Agent Teams swarm) |
138
- | `/jdi:quick` | Direct | Quick focused change without orchestration |
139
- | `/jdi:commit` | Agent | Create a conventional commit |
140
- | `/jdi:generate-pr` | Agent | Generate and create a pull request |
141
- | `/jdi:pr-review` | Agent | Review a PR and post line comments to GitHub |
142
- | `/jdi:pr-feedback` | Agent | Address PR review comments |
143
- | `/jdi:worktree` | Direct | Create an isolated git worktree with full project environment |
144
- | `/jdi:worktree-remove` | Direct | Remove a worktree and clean up all resources |
145
- | `/jdi:status` | Direct | Show current framework state and suggest next action |
146
-
147
- **Agent commands** spawn a Task agent with isolated context (~300 tokens in main context). **Direct commands** execute in the main context.
148
-
149
- ### Command Flags
150
-
151
- #### `/jdi:create-plan`
152
-
95
+ | Slash Command | CLI Equivalent | Description |
96
+ |---------------|----------------|-------------|
97
+ | `/jdi:init` | `jdi init` | Initialise Jedi in the current project |
98
+ | `/jdi:create-plan` | `jdi plan <desc>` | Create an implementation plan |
99
+ | `/jdi:implement-plan` | `jdi implement [plan]` | Execute a plan (single-agent or Agent Teams) |
100
+ | `/jdi:quick` | `jdi quick <desc>` | Quick focused change without orchestration |
101
+ | `/jdi:commit` | `jdi commit` | Create a conventional commit |
102
+ | `/jdi:generate-pr` | `jdi pr` | Generate and create a pull request |
103
+ | `/jdi:pr-review` | `jdi review <pr>` | Review a PR and post line comments |
104
+ | `/jdi:pr-feedback` | `jdi feedback` | Address PR review comments |
105
+ | `/jdi:worktree` | `jdi worktree` | Create an isolated git worktree |
106
+ | `/jdi:worktree-remove` | `jdi worktree-remove` | Remove a worktree and clean up |
107
+ | `/jdi:status` | `jdi status` | Show current state and suggest next action |
108
+
109
+ ### CLI Flags
110
+
111
+ #### `jdi plan`
153
112
  | Flag | Description |
154
113
  |------|-------------|
155
- | `--worktree` | Create an isolated git worktree with full project environment (databases, deps, migrations, seeders per adapter config) before planning |
156
- | `--worktree-lightweight` | Create a worktree with minimal setup (deps + migrate only) |
157
-
158
- #### `/jdi:implement-plan`
114
+ | `--print` | Print prompt to stdout instead of executing |
115
+ | `--output <file>` | Write prompt to file |
159
116
 
117
+ #### `jdi implement`
160
118
  | Flag | Description |
161
119
  |------|-------------|
162
- | `--worktree` | Create a full-environment worktree before executing |
163
- | `--worktree-lightweight` | Create a lightweight worktree before executing |
164
- | `--team` | Force Agent Teams mode (even for simple plans) |
165
- | `--single` | Force single-agent mode (even for complex plans) |
166
-
167
- If `state.yaml` has `worktree.active: true` (set by `create-plan --worktree`), the implementation automatically runs inside that worktree.
168
-
169
- #### `/jdi:worktree`
120
+ | `--team` | Force Agent Teams mode |
121
+ | `--single` | Force single-agent mode |
122
+ | `--dry-run` | Preview changes without writing files |
123
+ | `--print` | Print prompt to stdout |
170
124
 
125
+ #### `jdi quick`
171
126
  | Flag | Description |
172
127
  |------|-------------|
173
- | `--lightweight` | Skip databases, web server setup — just deps and migrate |
174
- | `--base <branch>` | Base branch to create worktree from (default: `master`) |
175
-
176
- #### `/jdi:worktree-remove`
128
+ | `--dry-run` | Preview changes without writing files |
129
+ | `--print` | Print prompt to stdout |
177
130
 
131
+ #### `jdi pr`
178
132
  | Flag | Description |
179
133
  |------|-------------|
180
- | `--force` | Skip confirmation prompt |
181
- | `--keep-branch` | Don't delete the git branch after removal |
134
+ | `--draft` | Create as draft PR |
135
+ | `--base <branch>` | Base branch (default: main) |
136
+ | `--no-push` | Skip pushing the branch |
137
+ | `--dry-run` | Show generated PR without creating |
182
138
 
183
- #### `/jdi:init`
139
+ ---
184
140
 
185
- | Flag | Description |
186
- |------|-------------|
187
- | `--force` | Overwrite all existing command stubs |
141
+ ## GitHub Actions Setup
188
142
 
189
- ---
143
+ ### Installation
190
144
 
191
- ## Features
145
+ Run `jdi setup-action` to generate the workflow file, or manually copy `action/workflow-template.yml` to `.github/workflows/jedi.yml`.
192
146
 
193
- ### Planning and Implementation
147
+ ### Required Secrets
194
148
 
195
- JDI follows a plan-then-execute workflow:
149
+ | Secret | Required | Description |
150
+ |--------|----------|-------------|
151
+ | `ANTHROPIC_API_KEY` | Yes | Claude API key |
152
+ | `CLICKUP_API_TOKEN` | No | ClickUp integration for ticket-driven development |
196
153
 
197
- 1. **Research** — The planner agent analyses your codebase, gathers context, and identifies patterns before writing the plan.
198
- 2. **Plan** — Produces a structured `PLAN.md` with task breakdown, dependencies, wave computation, and success criteria.
199
- 3. **Execute** — The complexity router decides whether to use a single specialist agent or a full Agent Teams swarm.
200
- 4. **Verify** — Quality gates run automatically after execution (lint, type checking, tests).
201
- 5. **Commit** — Each task gets its own atomic conventional commit.
154
+ ### Optional Variables
202
155
 
203
- Plans are written to `.jdi/plans/{phase}-{plan}-PLAN.md` and can be reviewed before execution.
156
+ | Variable | Description |
157
+ |----------|-------------|
158
+ | `JEDI_AUTH_ENABLED` | Set to `true` to restrict Jedi to write collaborators |
159
+ | `JEDI_ALLOWED_USERS` | Comma-separated list of allowed GitHub usernames |
204
160
 
205
- ### Git Worktrees
161
+ ### Comment Syntax
206
162
 
207
- JDI provides full-environment git worktrees for isolated development. Unlike the built-in `EnterWorktree` tool, JDI worktrees set up the complete project environment via adapter configs:
163
+ | Command | Description |
164
+ |---------|-------------|
165
+ | `Hey Jedi plan <description>` | Create an implementation plan |
166
+ | `Hey Jedi implement` | Execute the current plan |
167
+ | `Hey Jedi implement --dry-run` | Preview implementation without writing |
168
+ | `Hey Jedi quick <description>` | Make a quick change |
169
+ | `Hey Jedi review` | Review the current PR |
170
+ | `Hey Jedi do <clickup-url>` | Full flow: plan + implement from ticket |
171
+ | `Hey Jedi ping` | Check framework status |
208
172
 
209
- **Full worktree** (`--worktree`):
210
- - Creates project databases per adapter config
211
- - Configures environment files with worktree-specific settings
212
- - Installs dependencies per adapter config
213
- - Runs project bootstrap (migrations, seeders, post-setup)
214
- - Configures web server per adapter config
173
+ ### Conversation Flow
215
174
 
216
- **Lightweight worktree** (`--worktree-lightweight`):
217
- - Installs dependencies and runs migrations only
218
- - Skips databases, web server setup, seeders, and post-setup
175
+ 1. Comment `Hey Jedi plan ...` to start planning
176
+ 2. Jedi posts the plan and asks for feedback
177
+ 3. Reply with refinement feedback (e.g. "change task 2 to use Redis instead")
178
+ 4. Say "approved" or "lgtm" to lock the plan
179
+ 5. Comment `Hey Jedi implement` to execute
180
+ 6. Reply with follow-up feedback to iterate on the implementation
219
181
 
220
- Worktree names are derived from ticket IDs and task descriptions (e.g., `"PROJ-1234 Add user auth"` becomes `proj-1234-add-user-auth`). Cleanup via `/jdi:worktree-remove` reverses all setup, removes the worktree, and deletes the branch.
182
+ Jedi maintains conversation context across comments no need to repeat earlier instructions.
221
183
 
222
- ### Agent Teams
184
+ ---
185
+
186
+ ## Features
223
187
 
224
- For complex plans, JDI uses Claude Code's native Agent Teams to orchestrate multiple specialist agents working in parallel:
188
+ ### Planning and Implementation
225
189
 
226
- 1. **TeamCreate** — Creates a shared task list
227
- 2. **TaskCreate** — Creates tasks with dependencies per the plan
228
- 3. **Spawn Specialists** — Routes tasks to the right agent by tech stack
229
- 4. **Wave Coordination** — Agents execute in dependency-ordered waves
230
- 5. **Deferred Operations** — Orchestrator collects file creation and commits from agents, then executes them
231
- 6. **Cleanup** — Graceful shutdown and team deletion
190
+ 1. **Research** — The planner agent analyses your codebase and gathers context
191
+ 2. **Plan** — Produces a structured `PLAN.md` with task breakdown, dependencies, and success criteria
192
+ 3. **Execute** — The complexity router decides single-agent or Agent Teams mode
193
+ 4. **Verify** — Quality gates run automatically after execution
194
+ 5. **Commit** — Each task gets its own atomic conventional commit
232
195
 
233
- Agents operate in isolated sandboxed contexts. They can edit existing files but cannot create new files or make git commits directly — these are reported as `files_to_create` and `commits_pending` for the orchestrator to execute.
196
+ ### Dry-Run Mode
234
197
 
235
- ### Complexity Router
198
+ Preview what Jedi would change without writing any files:
236
199
 
237
- The complexity router (`<JDI:ComplexityRouter />`) evaluates the plan and decides the execution mode:
200
+ ```bash
201
+ jdi implement --dry-run
202
+ jdi quick --dry-run "add error handling to the API"
203
+ ```
238
204
 
239
- | Signal | Simple | Complex |
240
- |--------|--------|---------|
241
- | Task count | 1-3 | >3 |
242
- | Tech stacks | Single (PHP-only or TS-only) | Mixed (PHP + TS/React) |
243
- | Wave count | 1 | >1 |
205
+ Or in GitHub Actions: `Hey Jedi implement --dry-run`
244
206
 
245
- **If ANY signal is "Complex"**, the plan uses Agent Teams mode. All signals must be "Simple" for single-agent mode.
207
+ In dry-run mode, Jedi can only read files writes, commits, and pushes are blocked.
246
208
 
247
- Override with `--team` (force swarm) or `--single` (force single-agent).
209
+ ### Plan-Aware PR Generation
248
210
 
249
- **Tech-stack routing** per task:
211
+ `jdi pr` reads the current plan from state.yaml and generates a richer PR body:
212
+ - Summary derived from the plan objective
213
+ - Task list from the plan breakdown
214
+ - Verification checklist from plan criteria
250
215
 
251
- | Task Stack | Agent(s) |
252
- |-----------|----------|
253
- | PHP only | jdi-backend |
254
- | TS/React only | jdi-frontend |
255
- | Full-stack | jdi-backend + jdi-frontend |
256
- | Config/docs | jdi-backend (default) |
216
+ ### Automated Verification Runner
257
217
 
258
- ### PR Workflow
218
+ After implementation (both CLI and GitHub Actions), Jedi automatically runs quality gates defined in `adapter.yaml`:
259
219
 
260
- JDI provides a complete PR lifecycle:
220
+ ```yaml
221
+ quality_gates:
222
+ lint: "bun run lint"
223
+ typecheck: "bun run typecheck"
224
+ test: "bun test"
225
+ ```
261
226
 
262
- **`/jdi:pr-review <number>`** Structured code review with severity-classified findings:
263
- - Checks out the PR branch and reads all changed files in full
264
- - Applies a comprehensive checklist (correctness, security, performance, architecture, style, testing, type safety)
265
- - Classifies findings by severity (blocker, major, minor, suggestion, question, praise)
266
- - Posts all findings as line comments in a single atomic GitHub review
267
- - Supports `--no-comments` for local-only review (writes to `.jdi/reviews/`)
268
- - Supports focus areas and ClickUp context via additional arguments
227
+ Results are printed in the CLI and posted as a collapsible section in GitHub comments.
269
228
 
270
- **`/jdi:pr-feedback <number>`** — Addresses review comments systematically, learning from team patterns.
229
+ ### Git Worktrees
230
+
231
+ Full-environment git worktrees for isolated development:
271
232
 
272
- **`/jdi:generate-pr`** Creates a PR with a structured description derived from the implementation plan and commits.
233
+ - **Full worktree** (`--worktree`): databases, dependencies, migrations, seeders, web server
234
+ - **Lightweight worktree** (`--worktree-lightweight`): dependencies and migrations only
273
235
 
274
- ### Verification and Quality Gates
236
+ ### Agent Teams
275
237
 
276
- JDI runs multi-level verification after implementation:
238
+ For complex plans (>3 tasks, multiple tech stacks, or multiple waves), Jedi uses Claude Code's Agent Teams to orchestrate multiple specialist agents working in parallel.
277
239
 
278
- **Three-level verification** for every artefact:
279
- 1. **Existence** — Does it exist at the expected path?
280
- 2. **Substantive** — Is it real implementation, not a stub?
281
- 3. **Wired** — Is it connected to the system (imported, registered, routed)?
240
+ ### Complexity Router
282
241
 
283
- **Verification scopes:**
242
+ | Signal | Simple | Complex |
243
+ |--------|--------|---------|
244
+ | Task count | 1-3 | >3 |
245
+ | Tech stacks | Single | Mixed |
246
+ | Wave count | 1 | >1 |
284
247
 
285
- | Scope | Verifies |
286
- |-------|----------|
287
- | `task` | Current task criteria and done conditions |
288
- | `plan` | All tasks + plan success criteria |
289
- | `phase` | All plans + phase must-haves |
290
- | `requirements` | All v1 requirements coverage |
248
+ Override with `--team` or `--single`.
291
249
 
292
- **Quality gates** run automatically:
293
- - `composer check-style` / `composer stan` / `composer test` (PHP)
294
- - `bun run lint` / `bun run typecheck` / `bun run test:vitest` (TypeScript)
250
+ ### PR Workflow
295
251
 
296
- Backend tests are a **mandatory blocking gate** verification fails if `composer test` fails.
252
+ - **`jdi review <pr>`** Structured code review with severity-classified findings posted as line comments
253
+ - **`jdi feedback`** — Address review comments systematically, learning from team patterns
254
+ - **`jdi pr`** — Create a PR with plan-aware description
297
255
 
298
256
  ### Component System
299
257
 
300
- JDI uses a JSX-like component syntax for reusable instructions:
258
+ JSX-like reusable instruction syntax:
301
259
 
302
260
  ```markdown
303
261
  <JDI:Commit /> # Full component
304
- <JDI:Commit:Message /> # Specific section
305
262
  <JDI:Verify scope="plan" /> # With parameters
306
- <JDI:PRReview post="false" /> # Boolean parameter
263
+ <JDI:PRReview post="false" /> # Local review mode
307
264
  ```
308
265
 
309
- Components are **lazy-loaded on-demand** by agents — not pre-embedded in commands. When an agent encounters a `<JDI:*>` tag, it reads the component file, executes the instructions, and returns to the calling context.
310
-
311
266
  **Available components:**
312
267
 
313
268
  | Component | Category | Purpose |
@@ -316,300 +271,168 @@ Components are **lazy-loaded on-demand** by agents — not pre-embedded in comma
316
271
  | `Verify` | execution | Multi-level verification |
317
272
  | `VerifyAdvanced` | execution | Phase and requirements verification |
318
273
  | `CodebaseContext` | execution | Load and cache codebase analysis |
319
- | `PRReview` | quality | Structured PR review with line comments |
320
- | `PRReviewLocal` | quality | Write review to local file |
274
+ | `PRReview` | quality | Structured PR review (remote and local modes) |
321
275
  | `TaskBreakdown` | planning | Break features into tasks |
322
276
  | `WaveComputation` | planning | Compute dependency-ordered waves |
323
277
  | `AgentBase` | meta | Base protocol for all agents |
324
278
  | `AgentTeamsOrchestration` | meta | Agent Teams lifecycle management |
325
279
  | `ComplexityRouter` | meta | Route plans to single-agent or swarm |
326
280
  | `TeamRouter` | meta | Route commands to teams |
327
- | `StateUpdate` | meta | Update state.yaml fields |
328
-
329
- ### Model Routing
330
-
331
- JDI routes different agents to different Claude models based on a configurable profile:
332
-
333
- | Profile | Description | Planner | Executor | Researcher | Verifier |
334
- |---------|-------------|---------|----------|------------|----------|
335
- | `quality` | Maximum reasoning power | Opus | Opus | Sonnet | Sonnet |
336
- | `balanced` | Smart allocation (default) | Opus | Sonnet | Sonnet | Sonnet |
337
- | `budget` | Conserve quota | Sonnet | Sonnet | Haiku | Haiku |
338
-
339
- Individual agents can be overridden in `jdi-config.yaml` regardless of the active profile.
281
+ | `StateUpdate` | meta | Record decisions, deviations, blockers |
340
282
 
341
283
  ### State Management
342
284
 
343
- JDI tracks all progress in external YAML files (no context pollution):
285
+ All state lives in YAML files on disk — no context pollution:
344
286
 
345
287
  | File | Purpose |
346
288
  |------|---------|
347
- | `.jdi/config/state.yaml` | Runtime state — current phase, plan, task, progress, commits, blockers |
348
- | `.jdi/config/variables.yaml` | Shareable variables across agents |
349
- | `.jdi/config/jdi-config.yaml` | Global configuration (workflow, models, quality gates) |
350
- | `.jdi/PROJECT.yaml` | Project vision and constraints |
351
- | `.jdi/REQUIREMENTS.yaml` | Scoped requirements with REQ-IDs |
352
- | `.jdi/ROADMAP.yaml` | Phase structure and plan statuses |
289
+ | `.jdi/config/state.yaml` | Runtime state — position, progress, review status |
290
+ | `.jdi/config/adapter.yaml` | Project-type adapter config (tech stack, quality gates) |
291
+ | `.jdi/config/jdi-config.yaml` | Global configuration (workflow, models) |
353
292
 
354
293
  ### PR Feedback Learning
355
294
 
356
- When processing PR comments, JDI detects learning phrases like:
357
- - "we usually do this"
358
- - "we prefer to"
359
- - "convention is"
360
-
361
- These patterns are automatically captured to learnings files in `.jdi/framework/learnings/` (categorised by backend, frontend, testing, devops, general) for future reference.
295
+ Jedi detects learning phrases from PR reviews ("we usually do this", "convention is") and captures them to categorised learnings files in `.jdi/framework/learnings/` for future reference.
362
296
 
363
297
  ---
364
298
 
365
299
  ## Agents
366
300
 
367
- JDI has 16 specialised agents, each with a defined spec and clear boundaries:
301
+ 20 specialised agents organised by team:
368
302
 
369
303
  ### Engineering
370
-
371
- | Agent | Role | Spec |
372
- |-------|------|------|
373
- | `jdi-backend` | Backend Engineer (PHP/Laravel) | `.jdi/framework/agents/jdi-backend.md` |
374
- | `jdi-frontend` | Frontend Engineer (React/TypeScript) | `.jdi/framework/agents/jdi-frontend.md` |
375
- | `jdi-architect` | Systems Architect | `.jdi/framework/agents/jdi-architect.md` |
376
- | `jdi-executor` | Senior Fullstack Engineer | `.jdi/framework/agents/jdi-executor.md` |
304
+ | Agent | Role |
305
+ |-------|------|
306
+ | `jdi-backend` | Backend Engineer |
307
+ | `jdi-frontend` | Frontend Engineer |
308
+ | `jdi-architect` | Systems Architect |
309
+ | `jdi-executor` | Senior Fullstack Engineer |
377
310
 
378
311
  ### Product and Research
379
-
380
- | Agent | Role | Spec |
381
- |-------|------|------|
382
- | `jdi-planner` | Product Manager / Planner | `.jdi/framework/agents/jdi-planner.md` |
383
- | `jdi-researcher` | Senior Analyst | `.jdi/framework/agents/jdi-researcher.md` |
384
- | `jdi-product-lead` | Product Lead | `.jdi/framework/agents/jdi-product-lead.md` |
385
- | `jdi-ux-designer` | Lead UI/UX Designer | `.jdi/framework/agents/jdi-ux-designer.md` |
312
+ | Agent | Role |
313
+ |-------|------|
314
+ | `jdi-planner` | Product Manager / Planner |
315
+ | `jdi-researcher` | Senior Analyst |
316
+ | `jdi-product-lead` | Product Lead |
317
+ | `jdi-ux-designer` | Lead UI/UX Designer |
386
318
 
387
319
  ### Quality Assurance
388
-
389
- | Agent | Role | Spec |
390
- |-------|------|------|
391
- | `jdi-quality` | Lead QA Developer | `.jdi/framework/agents/jdi-quality.md` |
392
- | `jdi-verifier` | Senior QA Developer | `.jdi/framework/agents/jdi-verifier.md` |
320
+ | Agent | Role |
321
+ |-------|------|
322
+ | `jdi-quality` | Lead QA Developer |
323
+ | `jdi-verifier` | Senior QA Developer |
393
324
 
394
325
  ### DevOps
395
-
396
- | Agent | Role | Spec |
397
- |-------|------|------|
398
- | `jdi-devops` | DevOps Engineer | `.jdi/framework/agents/jdi-devops.md` |
326
+ | Agent | Role |
327
+ |-------|------|
328
+ | `jdi-devops` | DevOps Engineer |
399
329
 
400
330
  ### Supporting
401
-
402
- | Agent | Role | Spec |
403
- |-------|------|------|
404
- | `jdi-committer` | Commit specialist | `.jdi/framework/agents/jdi-committer.md` |
405
- | `jdi-pr-generator` | PR generation | `.jdi/framework/agents/jdi-pr-generator.md` |
406
- | `jdi-pr-feedback` | PR feedback handler | `.jdi/framework/agents/jdi-pr-feedback.md` |
407
- | `jdi-debugger` | Debugging specialist | `.jdi/framework/agents/jdi-debugger.md` |
408
- | `jdi-head-engineering` | Head of Engineering (oversight) | `.jdi/framework/agents/jdi-head-engineering.md` |
409
-
410
- All agents inherit the `<JDI:AgentBase />` protocol which defines sandbox awareness, structured returns, communication patterns, and component resolution.
331
+ | Agent | Role |
332
+ |-------|------|
333
+ | `jdi-committer` | Commit specialist |
334
+ | `jdi-pr-generator` | PR generation |
335
+ | `jdi-pr-feedback` | PR feedback handler |
336
+ | `jdi-debugger` | Debugging specialist |
337
+ | `jdi-head-engineering` | Head of Engineering (oversight) |
338
+ | `jdi-codebase-mapper` | Codebase indexing |
339
+ | `jdi-feedback-learner` | Learning extraction |
340
+ | `jdi-plan-checker` | Plan validation |
341
+
342
+ All agents inherit `<JDI:AgentBase />` which defines sandbox awareness, structured returns, and component resolution.
411
343
 
412
344
  ---
413
345
 
414
346
  ## Teams
415
347
 
416
- Agents are organised into 5 teams, each with defined responsibilities and boundaries:
417
-
418
348
  | Team | Members | Purpose |
419
349
  |------|---------|---------|
420
- | **Engineering** | jdi-backend, jdi-frontend, jdi-architect, jdi-executor | All coding — features, bugs, refactoring across full stack |
421
- | **Product & Research** | jdi-planner, jdi-researcher, jdi-product-lead, jdi-ux-designer | Requirements, research, planning — does NOT write code |
422
- | **Quality Assurance** | jdi-quality, jdi-verifier | Testing (Pest/Vitest), verification, quality gates |
423
- | **DevOps** | jdi-devops | Docker, AWS, CI/CD, worktrees, infrastructure |
424
- | **Micro-Management** | jdi-product-lead, jdi-head-engineering | Engineering oversight — **opt-in only** via `--oversight` |
425
-
426
- ### Team Routing
427
-
428
- Commands are automatically routed to the appropriate team:
429
-
430
- | Command | Primary Team | Pattern |
431
- |---------|-------------|---------|
432
- | `create-plan` | Product & Research | Sequential |
433
- | `implement-plan` | Engineering | Parallel |
434
- | `pr-review` | Quality Assurance | Parallel (with Engineering context) |
435
- | `pr-feedback` | Engineering | Sequential |
436
- | `commit` | Engineering | Direct (no team) |
437
- | `generate-pr` | Engineering | Direct (no team) |
438
-
439
- ### Collaboration Patterns
440
-
441
- | Pattern | Description |
442
- |---------|-------------|
443
- | **Sequential** | Primary team executes, writes state, next team reads state |
444
- | **Parallel (Oversight)** | Engineering executes; Micro-Management monitors and flags concerns |
445
- | **Parallel (Context)** | QA reviews code; Engineering provides context |
446
- | **Direct** | Single agent, single Task invocation, no team coordination |
350
+ | **Engineering** | backend, frontend, architect, executor | All coding |
351
+ | **Product & Research** | planner, researcher, product-lead, ux-designer | Planning (no code) |
352
+ | **Quality Assurance** | quality, verifier | Testing, verification |
353
+ | **DevOps** | devops | Infrastructure, CI/CD |
354
+ | **Micro-Management** | product-lead, head-engineering | Oversight (opt-in) |
447
355
 
448
356
  ---
449
357
 
450
358
  ## Configuration
451
359
 
452
- Global configuration lives in `.jdi/config/jdi-config.yaml`:
360
+ Global configuration in `.jdi/config/jdi-config.yaml`:
453
361
 
454
362
  ```yaml
455
- # Workflow mode
456
363
  workflow:
457
- mode: yolo # yolo (autonomous) | interactive (confirm gates) | strict (all confirmations)
458
- depth: standard # shallow | standard | deep (task granularity)
459
- parallelisation: true
460
- commit_docs: true
461
-
462
- # Agent toggles
463
- agents:
464
- research: true # Run research before planning
465
- plan_check: true # Validate plans before execution
466
- verifier: true # Verify outcomes after execution
467
-
468
- # Model routing profile
364
+ mode: yolo # yolo | interactive | strict
365
+ depth: standard # shallow | standard | deep
366
+
469
367
  models:
470
368
  profile: balanced # quality | balanced | budget
471
- overrides:
472
- planner: null # Override specific agents (opus | sonnet | haiku | null)
473
- executor: null
474
369
 
475
- # Quality gates
476
370
  quality:
477
371
  run_lint_before_commit: true
478
372
  run_tests_before_pr: true
479
- require_verification: true
480
-
481
- # Git settings
482
- git:
483
- auto_stage: false
484
- require_clean_worktree: false
485
- protected_branches: [main, master, develop]
486
-
487
- # Context management
488
- context:
489
- max_files_per_task: 5
490
- split_threshold_tasks: 3
491
- context_budget_warning: 0.5
492
- context_budget_critical: 0.7
493
373
  ```
494
374
 
495
375
  ---
496
376
 
497
- ## Directory Structure
377
+ ## Security
378
+
379
+ Jedi v0.1.30 includes several security hardening measures:
498
380
 
499
- ### Package Source (this repo)
381
+ - **Opt-in authorization gate**: Restrict Jedi to write collaborators or an explicit allow-list via `JEDI_AUTH_ENABLED` and `JEDI_ALLOWED_USERS` repo variables
382
+ - **Prompt injection defense**: User input is sanitized (injection preambles stripped) and wrapped in XML fences with untrusted-content warnings
383
+ - **Shell injection prevention**: All workflow arguments are individually quoted — no unquoted variable expansion
384
+ - **Comment pagination limits**: Comment fetching is bounded to 100 items
385
+ - **Storage path traversal prevention**: Storage keys with path traversal characters are rejected
386
+ - **YAML state management**: State updates use a proper YAML parser instead of regex
387
+
388
+ ---
389
+
390
+ ## Directory Structure
500
391
 
501
392
  ```
502
393
  src/ # CLI source (TypeScript)
503
- ├── commands/ # CLI commands (init, plan, status, components)
504
- ├── utils/ # Utilities (detect-project, state, resolve-components)
394
+ ├── commands/ # CLI commands
395
+ ├── utils/ # Utilities (prompt-builder, state, verify, sanitize)
396
+ ├── storage/ # Pluggable storage adapters
505
397
  └── index.ts # Entry point
506
398
 
507
- framework/ # Distributable framework (single source of truth)
399
+ framework/ # Distributable framework
508
400
  ├── agents/ # Agent specifications (20 agents)
509
- ├── commands/ # Command stub templates (copied to .claude/commands/jdi/)
401
+ ├── commands/ # Command stub templates
510
402
  ├── components/ # Reusable component instructions
511
403
  │ ├── execution/ # Commit, Verify, CodebaseContext
512
404
  │ ├── planning/ # TaskBreakdown, WaveComputation
513
- │ ├── quality/ # PRReview, PRReviewLocal
405
+ │ ├── quality/ # PRReview
514
406
  │ └── meta/ # AgentBase, ComplexityRouter, TeamRouter, StateUpdate
515
407
  ├── teams/ # Team definitions (5 teams)
516
- ├── adapters/ # Project-type configs (laravel, nextjs, node, generic)
517
- ├── config/ # Configuration templates
518
- ├── hooks/ # Pre-commit, checkpoint, worktree cleanup
519
- ├── rules/ # Commit rules, deviation rules
520
- ├── templates/ # PLAN, PROJECT, REQUIREMENTS, ROADMAP templates
521
- ├── learnings/ # Empty category shells for PR review learnings
522
- └── jedi.md # Full framework architecture doc
523
- ```
524
-
525
- ### Installed in User Projects (via `jdi init`)
408
+ ├── adapters/ # Project-type configs
409
+ ├── templates/ # PLAN, PLAN-TASK, SUMMARY, CLAUDE-SHARED, PROJECT/REQUIREMENTS/ROADMAP.yaml
410
+ ├── learnings/ # Category shells for PR review learnings
411
+ └── jedi.md # Framework architecture doc
526
412
 
527
- ```
528
- .jdi/framework/ # Framework files (installed by jdi init)
529
- ├── agents/ # Agent specifications
530
- ├── components/ # Reusable component instructions
531
- ├── teams/ # Team definitions
532
- ├── config/ # Configuration templates
533
- ├── hooks/ # Pre-commit, checkpoint, worktree cleanup
534
- ├── rules/ # Commit rules, deviation rules
535
- ├── templates/ # Scaffolding templates
536
- ├── learnings/ # Patterns learned from PR reviews
537
- └── jedi.md # Full framework architecture doc
538
-
539
- .claude/commands/jdi/ # Slash command stubs (~300 tokens each)
540
- ├── create-plan.md
541
- ├── implement-plan.md
542
- ├── quick.md
543
- ├── commit.md
544
- ├── generate-pr.md
545
- ├── pr-review.md
546
- ├── pr-feedback.md
547
- ├── worktree.md
548
- ├── worktree-remove.md
549
- ├── init.md
550
- └── status.md
551
-
552
- .jdi/ # Project state (created by /jdi:init)
553
- ├── plans/ # Implementation plans
554
- ├── research/ # Research documentation
555
- ├── codebase/ # Codebase analysis (SUMMARY.md)
556
- ├── reviews/ # Local PR reviews (when --no-comments)
557
- ├── config/
558
- │ ├── state.yaml # Runtime state
559
- │ ├── variables.yaml # Shared variables
560
- │ ├── jdi-config.yaml # Global config
561
- │ └── adapter.yaml # Project-type adapter config
562
- ├── PROJECT.yaml # Project context
563
- ├── REQUIREMENTS.yaml # Scoped requirements
564
- └── ROADMAP.yaml # Phase structure
413
+ action/ # GitHub Actions
414
+ └── workflow-template.yml # Workflow template for `jdi setup-action`
565
415
  ```
566
416
 
567
417
  ---
568
418
 
569
419
  ## Architecture
570
420
 
571
- JDI is built on three core principles:
572
-
573
421
  ### Minimal Context
574
422
 
575
- Commands are ultra-minimal stubs (~300 tokens). Heavy specs, components, and rules stay out of the main context window. Agents read what they need on-demand in their isolated context.
423
+ Commands are ultra-minimal stubs (~300 tokens). Agents read specs and components on-demand in their isolated context. Take this with a grain of salt 🧂.
576
424
 
577
- | Scenario | Without JDI | With JDI | Savings |
425
+ | Scenario | Without Jedi | With Jedi | Savings |
578
426
  |----------|-------------|----------|---------|
579
427
  | Single command | ~6,900 tokens | ~300 tokens | 95% |
580
428
  | 5-command workflow | ~34,500 tokens | ~1,500 tokens | 96% |
581
429
 
582
430
  ### Agent Delegation
583
431
 
584
- Complex operations spawn agents via the Task tool. Each agent runs in an isolated context with its own spec, components, and rules. The orchestrator stays lightweight.
585
-
586
- ```
587
- ┌─────────────────────────────────────────────┐
588
- │ MAIN CONTEXT │
589
- │ │
590
- │ User: /jdi:create-plan "Add user auth" │
591
- │ │ │
592
- │ ▼ │
593
- │ ┌──────────────────────┐ │
594
- │ │ Command Stub (~300) │ │
595
- │ └──────────┬───────────┘ │
596
- │ │ Task tool spawns agent │
597
- │ ▼ │
598
- └─────────────────────────────────────────────┘
599
-
600
-
601
- ┌─────────────────────────────────────────────┐
602
- │ AGENT CONTEXT (Isolated, Fresh) │
603
- │ │
604
- │ jdi-planner reads spec, researches, │
605
- │ creates plan → Returns result to main │
606
- └─────────────────────────────────────────────┘
607
- ```
432
+ Complex operations spawn agents via the Task tool. Each agent runs in an isolated context with its own spec and components.
608
433
 
609
434
  ### External State
610
435
 
611
- All state lives in YAML files on disk. No context pollution from state tracking. Agents read state when they need it and report updates for the orchestrator to write.
436
+ All state lives in YAML files on disk. No context pollution from state tracking.
612
437
 
613
438
  ---
614
-
615
- *Jedi — Context-efficient development through agent delegation.*