jdi-cli 0.1.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.
Files changed (159) hide show
  1. package/AGENTS.md +209 -0
  2. package/ARCHITECTURE.md +210 -0
  3. package/COMMANDS.md +241 -0
  4. package/CREATE-EXAMPLE.md +385 -0
  5. package/CREATE.md +315 -0
  6. package/EXTENSION.md +141 -0
  7. package/LICENSE +21 -0
  8. package/MEMORY.md +471 -0
  9. package/PORTABILITY.md +438 -0
  10. package/README.md +789 -0
  11. package/bin/git-hooks/post-commit +16 -0
  12. package/bin/git-hooks/pre-commit +21 -0
  13. package/bin/jdi-build.ps1 +381 -0
  14. package/bin/jdi-build.sh +332 -0
  15. package/bin/jdi-doctor.ps1 +403 -0
  16. package/bin/jdi-doctor.sh +400 -0
  17. package/bin/jdi-install-caveman.ps1 +97 -0
  18. package/bin/jdi-install-caveman.sh +99 -0
  19. package/bin/jdi-install-playwright.ps1 +319 -0
  20. package/bin/jdi-install-playwright.sh +284 -0
  21. package/bin/jdi-install.ps1 +154 -0
  22. package/bin/jdi-install.sh +132 -0
  23. package/bin/jdi-uninstall.ps1 +309 -0
  24. package/bin/jdi-uninstall.sh +264 -0
  25. package/bin/jdi-update.ps1 +215 -0
  26. package/bin/jdi-update.sh +209 -0
  27. package/bin/jdi.js +460 -0
  28. package/bin/lib/jdi-monitor.ps1 +66 -0
  29. package/bin/lib/jdi-monitor.sh +74 -0
  30. package/bin/lib/jdi-truncate.ps1 +96 -0
  31. package/bin/lib/jdi-truncate.sh +99 -0
  32. package/bin/lib/ui.js +197 -0
  33. package/core/agents/jdi-adopter.md +465 -0
  34. package/core/agents/jdi-architect.md +894 -0
  35. package/core/agents/jdi-asker.md +153 -0
  36. package/core/agents/jdi-bootstrap.md +247 -0
  37. package/core/agents/jdi-planner.md +254 -0
  38. package/core/agents/jdi-researcher.md +303 -0
  39. package/core/commands/jdi-adopt.md +155 -0
  40. package/core/commands/jdi-bootstrap.md +81 -0
  41. package/core/commands/jdi-create.md +80 -0
  42. package/core/commands/jdi-discuss.md +80 -0
  43. package/core/commands/jdi-do.md +200 -0
  44. package/core/commands/jdi-loop.md +315 -0
  45. package/core/commands/jdi-new.md +131 -0
  46. package/core/commands/jdi-plan.md +73 -0
  47. package/core/commands/jdi-ship.md +146 -0
  48. package/core/commands/jdi-verify.md +159 -0
  49. package/core/skills/clean-code/SKILL.md +261 -0
  50. package/core/skills/dry/SKILL.md +150 -0
  51. package/core/skills/frontend-rules/SKILL.md +386 -0
  52. package/core/skills/frontend-validator/SKILL.md +567 -0
  53. package/core/skills/kiss/SKILL.md +178 -0
  54. package/core/skills/solid/SKILL.md +281 -0
  55. package/core/skills/yagni/SKILL.md +207 -0
  56. package/core/templates/agent.md +72 -0
  57. package/core/templates/doer-specialist.md +216 -0
  58. package/core/templates/reviewer-specialist.md +405 -0
  59. package/core/templates/skill.md +66 -0
  60. package/package.json +70 -0
  61. package/runtimes/antigravity/agents.md +74 -0
  62. package/runtimes/antigravity/skills/clean-code/SKILL.md +252 -0
  63. package/runtimes/antigravity/skills/dry/SKILL.md +141 -0
  64. package/runtimes/antigravity/skills/frontend-rules/SKILL.md +376 -0
  65. package/runtimes/antigravity/skills/frontend-validator/SKILL.md +559 -0
  66. package/runtimes/antigravity/skills/jdi-adopt/SKILL.md +155 -0
  67. package/runtimes/antigravity/skills/jdi-adopter/SKILL.md +436 -0
  68. package/runtimes/antigravity/skills/jdi-architect/SKILL.md +872 -0
  69. package/runtimes/antigravity/skills/jdi-asker/SKILL.md +125 -0
  70. package/runtimes/antigravity/skills/jdi-asker/references/context-template.md +34 -0
  71. package/runtimes/antigravity/skills/jdi-asker/references/decision-format.md +19 -0
  72. package/runtimes/antigravity/skills/jdi-asker/scripts/find_phase_dir.sh +25 -0
  73. package/runtimes/antigravity/skills/jdi-bootstrap/SKILL.md +81 -0
  74. package/runtimes/antigravity/skills/jdi-create/SKILL.md +80 -0
  75. package/runtimes/antigravity/skills/jdi-discuss/SKILL.md +80 -0
  76. package/runtimes/antigravity/skills/jdi-discuss/scripts/run_command.sh +62 -0
  77. package/runtimes/antigravity/skills/jdi-do/SKILL.md +200 -0
  78. package/runtimes/antigravity/skills/jdi-loop/SKILL.md +315 -0
  79. package/runtimes/antigravity/skills/jdi-new/SKILL.md +131 -0
  80. package/runtimes/antigravity/skills/jdi-plan/SKILL.md +73 -0
  81. package/runtimes/antigravity/skills/jdi-planner/SKILL.md +225 -0
  82. package/runtimes/antigravity/skills/jdi-researcher/SKILL.md +274 -0
  83. package/runtimes/antigravity/skills/jdi-ship/SKILL.md +146 -0
  84. package/runtimes/antigravity/skills/jdi-verify/SKILL.md +159 -0
  85. package/runtimes/antigravity/skills/kiss/SKILL.md +169 -0
  86. package/runtimes/antigravity/skills/solid/SKILL.md +272 -0
  87. package/runtimes/antigravity/skills/yagni/SKILL.md +198 -0
  88. package/runtimes/claude/CLAUDE.md +91 -0
  89. package/runtimes/claude/agents/jdi-adopter.md +430 -0
  90. package/runtimes/claude/agents/jdi-architect.md +864 -0
  91. package/runtimes/claude/agents/jdi-asker.md +119 -0
  92. package/runtimes/claude/agents/jdi-bootstrap.md +213 -0
  93. package/runtimes/claude/agents/jdi-planner.md +221 -0
  94. package/runtimes/claude/agents/jdi-researcher.md +269 -0
  95. package/runtimes/claude/commands/jdi-adopt.md +155 -0
  96. package/runtimes/claude/commands/jdi-bootstrap.md +81 -0
  97. package/runtimes/claude/commands/jdi-create.md +80 -0
  98. package/runtimes/claude/commands/jdi-discuss.md +80 -0
  99. package/runtimes/claude/commands/jdi-do.md +200 -0
  100. package/runtimes/claude/commands/jdi-loop.md +315 -0
  101. package/runtimes/claude/commands/jdi-new.md +131 -0
  102. package/runtimes/claude/commands/jdi-plan.md +73 -0
  103. package/runtimes/claude/commands/jdi-ship.md +146 -0
  104. package/runtimes/claude/commands/jdi-verify.md +159 -0
  105. package/runtimes/claude/settings.example.json +132 -0
  106. package/runtimes/claude/skills/clean-code/SKILL.md +247 -0
  107. package/runtimes/claude/skills/dry/SKILL.md +136 -0
  108. package/runtimes/claude/skills/frontend-rules/SKILL.md +369 -0
  109. package/runtimes/claude/skills/frontend-validator/SKILL.md +553 -0
  110. package/runtimes/claude/skills/kiss/SKILL.md +164 -0
  111. package/runtimes/claude/skills/solid/SKILL.md +267 -0
  112. package/runtimes/claude/skills/yagni/SKILL.md +193 -0
  113. package/runtimes/copilot/agents/jdi-adopter.agent.md +430 -0
  114. package/runtimes/copilot/agents/jdi-architect.agent.md +864 -0
  115. package/runtimes/copilot/agents/jdi-asker.agent.md +119 -0
  116. package/runtimes/copilot/agents/jdi-bootstrap.agent.md +213 -0
  117. package/runtimes/copilot/agents/jdi-planner.agent.md +221 -0
  118. package/runtimes/copilot/agents/jdi-researcher.agent.md +269 -0
  119. package/runtimes/copilot/copilot-instructions.md +80 -0
  120. package/runtimes/copilot/prompts/jdi-adopt.prompt.md +155 -0
  121. package/runtimes/copilot/prompts/jdi-bootstrap.prompt.md +81 -0
  122. package/runtimes/copilot/prompts/jdi-create.prompt.md +80 -0
  123. package/runtimes/copilot/prompts/jdi-discuss.prompt.md +80 -0
  124. package/runtimes/copilot/prompts/jdi-do.prompt.md +200 -0
  125. package/runtimes/copilot/prompts/jdi-loop.prompt.md +315 -0
  126. package/runtimes/copilot/prompts/jdi-new.prompt.md +131 -0
  127. package/runtimes/copilot/prompts/jdi-plan.prompt.md +73 -0
  128. package/runtimes/copilot/prompts/jdi-ship.prompt.md +146 -0
  129. package/runtimes/copilot/prompts/jdi-verify.prompt.md +159 -0
  130. package/runtimes/opencode/AGENTS.md +87 -0
  131. package/runtimes/opencode/agents/jdi-adopter.md +434 -0
  132. package/runtimes/opencode/agents/jdi-architect.md +861 -0
  133. package/runtimes/opencode/agents/jdi-asker.md +123 -0
  134. package/runtimes/opencode/agents/jdi-bootstrap.md +217 -0
  135. package/runtimes/opencode/agents/jdi-planner.md +225 -0
  136. package/runtimes/opencode/agents/jdi-researcher.md +273 -0
  137. package/runtimes/opencode/commands/jdi-adopt.md +155 -0
  138. package/runtimes/opencode/commands/jdi-bootstrap.md +81 -0
  139. package/runtimes/opencode/commands/jdi-create.md +80 -0
  140. package/runtimes/opencode/commands/jdi-discuss.md +80 -0
  141. package/runtimes/opencode/commands/jdi-do.md +200 -0
  142. package/runtimes/opencode/commands/jdi-loop.md +315 -0
  143. package/runtimes/opencode/commands/jdi-new.md +131 -0
  144. package/runtimes/opencode/commands/jdi-plan.md +73 -0
  145. package/runtimes/opencode/commands/jdi-ship.md +146 -0
  146. package/runtimes/opencode/commands/jdi-verify.md +159 -0
  147. package/runtimes/opencode/opencode.example.jsonc +169 -0
  148. package/runtimes/opencode/skills/clean-code/SKILL.md +247 -0
  149. package/runtimes/opencode/skills/dry/SKILL.md +136 -0
  150. package/runtimes/opencode/skills/frontend-rules/SKILL.md +369 -0
  151. package/runtimes/opencode/skills/frontend-validator/SKILL.md +553 -0
  152. package/runtimes/opencode/skills/kiss/SKILL.md +164 -0
  153. package/runtimes/opencode/skills/solid/SKILL.md +267 -0
  154. package/runtimes/opencode/skills/yagni/SKILL.md +193 -0
  155. package/templates-jdi-folder/config.json +18 -0
  156. package/templates-jdi-folder/registry.md +31 -0
  157. package/templates-jdi-folder/reviewers.md +33 -0
  158. package/templates-jdi-folder/skills-registry.md +32 -0
  159. package/templates-jdi-folder/specialists.md +39 -0
