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,198 @@
1
+ ---
2
+ name: yagni
3
+ description: YAGNI (You Aren't Gonna Need It). Build only what the current requirement asks for. Generalize after the 3rd real case, never before. Code not written is code with no bug, no maintenance cost, no pending test. Applies in any language.
4
+ triggers:
5
+ - "YAGNI"
6
+ - "speculative code"
7
+ - "future-proof"
8
+ - "premature abstraction"
9
+ ---
10
+
11
+ # Skill: YAGNI
12
+
13
+ > You aren't gonna need it.
14
+
15
+ YAGNI is discipline against **speculative code**: features, abstractions, parameters, hooks, layers, configs that exist "in case it's needed". In 90% of cases, never needed — and when needed, the requirement is different from what you imagined.
16
+
17
+ ## Rules
18
+
19
+ ### 1. Build only what the current requirement asks
20
+
21
+ Ask of every new line of code:
22
+ - **Does this functionality have a requirement today?**
23
+ - **Who is the caller that needs this NOW?**
24
+
25
+ If there's no real caller, don't write it. Dead code is **net negative**: latent bug, maintenance cost, distraction in review, hinders refactor.
26
+
27
+ ### 2. Generalize after the 3rd real case
28
+
29
+ Sandi Metz: "Duplication is far cheaper than the wrong abstraction."
30
+
31
+ - 1 case: implement specific
32
+ - 2 cases: copy or minimally parameterize
33
+ - 3 cases: now extract real pattern (one you **saw** happen, not imagined)
34
+
35
+ Generalizing earlier couples callers to the wrong interface. Refactoring later to the right interface is cheap; breaking callers to swap a wrong generic interface is expensive.
36
+
37
+ ### 3. Costs of speculative code
38
+
39
+ Every "in case it's needed" line costs:
40
+
41
+ - **Maintenance**: someone will touch it when refactoring the neighborhood
42
+ - **Confusion**: reader thinks "this is being used, must be important"
43
+ - **Tests**: untested code becomes a bomb; tested, wasted time
44
+ - **Coupling**: callers will couple to the speculative interface, making it hard to remove
45
+ - **Scope creep**: simple feature becomes complex feature
46
+ - **Bug surface**: a line that doesn't exist has no bug
47
+
48
+ ### 4. What YAGNI is NOT
49
+
50
+ YAGNI is not an excuse to:
51
+ - **Hardcoded everywhere**: some extension points are real requirements (i18n, logging, auth)
52
+ - **Cut real requirement**: if ticket asks for X, deliver X complete, not half
53
+ - **Skip security/error handling**: these are universal requirements, not speculative
54
+ - **Raw illegible code**: clarity is a requirement, not speculation
55
+ - **Skip tests**: coverage is a contract
56
+
57
+ ### 5. Symptoms of violation
58
+
59
+ Code smells of broken YAGNI if:
60
+
61
+ - Optional parameters never passed (`fn(a, b, opts?: {...})` with opts always `undefined`)
62
+ - Hooks/events without subscribers
63
+ - Plugin system without plugins
64
+ - Config "in case we want to change" that nobody ever changed
65
+ - Interface with 1 impl (overlap with KISS)
66
+ - Generic `<T>` used with only 1 type
67
+ - "Future-proof" architecture written to scale 100x before validating current requirement
68
+ - Branches in code for scenarios nobody can describe
69
+
70
+ ### 6. How to remove
71
+
72
+ After discovering speculative code:
73
+ 1. Confirm nobody calls (`grep` callers)
74
+ 2. Delete. Yes, delete directly. Git keeps history.
75
+ 3. Don't leave "// removed on XX/YY" — more trash.
76
+ 4. If you find out later you need it, add it when you need it (safe bet: later you know the real requirement, not imagined).
77
+
78
+ ## Anti-patterns
79
+
80
+ | Anti-pattern | Why it violates |
81
+ |---|---|
82
+ | Optional parameter never used | Adds surface area without benefit |
83
+ | "Generic" function used by 1 caller | Generalized too early |
84
+ | Plugin/extension point without extenders | Dead code carries maintenance |
85
+ | "Configurable" config nobody changes | False flexibility — becomes hardcode later |
86
+ | Try/catch for impossible exception | Indicates fear, not requirement |
87
+ | Defensive validation for value coming from a safe type | TypeScript/C#/Python types already guarantee |
88
+ | `for/while` instead of direct return for "future looping" | Invents speculative repetition |
89
+ | Layer "to make it generic" without 2nd impl | Speculation with pass-through cost |
90
+ | Comment "TODO: extend to X later" without ticket | Message to nobody |
91
+ | Abstraction with 1 concrete implementation | Generic abstraction without second case |
92
+ | `enum` with 1 value "will grow" | Add value when it appears |
93
+
94
+ ## Procedure
95
+
96
+ ### Doer (before/during implementation)
97
+
98
+ Before adding:
99
+
100
+ 1. **Is there a current requirement?** (ticket, conversation, explicit business rule) Otherwise, don't add.
101
+ 2. **Who calls this today?** If nobody, don't add.
102
+ 3. **When will I use that flexibility?** If "don't know", don't add.
103
+
104
+ After writing, ask:
105
+ - Is there a parameter/config/branch that could disappear without losing requirement?
106
+
107
+ ### Reviewer (gate 5)
108
+
109
+ Heuristics:
110
+
111
+ ```bash
112
+ # Optional parameters never passed
113
+ # (depends on stack — examples)
114
+ grep -RnE 'function \w+\([^)]*opts\?:' src/ # TS
115
+ grep -RnE '\([^)]*=\s*null\)' src/ # optional default null
116
+
117
+ # "TODO: extend" code
118
+ grep -RnE 'TODO.*(extend|future|reserved|placeholder|in case)' src/
119
+
120
+ # Try/catch without clear reason
121
+ grep -RnA3 'try\s*{' src/ | grep -B1 'catch.*:.*ignore'
122
+
123
+ # Declared and unused variables
124
+ # (linter already catches — confirm in review)
125
+
126
+ # Plugin/extension points
127
+ grep -RnE 'register|registerPlugin|EventEmitter|hook(' src/
128
+ # Cross-check: are there actually callers?
129
+ ```
130
+
131
+ 3+ matches without real caller -> WARN.
132
+
133
+ ## Inputs
134
+
135
+ - File diff (focus on additions)
136
+ - List of callers if any
137
+
138
+ ## Outputs
139
+
140
+ Does NOT produce a file. Modifies judgement — doer avoids writing, reviewer marks WARN.
141
+
142
+ ## Examples
143
+
144
+ ### Example 1: Speculative optional param
145
+
146
+ Wrong:
147
+ ```python
148
+ def send_email(to: str, subject: str, body: str,
149
+ cc: list[str] = None,
150
+ bcc: list[str] = None,
151
+ attachments: list[Path] = None,
152
+ priority: str = "normal",
153
+ retry_count: int = 3,
154
+ on_failure: Callable = None):
155
+ ...
156
+ ```
157
+
158
+ Current requirement is to send simple email (`to, subject, body`). The other 5 params are speculative.
159
+
160
+ Right:
161
+ ```python
162
+ def send_email(to: str, subject: str, body: str):
163
+ ...
164
+ ```
165
+
166
+ Add `cc`, `bcc` etc **when** real requirement arrives, not before.
167
+
168
+ ### Example 2: Plugin system without plugins
169
+
170
+ Wrong:
171
+ ```typescript
172
+ class PaymentProcessor {
173
+ private plugins: Plugin[] = []
174
+ registerPlugin(p: Plugin) { this.plugins.push(p) }
175
+ process(...) {
176
+ this.plugins.forEach(p => p.beforeProcess())
177
+ // logic
178
+ this.plugins.forEach(p => p.afterProcess())
179
+ }
180
+ }
181
+ ```
182
+
183
+ Has 0 plugins registered. Whole plugin system is dead code.
184
+
185
+ Right:
186
+ ```typescript
187
+ class PaymentProcessor {
188
+ process(...) { /* logic */ }
189
+ }
190
+ ```
191
+
192
+ When the 1st real plugin appears, then yes. Not before.
193
+
194
+ ### Example 3: Unused config string
195
+
196
+ Wrong: `config.json -> "DEFAULT_LANGUAGE": "pt-BR"` but nobody reads it. Code uses `"pt-BR"` directly.
197
+
198
+ Right: delete the config. Add it when the multi-language feature is actually implemented.
@@ -0,0 +1,91 @@
1
+ # JDI — Instrucoes Claude Code
2
+
3
+ Este projeto usa o JDI (Just Do It) como workflow de desenvolvimento. JDI eh um workflow enxuto: 6 comandos no loop principal, 5 agents core + 2 per-project specialists.
4
+
5
+ ## Loop canonico
6
+
7
+ ```
8
+ /jdi-new "<descricao>" -> research + PROJECT.md + ROADMAP.md
9
+ /jdi-bootstrap -> cria specialists per-project (doer + reviewer)
10
+ /jdi-discuss <N> -> captura decisoes locked da phase
11
+ /jdi-plan <N> -> decompoe em tasks com waves
12
+ /jdi-do <N> -> executa via doer specialist
13
+ /jdi-verify <N> -> gates de qualidade via reviewer specialist
14
+ /jdi-ship <N> -> finaliza phase + avanca pra proxima
15
+ ```
16
+
17
+ `/jdi-create [desc]` gera novos agents/skills genericos no `core/` (rodado dentro do repo JDI, nao de projetos consumindo).
18
+
19
+ ## Agents core (em `.claude/agents/`)
20
+
21
+ Genericos, shipped pelo JDI:
22
+
23
+ | Agent | Modelo | Funcao |
24
+ |---|---|---|
25
+ | `jdi-researcher` | Opus | Research pre-roadmap. Le ideia, pergunta, gera PROJECT.md + ROADMAP.md |
26
+ | `jdi-bootstrap` | Sonnet | Dispara architect modo specialist pra gerar per-project doer + reviewer |
27
+ | `jdi-asker` | Sonnet | Loop adaptativo de perguntas pra capturar decisoes locked (CONTEXT.md) |
28
+ | `jdi-planner` | Opus | Decompoe phase em tasks, agrupa em waves de paralelismo (PLAN.md) |
29
+ | `jdi-architect` | Opus | Meta-agent. 2 modos: cria agents/skills genericos no core/ OU cria specialists per-project |
30
+
31
+ ## Specialists per-project (em `.jdi/agents/`)
32
+
33
+ Gerados pelo `/jdi-bootstrap` baseado em PROJECT.md:
34
+
35
+ | Agent | Funcao |
36
+ |---|---|
37
+ | `jdi-doer-{slug}` | Executor que ja conhece stack/code-design/conventions do projeto. Sem descoberta, ja sabe |
38
+ | `jdi-reviewer-{slug}` | Roda gates de qualidade definidos pra stack: build, tests, coverage, lint, security |
39
+
40
+ Routing em `.jdi/specialists.md` e `.jdi/reviewers.md`.
41
+
42
+ ## Memoria — files em `.jdi/`
43
+
44
+ ```
45
+ .jdi/
46
+ PROJECT.md <- visao + stack + code-design locked
47
+ ROADMAP.md <- phases + status
48
+ DECISIONS.md <- D-XX append-only (decisoes locked)
49
+ STATE.md <- current_phase + next_step
50
+ specialists.md <- routing pro doer
51
+ reviewers.md <- routing pro reviewer
52
+ registry.md <- audit trail dos specialists criados
53
+ agents/ <- per-project specialists
54
+ jdi-doer-{slug}.md
55
+ jdi-reviewer-{slug}.md
56
+ phases/{NN-slug}/
57
+ CONTEXT.md <- output do asker
58
+ PLAN.md <- output do planner
59
+ SUMMARY.md <- output do doer
60
+ REVIEW.md <- output do reviewer
61
+ ```
62
+
63
+ ## Convencoes
64
+
65
+ - Conventional Commits — scope = phase slug, ex: `feat(01-setup-api): ...`
66
+ - Atomic commits — 1 task = 1 commit
67
+ - 80% cobertura minima (overridable via PROJECT.md)
68
+ - Code design locked uma vez no `/jdi-new`, nunca muda
69
+ - D-XX referenciado em commit message quando aplicavel
70
+
71
+ ## Idioma
72
+
73
+ - Codigo, commits, PRs: ingles
74
+ - Discussao, docs em `.jdi/`: pt-BR
75
+ - i18n no frontend: nunca string hardcoded em pt-BR no JSX
76
+
77
+ ## Prioridade quando conflita
78
+
79
+ 1. Seguranca
80
+ 2. Performance
81
+ 3. Boas praticas
82
+
83
+ ## Hooks (opcional)
84
+
85
+ `.githooks/pre-commit` e `post-commit` shipped. Pra ativar:
86
+
87
+ ```bash
88
+ git config core.hooksPath .githooks
89
+ ```
90
+
91
+ Windows: hooks rodam via Git Bash (vem com Git for Windows). Sem ele, hooks sao silenciosamente ignorados.