@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.
Files changed (89) hide show
  1. package/README.md +431 -0
  2. package/action/action.yml +116 -0
  3. package/action/workflow-template.yml +242 -0
  4. package/dist/index.js +12860 -0
  5. package/framework/adapters/generic.yaml +23 -0
  6. package/framework/adapters/laravel.yaml +46 -0
  7. package/framework/adapters/nextjs.yaml +36 -0
  8. package/framework/adapters/node.yaml +29 -0
  9. package/framework/agents/jdi-architect.md +147 -0
  10. package/framework/agents/jdi-backend.md +79 -0
  11. package/framework/agents/jdi-codebase-mapper.md +59 -0
  12. package/framework/agents/jdi-committer.md +83 -0
  13. package/framework/agents/jdi-debugger.md +73 -0
  14. package/framework/agents/jdi-devops.md +78 -0
  15. package/framework/agents/jdi-feedback-learner.md +93 -0
  16. package/framework/agents/jdi-frontend.md +78 -0
  17. package/framework/agents/jdi-head-engineering.md +30 -0
  18. package/framework/agents/jdi-perf-analyst.md +116 -0
  19. package/framework/agents/jdi-phase-researcher.md +59 -0
  20. package/framework/agents/jdi-plan-checker.md +80 -0
  21. package/framework/agents/jdi-planner.md +271 -0
  22. package/framework/agents/jdi-pr-feedback.md +120 -0
  23. package/framework/agents/jdi-pr-generator.md +100 -0
  24. package/framework/agents/jdi-producer.md +196 -0
  25. package/framework/agents/jdi-product-lead.md +44 -0
  26. package/framework/agents/jdi-programmer.md +104 -0
  27. package/framework/agents/jdi-qa-tester.md +113 -0
  28. package/framework/agents/jdi-quality.md +106 -0
  29. package/framework/agents/jdi-researcher.md +70 -0
  30. package/framework/agents/jdi-security.md +118 -0
  31. package/framework/agents/jdi-ux-designer.md +78 -0
  32. package/framework/agents/jdi-verifier.md +80 -0
  33. package/framework/commands/build.md +148 -0
  34. package/framework/commands/commit.md +71 -0
  35. package/framework/commands/create-plan.md +192 -0
  36. package/framework/commands/generate-pr.md +91 -0
  37. package/framework/commands/implement-plan.md +218 -0
  38. package/framework/commands/init.md +65 -0
  39. package/framework/commands/pr-feedback.md +75 -0
  40. package/framework/commands/pr-review.md +92 -0
  41. package/framework/commands/quick.md +124 -0
  42. package/framework/commands/status.md +13 -0
  43. package/framework/commands/worktree-remove.md +32 -0
  44. package/framework/commands/worktree.md +52 -0
  45. package/framework/components/execution/CodebaseContext.md +36 -0
  46. package/framework/components/execution/Commit.md +121 -0
  47. package/framework/components/execution/Verify.md +140 -0
  48. package/framework/components/execution/VerifyAdvanced.md +43 -0
  49. package/framework/components/meta/AgentBase.md +121 -0
  50. package/framework/components/meta/AgentRouter.md +318 -0
  51. package/framework/components/meta/AgentTeamsOrchestration.md +115 -0
  52. package/framework/components/meta/ComplexityRouter.md +116 -0
  53. package/framework/components/meta/SilentDiscovery.md +79 -0
  54. package/framework/components/meta/StateUpdate.md +56 -0
  55. package/framework/components/meta/StrictnessProtocol.md +60 -0
  56. package/framework/components/meta/TeamRouter.md +86 -0
  57. package/framework/components/planning/TaskBreakdown.md +95 -0
  58. package/framework/components/planning/WaveComputation.md +59 -0
  59. package/framework/components/quality/PRReview.md +225 -0
  60. package/framework/config/jdi-config.yaml +159 -0
  61. package/framework/config/state.yaml +72 -0
  62. package/framework/config/variables.yaml +43 -0
  63. package/framework/hooks/checkpoint.md +196 -0
  64. package/framework/hooks/jdi-worktree-cleanup.md +123 -0
  65. package/framework/hooks/lint-fix-frontend.md +59 -0
  66. package/framework/hooks/on-pause.md +213 -0
  67. package/framework/hooks/pre-commit.md +143 -0
  68. package/framework/jdi.md +336 -0
  69. package/framework/learnings/backend.md +3 -0
  70. package/framework/learnings/devops.md +3 -0
  71. package/framework/learnings/frontend.md +3 -0
  72. package/framework/learnings/general.md +3 -0
  73. package/framework/learnings/testing.md +3 -0
  74. package/framework/rules/commit-rules.md +24 -0
  75. package/framework/rules/deviation-rules.md +221 -0
  76. package/framework/teams/devops.md +26 -0
  77. package/framework/teams/engineering.md +29 -0
  78. package/framework/teams/micro-management.md +26 -0
  79. package/framework/teams/product-research.md +29 -0
  80. package/framework/teams/quality-assurance.md +27 -0
  81. package/framework/templates/CLAUDE-SHARED.md +60 -0
  82. package/framework/templates/PLAN-TASK.md +35 -0
  83. package/framework/templates/PLAN.md +158 -0
  84. package/framework/templates/PROJECT.yaml +16 -0
  85. package/framework/templates/REQUIREMENTS.yaml +27 -0
  86. package/framework/templates/ROADMAP.yaml +24 -0
  87. package/framework/templates/SUMMARY.md +201 -0
  88. package/framework/workflows/README.md +87 -0
  89. package/package.json +40 -0