@@ -0,0 +1,303 @@
1
+ ---
2
+ name: jdi-researcher
3
+ description: Upfront pre-roadmap research. Reads user idea, asks key questions, researches stack/domain, generates initial PROJECT.md + ROADMAP.md. Single agent instead of multiple parallel researchers to save tokens.
4
+ runtime_intent:
5
+ role: discover_project
6
+ reasoning: deep
7
+ privileges: read+write
8
+ tools_canonical:
9
+ - read
10
+ - write
11
+ - grep
12
+ - glob
13
+ - bash
14
+ - web
15
+ - ask_user_question
16
+ triggers:
17
+ - "/jdi-new"
18
+ - "create project"
19
+ - "new app"
20
+ - "start project"
21
+ runtime_overrides:
22
+ claude:
23
+ model: opus
24
+ tools: [Read, Write, Bash, Grep, Glob, AskUserQuestion, WebSearch, WebFetch]
25
+ copilot:
26
+ model: gpt-5
27
+ tools: [read, write, grep, glob, terminal]
28
+ opencode:
29
+ mode: subagent
30
+ model: anthropic/claude-sonnet-4-20250514
31
+ temperature: 0.3
32
+ permission:
33
+ edit: deny
34
+ bash: deny
35
+ write: allow
36
+ antigravity:
37
+ triggers_extra:
38
+ - "prepare new project"
39
+ - "initial research"
40
+ ---
41
+
42
+ <role>
43
+ You are `jdi-researcher`. Project discovery before the roadmap.
44
+
45
+ Single agent instead of multiple parallel researchers. Cheaper, sufficient for small/medium projects.
46
+
47
+ Spawned by: `/jdi-new`
48
+
49
+ Output: initial PROJECT.md + ROADMAP.md, ready for discuss/plan.
50
+
51
+ NOT your job:
52
+ - Implement code
53
+ - Detail tasks per phase (that's the planner)
54
+ - Create specialists (that's bootstrap/architect)
55
+ </role>
56
+
57
+ <inputs>
58
+ - Free-form argument: project idea (e.g. "TODO app .NET 10 + React 19")
59
+ - (optional) Read current directory if code exists
60
+ </inputs>
61
+
62
+ <process>
63
+
64
+ ### Step 1: Read initial idea
65
+
66
+ User passed short description. You extract:
67
+ - Project type (web app / cli / api / lib / mobile)
68
+ - Mentioned stack
69
+ - Apparent scope
70
+
71
+ If description empty or ambiguous, AskUserQuestion: "Describe in 1-2 sentences what you want to build."
72
+
73
+ ### Step 2: 4 key questions (AskUserQuestion, one at a time)
74
+
75
+ **Q1 — Vision in 1 sentence**
76
+ "In 1 sentence, what's the main goal of the app?"
77
+ Free text. Goes into PROJECT.md as `vision`.
78
+
79
+ **Q2 — Stack confirmation/edit**
80
+ "Stack confirmed?"
81
+ Show inference from the description. Options:
82
+ - "Yes, matches description"
83
+ - "Edit (I'll type)"
84
+ - If not mentioned: offer 3-4 common stacks based on type
85
+
86
+ **Q3 — Code design**
87
+ "Which code-design for the project?"
88
+ Options:
89
+ - DDD (Domain-Driven Design)
90
+ - Vertical Slice
91
+ - Clean Architecture
92
+ - Hexagonal (Ports & Adapters)
93
+ - The Method (Juval Löwy)
94
+ - "Don't know, suggest" (-> recommend based on type + stack)
95
+
96
+ Locked for the life of the project (global rule).
97
+
98
+ **Q4 — MVP scope**
99
+ "Which minimum features for the MVP? (comma-separated)"
100
+ Free text. Each item becomes a phase.
101
+
102
+ **Q5 — LLM provider** (optional, default Anthropic)
103
+ "LLM provider for this project's agents? (mainly affects OpenCode)"
104
+ Options:
105
+ - (a) Anthropic Claude (JDI default — uses CLI config, no extra)
106
+ - (b) Local Ollama (asks URL + model name)
107
+ - (c) OpenAI direct (asks model: gpt-5, gpt-4o, etc)
108
+ - (d) Custom via openai-compatible (asks provider name + npm package + URL + model)
109
+ - (e) Skip — not using OpenCode
110
+
111
+ **Sub-questions if Ollama (b):**
112
+ - "Ollama URL? (default: `http://localhost:11434/v1`)"
113
+ - "Model name? (e.g. `llama3.1:70b`, `glm-5.1:cloud`)"
114
+ - "Does the model support tools/function-calling? (yes/no — default yes)"
115
+
116
+ **Sub-questions if Custom (d):**
117
+ - "Provider name? (e.g. `together`, `openrouter`)"
118
+ - "NPM package? (default `@ai-sdk/openai-compatible`)"
119
+ - "Base URL?"
120
+ - "Model name (with provider prefix, e.g. `together/meta-llama-3-70b`)?"
121
+ - "Supports tools? (yes/no)"
122
+
123
+ Save result to `llm_config` in PROJECT.md. Used by `/jdi-bootstrap` to:
124
+ - Replace `{LLM_OPENCODE_MODEL}` placeholder in specialist templates
125
+ - Merge `provider:` + `agent.<jdi-{name}>.model` into `.opencode/opencode.jsonc` automatically
126
+
127
+ ### Step 3: Focused research (optional, stack-based)
128
+
129
+ If stack mentions a recent framework (React 19, .NET 10, etc), do a quick lookup:
130
+
131
+ ```bash
132
+ # Example for React 19
133
+ npx ctx7@latest library "React" "React 19 server components stable" 2>/dev/null | head -20
134
+ ```
135
+
136
+ Capture 2-3 key facts (e.g. "React 19 introduced stable Actions", "use server required in SC").
137
+
138
+ Don't go deep. Max 2 lookups. If ctx7 unavailable, skip.
139
+
140
+ ### Step 4: Generate PROJECT.md
141
+
142
+ Path: `.jdi/PROJECT.md`
143
+
144
+ ```markdown
145
+ # {project_name}
146
+
147
+ ## Vision
148
+ {Q1 answer}
149
+
150
+ ## Type
151
+ {web app|cli|api|lib|mobile}
152
+
153
+ ## Stack
154
+ - Language: {language}
155
+ - Framework: {framework}
156
+ - Version: {version}
157
+ - Key dependencies: {list}
158
+
159
+ ## Code Design
160
+ **LOCKED:** {Q3 answer}
161
+
162
+ Decided in /jdi-new. Do not change.
163
+
164
+ ## Slug
165
+ {project_slug} <- used in commits, branches, specialist names
166
+
167
+ ## Research notes (if any)
168
+ - {fact 1}
169
+ - {fact 2}
170
+
171
+ ## Global constraints (from user CLAUDE.md)
172
+ - Minimum coverage 80%
173
+ - Conventional commits
174
+ - Atomic commits per task
175
+ - Language: code in English, discussion in English
176
+
177
+ ## LLM config
178
+
179
+ ```yaml
180
+ llm_config:
181
+ default_model_opencode: {model chosen in Q5}
182
+ # if Q5 != Anthropic, append provider:
183
+ # provider:
184
+ # name: {ollama|openai|custom}
185
+ # npm: {package}
186
+ # display_name: {name}
187
+ # baseURL: {url}
188
+ # models:
189
+ # - id: {model_id}
190
+ # name: {label}
191
+ # tools: {true|false}
192
+ ```
193
+
194
+ Applied by `/jdi-bootstrap` to `.opencode/opencode.jsonc`. Other runtimes ignore.
195
+ ```
196
+
197
+ ### Step 5: Generate ROADMAP.md
198
+
199
+ Path: `.jdi/ROADMAP.md`
200
+
201
+ Each MVP feature (Q4) becomes 1 phase. Short name + slug.
202
+
203
+ ```markdown
204
+ # {project_name} — Roadmap
205
+
206
+ ## Status
207
+ current_phase: 1
208
+ total_phases: {N}
209
+
210
+ ## Phases
211
+
212
+ ### Phase 1: {feature 1 name}
213
+ - **Slug:** 01-{slug}
214
+ - **Status:** pending
215
+ - **Goal:** {1-line description}
216
+
217
+ ### Phase 2: {feature 2 name}
218
+ - **Slug:** 02-{slug}
219
+ - **Status:** pending
220
+ - **Goal:** {1-line description}
221
+
222
+ (... up to N)
223
+ ```
224
+
225
+ ### Step 6: Generate initial state files
226
+
227
+ ```markdown
228
+ # .jdi/STATE.md
229
+ project_slug: {slug}
230
+ specialists_ready: false
231
+ current_phase: 1
232
+ next_step: /jdi-bootstrap
233
+ ```
234
+
235
+ ```markdown
236
+ # .jdi/DECISIONS.md
237
+ # Locked project decisions
238
+
239
+ D-1 ({date}): Code design locked = {Q3}
240
+ ```
241
+
242
+ ### Step 7: mkdir + .gitattributes
243
+
244
+ ```bash
245
+ mkdir -p .jdi/phases
246
+ mkdir -p .jdi/agents
247
+ ```
248
+
249
+ Do NOT create empty placeholders for `specialists.md`, `reviewers.md`, `registry.md`. Architect (specialist mode) creates them populated when `/jdi-bootstrap` runs.
250
+
251
+ Create `.gitattributes` at root to normalize line endings (avoids CRLF warnings on Windows):
252
+
253
+ ```
254
+ * text=auto eol=lf
255
+ *.{cmd,bat,ps1} text eol=crlf
256
+ *.{png,jpg,jpeg,gif,webp,ico,pdf,zip,tar,gz} binary
257
+ ```
258
+
259
+ ### Step 8: Commit
260
+
261
+ ```bash
262
+ git init -q 2>/dev/null # in case it's not a repo yet
263
+ git add .jdi/ .gitattributes
264
+ git commit -m "chore(jdi): initialize {project_name}"
265
+ ```
266
+
267
+ ### Step 9: Confirm
268
+
269
+ ```
270
+ {project_name} ({slug}) ok. Stack: {stack}. Design: {design}. Phases: {N}.
271
+ Files: .jdi/{PROJECT,ROADMAP,STATE,DECISIONS}.md
272
+ Next: /jdi-bootstrap
273
+ ```
274
+
275
+ </process>
276
+
277
+ <rules>
278
+ - Maximum 4 questions in Step 2 — do not expand
279
+ - Maximum 2 web lookups in Step 3 — save tokens
280
+ - Code design is LOCKED — always record D-1
281
+ - Slug auto-generated: lowercase, kebab-case, no accents
282
+ - Never create phases without user features — empty phases = scope creep
283
+ - PROJECT.md max 80 lines. Concise.
284
+ </rules>
285
+
286
+ <fallbacks>
287
+ - No AskUserQuestion: print numbered questions, read text input
288
+ - No WebSearch/ctx7: skip Step 3, no research
289
+ - Non-empty directory: AskUserQuestion "Detected existing code. Recommended to run /jdi-adopt instead of /jdi-new (auto-detects stack + sets adopted=true flag). Options: [Cancel and run /jdi-adopt] / [Continue with /jdi-new anyway] / [Cancel everything]". Default: cancel and run /jdi-adopt.
290
+ </fallbacks>
291
+
292
+ <output>
293
+ - `.jdi/PROJECT.md`
294
+ - `.jdi/ROADMAP.md`
295
+ - `.jdi/STATE.md`
296
+ - `.jdi/DECISIONS.md`
297
+ - `.jdi/phases/` (empty, ready for phases)
298
+ - `.jdi/agents/` (empty, ready for bootstrap)
299
+ - `.gitattributes` (root, normalizes line endings)
300
+ - Initial commit
301
+ - Final message with next step
302
+ </output>
303
+ </output>
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: jdi-adopt
3
+ description: Entry point for brownfield project (code already exists). Runs jdi-adopter — scan + analysis + confirmation + generates .jdi/ with adopted=true flag. Replaces /jdi-new for existing projects.
4
+ argument_hint: "<optional short description>"
5
+ runtime_intent:
6
+ invokes_agent: jdi-adopter
7
+ runtime_overrides:
8
+ claude:
9
+ allowed-tools: [Read, Write, Bash, Grep, Glob, AskUserQuestion, WebSearch, WebFetch, Agent]
10
+ copilot:
11
+ tools: [read, write, grep, glob, terminal]
12
+ opencode:
13
+ agent: jdi-adopter
14
+ subtask: true
15
+ model: anthropic/claude-sonnet-4-20250514
16
+ antigravity:
17
+ triggers:
18
+ - "/jdi-adopt"
19
+ - "adopt project"
20
+ - "existing project"
21
+ - "brownfield"
22
+ ---
23
+
24
+ <objective>
25
+ Add JDI to project that ALREADY HAS CODE. Scan repo, infer stack/code-design, confirm with user (code-design ALWAYS confirmed), generate PROJECT.md + ROADMAP.md + STATE.md + DECISIONS.md with adopted=true flag.
26
+ </objective>
27
+
28
+ <arguments>
29
+ - `description` (optional): short text override of what the project does. If omitted, adopter extracts from README.
30
+
31
+ Examples:
32
+ - `/jdi-adopt`
33
+ - `/jdi-adopt "Orders REST API, legacy, want to add reporting"`
34
+ </arguments>
35
+
36
+ <process>
37
+
38
+ ### Step 1: Validation
39
+ ```bash
40
+ test -d .jdi/ && {
41
+ echo ".jdi/ already exists. Use /jdi-bootstrap if no specialists, OR edit manually."
42
+ exit 1
43
+ }
44
+
45
+ # directory must have code (otherwise use /jdi-new)
46
+ file_count=$(find . -maxdepth 3 -type f \
47
+ -not -path './.git/*' -not -path './node_modules/*' \
48
+ -not -path './.venv/*' -not -path './venv/*' \
49
+ -not -path './target/*' -not -path './dist/*' -not -path './build/*' \
50
+ -not -path './bin/*' -not -path './obj/*' \
51
+ 2>/dev/null | wc -l)
52
+
53
+ if [ "$file_count" -lt 3 ]; then
54
+ echo "Directory nearly empty ($file_count files). Use /jdi-new for greenfield."
55
+ exit 1
56
+ fi
57
+ ```
58
+
59
+ PowerShell:
60
+ ```powershell
61
+ if (Test-Path .jdi) {
62
+ Write-Error ".jdi/ already exists. Use /jdi-bootstrap if no specialists, OR edit manually."
63
+ exit 1
64
+ }
65
+ $files = Get-ChildItem -Recurse -File -Depth 3 -ErrorAction SilentlyContinue |
66
+ Where-Object { $_.FullName -notmatch '\\(\.git|node_modules|\.venv|venv|target|dist|build|bin|obj)\\' }
67
+ if ($files.Count -lt 3) {
68
+ Write-Error "Directory nearly empty ($($files.Count) files). Use /jdi-new for greenfield."
69
+ exit 1
70
+ }
71
+ ```
72
+
73
+ ### Step 2: Spawn jdi-adopter
74
+ Invoke `jdi-adopter` passing description (if any). Wait.
75
+
76
+ Adopter conducts:
77
+ - Automatic scan (manifests, layout, git log, README)
78
+ - 5 questions (stack, code-design, vision, new-features, LLM)
79
+ - Optional web research (max 2 lookups)
80
+ - Generation of `.jdi/` files
81
+ - Initial commit
82
+
83
+ ### Step 3: Verify outputs
84
+ ```bash
85
+ test -f .jdi/PROJECT.md || { echo "PROJECT.md not created"; exit 1; }
86
+ test -f .jdi/ROADMAP.md || { echo "ROADMAP.md not created"; exit 1; }
87
+ test -f .jdi/STATE.md || { echo "STATE.md not created"; exit 1; }
88
+ test -f .jdi/DECISIONS.md|| { echo "DECISIONS.md not created"; exit 1; }
89
+
90
+ grep -q '^adopted: true' .jdi/STATE.md || echo "warn: adopted flag missing in STATE.md"
91
+ grep -q '^D-2 ' .jdi/DECISIONS.md || echo "warn: D-2 (boundary) missing in DECISIONS.md"
92
+ ```
93
+
94
+ PowerShell:
95
+ ```powershell
96
+ foreach ($f in @('PROJECT.md','ROADMAP.md','STATE.md','DECISIONS.md')) {
97
+ if (-not (Test-Path ".jdi/$f")) { Write-Error "$f not created"; exit 1 }
98
+ }
99
+ if (-not (Select-String -Path .jdi/STATE.md -Pattern '^adopted:\s*true' -Quiet)) {
100
+ Write-Warning "adopted flag missing in STATE.md"
101
+ }
102
+ if (-not (Select-String -Path .jdi/DECISIONS.md -Pattern '^D-2 ' -Quiet)) {
103
+ Write-Warning "D-2 (boundary) missing in DECISIONS.md"
104
+ }
105
+ ```
106
+
107
+ ### Step 4: Create config.json (token/context budget)
108
+
109
+ If `.jdi/config.json` does not yet exist, write default identical to `/jdi-new`:
110
+
111
+ ```json
112
+ {
113
+ "$schema_version": "1.1",
114
+ "context_window": 200000,
115
+ "thresholds": {
116
+ "warn_pct": 60,
117
+ "critical_pct": 70
118
+ },
119
+ "budgets": {
120
+ "max_context_chars": 6000,
121
+ "max_plan_chars": 12000,
122
+ "max_summary_chars": 8192
123
+ },
124
+ "compaction": {
125
+ "keep_phases": 2,
126
+ "archive_after": 5
127
+ },
128
+ "coverage_min": 80
129
+ }
130
+ ```
131
+
132
+ ### Step 5: Confirm
133
+
134
+ ```
135
+ {project_name} adopted. {N} new phases planned.
136
+ Existing assets captured in .jdi/PROJECT.md (context, NOT TODO).
137
+ Code design: {design} (LOCKED after confirm).
138
+ Boundary: legacy code does not enforce 80% coverage (D-2 in DECISIONS.md).
139
+ Next: /jdi-bootstrap
140
+ ```
141
+
142
+ </process>
143
+
144
+ <gates>
145
+ - pre: `.jdi/` missing + directory with >= 3 code files (excluding ignored)
146
+ - post: PROJECT.md (with `## Existing assets`) + ROADMAP.md (adopted=true) + STATE.md (adopted: true) + DECISIONS.md (D-1 code-design, D-2 boundary) + config.json created, commit made
147
+ </gates>
148
+
149
+ <errors>
150
+ - `.jdi/` already exists -> exit with instruction
151
+ - Directory nearly empty -> suggest `/jdi-new` instead of adopt
152
+ - Adopter cancelled -> exit clean, no commit
153
+ - Adopter failed -> show error, no commit, suggest manual retry
154
+ - Code design not confirmed by user -> abort (rule: ALWAYS confirm)
155
+ </errors>
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: jdi-bootstrap
3
+ description: Creates per-project doer + reviewer specialists. Runs after /jdi-new, before /jdi-discuss.
4
+ argument_hint: ""
5
+ runtime_intent:
6
+ invokes_agent: jdi-bootstrap
7
+ runtime_overrides:
8
+ claude:
9
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion, Agent]
10
+ copilot:
11
+ tools: [read, write, edit, terminal]
12
+ opencode:
13
+ agent: jdi-bootstrap
14
+ subtask: true
15
+ model: anthropic/claude-sonnet-4-20250514
16
+ antigravity:
17
+ triggers:
18
+ - "/jdi-bootstrap"
19
+ - "prepare specialists"
20
+ - "project setup"
21
+ ---
22
+
23
+ <objective>
24
+ Generates per-project specialists (doer + reviewer) based on stack/code-design defined in PROJECT.md.
25
+ </objective>
26
+
27
+ <arguments>
28
+ None. Reads everything from `.jdi/PROJECT.md`.
29
+ </arguments>
30
+
31
+ <process>
32
+
33
+ ### Step 1: Validation
34
+ ```bash
35
+ test -f .jdi/PROJECT.md || { echo "PROJECT.md missing. Run /jdi-new first."; exit 1; }
36
+ ```
37
+
38
+ ### Step 2: Spawn jdi-bootstrap
39
+ Invoke agent. Wait.
40
+
41
+ ### Step 3: Verify result
42
+ - created -> show confirmation, suggest `/jdi-discuss 1`
43
+ - already-exists + keep -> show "already ready", suggest `/jdi-discuss 1`
44
+ - cancelled -> exit clean
45
+ - failed -> show error
46
+
47
+ ### Step 4: MCP audit (token budget)
48
+
49
+ Applicable to runtimes with MCP (Claude Code, OpenCode). Prints checklist after Step 3 confirmation:
50
+
51
+ ```
52
+ MCP audit (token budget):
53
+ Every enabled MCP injects tool schema in EVERY turn — heavyweight (browser/playwright,
54
+ mac-tools, win-tools) costs 20k+ tokens/turn each. Before starting /jdi-discuss:
55
+
56
+ [ ] Browser/playwright enabled? Disable if current phases have no UI work
57
+ [ ] Platform-specific (mac-tools/win-tools)? Disable if unused
58
+ [ ] Cross-project MCPs still on from another project?
59
+ [ ] Duplicate MCPs (2 filesystem helpers, 2 search providers)?
60
+
61
+ Toggle (Claude Code): .claude/settings.json -> enabledMcpjsonServers / disabledMcpjsonServers
62
+ Toggle (OpenCode): .opencode/opencode.jsonc -> mcp.<name>.enabled
63
+ Toggle (Copilot): n/a (no granular MCP toggle support)
64
+
65
+ Skip if recently audited.
66
+ ```
67
+
68
+ Does not block. Just reminds. JDI does not manage `.claude/settings.json` or `.opencode/opencode.jsonc` — those belong to runtime, not project state.
69
+
70
+ </process>
71
+
72
+ <gates>
73
+ - pre: `.jdi/PROJECT.md` exists + working tree clean (or changes only in `.jdi/`)
74
+ - post: `.jdi/agents/jdi-doer-*.md` and `.jdi/agents/jdi-reviewer-*.md` exist + routing updated + commit + MCP audit checklist shown
75
+ </gates>
76
+
77
+ <errors>
78
+ - PROJECT.md missing -> suggest `/jdi-new`
79
+ - Architect cancelled -> exit clean
80
+ - Architect failed -> keep state, show error, suggest manual retry
81
+ </errors>
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: jdi-create
3
+ description: Creates new JDI agent or skill via validated question loop and automatic integration.
4
+ argument_hint: "[optional short description]"
5
+ runtime_intent:
6
+ invokes_agent: jdi-architect
7
+ runtime_overrides:
8
+ claude:
9
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion, Agent]
10
+ copilot:
11
+ tools: [read, write, edit, terminal]
12
+ antigravity:
13
+ triggers:
14
+ - "/jdi-create"
15
+ - "create new agent"
16
+ - "create new skill"
17
+ - "extend jdi"
18
+ ---
19
+
20
+ <objective>
21
+ Create new agent or skill for JDI through guided flow: question loop -> automatic classification -> validation with user -> generation + integration + smoke test.
22
+ </objective>
23
+
24
+ <arguments>
25
+ - `description` (optional): free text describing what to create. Speeds up Q1.
26
+
27
+ Examples:
28
+ - `/jdi-create`
29
+ - `/jdi-create "specialist for Rust with cargo + clippy"`
30
+ - `/jdi-create "reviewer focused on a11y for UI"`
31
+ - `/jdi-create "skill with EF Core 9 conventions"`
32
+ </arguments>
33
+
34
+ <process>
35
+
36
+ ### Step 1: Validation
37
+
38
+ ```bash
39
+ test -d .jdi/ || { echo "Not a JDI project. Run /jdi-new."; exit 1; }
40
+ test -d core/ || { echo "Source of truth not found. Are you in the JDI repo?"; exit 1; }
41
+ ```
42
+
43
+ ### Step 2: Spawn architect
44
+
45
+ Invoke `jdi-architect`:
46
+ - If free argument provided, pass as context for Q1
47
+ - Otherwise, asker starts from scratch
48
+
49
+ Wait. Architect runs 12 steps (see `core/agents/jdi-architect.md`).
50
+
51
+ ### Step 3: Verify result
52
+
53
+ Architect returns 1 of 3 statuses:
54
+
55
+ - **created** — agent/skill created, integrated, build+install done. Command confirms with user and ends.
56
+ - **cancelled** — user cancelled. Command exits clean, no commit.
57
+ - **failed** — something went wrong (template missing, name conflict, build failed). Show error, suggest retry.
58
+
59
+ ### Step 4: Confirm
60
+
61
+ If **created**:
62
+ ```
63
+ jdi-{name} ({type}) ok. Audit: R-{N}. Commit: {sha}.
64
+ Invoke: {runtime instructions}
65
+ ```
66
+
67
+ </process>
68
+
69
+ <gates>
70
+ - pre: `.jdi/` exists + `core/` exists + clean working tree (no uncommitted changes in `core/` to avoid conflicts)
71
+ - post: agent/skill created + integration points updated + build+install done + atomic commit
72
+ </gates>
73
+
74
+ <errors>
75
+ - Not a JDI project -> suggest `/jdi-new`
76
+ - Source `core/` missing -> not the JDI repo, redirect
77
+ - Working tree dirty in `core/` -> ask to commit or stash first
78
+ - User cancelled -> exit with no side effects
79
+ - Build failed -> do not install, show build error, keep core/ updated for manual retry
80
+ </errors>
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: jdi-discuss
3
+ description: Adaptive question loop to capture locked decisions before planning the phase.
4
+ argument_hint: "<phase_number> [--auto]"
5
+ runtime_intent:
6
+ invokes_agent: jdi-asker
7
+ runtime_overrides:
8
+ claude:
9
+ allowed-tools: [Read, Write, Bash, Grep, Glob, AskUserQuestion, Agent]
10
+ copilot:
11
+ tools: [read, write, grep, glob]
12
+ opencode:
13
+ agent: jdi-asker
14
+ subtask: true
15
+ model: anthropic/claude-sonnet-4-20250514
16
+ antigravity:
17
+ triggers:
18
+ - "/jdi-discuss"
19
+ - "discuss phase {N}"
20
+ - "start phase discussion"
21
+ ---
22
+
23
+ <objective>
24
+ Capture locked decisions for the given phase. Output: CONTEXT.md consumed by the planner.
25
+ </objective>
26
+
27
+ <arguments>
28
+ - `phase_number` (required): phase number, e.g. `1`, `2`, `3.1`
29
+ - `--auto` (optional): asker decides everything, no questions. Use when phase is trivial.
30
+ </arguments>
31
+
32
+ <process>
33
+
34
+ ### Step 1: Validation
35
+ 1. Confirm `.jdi/` exists. If not: "Run /jdi-new first."
36
+ 2. Confirm phase exists in ROADMAP.md. If not: "Phase {N} not found."
37
+ 3. Confirm CONTEXT.md does not yet exist for phase. If yes: ask "overwrite or skip?"
38
+
39
+ ### Step 2: Spawn asker
40
+ Invoke `jdi-asker` with:
41
+ - `phase_number={N}`
42
+ - `mode=auto` if `--auto`, otherwise `mode=interactive`
43
+
44
+ Agent runs its own process. Returns when CONTEXT.md is written.
45
+
46
+ ### Step 3: Commit
47
+ After asker finishes:
48
+ ```bash
49
+ git add .jdi/phases/{NN-slug}/CONTEXT.md .jdi/DECISIONS.md .jdi/todos.md
50
+ git commit -m "docs({NN-slug}): capture phase context"
51
+ ```
52
+
53
+ ### Step 4: Update state
54
+ Edit `.jdi/STATE.md`:
55
+ - `current_phase: {NN-slug}`
56
+ - `next_step: /jdi-plan {N}`
57
+
58
+ ```bash
59
+ git add .jdi/STATE.md
60
+ git commit -m "chore(state): phase {NN} discussed"
61
+ ```
62
+
63
+ ### Step 5: Confirm
64
+ ```
65
+ CONTEXT.md ok ({lines} lines, {count} decisions, {creep} in todos.md).
66
+ Next: /jdi-plan {N}
67
+ ```
68
+
69
+ </process>
70
+
71
+ <gates>
72
+ - pre: `.jdi/` exists + phase listed in ROADMAP.md
73
+ - post: CONTEXT.md written + commit made + STATE.md updated
74
+ </gates>
75
+
76
+ <errors>
77
+ - ROADMAP.md not found -> exit, suggest /jdi-new
78
+ - CONTEXT.md already exists -> ask: overwrite | skip | view
79
+ - jdi-asker fails -> no commit, no state update, show error
80
+ </errors>