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.
- package/AGENTS.md +209 -0
- package/ARCHITECTURE.md +210 -0
- package/COMMANDS.md +241 -0
- package/CREATE-EXAMPLE.md +385 -0
- package/CREATE.md +315 -0
- package/EXTENSION.md +141 -0
- package/LICENSE +21 -0
- package/MEMORY.md +471 -0
- package/PORTABILITY.md +438 -0
- package/README.md +789 -0
- package/bin/git-hooks/post-commit +16 -0
- package/bin/git-hooks/pre-commit +21 -0
- package/bin/jdi-build.ps1 +381 -0
- package/bin/jdi-build.sh +332 -0
- package/bin/jdi-doctor.ps1 +403 -0
- package/bin/jdi-doctor.sh +400 -0
- package/bin/jdi-install-caveman.ps1 +97 -0
- package/bin/jdi-install-caveman.sh +99 -0
- package/bin/jdi-install-playwright.ps1 +319 -0
- package/bin/jdi-install-playwright.sh +284 -0
- package/bin/jdi-install.ps1 +154 -0
- package/bin/jdi-install.sh +132 -0
- package/bin/jdi-uninstall.ps1 +309 -0
- package/bin/jdi-uninstall.sh +264 -0
- package/bin/jdi-update.ps1 +215 -0
- package/bin/jdi-update.sh +209 -0
- package/bin/jdi.js +460 -0
- package/bin/lib/jdi-monitor.ps1 +66 -0
- package/bin/lib/jdi-monitor.sh +74 -0
- package/bin/lib/jdi-truncate.ps1 +96 -0
- package/bin/lib/jdi-truncate.sh +99 -0
- package/bin/lib/ui.js +197 -0
- package/core/agents/jdi-adopter.md +465 -0
- package/core/agents/jdi-architect.md +894 -0
- package/core/agents/jdi-asker.md +153 -0
- package/core/agents/jdi-bootstrap.md +247 -0
- package/core/agents/jdi-planner.md +254 -0
- package/core/agents/jdi-researcher.md +303 -0
- package/core/commands/jdi-adopt.md +155 -0
- package/core/commands/jdi-bootstrap.md +81 -0
- package/core/commands/jdi-create.md +80 -0
- package/core/commands/jdi-discuss.md +80 -0
- package/core/commands/jdi-do.md +200 -0
- package/core/commands/jdi-loop.md +315 -0
- package/core/commands/jdi-new.md +131 -0
- package/core/commands/jdi-plan.md +73 -0
- package/core/commands/jdi-ship.md +146 -0
- package/core/commands/jdi-verify.md +159 -0
- package/core/skills/clean-code/SKILL.md +261 -0
- package/core/skills/dry/SKILL.md +150 -0
- package/core/skills/frontend-rules/SKILL.md +386 -0
- package/core/skills/frontend-validator/SKILL.md +567 -0
- package/core/skills/kiss/SKILL.md +178 -0
- package/core/skills/solid/SKILL.md +281 -0
- package/core/skills/yagni/SKILL.md +207 -0
- package/core/templates/agent.md +72 -0
- package/core/templates/doer-specialist.md +216 -0
- package/core/templates/reviewer-specialist.md +405 -0
- package/core/templates/skill.md +66 -0
- package/package.json +70 -0
- package/runtimes/antigravity/agents.md +74 -0
- package/runtimes/antigravity/skills/clean-code/SKILL.md +252 -0
- package/runtimes/antigravity/skills/dry/SKILL.md +141 -0
- package/runtimes/antigravity/skills/frontend-rules/SKILL.md +376 -0
- package/runtimes/antigravity/skills/frontend-validator/SKILL.md +559 -0
- package/runtimes/antigravity/skills/jdi-adopt/SKILL.md +155 -0
- package/runtimes/antigravity/skills/jdi-adopter/SKILL.md +436 -0
- package/runtimes/antigravity/skills/jdi-architect/SKILL.md +872 -0
- package/runtimes/antigravity/skills/jdi-asker/SKILL.md +125 -0
- package/runtimes/antigravity/skills/jdi-asker/references/context-template.md +34 -0
- package/runtimes/antigravity/skills/jdi-asker/references/decision-format.md +19 -0
- package/runtimes/antigravity/skills/jdi-asker/scripts/find_phase_dir.sh +25 -0
- package/runtimes/antigravity/skills/jdi-bootstrap/SKILL.md +81 -0
- package/runtimes/antigravity/skills/jdi-create/SKILL.md +80 -0
- package/runtimes/antigravity/skills/jdi-discuss/SKILL.md +80 -0
- package/runtimes/antigravity/skills/jdi-discuss/scripts/run_command.sh +62 -0
- package/runtimes/antigravity/skills/jdi-do/SKILL.md +200 -0
- package/runtimes/antigravity/skills/jdi-loop/SKILL.md +315 -0
- package/runtimes/antigravity/skills/jdi-new/SKILL.md +131 -0
- package/runtimes/antigravity/skills/jdi-plan/SKILL.md +73 -0
- package/runtimes/antigravity/skills/jdi-planner/SKILL.md +225 -0
- package/runtimes/antigravity/skills/jdi-researcher/SKILL.md +274 -0
- package/runtimes/antigravity/skills/jdi-ship/SKILL.md +146 -0
- package/runtimes/antigravity/skills/jdi-verify/SKILL.md +159 -0
- package/runtimes/antigravity/skills/kiss/SKILL.md +169 -0
- package/runtimes/antigravity/skills/solid/SKILL.md +272 -0
- package/runtimes/antigravity/skills/yagni/SKILL.md +198 -0
- package/runtimes/claude/CLAUDE.md +91 -0
- package/runtimes/claude/agents/jdi-adopter.md +430 -0
- package/runtimes/claude/agents/jdi-architect.md +864 -0
- package/runtimes/claude/agents/jdi-asker.md +119 -0
- package/runtimes/claude/agents/jdi-bootstrap.md +213 -0
- package/runtimes/claude/agents/jdi-planner.md +221 -0
- package/runtimes/claude/agents/jdi-researcher.md +269 -0
- package/runtimes/claude/commands/jdi-adopt.md +155 -0
- package/runtimes/claude/commands/jdi-bootstrap.md +81 -0
- package/runtimes/claude/commands/jdi-create.md +80 -0
- package/runtimes/claude/commands/jdi-discuss.md +80 -0
- package/runtimes/claude/commands/jdi-do.md +200 -0
- package/runtimes/claude/commands/jdi-loop.md +315 -0
- package/runtimes/claude/commands/jdi-new.md +131 -0
- package/runtimes/claude/commands/jdi-plan.md +73 -0
- package/runtimes/claude/commands/jdi-ship.md +146 -0
- package/runtimes/claude/commands/jdi-verify.md +159 -0
- package/runtimes/claude/settings.example.json +132 -0
- package/runtimes/claude/skills/clean-code/SKILL.md +247 -0
- package/runtimes/claude/skills/dry/SKILL.md +136 -0
- package/runtimes/claude/skills/frontend-rules/SKILL.md +369 -0
- package/runtimes/claude/skills/frontend-validator/SKILL.md +553 -0
- package/runtimes/claude/skills/kiss/SKILL.md +164 -0
- package/runtimes/claude/skills/solid/SKILL.md +267 -0
- package/runtimes/claude/skills/yagni/SKILL.md +193 -0
- package/runtimes/copilot/agents/jdi-adopter.agent.md +430 -0
- package/runtimes/copilot/agents/jdi-architect.agent.md +864 -0
- package/runtimes/copilot/agents/jdi-asker.agent.md +119 -0
- package/runtimes/copilot/agents/jdi-bootstrap.agent.md +213 -0
- package/runtimes/copilot/agents/jdi-planner.agent.md +221 -0
- package/runtimes/copilot/agents/jdi-researcher.agent.md +269 -0
- package/runtimes/copilot/copilot-instructions.md +80 -0
- package/runtimes/copilot/prompts/jdi-adopt.prompt.md +155 -0
- package/runtimes/copilot/prompts/jdi-bootstrap.prompt.md +81 -0
- package/runtimes/copilot/prompts/jdi-create.prompt.md +80 -0
- package/runtimes/copilot/prompts/jdi-discuss.prompt.md +80 -0
- package/runtimes/copilot/prompts/jdi-do.prompt.md +200 -0
- package/runtimes/copilot/prompts/jdi-loop.prompt.md +315 -0
- package/runtimes/copilot/prompts/jdi-new.prompt.md +131 -0
- package/runtimes/copilot/prompts/jdi-plan.prompt.md +73 -0
- package/runtimes/copilot/prompts/jdi-ship.prompt.md +146 -0
- package/runtimes/copilot/prompts/jdi-verify.prompt.md +159 -0
- package/runtimes/opencode/AGENTS.md +87 -0
- package/runtimes/opencode/agents/jdi-adopter.md +434 -0
- package/runtimes/opencode/agents/jdi-architect.md +861 -0
- package/runtimes/opencode/agents/jdi-asker.md +123 -0
- package/runtimes/opencode/agents/jdi-bootstrap.md +217 -0
- package/runtimes/opencode/agents/jdi-planner.md +225 -0
- package/runtimes/opencode/agents/jdi-researcher.md +273 -0
- package/runtimes/opencode/commands/jdi-adopt.md +155 -0
- package/runtimes/opencode/commands/jdi-bootstrap.md +81 -0
- package/runtimes/opencode/commands/jdi-create.md +80 -0
- package/runtimes/opencode/commands/jdi-discuss.md +80 -0
- package/runtimes/opencode/commands/jdi-do.md +200 -0
- package/runtimes/opencode/commands/jdi-loop.md +315 -0
- package/runtimes/opencode/commands/jdi-new.md +131 -0
- package/runtimes/opencode/commands/jdi-plan.md +73 -0
- package/runtimes/opencode/commands/jdi-ship.md +146 -0
- package/runtimes/opencode/commands/jdi-verify.md +159 -0
- package/runtimes/opencode/opencode.example.jsonc +169 -0
- package/runtimes/opencode/skills/clean-code/SKILL.md +247 -0
- package/runtimes/opencode/skills/dry/SKILL.md +136 -0
- package/runtimes/opencode/skills/frontend-rules/SKILL.md +369 -0
- package/runtimes/opencode/skills/frontend-validator/SKILL.md +553 -0
- package/runtimes/opencode/skills/kiss/SKILL.md +164 -0
- package/runtimes/opencode/skills/solid/SKILL.md +267 -0
- package/runtimes/opencode/skills/yagni/SKILL.md +193 -0
- package/templates-jdi-folder/config.json +18 -0
- package/templates-jdi-folder/registry.md +31 -0
- package/templates-jdi-folder/reviewers.md +33 -0
- package/templates-jdi-folder/skills-registry.md +32 -0
- package/templates-jdi-folder/specialists.md +39 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# JDI — Agents
|
|
2
|
+
|
|
3
|
+
5 agents core (shipped) + 2 specialists per-project (gerados).
|
|
4
|
+
|
|
5
|
+
## Core (em `core/agents/`)
|
|
6
|
+
|
|
7
|
+
### `jdi-researcher` (Opus)
|
|
8
|
+
|
|
9
|
+
**Funcao:** Discover do projeto antes do roadmap.
|
|
10
|
+
|
|
11
|
+
**Spawned por:** `/jdi-new`
|
|
12
|
+
|
|
13
|
+
**Filosofia:** 1 agent unico em vez de varios researchers paralelos. Mais barato, suficiente pra projetos pequenos/medios.
|
|
14
|
+
|
|
15
|
+
**Inputs:**
|
|
16
|
+
- Argumento livre: ideia do projeto
|
|
17
|
+
- Read em diretorio atual
|
|
18
|
+
|
|
19
|
+
**Outputs:**
|
|
20
|
+
- `.jdi/PROJECT.md` (visao + stack + code-design LOCKED)
|
|
21
|
+
- `.jdi/ROADMAP.md` (1 phase por feature MVP)
|
|
22
|
+
- `.jdi/STATE.md`
|
|
23
|
+
- `.jdi/DECISIONS.md` (com D-1)
|
|
24
|
+
- `.gitattributes` (normaliza line endings)
|
|
25
|
+
|
|
26
|
+
**Permissoes:** Read, Write, WebSearch (max 2 lookups via ctx7), AskUserQuestion.
|
|
27
|
+
|
|
28
|
+
### `jdi-bootstrap` (Sonnet)
|
|
29
|
+
|
|
30
|
+
**Funcao:** Wrapper que dispara `jdi-architect` em modo specialist pra gerar doer + reviewer per-project.
|
|
31
|
+
|
|
32
|
+
**Spawned por:** `/jdi-bootstrap`
|
|
33
|
+
|
|
34
|
+
**Inputs:**
|
|
35
|
+
- Read em `.jdi/PROJECT.md`
|
|
36
|
+
|
|
37
|
+
**Outputs:**
|
|
38
|
+
- `.jdi/agents/jdi-doer-{slug}.md`
|
|
39
|
+
- `.jdi/agents/jdi-reviewer-{slug}.md`
|
|
40
|
+
- `.jdi/specialists.md` + `.jdi/reviewers.md` (routing)
|
|
41
|
+
- `.jdi/registry.md` (R-1 audit trail)
|
|
42
|
+
- `.jdi/STATE.md` atualizado (`specialists_ready: true`)
|
|
43
|
+
|
|
44
|
+
**Permissoes:** Read, Write, Edit, Bash, AskUserQuestion, Agent (spawn architect).
|
|
45
|
+
|
|
46
|
+
### `jdi-asker` (Sonnet)
|
|
47
|
+
|
|
48
|
+
**Funcao:** Loop adaptativo de perguntas pra capturar decisoes locked.
|
|
49
|
+
|
|
50
|
+
**Spawned por:** `/jdi-discuss <N>`
|
|
51
|
+
|
|
52
|
+
**Inputs:**
|
|
53
|
+
- `phase_number`
|
|
54
|
+
- Read em PROJECT.md, ROADMAP.md, DECISIONS.md, ate 2 CONTEXT.md anteriores
|
|
55
|
+
|
|
56
|
+
**Outputs:**
|
|
57
|
+
- `.jdi/phases/{NN-slug}/CONTEXT.md`
|
|
58
|
+
- `.jdi/DECISIONS.md` (append D-XX)
|
|
59
|
+
- `.jdi/todos.md` (se scope creep)
|
|
60
|
+
|
|
61
|
+
**Regras:**
|
|
62
|
+
- Max 5 perguntas por sessao
|
|
63
|
+
- Max 5 D-XX por sessao
|
|
64
|
+
- Identifica gray areas especificas (nao categorias genericas)
|
|
65
|
+
- Para quando user diz "chega" / "go" / 5 perguntas
|
|
66
|
+
|
|
67
|
+
**Permissoes:** Read, Write, AskUserQuestion.
|
|
68
|
+
|
|
69
|
+
### `jdi-planner` (Opus)
|
|
70
|
+
|
|
71
|
+
**Funcao:** Decompoe phase em tasks com waves de paralelismo.
|
|
72
|
+
|
|
73
|
+
**Spawned por:** `/jdi-plan <N>`
|
|
74
|
+
|
|
75
|
+
**Inputs:**
|
|
76
|
+
- `phase_number`
|
|
77
|
+
- Read em PROJECT.md, ROADMAP.md, DECISIONS.md, CONTEXT.md, doer specialist
|
|
78
|
+
- Read no codigo existente (mapeamento de files_modified)
|
|
79
|
+
|
|
80
|
+
**Outputs:**
|
|
81
|
+
- `.jdi/phases/{NN-slug}/PLAN.md`
|
|
82
|
+
|
|
83
|
+
**Regras:**
|
|
84
|
+
- Max 8 tasks por phase (split se passar)
|
|
85
|
+
- Cada task tem: `files_modified`, `acceptance` mensuravel, `dependencies`, `test`
|
|
86
|
+
- Wave grouping: paralelo dentro, sequencial entre
|
|
87
|
+
- Files_modified disjoint dentro da mesma wave (overlap = sequencial automatico)
|
|
88
|
+
- Self-check antes de salvar (checklist 5 itens)
|
|
89
|
+
|
|
90
|
+
**Permissoes:** Read, Write, AskUserQuestion (so se ambiguo).
|
|
91
|
+
|
|
92
|
+
### `jdi-architect` (Opus)
|
|
93
|
+
|
|
94
|
+
**Funcao:** Meta-agent. 2 modos.
|
|
95
|
+
|
|
96
|
+
**Modo `create` (spawned por `/jdi-create`):**
|
|
97
|
+
- Cria agent ou skill GENERICO em `core/agents/` ou `core/skills/`
|
|
98
|
+
- 8 perguntas pra classificar (agent / skill / composite)
|
|
99
|
+
- Validacao com user (approve / edit / cancel)
|
|
100
|
+
- Build + install pro runtime
|
|
101
|
+
|
|
102
|
+
**Modo `specialist` (spawned por `/jdi-bootstrap`):**
|
|
103
|
+
- Cria doer + reviewer PER-PROJECT em `.jdi/agents/`
|
|
104
|
+
- 6 perguntas focadas (test framework, build/test commands, coverage min, lint, conventions)
|
|
105
|
+
- Substitui placeholders nos templates `core/templates/{doer,reviewer}-specialist.md`
|
|
106
|
+
- Mapeia bash<->PowerShell pros gates do reviewer
|
|
107
|
+
|
|
108
|
+
**Inputs:**
|
|
109
|
+
- Modo `create`: argumento livre opcional
|
|
110
|
+
- Modo `specialist`: `.jdi/PROJECT.md` obrigatorio
|
|
111
|
+
- Read em todos os files de routing
|
|
112
|
+
|
|
113
|
+
**Outputs:**
|
|
114
|
+
- Modo `create`: `core/agents/jdi-{nome}.md` ou `core/skills/{nome}/`
|
|
115
|
+
- Modo `specialist`: `.jdi/agents/jdi-{doer,reviewer}-{slug}.md`
|
|
116
|
+
- Em ambos: update de routing + audit em `.jdi/registry.md`
|
|
117
|
+
|
|
118
|
+
**Permissoes:** Read, Write, Edit, Bash, AskUserQuestion.
|
|
119
|
+
|
|
120
|
+
## Per-project (em `.jdi/agents/`)
|
|
121
|
+
|
|
122
|
+
### `jdi-doer-{slug}` (Sonnet)
|
|
123
|
+
|
|
124
|
+
**Funcao:** Executor que JA SABE stack/code-design/conventions do projeto.
|
|
125
|
+
|
|
126
|
+
**Spawned por:** `/jdi-do <N>`
|
|
127
|
+
|
|
128
|
+
**Filosofia:** 1 specialist focado que ja sabe a stack, em vez de executor + code-fixer + doc-writer separados.
|
|
129
|
+
|
|
130
|
+
**Inputs:**
|
|
131
|
+
- `phase_number`
|
|
132
|
+
- Read em PROJECT.md, DECISIONS.md, CONTEXT.md, PLAN.md
|
|
133
|
+
- Write nos paths em `files_modified` do PLAN
|
|
134
|
+
|
|
135
|
+
**Outputs:**
|
|
136
|
+
- Codigo modificado, commitado atomicamente
|
|
137
|
+
- `.jdi/phases/{NN}/PLAN.md` atualizado (status das tasks)
|
|
138
|
+
- `.jdi/phases/{NN}/SUMMARY.md` final
|
|
139
|
+
|
|
140
|
+
**Regras:**
|
|
141
|
+
- Sem `--no-verify` em commits (hooks rodam)
|
|
142
|
+
- Sem skip de testes — task so completa se test passou
|
|
143
|
+
- Atomic commit por task
|
|
144
|
+
- Conventional Commits, scope = phase slug
|
|
145
|
+
- Max 3 tentativas de correcao por task antes de marcar `blocked`
|
|
146
|
+
|
|
147
|
+
**Permissoes:** Read, Write, Edit, Bash. Sem Web (deve ja saber stack).
|
|
148
|
+
|
|
149
|
+
### `jdi-reviewer-{slug}` (Sonnet)
|
|
150
|
+
|
|
151
|
+
**Funcao:** Roda gates de qualidade definidos pra stack.
|
|
152
|
+
|
|
153
|
+
**Spawned por:** `/jdi-verify <N>`
|
|
154
|
+
|
|
155
|
+
**Filosofia:** 1 reviewer focado por stack, em vez de code-reviewer + security-auditor + integration-checker + verifier separados.
|
|
156
|
+
|
|
157
|
+
**Inputs:**
|
|
158
|
+
- `phase_number`
|
|
159
|
+
- Read em PROJECT.md, PLAN.md, SUMMARY.md, codigo modificado
|
|
160
|
+
|
|
161
|
+
**Outputs:**
|
|
162
|
+
- `.jdi/phases/{NN}/REVIEW.md` com veredicto
|
|
163
|
+
|
|
164
|
+
**Gates:**
|
|
165
|
+
1. Build
|
|
166
|
+
2. Tests
|
|
167
|
+
3. Coverage (>= threshold do PROJECT.md, default 80%)
|
|
168
|
+
4. Lint/Format
|
|
169
|
+
5. Security/Perf rules da stack (sem secrets, sem TODO sem issue, sem localStorage tokens, etc)
|
|
170
|
+
6. Plan consistency (commits batem com files_modified)
|
|
171
|
+
|
|
172
|
+
**Veredictos:**
|
|
173
|
+
- APPROVED — todos PASS
|
|
174
|
+
- APPROVED_WITH_WARNINGS — sem blockers, com warns
|
|
175
|
+
- BLOCKED — gate 1-3 falhou OU gate 5 critical
|
|
176
|
+
|
|
177
|
+
**Permissoes:** Read-only por design. Read + Bash (so pra rodar comandos de gate). **Sem Write, sem Edit.**
|
|
178
|
+
|
|
179
|
+
## Resumo visual
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
core/agents/ <- 5 agents shipped
|
|
183
|
+
jdi-researcher Opus pre-roadmap discovery
|
|
184
|
+
jdi-bootstrap Sonnet wrapper -> spawn architect specialist
|
|
185
|
+
jdi-asker Sonnet loop perguntas
|
|
186
|
+
jdi-planner Opus decompose phase
|
|
187
|
+
jdi-architect Opus meta (2 modos)
|
|
188
|
+
|
|
189
|
+
.jdi/agents/ <- per-project, gerados pelo /jdi-bootstrap
|
|
190
|
+
jdi-doer-{slug} Sonnet executor especialista
|
|
191
|
+
jdi-reviewer-{slug} Sonnet reviewer especialista (read-only)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Modelos por runtime
|
|
195
|
+
|
|
196
|
+
Cada agent declara `runtime_overrides:` no frontmatter. Build script gera frontmatter especifico:
|
|
197
|
+
|
|
198
|
+
| Runtime | Field | Exemplo (researcher) |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| Claude Code | `model:` | `opus` |
|
|
201
|
+
| GitHub Copilot | `model:` | `gpt-5` |
|
|
202
|
+
| Antigravity | `triggers:` | discovery automatica via prefixo `jdi-` |
|
|
203
|
+
| OpenCode | `mode:`, `model:`, `temperature:`, `permission:` | `subagent`, `anthropic/claude-sonnet-4-20250514`, `0.2`, edit/bash/write rules |
|
|
204
|
+
|
|
205
|
+
## Estendendo
|
|
206
|
+
|
|
207
|
+
Pra criar agent novo no core: rode `/jdi-create` dentro do repo JDI. Architect modo create faz tudo.
|
|
208
|
+
|
|
209
|
+
Pra criar specialists per-project diferentes (ex: multi-stack): atualmente `/jdi-bootstrap` cria 1 doer agregado. Multi-doer eh feature pendente — workaround: edita `.jdi/agents/` manual ou rode bootstrap multiplas vezes com slugs diferentes.
|
package/ARCHITECTURE.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# JDI — Architecture
|
|
2
|
+
|
|
3
|
+
## Principios
|
|
4
|
+
|
|
5
|
+
1. **Fresh context per agent** — cada spawn tem janela limpa. Anti context-rot
|
|
6
|
+
2. **Thin orchestrator** — comando carrega contexto, spawn agente, roteia. Nada mais
|
|
7
|
+
3. **File-based state** — `.jdi/` em md/json. Sem DB, sem servidor
|
|
8
|
+
4. **Decisao locked = imutavel** — D-XX nunca volta
|
|
9
|
+
5. **1 task = 1 commit atomico**
|
|
10
|
+
6. **Plano e prompt** — PLAN.md ja eh o input do executor
|
|
11
|
+
7. **Per-project specialists** — doer/reviewer customizados por projeto, nao genericos
|
|
12
|
+
8. **Wave-based parallelism** — paralelo dentro da wave, sequencial entre waves
|
|
13
|
+
9. **Security > Perf > Best Practices** — ordem fixa quando conflita
|
|
14
|
+
|
|
15
|
+
## Estrutura em camadas
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
core/ <- shipped, generators (lives in JDI repo)
|
|
19
|
+
agents/ <- 5 agents core
|
|
20
|
+
jdi-researcher.md
|
|
21
|
+
jdi-bootstrap.md
|
|
22
|
+
jdi-asker.md
|
|
23
|
+
jdi-planner.md
|
|
24
|
+
jdi-architect.md
|
|
25
|
+
commands/ <- 8 commands
|
|
26
|
+
jdi-new.md, jdi-bootstrap.md, jdi-discuss.md, jdi-plan.md,
|
|
27
|
+
jdi-do.md, jdi-verify.md, jdi-ship.md, jdi-create.md
|
|
28
|
+
templates/
|
|
29
|
+
agent.md, skill.md
|
|
30
|
+
doer-specialist.md <- usado pelo architect modo specialist
|
|
31
|
+
reviewer-specialist.md <- idem
|
|
32
|
+
|
|
33
|
+
.jdi/ <- per-project state (gerado por /jdi-new)
|
|
34
|
+
PROJECT.md, ROADMAP.md, DECISIONS.md, STATE.md
|
|
35
|
+
specialists.md, reviewers.md, registry.md
|
|
36
|
+
agents/ <- per-project specialists (gerado por /jdi-bootstrap)
|
|
37
|
+
jdi-doer-{slug}.md
|
|
38
|
+
jdi-reviewer-{slug}.md
|
|
39
|
+
phases/{NN-slug}/
|
|
40
|
+
CONTEXT.md, PLAN.md, SUMMARY.md, REVIEW.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Ciclo de vida
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
/jdi-new "<descricao>" -> PROJECT.md + ROADMAP.md + STATE.md + DECISIONS.md
|
|
47
|
+
/jdi-bootstrap -> .jdi/agents/jdi-doer-{slug} + jdi-reviewer-{slug}
|
|
48
|
+
/jdi-discuss N -> phases/NN/CONTEXT.md
|
|
49
|
+
/jdi-plan N -> phases/NN/PLAN.md (tasks + waves)
|
|
50
|
+
/jdi-do N -> commits atomicos + phases/NN/SUMMARY.md
|
|
51
|
+
/jdi-verify N -> phases/NN/REVIEW.md (gates)
|
|
52
|
+
/jdi-ship N -> ROADMAP advance + tag (opcional) + STATE atualizado
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Gates entre etapas:
|
|
56
|
+
|
|
57
|
+
| De | Para | Gate |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| /jdi-new | /jdi-bootstrap | PROJECT.md + ROADMAP.md exist |
|
|
60
|
+
| /jdi-bootstrap | /jdi-discuss | .jdi/agents/jdi-doer-* + jdi-reviewer-* exist |
|
|
61
|
+
| /jdi-discuss | /jdi-plan | CONTEXT.md exist + decisoes locked claras |
|
|
62
|
+
| /jdi-plan | /jdi-do | PLAN.md valido (tasks + acceptance + files_modified) |
|
|
63
|
+
| /jdi-do | /jdi-verify | SUMMARY.md exist (todas tasks concluidas ou marcadas blocked) |
|
|
64
|
+
| /jdi-verify | /jdi-ship | REVIEW.md verdict != BLOCKED |
|
|
65
|
+
|
|
66
|
+
## Permissoes (least privilege)
|
|
67
|
+
|
|
68
|
+
| Agente | Read | Write | Edit | Bash | Web |
|
|
69
|
+
|---|:---:|:---:|:---:|:---:|:---:|
|
|
70
|
+
| jdi-researcher | x | x | - | - | x |
|
|
71
|
+
| jdi-bootstrap | x | x | x | x | - |
|
|
72
|
+
| jdi-asker | x | x | - | - | - |
|
|
73
|
+
| jdi-planner | x | x | - | - | - |
|
|
74
|
+
| jdi-architect | x | x | x | x | - |
|
|
75
|
+
| jdi-doer-{slug} | x | x | x | x | - |
|
|
76
|
+
| jdi-reviewer-{slug} | x | - | - | x | - |
|
|
77
|
+
|
|
78
|
+
Reviewer eh **read-only** por design. So roda gates, nao corrige.
|
|
79
|
+
|
|
80
|
+
## Agents core x specialists per-project
|
|
81
|
+
|
|
82
|
+
**Core (shipped, em `core/agents/`):**
|
|
83
|
+
- `jdi-researcher` — discover do projeto, gera PROJECT.md + ROADMAP.md
|
|
84
|
+
- `jdi-bootstrap` — wrapper que dispara architect modo specialist
|
|
85
|
+
- `jdi-asker` — loop adaptativo de perguntas (CONTEXT.md)
|
|
86
|
+
- `jdi-planner` — decompoe phase em tasks + waves
|
|
87
|
+
- `jdi-architect` — meta. 2 modos: `create` (agents/skills no core/) ou `specialist` (doer/reviewer per-project)
|
|
88
|
+
|
|
89
|
+
**Per-project (gerados, em `.jdi/agents/`):**
|
|
90
|
+
- `jdi-doer-{slug}` — executor que JA SABE stack/conventions/code-design. Sem descoberta
|
|
91
|
+
- `jdi-reviewer-{slug}` — gates customizados pra stack (build/test/coverage/lint/security)
|
|
92
|
+
|
|
93
|
+
Specialist routing via `.jdi/specialists.md` e `.jdi/reviewers.md`.
|
|
94
|
+
|
|
95
|
+
## Wave-based parallelism
|
|
96
|
+
|
|
97
|
+
`/jdi-do N`:
|
|
98
|
+
1. Le PLAN.md, agrupa tasks em waves (wave M = tasks que so dependem de wave M-1)
|
|
99
|
+
2. Pra cada wave:
|
|
100
|
+
- Intra-wave overlap check (files_modified disjoint?)
|
|
101
|
+
- Se 2+ tasks paralelas E sem overlap E nao `--sequential`:
|
|
102
|
+
- Sequential dispatch — UM `Agent()` por message com `run_in_background: true`
|
|
103
|
+
- Aguarda wave inteira terminar antes da proxima
|
|
104
|
+
- Senao: executa sequencial, 1 doer por task
|
|
105
|
+
3. Apos todas waves: doer escreve SUMMARY.md final
|
|
106
|
+
|
|
107
|
+
Sequential dispatch evita race em `.git/config.lock` (problema bem documentado em git worktree).
|
|
108
|
+
|
|
109
|
+
## Loop de perguntas (jdi-asker)
|
|
110
|
+
|
|
111
|
+
Adaptativo. Regras:
|
|
112
|
+
|
|
113
|
+
1. Le PROJECT.md, ROADMAP.md, DECISIONS.md
|
|
114
|
+
2. Le ate 2 CONTEXT.md anteriores (max)
|
|
115
|
+
3. Identifica 3-5 gray areas especificas da phase (nao categorias genericas)
|
|
116
|
+
4. Pergunta uma por vez via AskUserQuestion
|
|
117
|
+
5. Cada resposta vira D-XX em DECISIONS.md
|
|
118
|
+
6. Para quando user diz "chega" / "go" / 5 perguntas atingidas
|
|
119
|
+
7. Escreve CONTEXT.md com decisoes + canonical_refs
|
|
120
|
+
|
|
121
|
+
## Loop de execucao (jdi-doer-{slug})
|
|
122
|
+
|
|
123
|
+
Por task no PLAN.md:
|
|
124
|
+
|
|
125
|
+
1. Le task (files_modified, acceptance, dependencies, test)
|
|
126
|
+
2. Implementa codigo
|
|
127
|
+
3. Roda test command (`{TEST_COMMAND}` definido no specialist)
|
|
128
|
+
4. Se falha -> tenta corrigir 1 vez. Falha de novo -> marca `blocked`, segue
|
|
129
|
+
5. Commit atomico: `feat({phase-slug}): {task summary}` (Conventional Commits)
|
|
130
|
+
6. Append linha em SUMMARY.md
|
|
131
|
+
7. Proxima task
|
|
132
|
+
|
|
133
|
+
## Review pos-execucao (jdi-reviewer-{slug})
|
|
134
|
+
|
|
135
|
+
`/jdi-verify N` dispara reviewer. 6 gates:
|
|
136
|
+
1. Build
|
|
137
|
+
2. Tests
|
|
138
|
+
3. Coverage (>= threshold do PROJECT.md, default 80%)
|
|
139
|
+
4. Lint/Format
|
|
140
|
+
5. Security/Perf rules da stack
|
|
141
|
+
6. Plan consistency (commits batem com files_modified)
|
|
142
|
+
|
|
143
|
+
Veredicto: APPROVED / APPROVED_WITH_WARNINGS / BLOCKED. BLOCKED bloqueia /jdi-ship.
|
|
144
|
+
|
|
145
|
+
## Read-depth scaling (token budget)
|
|
146
|
+
|
|
147
|
+
Regra dura: **read-depth escala com distancia da phase atual**. Orchestrator e agentes nao leem corpo de phase qualquer — leem o necessario.
|
|
148
|
+
|
|
149
|
+
| Distancia | Arquivo | Read permitido |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| `current_phase` | CONTEXT, PLAN, SUMMARY, REVIEW da phase | Corpo inteiro (ate budget de `config.json`) |
|
|
152
|
+
| `current_phase - 1` | SUMMARY.md, REVIEW.md anterior | **Frontmatter + veredict apenas**. Nunca corpo. |
|
|
153
|
+
| `<= current_phase - 2` | Phases antigas | **Nao ler.** Existencia via `ls`. Metadados via `head -10`. |
|
|
154
|
+
|
|
155
|
+
**Excecoes documentadas:**
|
|
156
|
+
- `/jdi-verify N` pode ler `PLAN.md` de phase `N-1` se task atual referencia `D-XX` daquela phase (rastreabilidade)
|
|
157
|
+
- `/jdi-discuss N` (asker) le ate **2 CONTEXT.md anteriores** (regra ja vigente em `core/agents/jdi-asker.md`)
|
|
158
|
+
- `jdi-researcher` le PROJECT/ROADMAP inteiros — sao curtos por design (PROJECT cap 80 linhas, ROADMAP eh sumario)
|
|
159
|
+
|
|
160
|
+
**Por que:**
|
|
161
|
+
- Phase 8 nao precisa de corpo de SUMMARY phase 1. Frontmatter ja contem `status` + `verdict`.
|
|
162
|
+
- Context rot: pesquisa Anthropic/Chroma 2025 confirma — recall degrada com tokens, mesmo dentro do limite.
|
|
163
|
+
- Cache hit aumenta: arquivos imutaveis (PROJECT, DECISIONS) viram prefix estavel.
|
|
164
|
+
|
|
165
|
+
**Como aplicar (orchestrator):**
|
|
166
|
+
- Antes de `Read` em arquivo de phase anterior: cheque distancia via STATE.md
|
|
167
|
+
- Use `head -20` no lugar de `cat` quando so quer frontmatter
|
|
168
|
+
- Phases archived (`.jdi/archive/`): tratar como phase `<= current - 2`. Nao ler corpo.
|
|
169
|
+
- Pra arquivos grandes na phase atual, use `bin/lib/jdi-truncate.{sh,ps1}` antes de inline em prompt:
|
|
170
|
+
```bash
|
|
171
|
+
bash bin/lib/jdi-truncate.sh .jdi/phases/01-x/PLAN.md 12000 # cap em chars
|
|
172
|
+
```
|
|
173
|
+
Helper preserva frontmatter, headings, 1a linha de cada secao. Resto vira pointer.
|
|
174
|
+
|
|
175
|
+
## Memoria
|
|
176
|
+
|
|
177
|
+
| Arquivo | Lifespan | Conteudo |
|
|
178
|
+
|---|---|---|
|
|
179
|
+
| `PROJECT.md` | Vida do projeto | Visao, stack, code-design locked |
|
|
180
|
+
| `ROADMAP.md` | Vida do projeto | Phases + status |
|
|
181
|
+
| `DECISIONS.md` | Append-only | D-XX (decisoes locked) |
|
|
182
|
+
| `STATE.md` | Sobrescreve | current_phase + next_step |
|
|
183
|
+
| `specialists.md`, `reviewers.md` | Append-only | Routing per-project |
|
|
184
|
+
| `registry.md` | Append-only | Audit trail dos specialists/agents criados |
|
|
185
|
+
| `phases/{NN}/CONTEXT.md` | Vida da phase | Output do asker |
|
|
186
|
+
| `phases/{NN}/PLAN.md` | Vida da phase | Output do planner |
|
|
187
|
+
| `phases/{NN}/SUMMARY.md` | Vida da phase | Output do doer |
|
|
188
|
+
| `phases/{NN}/REVIEW.md` | Vida da phase | Output do reviewer |
|
|
189
|
+
|
|
190
|
+
Decisoes locked em DECISIONS.md, audit trail em registry.md.
|
|
191
|
+
|
|
192
|
+
## Hooks
|
|
193
|
+
|
|
194
|
+
`.githooks/pre-commit` e `post-commit` shipped como **no-op por padrao**. Doer/reviewer cobrem responsabilidades de docs/qualidade dentro do flow normal.
|
|
195
|
+
|
|
196
|
+
User pode customizar `.githooks/` pra:
|
|
197
|
+
- Lint rapido pre-commit
|
|
198
|
+
- Notificacao Slack pos-commit
|
|
199
|
+
- Etc.
|
|
200
|
+
|
|
201
|
+
## Codigo nao spec-driven 100%
|
|
202
|
+
|
|
203
|
+
JDI nao eh Spec-Driven Development puro. Spec ortodoxo exige spec antes de codigo, rastreabilidade ate teste, assinatura de stakeholders.
|
|
204
|
+
|
|
205
|
+
JDI faz:
|
|
206
|
+
- CONTEXT.md = spec lite. Decisao locked, nada mais
|
|
207
|
+
- PLAN.md = task list com acceptance. Rastreabilidade via D-XX
|
|
208
|
+
- Nada de stakeholder. So user
|
|
209
|
+
|
|
210
|
+
Quando user precisa de spec formal -> usa ferramenta dedicada de governanca. JDI eh dev workflow, nao governanca.
|
package/COMMANDS.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# JDI — Commands
|
|
2
|
+
|
|
3
|
+
9 comandos. 7 no loop principal + 1 ralph mode + 1 meta (`/jdi-create`).
|
|
4
|
+
|
|
5
|
+
## Loop principal
|
|
6
|
+
|
|
7
|
+
### `/jdi-new "<descricao>"`
|
|
8
|
+
|
|
9
|
+
**Entry point.** Cria projeto JDI do zero.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/jdi-new "TODO app .NET 10 + React 19"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Faz:
|
|
16
|
+
1. Validacao: `.jdi/` nao existe (ou `--reset`)
|
|
17
|
+
2. Spawn `jdi-researcher`:
|
|
18
|
+
- 4 perguntas chave (visao, stack, code-design, MVP features)
|
|
19
|
+
- Research focado opcional via ctx7 (max 2 lookups)
|
|
20
|
+
- Gera `PROJECT.md` (visao + stack + code-design LOCKED)
|
|
21
|
+
- Gera `ROADMAP.md` (1 phase por feature do MVP)
|
|
22
|
+
- Gera `STATE.md` + `DECISIONS.md` (D-1: code design)
|
|
23
|
+
- Cria `.gitattributes` (normaliza CRLF)
|
|
24
|
+
3. Commit inicial: `chore(jdi): initialize <project_name>`
|
|
25
|
+
|
|
26
|
+
**Proximo:** `/jdi-bootstrap`
|
|
27
|
+
|
|
28
|
+
### `/jdi-bootstrap`
|
|
29
|
+
|
|
30
|
+
Cria specialists per-project (doer + reviewer).
|
|
31
|
+
|
|
32
|
+
Faz:
|
|
33
|
+
1. Le `.jdi/PROJECT.md`
|
|
34
|
+
2. Spawn `jdi-architect` em modo `specialist`:
|
|
35
|
+
- 6 perguntas focadas (test framework, build/test commands, coverage min, lint, conventions)
|
|
36
|
+
- Gera `.jdi/agents/jdi-doer-{slug}.md` (de `core/templates/doer-specialist.md`)
|
|
37
|
+
- Gera `.jdi/agents/jdi-reviewer-{slug}.md` (de `core/templates/reviewer-specialist.md`)
|
|
38
|
+
- Atualiza `.jdi/specialists.md` + `.jdi/reviewers.md` + `.jdi/registry.md`
|
|
39
|
+
3. Commit: `chore(jdi): bootstrap specialists for <project_name>`
|
|
40
|
+
4. Atualiza STATE.md: `specialists_ready: true`
|
|
41
|
+
|
|
42
|
+
**Proximo:** `/jdi-discuss 1`
|
|
43
|
+
|
|
44
|
+
### `/jdi-discuss <N> [--auto]`
|
|
45
|
+
|
|
46
|
+
Captura decisoes locked da phase.
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
/jdi-discuss 2
|
|
50
|
+
/jdi-discuss 1 --auto # asker decide tudo, sem perguntar
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Faz:
|
|
54
|
+
1. Validacao: phase existe em ROADMAP.md
|
|
55
|
+
2. Spawn `jdi-asker`:
|
|
56
|
+
- Identifica 3-5 gray areas especificas da phase
|
|
57
|
+
- Pergunta uma por vez (max 5 D-XX por sessao)
|
|
58
|
+
- Captura cada resposta como D-XX em DECISIONS.md
|
|
59
|
+
- Scope creep -> `.jdi/todos.md`
|
|
60
|
+
- Escreve `.jdi/phases/{NN-slug}/CONTEXT.md`
|
|
61
|
+
3. Commit: `docs({NN-slug}): capture phase context`
|
|
62
|
+
|
|
63
|
+
**Proximo:** `/jdi-plan N`
|
|
64
|
+
|
|
65
|
+
### `/jdi-plan <N> [--review]`
|
|
66
|
+
|
|
67
|
+
Decompoe phase em tasks executaveis.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
/jdi-plan 2
|
|
71
|
+
/jdi-plan 2 --review # mostra preview, pede approve
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Faz:
|
|
75
|
+
1. Validacao: CONTEXT.md existe
|
|
76
|
+
2. Spawn `jdi-planner`:
|
|
77
|
+
- Le PROJECT.md + ROADMAP.md + DECISIONS.md + CONTEXT.md
|
|
78
|
+
- Decompoe em tasks (max 8) com `files_modified` + `acceptance` + `dependencies` + `test`
|
|
79
|
+
- Agrupa em waves (paralelo dentro, sequencial entre)
|
|
80
|
+
- Self-check (toda task tem files_modified? wave grouping respeita deps?)
|
|
81
|
+
- Escreve `.jdi/phases/{NN-slug}/PLAN.md`
|
|
82
|
+
3. Commit: `docs({NN-slug}): generate plan ({M} tasks, {W} waves)`
|
|
83
|
+
|
|
84
|
+
**Proximo:** `/jdi-do N`
|
|
85
|
+
|
|
86
|
+
### `/jdi-do <N> [--sequential]`
|
|
87
|
+
|
|
88
|
+
Executa tasks da phase via doer specialist do projeto.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
/jdi-do 2
|
|
92
|
+
/jdi-do 2 --sequential # forca sequencial, mesmo se waves permitem paralelo
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Faz:
|
|
96
|
+
1. Validacao: PLAN.md existe + doer registrado em `.jdi/specialists.md`
|
|
97
|
+
2. Resolve doer specialist (`jdi-doer-{slug}`)
|
|
98
|
+
3. Le PLAN.md, identifica tasks pendentes, agrupa waves
|
|
99
|
+
4. Pra cada wave:
|
|
100
|
+
- Intra-wave overlap check (files_modified disjoint?)
|
|
101
|
+
- Se paralelo: sequential dispatch (1 Agent por message com `run_in_background:true`)
|
|
102
|
+
- Se sequencial: 1 doer por task em sequencia
|
|
103
|
+
5. Doer atualiza status no PLAN.md, commita atomico, escreve SUMMARY.md final
|
|
104
|
+
6. Commit final do orchestrator: `chore(state): phase {N} executed`
|
|
105
|
+
|
|
106
|
+
**Proximo:** `/jdi-verify N`
|
|
107
|
+
|
|
108
|
+
### `/jdi-verify <N>`
|
|
109
|
+
|
|
110
|
+
Roda gates de qualidade via reviewer specialist.
|
|
111
|
+
|
|
112
|
+
Faz:
|
|
113
|
+
1. Validacao: SUMMARY.md existe + reviewer registrado em `.jdi/reviewers.md`
|
|
114
|
+
2. Resolve reviewer specialist (`jdi-reviewer-{slug}`)
|
|
115
|
+
3. Spawn reviewer:
|
|
116
|
+
- Gate 1: Build
|
|
117
|
+
- Gate 2: Tests
|
|
118
|
+
- Gate 3: Coverage (>= threshold)
|
|
119
|
+
- Gate 4: Lint/Format
|
|
120
|
+
- Gate 5: Security/Perf rules da stack
|
|
121
|
+
- Gate 6: Plan consistency (commits batem com files_modified)
|
|
122
|
+
4. Reviewer escreve `.jdi/phases/{NN-slug}/REVIEW.md` com veredicto:
|
|
123
|
+
- APPROVED — todos gates PASS
|
|
124
|
+
- APPROVED_WITH_WARNINGS — sem blockers, alguns warns
|
|
125
|
+
- BLOCKED — gate 1-3 falhou OU gate 5 critical
|
|
126
|
+
5. Commit: `docs({NN-slug}): verify phase ({VERDICT})`
|
|
127
|
+
|
|
128
|
+
**Proximo:** `/jdi-ship N` (se nao BLOCKED) — ou `/jdi-loop N` se quiser auto-fix loop
|
|
129
|
+
|
|
130
|
+
### `/jdi-loop <N> [--max-iter=5] [--max-resets=3]`
|
|
131
|
+
|
|
132
|
+
**Ralph loop mode.** Roda `/jdi-do` -> `/jdi-verify` em ciclo automatico ate veredicto APPROVED. Sem acao humana entre iter. Cap absoluto: 5 iter por round x 3 resets = 15 iter.
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
/jdi-loop 2
|
|
136
|
+
/jdi-loop 2 --max-iter=3 --max-resets=2 # cap mais conservador
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Faz:
|
|
140
|
+
1. Validacao: PLAN.md + doer + reviewer registrados
|
|
141
|
+
2. Inicializa `.jdi/phases/{NN-slug}/LOOP.md` (ou retoma se existe)
|
|
142
|
+
3. Loop:
|
|
143
|
+
- Spawn doer (com last REVIEW.md findings + LOOP history como contexto)
|
|
144
|
+
- Spawn reviewer (read-only, escreve REVIEW.md)
|
|
145
|
+
- Hash dos blockers/warnings -> append em LOOP.md history
|
|
146
|
+
- Se veredicto APPROVED ou APPROVED_WITH_WARNINGS -> converged, exit
|
|
147
|
+
- Se finding hash igual ao iter anterior -> oscillation detected, AskUserQuestion
|
|
148
|
+
- Se iter >= max_iter -> AskUserQuestion (continuar/abortar/ajustar)
|
|
149
|
+
4. Human gate options:
|
|
150
|
+
- `Continuar` -> reset counter, novo round (total_resets++)
|
|
151
|
+
- `Abortar` -> status=escalated, exit limpo
|
|
152
|
+
- `Ajustar plano` -> status=paused, exit, user edita PLAN/CONTEXT, re-roda /jdi-loop
|
|
153
|
+
5. Hard cap: total_resets >= max_resets -> status=killed, kill switch absoluto
|
|
154
|
+
6. Cada iter = doer commit atomico + reviewer commit (audit trail granular em git)
|
|
155
|
+
|
|
156
|
+
**Generator/Judge separation:** doer escreve, reviewer le (read-only). Invariante Ralph.
|
|
157
|
+
|
|
158
|
+
**Quando usar:**
|
|
159
|
+
- Phase com tests automaticos confiaveis
|
|
160
|
+
- Tasks mecanicas (refactor, test coverage, batch fixes)
|
|
161
|
+
- Quer "fire and forget" com cap controlado
|
|
162
|
+
|
|
163
|
+
**Quando NAO usar:**
|
|
164
|
+
- Tasks que precisam decisao arquitetural humana
|
|
165
|
+
- Phase com gates subjetivos
|
|
166
|
+
- Specs vagas (vai oscilar)
|
|
167
|
+
|
|
168
|
+
**Proximo:** `/jdi-ship N` (se converged) ou revisao humana (se killed/escalated/paused)
|
|
169
|
+
|
|
170
|
+
### `/jdi-ship <N>`
|
|
171
|
+
|
|
172
|
+
Finaliza phase, avanca pra proxima.
|
|
173
|
+
|
|
174
|
+
Faz:
|
|
175
|
+
1. Validacao: REVIEW.md existe + veredicto != BLOCKED
|
|
176
|
+
2. Se WITH_WARNINGS: pergunta "ship mesmo assim?"
|
|
177
|
+
3. Atualiza ROADMAP.md (phase {N}: status `done`, phase {N+1}: status `ready`)
|
|
178
|
+
4. Atualiza STATE.md (current_phase: {N+1})
|
|
179
|
+
5. Commit: `feat({NN-slug}): ship phase {N} ({VERDICT})`
|
|
180
|
+
6. Tag opcional: `phase-{N}-{slug}` (se PROJECT.md tem `tag_phases: true`)
|
|
181
|
+
|
|
182
|
+
**Proximo:** `/jdi-discuss <N+1>` (ou done)
|
|
183
|
+
|
|
184
|
+
## Comando meta
|
|
185
|
+
|
|
186
|
+
### `/jdi-create [descricao]`
|
|
187
|
+
|
|
188
|
+
Cria novo agent ou skill GENERICO no `core/`. So roda dentro do repo JDI fonte.
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
/jdi-create "specialist pra Rust com cargo + clippy"
|
|
192
|
+
/jdi-create "skill com convencoes EF Core 9"
|
|
193
|
+
/jdi-create
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Faz:
|
|
197
|
+
1. Validacao: esta no repo JDI (`core/` existe)
|
|
198
|
+
2. Spawn `jdi-architect` modo `create`:
|
|
199
|
+
- 8 perguntas (problema, trigger, input, output, reuso, decision-loop, custo, tools)
|
|
200
|
+
- Classificacao automatica (agent / skill / composite)
|
|
201
|
+
- Validacao com user (approve / edit / cancel)
|
|
202
|
+
- Geracao de files em `core/agents/` ou `core/skills/`
|
|
203
|
+
- Update de routing
|
|
204
|
+
3. Build + install pro runtime ativo
|
|
205
|
+
4. Commit + audit em `.jdi/registry.md`
|
|
206
|
+
|
|
207
|
+
**NAO usado em projetos consumindo JDI.** So pra contributors estendendo o core.
|
|
208
|
+
|
|
209
|
+
## Resumo visual
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
/jdi-new --> .jdi/{PROJECT,ROADMAP,STATE,DECISIONS}.md + .gitattributes
|
|
213
|
+
/jdi-bootstrap --> .jdi/agents/{jdi-doer-{slug},jdi-reviewer-{slug}}.md + routing
|
|
214
|
+
/jdi-discuss N --> .jdi/phases/{NN}/CONTEXT.md
|
|
215
|
+
/jdi-plan N --> .jdi/phases/{NN}/PLAN.md
|
|
216
|
+
/jdi-do N --> commits atomicos + .jdi/phases/{NN}/SUMMARY.md
|
|
217
|
+
/jdi-verify N --> .jdi/phases/{NN}/REVIEW.md
|
|
218
|
+
/jdi-loop N --> ralph mode: do<->verify auto + .jdi/phases/{NN}/LOOP.md
|
|
219
|
+
/jdi-ship N --> ROADMAP advance + tag (opcional)
|
|
220
|
+
|
|
221
|
+
/jdi-create --> [internal] core/agents/* ou core/skills/* (so no repo JDI)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Flags globais
|
|
225
|
+
|
|
226
|
+
- `--auto` (em `/jdi-discuss`): asker decide tudo, sem pergunta
|
|
227
|
+
- `--review` (em `/jdi-plan`): mostra preview do PLAN, pede approve
|
|
228
|
+
- `--sequential` (em `/jdi-do`): forca execucao sequencial mesmo se waves permitem paralelo
|
|
229
|
+
- `--max-iter=N` (em `/jdi-loop`): max iter por round antes de human gate (default 5)
|
|
230
|
+
- `--max-resets=N` (em `/jdi-loop`): max rounds de reset antes do kill switch (default 3)
|
|
231
|
+
- `--reset` (em `/jdi-new`): apaga `.jdi/` antes de iniciar (CUIDADO)
|
|
232
|
+
|
|
233
|
+
## Idempotencia
|
|
234
|
+
|
|
235
|
+
Todos os comandos sao idempotentes pra rerun:
|
|
236
|
+
- `/jdi-discuss` ja com CONTEXT.md -> pergunta overwrite/skip
|
|
237
|
+
- `/jdi-plan` ja com PLAN.md -> regera (warn)
|
|
238
|
+
- `/jdi-do` ja com tasks completed -> pula
|
|
239
|
+
- `/jdi-verify` ja com REVIEW.md -> regera
|
|
240
|
+
- `/jdi-loop` ja com LOOP.md status=converged -> aborta (rode /jdi-ship); status=running -> retoma; status=killed -> aborta (revisao humana); status=escalated/paused -> retoma com novo round
|
|
241
|
+
- `/jdi-ship` ja shipped -> warn
|