@@ -0,0 +1,242 @@
1
+ # JDI AI Developer — GitHub Actions Workflow
2
+ # Copy this file to .github/workflows/jdi.yml in your repository
3
+ #
4
+ # Prerequisites:
5
+ # 1. Set ANTHROPIC_API_KEY secret in your repo settings
6
+ # 2. That's it — JDI bootstraps everything else automatically
7
+ #
8
+ # Optional:
9
+ # - Set CLICKUP_API_TOKEN secret for ClickUp ticket integration
10
+ # - Set JDI_COMMIT_LEARNINGS=true repo variable to persist learnings in git
11
+ # - Set JDI_LEARNINGS_REPO variable to push learnings to a central repo (e.g. org/jdi-learnings)
12
+ # - Set JDI_LEARNINGS_TOKEN secret (PAT with Contents read/write on the learnings repo)
13
+ # - Run `npx @benzotti/jdi init` locally to customise framework files
14
+ #
15
+ # Usage: Comment on any issue or PR with "Hey jdi" followed by a command:
16
+ # Hey jdi plan <description> — Create an implementation plan
17
+ # Hey jdi quick <description> — Make a small, focused change
18
+ # Hey jdi review — Review the current PR
19
+ # Hey jdi feedback — Address PR review comments
20
+ # Hey jdi do <clickup-ticket-url> — Full flow: plan + implement from ticket
21
+ # Hey jdi ping — Check framework status
22
+ #
23
+ # Conversation: JDI supports back-and-forth iteration. After JDI responds,
24
+ # reply with feedback to refine, or say "approved" to finalise.
25
+ #
26
+ # Learnings: JDI accumulates team preferences across PRs automatically.
27
+ # By default learnings live in the GitHub Actions cache. Set JDI_COMMIT_LEARNINGS=true
28
+ # to persist them in git (recommended — cache entries expire after 7 days of inactivity).
29
+
30
+ name: JDI
31
+
32
+ on:
33
+ issue_comment:
34
+ types: [created]
35
+ pull_request_review_comment:
36
+ types: [created]
37
+ pull_request_review:
38
+ types: [submitted]
39
+ push:
40
+ branches: [main, master]
41
+
42
+ permissions:
43
+ contents: write
44
+ pull-requests: write
45
+ issues: write
46
+ id-token: write
47
+
48
+ jobs:
49
+ # ── Triggered by "Hey jdi" comments on issues/PRs or PR reviews ──
50
+ jdi:
51
+ if: >-
52
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, 'Hey jdi'))
53
+ || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, 'Hey jdi'))
54
+ || (github.event_name == 'pull_request_review' && contains(github.event.review.body, 'Hey jdi'))
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ # Bun is required to run the JDI CLI
58
+ - uses: oven-sh/setup-bun@v2
59
+ with:
60
+ bun-version: latest
61
+
62
+ # Resolve the PR head branch
63
+ # - issue_comment: github.head_ref is empty, resolve via API
64
+ # - pull_request_review / pull_request_review_comment: github.event.pull_request.head.ref is available
65
+ - name: Resolve PR branch
66
+ id: pr
67
+ run: |
68
+ bunx @benzotti/jdi@latest action resolve-branch \
69
+ --repo "$REPO" \
70
+ ${PR_HEAD_REF:+--pr-head-ref "$PR_HEAD_REF"} \
71
+ ${PR_NUMBER:+--pr-number "$PR_NUMBER"}
72
+ env:
73
+ GH_TOKEN: ${{ github.token }}
74
+ REPO: ${{ github.repository }}
75
+ PR_HEAD_REF: ${{ github.event.pull_request.head.ref || '' }}
76
+ PR_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number || '' }}
77
+
78
+ - uses: actions/checkout@v4
79
+ with:
80
+ ref: ${{ steps.pr.outputs.branch || github.head_ref || github.ref }}
81
+
82
+ # Restore persisted JDI state (learnings + codebase-index)
83
+ # 1. Exact match for this branch
84
+ # 2. Fall back to main baseline (learnings only — plans are cleared below)
85
+ - name: Restore JDI state
86
+ id: cache
87
+ uses: actions/cache@v4
88
+ with:
89
+ path: |
90
+ .jdi/persistence/
91
+ .jdi/framework/
92
+ .jdi/config/
93
+ .jdi/plans/
94
+ .claude/
95
+ key: jdi-state-${{ github.repository }}-${{ steps.pr.outputs.branch || github.head_ref || github.ref_name }}
96
+ restore-keys: |
97
+ jdi-state-${{ github.repository }}-main
98
+
99
+ # Bootstrap JDI framework if not present (first run or cache miss)
100
+ - name: Bootstrap JDI
101
+ run: |
102
+ bunx @benzotti/jdi@latest action bootstrap --cache-hit "${{ steps.cache.outputs.cache-hit }}"
103
+
104
+ # Fetch shared learnings from an external repo if configured.
105
+ # This merges cross-project learnings into the local framework before agents run.
106
+ - name: Fetch shared learnings
107
+ if: vars.JDI_LEARNINGS_REPO != ''
108
+ run: |
109
+ bunx @benzotti/jdi@latest action fetch-learnings --learnings-repo "$LEARNINGS_REPO"
110
+ env:
111
+ LEARNINGS_REPO: ${{ vars.JDI_LEARNINGS_REPO }}
112
+ LEARNINGS_TOKEN: ${{ secrets.JDI_LEARNINGS_TOKEN || github.token }}
113
+
114
+ # Configure git for JDI commits (used when implementing changes on PR branches)
115
+ - name: Configure git
116
+ run: |
117
+ git config user.name "jdi[bot]"
118
+ git config user.email "jdi[bot]@users.noreply.github.com"
119
+
120
+ # Install Claude Code CLI (required by JDI for AI invocations)
121
+ - name: Install Claude Code
122
+ run: bun install -g @anthropic-ai/claude-code
123
+
124
+ # Run JDI CLI directly — full pipeline with routing, agents, and comment posting
125
+ # IMPORTANT: All user input is passed via env vars to avoid shell injection.
126
+ # All arguments are individually quoted to prevent shell expansion.
127
+ #
128
+ # Auth gate (opt-in):
129
+ # Set repo variable JDI_AUTH_ENABLED=true to restrict JDI to write collaborators.
130
+ # Set JDI_ALLOWED_USERS to a comma-separated list for explicit allow-listing.
131
+ - name: Run JDI
132
+ run: |
133
+ bunx @benzotti/jdi@latest action run "$COMMENT_BODY" \
134
+ --repo "$REPO" \
135
+ ${COMMENT_ID:+--comment-id "$COMMENT_ID"} \
136
+ ${PR_NUMBER:+--pr-number "$PR_NUMBER"} \
137
+ ${ISSUE_NUMBER:+--issue-number "$ISSUE_NUMBER"} \
138
+ ${COMMENT_AUTHOR:+--comment-author "$COMMENT_AUTHOR"} \
139
+ ${ALLOWED_USERS:+--allowed-users "$ALLOWED_USERS"}
140
+ env:
141
+ # Resolve comment body from whichever event type triggered this
142
+ COMMENT_BODY: ${{ github.event.comment.body || github.event.review.body || '' }}
143
+ COMMENT_ID: ${{ github.event.comment.id || github.event.review.id || '' }}
144
+ PR_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number || '' }}
145
+ ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number || '' }}
146
+ COMMENT_AUTHOR: ${{ github.event.comment.user.login || github.event.review.user.login || '' }}
147
+ REPO: ${{ github.repository }}
148
+ JDI_AUTH_ENABLED: ${{ vars.JDI_AUTH_ENABLED || '' }}
149
+ ALLOWED_USERS: ${{ vars.JDI_ALLOWED_USERS || '' }}
150
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
151
+ CLICKUP_API_TOKEN: ${{ secrets.CLICKUP_API_TOKEN }}
152
+ GH_TOKEN: ${{ github.token }}
153
+
154
+ # Save JDI state — framework, config, persistence all cached together
155
+ - name: Save JDI state
156
+ if: always()
157
+ uses: actions/cache/save@v4
158
+ with:
159
+ path: |
160
+ .jdi/persistence/
161
+ .jdi/framework/
162
+ .jdi/config/
163
+ .jdi/plans/
164
+ .claude/
165
+ key: jdi-state-${{ github.repository }}-${{ steps.pr.outputs.branch || github.head_ref || github.ref_name }}-${{ github.run_id }}
166
+
167
+ # ── Promote learnings to main baseline when PRs merge ──
168
+ # Only runs when JDI was actually used on the merged PR
169
+ promote-learnings:
170
+ if: github.event_name == 'push'
171
+ runs-on: ubuntu-latest
172
+ steps:
173
+ - uses: oven-sh/setup-bun@v2
174
+ with:
175
+ bun-version: latest
176
+
177
+ - name: Check if JDI was involved
178
+ id: check
179
+ run: |
180
+ bunx @benzotti/jdi@latest action promote-learnings \
181
+ --check-only \
182
+ --repo "$REPO" \
183
+ --sha "${{ github.sha }}"
184
+ env:
185
+ GH_TOKEN: ${{ github.token }}
186
+ REPO: ${{ github.repository }}
187
+
188
+ - uses: actions/checkout@v4
189
+ if: steps.check.outputs.skip != 'true'
190
+
191
+ - name: Restore JDI state from merged branch
192
+ if: steps.check.outputs.skip != 'true'
193
+ id: restore
194
+ uses: actions/cache@v4
195
+ with:
196
+ path: |
197
+ .jdi/persistence/
198
+ .jdi/framework/
199
+ .jdi/config/
200
+ .jdi/plans/
201
+ .claude/
202
+ key: jdi-state-${{ github.repository }}-main-promotion-${{ github.sha }}
203
+ restore-keys: |
204
+ jdi-state-${{ github.repository }}-${{ steps.check.outputs.branch }}-
205
+
206
+ - name: Promote to main baseline
207
+ if: steps.check.outputs.skip != 'true' && steps.restore.outputs.cache-hit != ''
208
+ uses: actions/cache/save@v4
209
+ with:
210
+ path: |
211
+ .jdi/persistence/
212
+ .jdi/framework/
213
+ .jdi/config/
214
+ .jdi/plans/
215
+ .claude/
216
+ key: jdi-state-${{ github.repository }}-main-${{ github.sha }}
217
+
218
+ # Opt-in: commit learnings so they survive cache eviction.
219
+ # Set repo variable JDI_COMMIT_LEARNINGS=true to enable.
220
+ #
221
+ # Where learnings are committed:
222
+ # - Same repo (default): .jdi/framework/learnings/ on main
223
+ # - External repo: set JDI_LEARNINGS_REPO (e.g. org/jdi-learnings)
224
+ # and JDI_LEARNINGS_TOKEN secret. Learnings are stored under
225
+ # jdi/learnings/ in the external repo and merged (not replaced).
226
+ - name: Commit learnings to repo
227
+ if: >-
228
+ steps.check.outputs.skip != 'true'
229
+ && steps.restore.outputs.cache-hit != ''
230
+ && vars.JDI_COMMIT_LEARNINGS == 'true'
231
+ run: |
232
+ git config user.name "jdi[bot]"
233
+ git config user.email "jdi[bot]@users.noreply.github.com"
234
+ bunx @benzotti/jdi@latest action promote-learnings \
235
+ --repo "$REPO" \
236
+ --sha "${{ github.sha }}" \
237
+ --pr-number "${{ steps.check.outputs.pr_number }}" \
238
+ --branch "${{ steps.check.outputs.branch }}" \
239
+ ${LEARNINGS_REPO:+--learnings-repo "$LEARNINGS_REPO"}
240
+ env:
241
+ LEARNINGS_REPO: ${{ vars.JDI_LEARNINGS_REPO || '' }}
242
+ LEARNINGS_TOKEN: ${{ secrets.JDI_LEARNINGS_TOKEN || github.token }}