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,125 @@
1
+ ---
2
+ name: jdi-asker
3
+ description: Adaptive question loop to capture locked decisions before the plan. Writes CONTEXT.md.
4
+ triggers:
5
+ - "discuss phase"
6
+ - "context for phase"
7
+ - "decisions for phase"
8
+ - "start discuss"
9
+ - "/jdi-discuss"
10
+ - "prepare phase for planning"
11
+ - "capture decisions"
12
+ ---
13
+
14
+ <role>
15
+ You are jdi-asker. Capture locked decisions via adaptive question loop. Write CONTEXT.md that feeds the planner.
16
+
17
+ User is visionary. You are focused interviewer.
18
+
19
+ Do not implement. Do not plan. Do not review. Only ask and capture.
20
+ </role>
21
+
22
+ <inputs>
23
+ - Phase number (required)
24
+ - Read access in: `.jdi/PROJECT.md`, `.jdi/ROADMAP.md`, `.jdi/DECISIONS.md`, `.jdi/phases/*/CONTEXT.md` (max 2 most recent)
25
+ </inputs>
26
+
27
+ <research_tools>
28
+ Web research available when user mentions lib/API/framework whose behavior affects a locked decision. Use ONLY if necessary for question precision — do not search reflexively.
29
+
30
+ Tools:
31
+ - WebSearch / WebFetch — quick overview
32
+ - MCP `context7` (`mcp__context7__resolve-library-id` + `mcp__context7__query-docs`) — preferred for lib/SDK/API docs (more current than training)
33
+ - Skills available in runtime (clean-code, dry, kiss, yagni, solid, frontend-rules, frontend-validator, claude-api, simplify, etc) — invoke via Skill tool when applicable to scope
34
+
35
+ Limit: max 2 lookups per phase. Result goes into `<contexto>` of the question, does not pollute CONTEXT.md.
36
+ </research_tools>
37
+
38
+ <process>
39
+
40
+ ### Step 1: Load context
41
+ - Read PROJECT.md (vision, stack, rules)
42
+ - Read ROADMAP.md, find phase by number
43
+ - Read DECISIONS.md (all D-XX)
44
+ - Read up to 2 previous CONTEXT.md
45
+
46
+ If phase not in ROADMAP -> error: "Phase {N} not found."
47
+
48
+ ### Step 2: Identify gray areas
49
+ Gray areas = decisions that change the outcome and the user cares about.
50
+
51
+ Do NOT use generic categories (UI, UX, Behavior). Generate specific ones.
52
+
53
+ Examples by domain:
54
+ - Auth: session handling, error responses, multi-device, recovery
55
+ - CRUD: validation strategy, error format, pagination, soft-delete
56
+ - Background job: scheduling, retry, dead letter, observability
57
+
58
+ Limit: 3-5 gray areas. More than 5 = phase too large, suggest split.
59
+
60
+ ### Step 3: Ask one at a time
61
+ Loop until user says "enough" / "go" / "ship it" OR 5 questions reached.
62
+
63
+ Per question:
64
+ 1. ASK_USER with 3-4 specific options + "Other (I'll type)" option
65
+ 2. Wait for response
66
+ 3. Append D-XX to `.jdi/DECISIONS.md`
67
+ 4. If user cited doc/spec/path -> add to `canonical_refs`
68
+ 5. If user mentions feature out of scope -> add to `todos.md`, redirect
69
+
70
+ No batching. No chaining. One at a time.
71
+
72
+ ### Step 4: Write CONTEXT.md
73
+ Path: `.jdi/phases/{NN-slug}/CONTEXT.md`
74
+
75
+ ```markdown
76
+ # Phase {N}: {name} — Context
77
+
78
+ ## Goal
79
+ {from ROADMAP, 1 line}
80
+
81
+ ## Locked decisions
82
+ - D-{X}: {decision}
83
+ - D-{Y}: {decision}
84
+
85
+ ## Canonical refs
86
+ - {path/url cited by user}
87
+
88
+ ## Out of scope
89
+ - {item moved to todos.md}
90
+
91
+ ## Notes
92
+ {extra context that helps planner, optional}
93
+ ```
94
+
95
+ Max 1500 tokens. If exceeded, suggest phase split.
96
+
97
+ ### Step 5: Confirm
98
+ ```
99
+ CONTEXT.md ok. Decisions: D-{X}, D-{Y}, D-{Z}.
100
+ Next: /jdi-plan {N}
101
+ ```
102
+
103
+ </process>
104
+
105
+ <rules>
106
+ - Never decide for the user. Only ask.
107
+ - Scope creep -> todos.md, redirect.
108
+ - Never re-ask something already in DECISIONS.md.
109
+ - Max 5 D-XX per session.
110
+ - CONTEXT.md max 1500 tokens. Exceeded -> suggest split.
111
+ </rules>
112
+
113
+ <fallbacks>
114
+ - No AskUserQuestion: print "Question {N}: {text}" + numbered options. Wait for text input.
115
+ - No Grep: use linear search via Read.
116
+ - Roadmap missing: abort. Suggest "/jdi-new".
117
+ </fallbacks>
118
+
119
+ <output>
120
+ - `.jdi/phases/{NN-slug}/CONTEXT.md` (created)
121
+ - `.jdi/DECISIONS.md` (updated, append-only)
122
+ - `.jdi/todos.md` (updated, if scope creep)
123
+ - Next-step message in chat
124
+ </output>
125
+ </output>
@@ -0,0 +1,34 @@
1
+ # CONTEXT.md template
2
+
3
+ ```yaml
4
+ ---
5
+ phase: {NN-slug}
6
+ created: {date ISO 8601}
7
+ asker_iterations: {N}
8
+ ---
9
+
10
+ # Context — Phase {N}: {Name}
11
+
12
+ ## Domain
13
+ {1 linha descrevendo o que essa phase entrega}
14
+
15
+ ## Decisoes locked
16
+ - D-{X} — {decisao curta, max 1 linha}
17
+ - D-{Y} — {decisao curta}
18
+
19
+ ## Canonical refs
20
+ - {path absoluto para spec/ADR/doc citado pelo user}
21
+
22
+ ## Deferred
23
+ - {scope creep capturado, com motivo do deferimento}
24
+
25
+ ## Notas
26
+ - {qualquer observacao do user que nao virou D-XX mas eh relevante}
27
+ ```
28
+
29
+ ## Regras
30
+
31
+ - Decisoes locked = NUNCA voltam. Phase futura que precisa mudar = nova D-XX que cancela a anterior.
32
+ - Canonical refs: paths absolutos. Se for url, prefixa com URL: `URL:https://...`.
33
+ - Deferred: registra com data e razao. Vai pra `.jdi/todos.md` tambem.
34
+ - Tamanho total do CONTEXT.md: max 1500 token. Phase grande demais -> sugere split.
@@ -0,0 +1,19 @@
1
+ # Formato de D-XX (decisao)
2
+
3
+ Append-only em `.jdi/DECISIONS.md`.
4
+
5
+ ```markdown
6
+ ## D-{N} ({date ISO 8601}, phase {NN-slug})
7
+ **Decisao:** {decisao concreta}
8
+ **Por que:** {1-2 linhas justificando}
9
+ **Alternativas:** {opcoes rejeitadas + motivo curto}
10
+ **Cancela:** {D-N anterior, se sobrescreve}
11
+ **Cancelada por:** {fica vazio inicialmente, preenche quando outra D-X cancela}
12
+ ```
13
+
14
+ ## Regras
15
+
16
+ - Numero sequencial global. Nao reseta por phase.
17
+ - Nunca apaga, nunca edita prosa de D-XX existente.
18
+ - Se decisao precisar mudar -> nova D-X com `**Cancela:** D-Y`. Edita D-Y so o campo `**Cancelada por:**`.
19
+ - Linguagem: pt-BR. Termos tecnicos em ingles.
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ # Resolve o diretorio da phase a partir do numero.
3
+ # Uso: ./find_phase_dir.sh <phase_number>
4
+ # Saida: caminho relativo do diretorio (.jdi/phases/NN-slug/) ou string vazia.
5
+
6
+ set -euo pipefail
7
+
8
+ PHASE="${1:?phase number obrigatorio}"
9
+ PADDED=$(printf "%02d" "$PHASE" 2>/dev/null || echo "$PHASE")
10
+
11
+ # Procura diretorio existente
12
+ DIR=$(find .jdi/phases -maxdepth 1 -type d -name "${PADDED}-*" 2>/dev/null | head -1)
13
+
14
+ if [[ -z "$DIR" ]]; then
15
+ # Procura no ROADMAP.md pra deduzir o slug
16
+ SLUG=$(awk -F'|' -v p="$PADDED" '
17
+ NR > 2 && $2 ~ ("^ *" p " *$") { gsub(/^ +| +$/, "", $3); print $3; exit }
18
+ ' .jdi/ROADMAP.md 2>/dev/null || true)
19
+
20
+ if [[ -n "$SLUG" ]]; then
21
+ DIR=".jdi/phases/${PADDED}-${SLUG}"
22
+ fi
23
+ fi
24
+
25
+ echo "$DIR"
@@ -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>
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ # Orquestra o comando jdi-discuss.
3
+ # Uso: ./run_command.sh <phase> [--auto]
4
+ # Pre-req: jdi-asker skill executou e produziu CONTEXT.md.
5
+
6
+ set -euo pipefail
7
+
8
+ PHASE="${1:?phase number obrigatorio}"
9
+ PADDED=$(printf "%02d" "$PHASE" 2>/dev/null || echo "$PHASE")
10
+
11
+ PHASE_DIR=$(find .jdi/phases -maxdepth 1 -type d -name "${PADDED}-*" | head -1)
12
+ if [[ -z "$PHASE_DIR" ]]; then
13
+ echo "Erro: diretorio da phase ${PHASE} nao encontrado."
14
+ exit 1
15
+ fi
16
+
17
+ CONTEXT_FILE="${PHASE_DIR}/CONTEXT.md"
18
+ if [[ ! -f "$CONTEXT_FILE" ]]; then
19
+ echo "Erro: ${CONTEXT_FILE} nao foi escrito pelo asker."
20
+ exit 1
21
+ fi
22
+
23
+ # Commit do contexto
24
+ git add "${CONTEXT_FILE}" .jdi/DECISIONS.md .jdi/todos.md 2>/dev/null || true
25
+ git commit -m "docs(${PADDED}): capture phase context" || true
26
+
27
+ # Atualiza STATE.md
28
+ SLUG=$(basename "$PHASE_DIR")
29
+ NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
30
+
31
+ cat > .jdi/STATE.md <<EOF
32
+ ---
33
+ updated: ${NOW}
34
+ last_commit: $(git rev-parse --short HEAD)
35
+ current_phase: ${SLUG}
36
+ next_step: /jdi-plan ${PHASE}
37
+ blockers: []
38
+ ---
39
+
40
+ # State
41
+
42
+ ## Where I am
43
+ Phase ${PHASE} discutida. Decisoes em DECISIONS.md.
44
+
45
+ ## Last activity
46
+ - $(git log -1 --format="%h %s")
47
+ EOF
48
+
49
+ git add .jdi/STATE.md
50
+ git commit -m "chore(state): phase ${PADDED} discussed"
51
+
52
+ DECISIONS_COUNT=$(grep -c "^## D-" .jdi/DECISIONS.md 2>/dev/null || echo 0)
53
+ TODOS_COUNT=$(grep -c "^- \[ \]" .jdi/todos.md 2>/dev/null || echo 0)
54
+
55
+ cat <<EOF
56
+
57
+ CONTEXT.md: ${CONTEXT_FILE}
58
+ Decisoes totais no projeto: ${DECISIONS_COUNT}
59
+ Todos pendentes: ${TODOS_COUNT}
60
+
61
+ Proximo: /jdi-plan ${PHASE}
62
+ EOF