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,403 @@
1
+ <#
2
+ .SYNOPSIS
3
+ jdi-doctor (Windows): diagnostica ambiente JDI.
4
+
5
+ .DESCRIPTION
6
+ Equivalente PowerShell de bin/jdi-doctor.sh.
7
+ Saida com OK / WARN / FAIL por check.
8
+ Exit 0 se tudo OK ou so WARN. Exit 1 se algum FAIL.
9
+
10
+ .PARAMETER Verbose
11
+ Mostra notas extras de debug.
12
+
13
+ .EXAMPLE
14
+ .\bin\jdi-doctor.ps1
15
+ .\bin\jdi-doctor.ps1 -Verbose
16
+ #>
17
+ [CmdletBinding()]
18
+ param()
19
+
20
+ $JdiRoot = Split-Path -Parent $PSScriptRoot
21
+ $ProjectDir = (Get-Location).Path
22
+ $UserHome = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
23
+
24
+ # cores
25
+ $useColor = $Host.UI.RawUI -ne $null -and -not $env:NO_COLOR
26
+ function Write-OK { param($m) if ($useColor) { Write-Host " OK " -ForegroundColor Green -NoNewline; Write-Host " $m" } else { Write-Host " OK $m" } }
27
+ function Write-WARN { param($m) if ($useColor) { Write-Host " WARN " -ForegroundColor Yellow -NoNewline; Write-Host " $m" } else { Write-Host " WARN $m" } ; $script:Warns++ }
28
+ function Write-FAIL { param($m) if ($useColor) { Write-Host " FAIL " -ForegroundColor Red -NoNewline; Write-Host " $m" } else { Write-Host " FAIL $m" } ; $script:Fails++ }
29
+ function Write-Note { param($m) if ($VerbosePreference -eq 'Continue') { if ($useColor) { Write-Host " note $m" -ForegroundColor DarkGray } else { Write-Host " note $m" } } }
30
+ function Write-Section { param($t) Write-Host ""; Write-Host $t }
31
+
32
+ $script:Fails = 0
33
+ $script:Warns = 0
34
+
35
+ function Test-Cmd {
36
+ param([string]$Name)
37
+ return (Get-Command $Name -ErrorAction SilentlyContinue) -ne $null
38
+ }
39
+
40
+ # ---------------------------------------------------------------------------
41
+ Write-Section '1. Dependencias'
42
+
43
+ # PowerShell nao precisa de awk/sed/find — scripts .ps1 substituem
44
+ foreach ($cmd in @('git')) {
45
+ if (Test-Cmd $cmd) {
46
+ $path = (Get-Command $cmd).Source
47
+ Write-OK "$cmd disponivel ($path)"
48
+ } else {
49
+ Write-FAIL "$cmd ausente. Instale: https://git-scm.com/download/win"
50
+ }
51
+ }
52
+
53
+ # Git for Windows traz bash + awk + sed (necessarios pros .sh e pros git hooks)
54
+ $gitBash = (Get-Command bash -ErrorAction SilentlyContinue)
55
+ if ($gitBash) {
56
+ Write-OK "bash disponivel ($($gitBash.Source)) - hooks .sh e scripts originais funcionam"
57
+ } else {
58
+ Write-WARN "bash ausente. Scripts .sh e git hooks nao funcionam. Instale Git for Windows ou WSL."
59
+ }
60
+
61
+ # ---------------------------------------------------------------------------
62
+ Write-Section '2. Runtimes'
63
+
64
+ $ClaudeOK = $false
65
+ if (Test-Cmd 'claude') {
66
+ Write-OK "claude CLI: $((Get-Command claude).Source)"
67
+ $ClaudeOK = $true
68
+ } elseif (Test-Path "$UserHome\.claude") {
69
+ Write-WARN "~/.claude/ existe mas claude CLI nao esta no PATH"
70
+ $ClaudeOK = $true
71
+ } else {
72
+ Write-WARN "Claude Code nao detectado (sem CLI nem ~/.claude/)"
73
+ }
74
+
75
+ $CopilotOK = $false
76
+ if (Test-Cmd 'code') {
77
+ $exts = & code --list-extensions 2>$null
78
+ if ($exts -match 'github.copilot') {
79
+ Write-OK 'VS Code + extensao Copilot detectados'
80
+ $CopilotOK = $true
81
+ } else {
82
+ Write-WARN 'VS Code presente mas extensao Copilot nao instalada'
83
+ }
84
+ } elseif (Test-Cmd 'gh') {
85
+ $ghExts = & gh extension list 2>$null
86
+ if ($ghExts -match 'copilot') {
87
+ Write-OK 'gh CLI com extensao copilot'
88
+ $CopilotOK = $true
89
+ } else {
90
+ Write-WARN 'Copilot nao detectado (sem VS Code ou sem extensao)'
91
+ }
92
+ } else {
93
+ Write-WARN 'Copilot nao detectado (sem VS Code nem gh)'
94
+ }
95
+
96
+ $AntigravityOK = $false
97
+ if (Test-Cmd 'antigravity') {
98
+ Write-OK "antigravity CLI: $((Get-Command antigravity).Source)"
99
+ $AntigravityOK = $true
100
+ } elseif (Test-Path "$UserHome\.gemini\antigravity") {
101
+ Write-OK '~/.gemini/antigravity/ existe'
102
+ $AntigravityOK = $true
103
+ } else {
104
+ Write-WARN 'Antigravity nao detectado'
105
+ }
106
+
107
+ $OpencodeOK = $false
108
+ if (Test-Cmd 'opencode') {
109
+ Write-OK "opencode CLI: $((Get-Command opencode).Source)"
110
+ $OpencodeOK = $true
111
+ } elseif (Test-Path "$UserHome\.config\opencode") {
112
+ Write-OK '~/.config/opencode/ existe'
113
+ $OpencodeOK = $true
114
+ } else {
115
+ Write-WARN 'OpenCode nao detectado (sem CLI nem ~/.config/opencode/)'
116
+ }
117
+
118
+ if (-not ($ClaudeOK -or $CopilotOK -or $AntigravityOK -or $OpencodeOK)) {
119
+ Write-FAIL 'Nenhum runtime detectado. JDI nao serve pra nada sem runtime.'
120
+ }
121
+
122
+ # ---------------------------------------------------------------------------
123
+ Write-Section '3. Tooling opcional'
124
+
125
+ if (Test-Cmd 'ctx7') {
126
+ Write-OK "ctx7 disponivel ($((Get-Command ctx7).Source))"
127
+ } elseif (Test-Cmd 'npx') {
128
+ Write-WARN 'ctx7 ausente. Recomendado pra docs de libs. Instale: npm i -g ctx7'
129
+ } else {
130
+ Write-WARN 'ctx7 e npx ausentes. Researcher fica limitado a WebSearch.'
131
+ }
132
+
133
+ if (Test-Cmd 'gh') {
134
+ Write-OK 'gh CLI disponivel (necessario pra /jdi-ship abrir PR)'
135
+ } else {
136
+ Write-WARN 'gh CLI ausente. /jdi-ship nao consegue criar PR. Install: cli.github.com'
137
+ }
138
+
139
+ # ---------------------------------------------------------------------------
140
+ Write-Section '4. Repo JDI (source of truth)'
141
+
142
+ if ((Test-Path "$JdiRoot\core\agents") -and (Test-Path "$JdiRoot\core\commands")) {
143
+ $agentsCount = (Get-ChildItem -Path "$JdiRoot\core\agents" -Filter '*.md' -File -ErrorAction SilentlyContinue).Count
144
+ $cmdsCount = (Get-ChildItem -Path "$JdiRoot\core\commands" -Filter '*.md' -File -ErrorAction SilentlyContinue).Count
145
+ Write-OK "core/ encontrado ($agentsCount agents, $cmdsCount commands)"
146
+ if ($agentsCount -lt 1) {
147
+ Write-FAIL 'core/agents/ vazio. Repo do JDI nao esta integro.'
148
+ }
149
+ } else {
150
+ Write-FAIL "core/ ausente em $JdiRoot. Esse script roda do repo do JDI?"
151
+ }
152
+
153
+ foreach ($s in @('jdi-build.ps1','jdi-install.ps1')) {
154
+ if (Test-Path "$JdiRoot\bin\$s") {
155
+ Write-OK "$s presente"
156
+ } else {
157
+ Write-WARN "$s ausente em bin/. Repo incompleto?"
158
+ }
159
+ }
160
+
161
+ # ---------------------------------------------------------------------------
162
+ Write-Section '5. Adapters buildados (runtimes/)'
163
+
164
+ $runtimeChecks = @{
165
+ 'claude' = @{ Path = "$JdiRoot\runtimes\claude\agents"; Filter = '*.md' }
166
+ 'copilot' = @{ Path = "$JdiRoot\runtimes\copilot\agents"; Filter = '*.agent.md' }
167
+ 'antigravity' = @{ Path = "$JdiRoot\runtimes\antigravity\skills"; Filter = 'SKILL.md' }
168
+ 'opencode' = @{ Path = "$JdiRoot\runtimes\opencode\agents"; Filter = '*.md' }
169
+ }
170
+
171
+ foreach ($rt in $runtimeChecks.Keys) {
172
+ $info = $runtimeChecks[$rt]
173
+ if (Test-Path $info.Path) {
174
+ $count = (Get-ChildItem -Path $info.Path -Filter $info.Filter -Recurse -File -ErrorAction SilentlyContinue).Count
175
+ if ($count -gt 0) {
176
+ Write-OK "runtimes/$rt buildado ($count agents/skills)"
177
+ } else {
178
+ Write-WARN "runtimes/$rt vazio. Rode: .\bin\jdi-build.ps1"
179
+ }
180
+ } else {
181
+ Write-WARN "runtimes/$rt ausente. Rode: .\bin\jdi-build.ps1"
182
+ }
183
+ }
184
+
185
+ # ---------------------------------------------------------------------------
186
+ Write-Section "6. Projeto atual ($ProjectDir)"
187
+
188
+ if ($ProjectDir -eq $JdiRoot) {
189
+ Write-Note 'Voce esta no proprio repo do JDI. Rode jdi-doctor de dentro do seu projeto pra checar install.'
190
+ }
191
+
192
+ if (Test-Path "$ProjectDir\.jdi") {
193
+ Write-OK 'projeto eh JDI (.jdi/ existe)'
194
+ foreach ($f in @('PROJECT.md','ROADMAP.md','STATE.md')) {
195
+ if (Test-Path "$ProjectDir\.jdi\$f") {
196
+ Write-OK ".jdi/$f presente"
197
+ } else {
198
+ Write-WARN ".jdi/$f ausente. /jdi-new nao completou ou foi removido."
199
+ }
200
+ }
201
+ foreach ($f in @('DECISIONS.md','specialists.md','reviewers.md','registry.md','todos.md')) {
202
+ if (Test-Path "$ProjectDir\.jdi\$f") { Write-OK ".jdi/$f presente" } else { Write-Note ".jdi/$f ausente (criado on-demand)" }
203
+ }
204
+ if (Test-Path "$ProjectDir\.jdi\agents") {
205
+ $specCount = (Get-ChildItem -Path "$ProjectDir\.jdi\agents" -Filter "jdi-doer-*.md" -File -ErrorAction SilentlyContinue).Count + (Get-ChildItem -Path "$ProjectDir\.jdi\agents" -Filter "jdi-reviewer-*.md" -File -ErrorAction SilentlyContinue).Count
206
+ if ($specCount -gt 0) {
207
+ Write-OK ".jdi/agents/ com $specCount specialist(s) per-project"
208
+ } else {
209
+ Write-Note '.jdi/agents/ vazio (rode /jdi-bootstrap pra criar specialists)'
210
+ }
211
+ }
212
+ if (Test-Path "$ProjectDir\.jdi\phases") {
213
+ $phaseCount = (Get-ChildItem -Path "$ProjectDir\.jdi\phases" -Directory -ErrorAction SilentlyContinue).Count
214
+ Write-OK ".jdi/phases/ com $phaseCount phase(s)"
215
+ }
216
+ } else {
217
+ Write-WARN '.jdi/ ausente. Rode /jdi-new ou esta fora de um projeto JDI.'
218
+ }
219
+
220
+ # ---------------------------------------------------------------------------
221
+ Write-Section '7. Runtime instalado no projeto'
222
+
223
+ $InstallFound = $false
224
+ function Check-Install {
225
+ param([string]$Path, [string]$Filter, [string]$Label)
226
+ if (Test-Path $Path) {
227
+ $count = (Get-ChildItem -Path $Path -Filter $Filter -File -Recurse -ErrorAction SilentlyContinue).Count
228
+ if ($count -gt 0) {
229
+ Write-OK "$Label com $count agents JDI"
230
+ $script:InstallFound = $true
231
+ }
232
+ }
233
+ }
234
+
235
+ Check-Install -Path "$ProjectDir\.claude\agents" -Filter 'jdi-*.md' -Label '.claude/agents/'
236
+ Check-Install -Path "$ProjectDir\.github\agents" -Filter 'jdi-*.agent.md' -Label '.github/agents/'
237
+ Check-Install -Path "$ProjectDir\.gemini\antigravity\skills" -Filter 'SKILL.md' -Label '.gemini/antigravity/skills/'
238
+ Check-Install -Path "$ProjectDir\.opencode\agents" -Filter 'jdi-*.md' -Label '.opencode/agents/'
239
+ Check-Install -Path "$UserHome\.claude\agents" -Filter 'jdi-*.md' -Label '~/.claude/agents/ (scope user)'
240
+ Check-Install -Path "$UserHome\.config\opencode\agents" -Filter 'jdi-*.md' -Label '~/.config/opencode/agents/ (scope user)'
241
+
242
+ if (-not $script:InstallFound -and (Test-Path "$ProjectDir\.jdi")) {
243
+ Write-FAIL "Projeto eh JDI mas nenhum runtime instalado. Rode: $JdiRoot\bin\jdi-install.ps1 -Runtime <runtime>"
244
+ }
245
+
246
+ # ---------------------------------------------------------------------------
247
+ Write-Section '8. Git hooks'
248
+
249
+ if (Test-Path "$ProjectDir\.githooks\pre-commit") {
250
+ Write-OK '.githooks/pre-commit existe'
251
+ if (-not $gitBash) {
252
+ Write-WARN 'Hook eh bash mas Git for Windows ausente. Hook nao executara em commits.'
253
+ }
254
+
255
+ $hooksPath = & git -C "$ProjectDir" config core.hooksPath 2>$null
256
+ if ($hooksPath -in @('.githooks',"$ProjectDir\.githooks","$ProjectDir/.githooks")) {
257
+ Write-OK 'git core.hooksPath aponta pra .githooks'
258
+ } else {
259
+ Write-WARN 'git core.hooksPath nao configurado. Rode: git config core.hooksPath .githooks'
260
+ }
261
+ } elseif (Test-Path "$ProjectDir\.jdi") {
262
+ Write-WARN '.githooks/ ausente em projeto JDI. Rode jdi-install.ps1 pra instalar.'
263
+ }
264
+
265
+ # ---------------------------------------------------------------------------
266
+ Write-Section '9. Repo git limpo (recomendado pra /jdi-create)'
267
+
268
+ $gitDir = & git -C "$ProjectDir" rev-parse --git-dir 2>$null
269
+ if ($LASTEXITCODE -eq 0) {
270
+ & git -C "$ProjectDir" diff-index --quiet HEAD -- 2>$null
271
+ if ($LASTEXITCODE -eq 0) {
272
+ Write-OK 'working tree limpo'
273
+ } else {
274
+ Write-Note 'working tree com mudancas (ok pra /jdi-do, mas commit antes de /jdi-create)'
275
+ }
276
+ } else {
277
+ Write-WARN 'Diretorio nao eh repo git. /jdi-new e atomic commits nao funcionam sem git.'
278
+ }
279
+
280
+ # ---------------------------------------------------------------------------
281
+ Write-Section '10. Playwright + MCP (optional)'
282
+
283
+ $pkgPath = Join-Path $ProjectDir 'package.json'
284
+ $hasPwDep = $false
285
+ if (Test-Path $pkgPath) {
286
+ try {
287
+ $pkg = Get-Content $pkgPath -Raw | ConvertFrom-Json
288
+ $allDeps = @{}
289
+ if ($pkg.dependencies) { $pkg.dependencies.PSObject.Properties | ForEach-Object { $allDeps[$_.Name] = $_.Value } }
290
+ if ($pkg.devDependencies) { $pkg.devDependencies.PSObject.Properties | ForEach-Object { $allDeps[$_.Name] = $_.Value } }
291
+ if ($allDeps.ContainsKey('@playwright/test')) { $hasPwDep = $true }
292
+ } catch { }
293
+ }
294
+
295
+ if ($hasPwDep) {
296
+ Write-OK '@playwright/test in package.json'
297
+ } else {
298
+ Write-Note '@playwright/test not installed (run: npx jdi-cli install-playwright)'
299
+ }
300
+
301
+ $claudeMcp = Join-Path $ProjectDir '.claude\settings.local.json'
302
+ if (Test-Path $claudeMcp) {
303
+ if ((Get-Content $claudeMcp -Raw) -match '"playwright"\s*:') {
304
+ Write-OK 'Claude Code MCP playwright configured'
305
+ } else {
306
+ Write-Note 'Claude Code settings.local.json present but no MCP playwright entry'
307
+ }
308
+ }
309
+
310
+ $opencodeMcp = Join-Path $ProjectDir '.opencode\opencode.jsonc'
311
+ if (Test-Path $opencodeMcp) {
312
+ if ((Get-Content $opencodeMcp -Raw) -match '"playwright"\s*:') {
313
+ Write-OK 'OpenCode MCP playwright configured'
314
+ } else {
315
+ Write-Note 'OpenCode opencode.jsonc present but no MCP playwright entry'
316
+ }
317
+ }
318
+
319
+ $copilotMcp = Join-Path $ProjectDir '.vscode\mcp.json'
320
+ if (Test-Path $copilotMcp) {
321
+ if ((Get-Content $copilotMcp -Raw) -match '"playwright"\s*:') {
322
+ Write-OK 'Copilot (VS Code) MCP playwright configured'
323
+ } else {
324
+ Write-Note '.vscode/mcp.json present but no playwright entry'
325
+ }
326
+ }
327
+
328
+ $agUser = Join-Path $UserHome '.gemini\settings.json'
329
+ $agProject = Join-Path $ProjectDir '.gemini\settings.json'
330
+ if ((Test-Path $agUser) -and ((Get-Content $agUser -Raw) -match '"playwright"\s*:')) {
331
+ Write-OK 'Antigravity MCP playwright configured (user scope)'
332
+ } elseif ((Test-Path $agProject) -and ((Get-Content $agProject -Raw) -match '"playwright"\s*:')) {
333
+ Write-OK 'Antigravity MCP playwright configured (project scope)'
334
+ }
335
+
336
+ # ---------------------------------------------------------------------------
337
+ Write-Section '12. Specialists (single vs multi-stack)'
338
+
339
+ $specPath = Join-Path $ProjectDir '.jdi\specialists.md'
340
+ $revPath = Join-Path $ProjectDir '.jdi\reviewers.md'
341
+
342
+ if (Test-Path $specPath) {
343
+ $doers = (Get-Content $specPath | Select-String -Pattern 'jdi-doer-[a-z0-9-]+' -AllMatches).Matches |
344
+ ForEach-Object { $_.Value } | Sort-Object -Unique
345
+ if ($doers.Count -eq 0) {
346
+ Write-Note 'specialists.md exists but no doer registered'
347
+ } elseif ($doers.Count -eq 1) {
348
+ Write-OK "Single-stack: $($doers[0])"
349
+ } else {
350
+ Write-OK "Multi-stack: $($doers.Count) doer specialists"
351
+ $doers | ForEach-Object { Write-Note " - $_" }
352
+ }
353
+ } else {
354
+ Write-Note '.jdi/specialists.md missing (run /jdi-bootstrap)'
355
+ }
356
+
357
+ if (Test-Path $revPath) {
358
+ $revs = (Get-Content $revPath | Select-String -Pattern 'jdi-reviewer-[a-z0-9-]+' -AllMatches).Matches |
359
+ ForEach-Object { $_.Value } | Sort-Object -Unique
360
+ if ($revs.Count -gt 1) {
361
+ Write-Note " Reviewer chain length: $($revs.Count) (multi-stack /jdi-verify)"
362
+ }
363
+ }
364
+
365
+ # ---------------------------------------------------------------------------
366
+ Write-Section '11. Caveman plugin (optional)'
367
+
368
+ $cavemanUser = Join-Path $UserHome '.claude\plugins\caveman'
369
+ $cavemanProject = Join-Path $ProjectDir '.claude\plugins\caveman'
370
+
371
+ if (Test-Path $cavemanUser) {
372
+ Write-OK "Caveman installed (user scope: $cavemanUser)"
373
+ } elseif (Test-Path $cavemanProject) {
374
+ Write-OK "Caveman installed (project scope: $cavemanProject)"
375
+ } else {
376
+ Write-Note 'Caveman plugin not installed (run: npx jdi-cli install-caveman)'
377
+ }
378
+
379
+ # ---------------------------------------------------------------------------
380
+ Write-Section 'Resumo'
381
+
382
+ if ($script:Fails -gt 0) {
383
+ if ($useColor) {
384
+ Write-Host " $($script:Fails) FAIL" -ForegroundColor Red -NoNewline
385
+ Write-Host ", $($script:Warns) WARN" -ForegroundColor Yellow
386
+ } else {
387
+ Write-Host " $($script:Fails) FAIL, $($script:Warns) WARN"
388
+ }
389
+ Write-Host ' -> Resolva os FAIL antes de usar JDI.'
390
+ exit 1
391
+ } elseif ($script:Warns -gt 0) {
392
+ if ($useColor) {
393
+ Write-Host " $($script:Warns) WARN" -ForegroundColor Yellow -NoNewline
394
+ Write-Host ' (JDI funciona mas com limitacoes)'
395
+ } else {
396
+ Write-Host " $($script:Warns) WARN (JDI funciona mas com limitacoes)"
397
+ }
398
+ exit 0
399
+ } else {
400
+ if ($useColor) { Write-Host ' Tudo OK' -ForegroundColor Green -NoNewline; Write-Host '. JDI pronto pra rodar.' }
401
+ else { Write-Host ' Tudo OK. JDI pronto pra rodar.' }
402
+ exit 0
403
+ }