@benzotti/jdi 0.1.46
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 +431 -0
- package/action/action.yml +116 -0
- package/action/workflow-template.yml +242 -0
- package/dist/index.js +12860 -0
- package/framework/adapters/generic.yaml +23 -0
- package/framework/adapters/laravel.yaml +46 -0
- package/framework/adapters/nextjs.yaml +36 -0
- package/framework/adapters/node.yaml +29 -0
- package/framework/agents/jdi-architect.md +147 -0
- package/framework/agents/jdi-backend.md +79 -0
- package/framework/agents/jdi-codebase-mapper.md +59 -0
- package/framework/agents/jdi-committer.md +83 -0
- package/framework/agents/jdi-debugger.md +73 -0
- package/framework/agents/jdi-devops.md +78 -0
- package/framework/agents/jdi-feedback-learner.md +93 -0
- package/framework/agents/jdi-frontend.md +78 -0
- package/framework/agents/jdi-head-engineering.md +30 -0
- package/framework/agents/jdi-perf-analyst.md +116 -0
- package/framework/agents/jdi-phase-researcher.md +59 -0
- package/framework/agents/jdi-plan-checker.md +80 -0
- package/framework/agents/jdi-planner.md +271 -0
- package/framework/agents/jdi-pr-feedback.md +120 -0
- package/framework/agents/jdi-pr-generator.md +100 -0
- package/framework/agents/jdi-producer.md +196 -0
- package/framework/agents/jdi-product-lead.md +44 -0
- package/framework/agents/jdi-programmer.md +104 -0
- package/framework/agents/jdi-qa-tester.md +113 -0
- package/framework/agents/jdi-quality.md +106 -0
- package/framework/agents/jdi-researcher.md +70 -0
- package/framework/agents/jdi-security.md +118 -0
- package/framework/agents/jdi-ux-designer.md +78 -0
- package/framework/agents/jdi-verifier.md +80 -0
- package/framework/commands/build.md +148 -0
- package/framework/commands/commit.md +71 -0
- package/framework/commands/create-plan.md +192 -0
- package/framework/commands/generate-pr.md +91 -0
- package/framework/commands/implement-plan.md +218 -0
- package/framework/commands/init.md +65 -0
- package/framework/commands/pr-feedback.md +75 -0
- package/framework/commands/pr-review.md +92 -0
- package/framework/commands/quick.md +124 -0
- package/framework/commands/status.md +13 -0
- package/framework/commands/worktree-remove.md +32 -0
- package/framework/commands/worktree.md +52 -0
- package/framework/components/execution/CodebaseContext.md +36 -0
- package/framework/components/execution/Commit.md +121 -0
- package/framework/components/execution/Verify.md +140 -0
- package/framework/components/execution/VerifyAdvanced.md +43 -0
- package/framework/components/meta/AgentBase.md +121 -0
- package/framework/components/meta/AgentRouter.md +318 -0
- package/framework/components/meta/AgentTeamsOrchestration.md +115 -0
- package/framework/components/meta/ComplexityRouter.md +116 -0
- package/framework/components/meta/SilentDiscovery.md +79 -0
- package/framework/components/meta/StateUpdate.md +56 -0
- package/framework/components/meta/StrictnessProtocol.md +60 -0
- package/framework/components/meta/TeamRouter.md +86 -0
- package/framework/components/planning/TaskBreakdown.md +95 -0
- package/framework/components/planning/WaveComputation.md +59 -0
- package/framework/components/quality/PRReview.md +225 -0
- package/framework/config/jdi-config.yaml +159 -0
- package/framework/config/state.yaml +72 -0
- package/framework/config/variables.yaml +43 -0
- package/framework/hooks/checkpoint.md +196 -0
- package/framework/hooks/jdi-worktree-cleanup.md +123 -0
- package/framework/hooks/lint-fix-frontend.md +59 -0
- package/framework/hooks/on-pause.md +213 -0
- package/framework/hooks/pre-commit.md +143 -0
- package/framework/jdi.md +336 -0
- package/framework/learnings/backend.md +3 -0
- package/framework/learnings/devops.md +3 -0
- package/framework/learnings/frontend.md +3 -0
- package/framework/learnings/general.md +3 -0
- package/framework/learnings/testing.md +3 -0
- package/framework/rules/commit-rules.md +24 -0
- package/framework/rules/deviation-rules.md +221 -0
- package/framework/teams/devops.md +26 -0
- package/framework/teams/engineering.md +29 -0
- package/framework/teams/micro-management.md +26 -0
- package/framework/teams/product-research.md +29 -0
- package/framework/teams/quality-assurance.md +27 -0
- package/framework/templates/CLAUDE-SHARED.md +60 -0
- package/framework/templates/PLAN-TASK.md +35 -0
- package/framework/templates/PLAN.md +158 -0
- package/framework/templates/PROJECT.yaml +16 -0
- package/framework/templates/REQUIREMENTS.yaml +27 -0
- package/framework/templates/ROADMAP.yaml +24 -0
- package/framework/templates/SUMMARY.md +201 -0
- package/framework/workflows/README.md +87 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
# JDI
|
|
2
|
+
|
|
3
|
+
**JDI aka Jedi — Multi-agent development framework for Claude Code — plan, implement, review, and ship with specialist agents and minimal token overhead.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@benzotti/jdi) [](LICENSE)
|
|
6
|
+
|
|
7
|
+
JDI 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**.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Usage Modes](#usage-modes)
|
|
14
|
+
- [Getting Started](#getting-started)
|
|
15
|
+
- [Commands](#commands)
|
|
16
|
+
- [GitHub Actions Setup](#github-actions-setup)
|
|
17
|
+
- [Features](#features)
|
|
18
|
+
- [Agents](#agents)
|
|
19
|
+
- [Teams](#teams)
|
|
20
|
+
- [Configuration](#configuration)
|
|
21
|
+
- [Security](#security)
|
|
22
|
+
- [Directory Structure](#directory-structure)
|
|
23
|
+
- [Architecture](#architecture)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Usage Modes
|
|
28
|
+
|
|
29
|
+
JDI runs in three modes with identical capabilities:
|
|
30
|
+
|
|
31
|
+
| Mode | How | Best For |
|
|
32
|
+
|------|-----|----------|
|
|
33
|
+
| **Claude Code App** | `/jdi:create-plan`, `/jdi:implement-plan`, etc. | Interactive development with Claude Code |
|
|
34
|
+
| **CLI** | `jdi plan`, `jdi implement`, `jdi quick`, etc. | Terminal workflows, scripting, CI |
|
|
35
|
+
| **GitHub Actions** | Comment `Hey JDI plan ...` on issues/PRs | Autonomous code generation from issue comments |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Getting Started
|
|
40
|
+
|
|
41
|
+
### Claude Code App
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bun install -g @benzotti/jdi
|
|
45
|
+
jdi init
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then inside Claude Code:
|
|
49
|
+
```
|
|
50
|
+
/jdi:create-plan "Add user authentication"
|
|
51
|
+
/jdi:implement-plan
|
|
52
|
+
/jdi:commit
|
|
53
|
+
/jdi:generate-pr
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### CLI
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bun install -g @benzotti/jdi
|
|
60
|
+
jdi init
|
|
61
|
+
|
|
62
|
+
jdi plan "Add user authentication"
|
|
63
|
+
jdi implement
|
|
64
|
+
jdi quick "fix the broken quote calculator"
|
|
65
|
+
jdi review 42
|
|
66
|
+
jdi pr
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### GitHub Actions
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
jdi setup-action
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then on any issue or PR, comment:
|
|
76
|
+
```
|
|
77
|
+
Hey JDI plan Add user authentication
|
|
78
|
+
Hey JDI implement
|
|
79
|
+
Hey JDI quick fix the broken login button
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
See [GitHub Actions Setup](#github-actions-setup) for details.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Commands
|
|
87
|
+
|
|
88
|
+
| Slash Command | CLI Equivalent | Description |
|
|
89
|
+
|---------------|----------------|-------------|
|
|
90
|
+
| `/jdi:init` | `jdi init` | Initialise JDI in the current project |
|
|
91
|
+
| `/jdi:create-plan` | `jdi plan <desc>` | Create an implementation plan |
|
|
92
|
+
| `/jdi:implement-plan` | `jdi implement [plan]` | Execute a plan (single-agent or Agent Teams) |
|
|
93
|
+
| `/jdi:quick` | `jdi quick <desc>` | Quick focused change without orchestration |
|
|
94
|
+
| `/jdi:commit` | `jdi commit` | Create a conventional commit |
|
|
95
|
+
| `/jdi:generate-pr` | `jdi pr` | Generate and create a pull request |
|
|
96
|
+
| `/jdi:pr-review` | `jdi review <pr>` | Review a PR and post line comments |
|
|
97
|
+
| `/jdi:pr-feedback` | `jdi feedback` | Address PR review comments |
|
|
98
|
+
| `/jdi:worktree` | `jdi worktree` | Create an isolated git worktree |
|
|
99
|
+
| `/jdi:worktree-remove` | `jdi worktree-remove` | Remove a worktree and clean up |
|
|
100
|
+
| `/jdi:status` | `jdi status` | Show current state and suggest next action |
|
|
101
|
+
|
|
102
|
+
### CLI Flags
|
|
103
|
+
|
|
104
|
+
#### `jdi plan`
|
|
105
|
+
| Flag | Description |
|
|
106
|
+
|------|-------------|
|
|
107
|
+
| `--print` | Print prompt to stdout instead of executing |
|
|
108
|
+
| `--output <file>` | Write prompt to file |
|
|
109
|
+
|
|
110
|
+
#### `jdi implement`
|
|
111
|
+
| Flag | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `--team` | Force Agent Teams mode |
|
|
114
|
+
| `--single` | Force single-agent mode |
|
|
115
|
+
| `--dry-run` | Preview changes without writing files |
|
|
116
|
+
| `--print` | Print prompt to stdout |
|
|
117
|
+
|
|
118
|
+
#### `jdi quick`
|
|
119
|
+
| Flag | Description |
|
|
120
|
+
|------|-------------|
|
|
121
|
+
| `--dry-run` | Preview changes without writing files |
|
|
122
|
+
| `--print` | Print prompt to stdout |
|
|
123
|
+
|
|
124
|
+
#### `jdi pr`
|
|
125
|
+
| Flag | Description |
|
|
126
|
+
|------|-------------|
|
|
127
|
+
| `--draft` | Create as draft PR |
|
|
128
|
+
| `--base <branch>` | Base branch (default: main) |
|
|
129
|
+
| `--no-push` | Skip pushing the branch |
|
|
130
|
+
| `--dry-run` | Show generated PR without creating |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## GitHub Actions Setup
|
|
135
|
+
|
|
136
|
+
### Installation
|
|
137
|
+
|
|
138
|
+
Run `jdi setup-action` to generate the workflow file, or manually copy `action/workflow-template.yml` to `.github/workflows/jdi.yml`.
|
|
139
|
+
|
|
140
|
+
### Required Secrets
|
|
141
|
+
|
|
142
|
+
| Secret | Required | Description |
|
|
143
|
+
|--------|----------|-------------|
|
|
144
|
+
| `ANTHROPIC_API_KEY` | Yes | Claude API key |
|
|
145
|
+
| `CLICKUP_API_TOKEN` | No | ClickUp integration for ticket-driven development |
|
|
146
|
+
|
|
147
|
+
### Optional Variables
|
|
148
|
+
|
|
149
|
+
| Variable | Description |
|
|
150
|
+
|----------|-------------|
|
|
151
|
+
| `JDI_AUTH_ENABLED` | Set to `true` to restrict JDI to write collaborators |
|
|
152
|
+
| `JDI_ALLOWED_USERS` | Comma-separated list of allowed GitHub usernames |
|
|
153
|
+
|
|
154
|
+
### Comment Syntax
|
|
155
|
+
|
|
156
|
+
| Command | Description |
|
|
157
|
+
|---------|-------------|
|
|
158
|
+
| `Hey JDI plan <description>` | Create an implementation plan |
|
|
159
|
+
| `Hey JDI implement` | Execute the current plan |
|
|
160
|
+
| `Hey JDI implement --dry-run` | Preview implementation without writing |
|
|
161
|
+
| `Hey JDI quick <description>` | Make a quick change |
|
|
162
|
+
| `Hey JDI review` | Review the current PR |
|
|
163
|
+
| `Hey JDI do <clickup-url>` | Full flow: plan + implement from ticket |
|
|
164
|
+
| `Hey JDI ping` | Check framework status |
|
|
165
|
+
|
|
166
|
+
### Conversation Flow
|
|
167
|
+
|
|
168
|
+
1. Comment `Hey JDI plan ...` to start planning
|
|
169
|
+
2. JDI posts the plan and asks for feedback
|
|
170
|
+
3. Reply with refinement feedback (e.g. "change task 2 to use Redis instead")
|
|
171
|
+
4. Say "approved" or "lgtm" to lock the plan
|
|
172
|
+
5. Comment `Hey JDI implement` to execute
|
|
173
|
+
6. Reply with follow-up feedback to iterate on the implementation
|
|
174
|
+
|
|
175
|
+
JDI maintains conversation context across comments — no need to repeat earlier instructions.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Features
|
|
180
|
+
|
|
181
|
+
### Planning and Implementation
|
|
182
|
+
|
|
183
|
+
1. **Research** — The planner agent analyses your codebase and gathers context
|
|
184
|
+
2. **Plan** — Produces a structured `PLAN.md` with task breakdown, dependencies, and success criteria
|
|
185
|
+
3. **Execute** — The complexity router decides single-agent or Agent Teams mode
|
|
186
|
+
4. **Verify** — Quality gates run automatically after execution
|
|
187
|
+
5. **Commit** — Each task gets its own atomic conventional commit
|
|
188
|
+
|
|
189
|
+
### Dry-Run Mode
|
|
190
|
+
|
|
191
|
+
Preview what JDI would change without writing any files:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
jdi implement --dry-run
|
|
195
|
+
jdi quick --dry-run "add error handling to the API"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Or in GitHub Actions: `Hey JDI implement --dry-run`
|
|
199
|
+
|
|
200
|
+
In dry-run mode, JDI can only read files — writes, commits, and pushes are blocked.
|
|
201
|
+
|
|
202
|
+
### Plan-Aware PR Generation
|
|
203
|
+
|
|
204
|
+
`jdi pr` reads the current plan from state.yaml and generates a richer PR body:
|
|
205
|
+
- Summary derived from the plan objective
|
|
206
|
+
- Task list from the plan breakdown
|
|
207
|
+
- Verification checklist from plan criteria
|
|
208
|
+
|
|
209
|
+
### Automated Verification Runner
|
|
210
|
+
|
|
211
|
+
After implementation (both CLI and GitHub Actions), JDI automatically runs quality gates defined in `adapter.yaml`:
|
|
212
|
+
|
|
213
|
+
```yaml
|
|
214
|
+
quality_gates:
|
|
215
|
+
lint: "bun run lint"
|
|
216
|
+
typecheck: "bun run typecheck"
|
|
217
|
+
test: "bun test"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Results are printed in the CLI and posted as a collapsible section in GitHub comments.
|
|
221
|
+
|
|
222
|
+
### Git Worktrees
|
|
223
|
+
|
|
224
|
+
Full-environment git worktrees for isolated development:
|
|
225
|
+
|
|
226
|
+
- **Full worktree** (`--worktree`): databases, dependencies, migrations, seeders, web server
|
|
227
|
+
- **Lightweight worktree** (`--worktree-lightweight`): dependencies and migrations only
|
|
228
|
+
|
|
229
|
+
### Agent Teams
|
|
230
|
+
|
|
231
|
+
For complex plans (>3 tasks, multiple tech stacks, or multiple waves), JDI uses Claude Code's Agent Teams to orchestrate multiple specialist agents working in parallel.
|
|
232
|
+
|
|
233
|
+
### Complexity Router
|
|
234
|
+
|
|
235
|
+
| Signal | Simple | Complex |
|
|
236
|
+
|--------|--------|---------|
|
|
237
|
+
| Task count | 1-3 | >3 |
|
|
238
|
+
| Tech stacks | Single | Mixed |
|
|
239
|
+
| Wave count | 1 | >1 |
|
|
240
|
+
|
|
241
|
+
Override with `--team` or `--single`.
|
|
242
|
+
|
|
243
|
+
### PR Workflow
|
|
244
|
+
|
|
245
|
+
- **`jdi review <pr>`** — Structured code review with severity-classified findings posted as line comments
|
|
246
|
+
- **`jdi feedback`** — Address review comments systematically, learning from team patterns
|
|
247
|
+
- **`jdi pr`** — Create a PR with plan-aware description
|
|
248
|
+
|
|
249
|
+
### Component System
|
|
250
|
+
|
|
251
|
+
JSX-like reusable instruction syntax:
|
|
252
|
+
|
|
253
|
+
```markdown
|
|
254
|
+
<JDI:Commit /> # Full component
|
|
255
|
+
<JDI:Verify scope="plan" /> # With parameters
|
|
256
|
+
<JDI:PRReview post="false" /> # Local review mode
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Available components:**
|
|
260
|
+
|
|
261
|
+
| Component | Category | Purpose |
|
|
262
|
+
|-----------|----------|---------|
|
|
263
|
+
| `Commit` | execution | Create conventional commits |
|
|
264
|
+
| `Verify` | execution | Multi-level verification |
|
|
265
|
+
| `VerifyAdvanced` | execution | Phase and requirements verification |
|
|
266
|
+
| `CodebaseContext` | execution | Load and cache codebase analysis |
|
|
267
|
+
| `PRReview` | quality | Structured PR review (remote and local modes) |
|
|
268
|
+
| `TaskBreakdown` | planning | Break features into tasks |
|
|
269
|
+
| `WaveComputation` | planning | Compute dependency-ordered waves |
|
|
270
|
+
| `AgentBase` | meta | Base protocol for all agents |
|
|
271
|
+
| `AgentTeamsOrchestration` | meta | Agent Teams lifecycle management |
|
|
272
|
+
| `ComplexityRouter` | meta | Route plans to single-agent or swarm |
|
|
273
|
+
| `TeamRouter` | meta | Route commands to teams |
|
|
274
|
+
| `StateUpdate` | meta | Record decisions, deviations, blockers |
|
|
275
|
+
|
|
276
|
+
### State Management
|
|
277
|
+
|
|
278
|
+
All state lives in YAML files on disk — no context pollution:
|
|
279
|
+
|
|
280
|
+
| File | Purpose |
|
|
281
|
+
|------|---------|
|
|
282
|
+
| `.jdi/config/state.yaml` | Runtime state — position, progress, review status |
|
|
283
|
+
| `.jdi/config/adapter.yaml` | Project-type adapter config (tech stack, quality gates) |
|
|
284
|
+
| `.jdi/config/jdi-config.yaml` | Global configuration (workflow, models) |
|
|
285
|
+
|
|
286
|
+
### PR Feedback Learning
|
|
287
|
+
|
|
288
|
+
JDI 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.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Agents
|
|
293
|
+
|
|
294
|
+
20 specialised agents organised by team:
|
|
295
|
+
|
|
296
|
+
### Engineering
|
|
297
|
+
| Agent | Role |
|
|
298
|
+
|-------|------|
|
|
299
|
+
| `jdi-backend` | Backend Engineer |
|
|
300
|
+
| `jdi-frontend` | Frontend Engineer |
|
|
301
|
+
| `jdi-architect` | Systems Architect |
|
|
302
|
+
| `jdi-programmer` | Senior Fullstack Engineer |
|
|
303
|
+
|
|
304
|
+
### Product and Research
|
|
305
|
+
| Agent | Role |
|
|
306
|
+
|-------|------|
|
|
307
|
+
| `jdi-planner` | Product Manager / Planner |
|
|
308
|
+
| `jdi-researcher` | Senior Analyst |
|
|
309
|
+
| `jdi-product-lead` | Product Lead |
|
|
310
|
+
| `jdi-ux-designer` | Lead UI/UX Designer |
|
|
311
|
+
|
|
312
|
+
### Quality Assurance
|
|
313
|
+
| Agent | Role |
|
|
314
|
+
|-------|------|
|
|
315
|
+
| `jdi-quality` | Lead QA Developer |
|
|
316
|
+
| `jdi-verifier` | Senior QA Developer |
|
|
317
|
+
|
|
318
|
+
### DevOps
|
|
319
|
+
| Agent | Role |
|
|
320
|
+
|-------|------|
|
|
321
|
+
| `jdi-devops` | DevOps Engineer |
|
|
322
|
+
|
|
323
|
+
### Supporting
|
|
324
|
+
| Agent | Role |
|
|
325
|
+
|-------|------|
|
|
326
|
+
| `jdi-committer` | Commit specialist |
|
|
327
|
+
| `jdi-pr-generator` | PR generation |
|
|
328
|
+
| `jdi-pr-feedback` | PR feedback handler |
|
|
329
|
+
| `jdi-debugger` | Debugging specialist |
|
|
330
|
+
| `jdi-head-engineering` | Head of Engineering (oversight) |
|
|
331
|
+
| `jdi-codebase-mapper` | Codebase indexing |
|
|
332
|
+
| `jdi-feedback-learner` | Learning extraction |
|
|
333
|
+
| `jdi-plan-checker` | Plan validation |
|
|
334
|
+
|
|
335
|
+
All agents inherit `<JDI:AgentBase />` which defines sandbox awareness, structured returns, and component resolution.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Teams
|
|
340
|
+
|
|
341
|
+
| Team | Members | Purpose |
|
|
342
|
+
|------|---------|---------|
|
|
343
|
+
| **Engineering** | backend, frontend, architect, executor | All coding |
|
|
344
|
+
| **Product & Research** | planner, researcher, product-lead, ux-designer | Planning (no code) |
|
|
345
|
+
| **Quality Assurance** | quality, verifier | Testing, verification |
|
|
346
|
+
| **DevOps** | devops | Infrastructure, CI/CD |
|
|
347
|
+
| **Micro-Management** | product-lead, head-engineering | Oversight (opt-in) |
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Configuration
|
|
352
|
+
|
|
353
|
+
Global configuration in `.jdi/config/jdi-config.yaml`:
|
|
354
|
+
|
|
355
|
+
```yaml
|
|
356
|
+
workflow:
|
|
357
|
+
mode: yolo # yolo | interactive | strict
|
|
358
|
+
depth: standard # shallow | standard | deep
|
|
359
|
+
|
|
360
|
+
models:
|
|
361
|
+
profile: balanced # quality | balanced | budget
|
|
362
|
+
|
|
363
|
+
quality:
|
|
364
|
+
run_lint_before_commit: true
|
|
365
|
+
run_tests_before_pr: true
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Security
|
|
371
|
+
|
|
372
|
+
JDI v0.1.30 includes several security hardening measures:
|
|
373
|
+
|
|
374
|
+
- **Opt-in authorization gate**: Restrict JDI to write collaborators or an explicit allow-list via `JDI_AUTH_ENABLED` and `JDI_ALLOWED_USERS` repo variables
|
|
375
|
+
- **Prompt injection defense**: User input is sanitized (injection preambles stripped) and wrapped in XML fences with untrusted-content warnings
|
|
376
|
+
- **Shell injection prevention**: All workflow arguments are individually quoted — no unquoted variable expansion
|
|
377
|
+
- **Comment pagination limits**: Comment fetching is bounded to 100 items
|
|
378
|
+
- **Storage path traversal prevention**: Storage keys with path traversal characters are rejected
|
|
379
|
+
- **YAML state management**: State updates use a proper YAML parser instead of regex
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Directory Structure
|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
src/ # CLI source (TypeScript)
|
|
387
|
+
├── commands/ # CLI commands
|
|
388
|
+
├── utils/ # Utilities (prompt-builder, state, verify, sanitize)
|
|
389
|
+
├── storage/ # Pluggable storage adapters
|
|
390
|
+
└── index.ts # Entry point
|
|
391
|
+
|
|
392
|
+
framework/ # Distributable framework
|
|
393
|
+
├── agents/ # Agent specifications (20 agents)
|
|
394
|
+
├── commands/ # Command stub templates
|
|
395
|
+
├── components/ # Reusable component instructions
|
|
396
|
+
│ ├── execution/ # Commit, Verify, CodebaseContext
|
|
397
|
+
│ ├── planning/ # TaskBreakdown, WaveComputation
|
|
398
|
+
│ ├── quality/ # PRReview
|
|
399
|
+
│ └── meta/ # AgentBase, ComplexityRouter, TeamRouter, StateUpdate
|
|
400
|
+
├── teams/ # Team definitions (5 teams)
|
|
401
|
+
├── adapters/ # Project-type configs
|
|
402
|
+
├── templates/ # PLAN, PLAN-TASK, SUMMARY, CLAUDE-SHARED, PROJECT/REQUIREMENTS/ROADMAP.yaml
|
|
403
|
+
├── learnings/ # Category shells for PR review learnings
|
|
404
|
+
└── jdi.md # Framework architecture doc
|
|
405
|
+
|
|
406
|
+
action/ # GitHub Actions
|
|
407
|
+
└── workflow-template.yml # Workflow template for `jdi setup-action`
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Architecture
|
|
413
|
+
|
|
414
|
+
### Minimal Context
|
|
415
|
+
|
|
416
|
+
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 🧂.
|
|
417
|
+
|
|
418
|
+
| Scenario | Without JDI | With JDI | Savings |
|
|
419
|
+
|----------|-------------|----------|---------|
|
|
420
|
+
| Single command | ~6,900 tokens | ~300 tokens | 95% |
|
|
421
|
+
| 5-command workflow | ~34,500 tokens | ~1,500 tokens | 96% |
|
|
422
|
+
|
|
423
|
+
### Agent Delegation
|
|
424
|
+
|
|
425
|
+
Complex operations spawn agents via the Task tool. Each agent runs in an isolated context with its own spec and components.
|
|
426
|
+
|
|
427
|
+
### External State
|
|
428
|
+
|
|
429
|
+
All state lives in YAML files on disk. No context pollution from state tracking.
|
|
430
|
+
|
|
431
|
+
---
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
name: 'JDI AI Developer'
|
|
2
|
+
description: 'AI-powered development workflows using the JDI framework, powered by anthropic/claude-code-action'
|
|
3
|
+
author: 'benzotti'
|
|
4
|
+
|
|
5
|
+
inputs:
|
|
6
|
+
anthropic_api_key:
|
|
7
|
+
description: 'Anthropic API key for Claude'
|
|
8
|
+
required: true
|
|
9
|
+
clickup_api_token:
|
|
10
|
+
description: 'ClickUp API token for ticket fetching (optional)'
|
|
11
|
+
required: false
|
|
12
|
+
default: ''
|
|
13
|
+
allowed_users:
|
|
14
|
+
description: 'Comma-separated GitHub usernames allowed to trigger (empty = repo collaborators with write access)'
|
|
15
|
+
required: false
|
|
16
|
+
default: ''
|
|
17
|
+
trigger_phrase:
|
|
18
|
+
description: 'The trigger phrase to look for in comments'
|
|
19
|
+
required: false
|
|
20
|
+
default: 'Hey jdi'
|
|
21
|
+
jdi_version:
|
|
22
|
+
description: 'Version of @benzotti/jdi to install for init'
|
|
23
|
+
required: false
|
|
24
|
+
default: 'latest'
|
|
25
|
+
claude_code_action_version:
|
|
26
|
+
description: 'Version of anthropic/claude-code-action to use'
|
|
27
|
+
required: false
|
|
28
|
+
default: 'v1'
|
|
29
|
+
|
|
30
|
+
outputs:
|
|
31
|
+
session_id:
|
|
32
|
+
description: 'Claude Code session ID for conversation continuity'
|
|
33
|
+
value: ${{ steps.claude.outputs.session_id }}
|
|
34
|
+
execution_file:
|
|
35
|
+
description: 'Path to Claude Code execution output'
|
|
36
|
+
value: ${{ steps.claude.outputs.execution_file }}
|
|
37
|
+
|
|
38
|
+
runs:
|
|
39
|
+
using: 'composite'
|
|
40
|
+
steps:
|
|
41
|
+
# Bun is required to run the JDI CLI
|
|
42
|
+
- name: Setup Bun
|
|
43
|
+
uses: oven-sh/setup-bun@v2
|
|
44
|
+
with:
|
|
45
|
+
bun-version: latest
|
|
46
|
+
|
|
47
|
+
# Ensure JDI framework is initialised in the repo
|
|
48
|
+
- name: Bootstrap JDI framework
|
|
49
|
+
shell: bash
|
|
50
|
+
run: |
|
|
51
|
+
if [ ! -d ".jdi/framework" ]; then
|
|
52
|
+
echo "JDI framework not found — initialising..."
|
|
53
|
+
bunx @benzotti/jdi@${{ inputs.jdi_version }} init --ci
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Ensure persistence directory exists
|
|
57
|
+
mkdir -p .jdi/persistence
|
|
58
|
+
|
|
59
|
+
# Run Claude Code Action with JDI-specific configuration
|
|
60
|
+
- name: Run Claude with JDI framework
|
|
61
|
+
id: claude
|
|
62
|
+
uses: anthropics/claude-code-action@${{ inputs.claude_code_action_version }}
|
|
63
|
+
with:
|
|
64
|
+
anthropic_api_key: ${{ inputs.anthropic_api_key }}
|
|
65
|
+
trigger_phrase: ${{ inputs.trigger_phrase }}
|
|
66
|
+
prompt: |
|
|
67
|
+
You are JDI, an AI development framework that uses specialised agents to plan, implement, review, and ship features.
|
|
68
|
+
|
|
69
|
+
IMPORTANT: You are running inside a GitHub Action. Your final text response will be posted as a comment on the issue/PR. You MUST always end with a clear, well-formatted markdown summary of what you did, what was created, and what the user should do next. Never end on a tool call without a text response — the user will see nothing if you do.
|
|
70
|
+
|
|
71
|
+
## Framework
|
|
72
|
+
|
|
73
|
+
Read `.jdi/framework/components/meta/AgentBase.md` for the base agent protocol.
|
|
74
|
+
Your framework files are in `.jdi/framework/` — agents, components, learnings, and teams.
|
|
75
|
+
Your state is tracked in `.jdi/config/state.yaml`.
|
|
76
|
+
Plans live in `.jdi/plans/`.
|
|
77
|
+
|
|
78
|
+
## Learnings
|
|
79
|
+
|
|
80
|
+
Check `.jdi/persistence/learnings.md` for accumulated team learnings and preferences.
|
|
81
|
+
Check `.jdi/framework/learnings/` for categorised learnings (backend, frontend, testing, devops, general).
|
|
82
|
+
When you learn something from a review or feedback, update the appropriate learnings file.
|
|
83
|
+
|
|
84
|
+
## Workflow Routing
|
|
85
|
+
|
|
86
|
+
Based on the user's request, follow the appropriate workflow:
|
|
87
|
+
|
|
88
|
+
- **Plan requests** ("plan", "design", or ClickUp ticket URLs): Read `.jdi/framework/agents/jdi-planner.md` and create a plan in `.jdi/plans/`. Present a summary and ask for feedback.
|
|
89
|
+
- **Implementation** ("implement", "build", "execute"): Read the current plan from state.yaml, use `.jdi/framework/components/meta/ComplexityRouter.md` to decide single-agent vs teams mode.
|
|
90
|
+
- **Quick changes** ("quick", "fix", "small"): Make minimal focused changes. Commit when done.
|
|
91
|
+
- **Review** ("review"): Review PR changes using `.jdi/framework/components/quality/PRReview.md`.
|
|
92
|
+
- **PR feedback** ("feedback"): Address review comments using `.jdi/framework/agents/jdi-pr-feedback.md`. Extract learnings from reviewer preferences.
|
|
93
|
+
- **"do" + ClickUp URL**: Full flow — plan from ticket, then implement.
|
|
94
|
+
|
|
95
|
+
## Iterative Refinement
|
|
96
|
+
|
|
97
|
+
After completing any workflow, present a summary and ask for feedback.
|
|
98
|
+
When the user provides feedback, apply changes incrementally — do not restart from scratch.
|
|
99
|
+
When the user approves ("approved", "lgtm", "looks good"), finalise the work.
|
|
100
|
+
|
|
101
|
+
## ClickUp Integration
|
|
102
|
+
|
|
103
|
+
If the user provides a ClickUp URL, fetch the ticket details using the ClickUp API:
|
|
104
|
+
```bash
|
|
105
|
+
curl -s -H "Authorization: $CLICKUP_API_TOKEN" "https://api.clickup.com/api/v2/task/{task_id}"
|
|
106
|
+
```
|
|
107
|
+
Use the ticket name, description, and checklists as requirements.
|
|
108
|
+
|
|
109
|
+
claude_args: '--permission-mode bypassPermissions'
|
|
110
|
+
|
|
111
|
+
env:
|
|
112
|
+
CLICKUP_API_TOKEN: ${{ inputs.clickup_api_token }}
|
|
113
|
+
|
|
114
|
+
branding:
|
|
115
|
+
icon: 'zap'
|
|
116
|
+
color: 'purple'
|