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,99 @@
1
+ #!/usr/bin/env bash
2
+ # jdi-truncate.sh — markdown-aware truncation pra context budget
3
+ #
4
+ # Uso:
5
+ # jdi-truncate.sh <path> [char_budget]
6
+ #
7
+ # Estrategia:
8
+ # - Preserva YAML frontmatter inteiro
9
+ # - Preserva TODAS as linhas de heading (#, ##, ...)
10
+ # - Preserva 1a linha nao-vazia de cada secao
11
+ # - Resto vira "[... N lines omitted]"
12
+ # - Footer aponta pro arquivo original
13
+ #
14
+ # Se file <= budget, ecoa inteiro. Output sempre pra stdout.
15
+
16
+ set -euo pipefail
17
+
18
+ PATH_IN="${1:-}"
19
+ BUDGET="${2:-8192}"
20
+
21
+ if [ -z "$PATH_IN" ]; then
22
+ echo "uso: jdi-truncate.sh <path> [char_budget]" >&2
23
+ exit 1
24
+ fi
25
+
26
+ if [ ! -f "$PATH_IN" ]; then
27
+ echo "arquivo nao encontrado: $PATH_IN" >&2
28
+ exit 1
29
+ fi
30
+
31
+ SIZE=$(wc -c < "$PATH_IN" | tr -d ' ')
32
+
33
+ if [ "$SIZE" -le "$BUDGET" ]; then
34
+ cat "$PATH_IN"
35
+ exit 0
36
+ fi
37
+
38
+ awk -v file="$PATH_IN" '
39
+ BEGIN {
40
+ in_frontmatter = 0
41
+ frontmatter_done = 0
42
+ paragraph_kept = 0
43
+ omitted = 0
44
+ }
45
+ {
46
+ line = $0
47
+
48
+ # Frontmatter (so se comecar na linha 1)
49
+ if (NR == 1 && line == "---") {
50
+ in_frontmatter = 1
51
+ print line
52
+ next
53
+ }
54
+ if (in_frontmatter) {
55
+ print line
56
+ if (line == "---") {
57
+ in_frontmatter = 0
58
+ frontmatter_done = 1
59
+ }
60
+ next
61
+ }
62
+
63
+ # Heading — sempre preserva
64
+ if (line ~ /^#{1,6}[[:space:]]/) {
65
+ if (omitted > 0) {
66
+ print "[... " omitted " lines omitted]"
67
+ omitted = 0
68
+ }
69
+ print line
70
+ paragraph_kept = 0
71
+ next
72
+ }
73
+
74
+ # Linha vazia
75
+ if (line ~ /^[[:space:]]*$/) {
76
+ if (paragraph_kept == 0) {
77
+ print line
78
+ } else {
79
+ omitted++
80
+ }
81
+ next
82
+ }
83
+
84
+ # Linha de conteudo
85
+ if (paragraph_kept == 0) {
86
+ print line
87
+ paragraph_kept = 1
88
+ } else {
89
+ omitted++
90
+ }
91
+ }
92
+ END {
93
+ if (omitted > 0) {
94
+ print "[... " omitted " lines omitted]"
95
+ }
96
+ print ""
97
+ print "[Truncated by jdi-truncate. Read " file " for full content]"
98
+ }
99
+ ' "$PATH_IN"
package/bin/lib/ui.js ADDED
@@ -0,0 +1,197 @@
1
+ 'use strict';
2
+
3
+ // ANSI escape codes — sem deps externas
4
+ const isTTY = process.stdout.isTTY;
5
+ const supportsColor = isTTY && !process.env.NO_COLOR;
6
+
7
+ const c = {
8
+ reset: supportsColor ? '\x1b[0m' : '',
9
+ bold: supportsColor ? '\x1b[1m' : '',
10
+ dim: supportsColor ? '\x1b[2m' : '',
11
+ italic: supportsColor ? '\x1b[3m' : '',
12
+ underline: supportsColor ? '\x1b[4m' : '',
13
+
14
+ black: supportsColor ? '\x1b[30m' : '',
15
+ red: supportsColor ? '\x1b[31m' : '',
16
+ green: supportsColor ? '\x1b[32m' : '',
17
+ yellow: supportsColor ? '\x1b[33m' : '',
18
+ blue: supportsColor ? '\x1b[34m' : '',
19
+ magenta: supportsColor ? '\x1b[35m' : '',
20
+ cyan: supportsColor ? '\x1b[36m' : '',
21
+ white: supportsColor ? '\x1b[37m' : '',
22
+ gray: supportsColor ? '\x1b[90m' : '',
23
+
24
+ bgBlue: supportsColor ? '\x1b[44m' : '',
25
+ bgGreen: supportsColor ? '\x1b[42m' : '',
26
+ };
27
+
28
+ // ASCII banner do JDI
29
+ const BANNER = [
30
+ '',
31
+ `${c.cyan}${c.bold} ██╗██████╗ ██╗${c.reset}`,
32
+ `${c.cyan}${c.bold} ██║██╔══██╗██║${c.reset}`,
33
+ `${c.cyan}${c.bold} ██║██║ ██║██║${c.reset}`,
34
+ `${c.cyan}${c.bold}██ ██║██║ ██║██║${c.reset}`,
35
+ `${c.cyan}${c.bold}╚█████╔╝██████╔╝██║${c.reset}`,
36
+ `${c.cyan}${c.bold} ╚════╝ ╚═════╝ ╚═╝${c.reset}`,
37
+ '',
38
+ `${c.dim} Just Do It ${c.reset}${c.gray}— workflow enxuto, multi-runtime${c.reset}`,
39
+ '',
40
+ ];
41
+
42
+ function banner() {
43
+ console.log(BANNER.join('\n'));
44
+ }
45
+
46
+ // Box drawing
47
+ function box(title, lines, opts = {}) {
48
+ const color = opts.color || c.cyan;
49
+ const width = Math.max(
50
+ title.length + 4,
51
+ ...lines.map((l) => stripAnsi(l).length + 4),
52
+ 50
53
+ );
54
+
55
+ const top = `${color}╭${'─'.repeat(width - 2)}╮${c.reset}`;
56
+ const bottom = `${color}╰${'─'.repeat(width - 2)}╯${c.reset}`;
57
+ const titleLine = `${color}│${c.reset} ${c.bold}${title}${c.reset}${' '.repeat(width - 3 - title.length)}${color}│${c.reset}`;
58
+ const sep = `${color}├${'─'.repeat(width - 2)}┤${c.reset}`;
59
+
60
+ console.log(top);
61
+ console.log(titleLine);
62
+ console.log(sep);
63
+ for (const line of lines) {
64
+ const visibleLen = stripAnsi(line).length;
65
+ const padding = ' '.repeat(Math.max(0, width - 3 - visibleLen));
66
+ console.log(`${color}│${c.reset} ${line}${padding}${color}│${c.reset}`);
67
+ }
68
+ console.log(bottom);
69
+ }
70
+
71
+ function stripAnsi(str) {
72
+ return str.replace(/\x1b\[[0-9;]*m/g, '');
73
+ }
74
+
75
+ // Symbols
76
+ const sym = {
77
+ success: `${c.green}✓${c.reset}`,
78
+ error: `${c.red}✗${c.reset}`,
79
+ warn: `${c.yellow}⚠${c.reset}`,
80
+ info: `${c.cyan}ℹ${c.reset}`,
81
+ arrow: `${c.cyan}→${c.reset}`,
82
+ dot: `${c.gray}·${c.reset}`,
83
+ bullet: `${c.cyan}●${c.reset}`,
84
+ };
85
+
86
+ // Step printers
87
+ function step(msg) {
88
+ console.log(`${sym.arrow} ${msg}`);
89
+ }
90
+ function ok(msg) {
91
+ console.log(` ${sym.success} ${msg}`);
92
+ }
93
+ function fail(msg) {
94
+ console.log(` ${sym.error} ${c.red}${msg}${c.reset}`);
95
+ }
96
+ function warn(msg) {
97
+ console.log(` ${sym.warn} ${c.yellow}${msg}${c.reset}`);
98
+ }
99
+ function info(msg) {
100
+ console.log(` ${sym.info} ${c.dim}${msg}${c.reset}`);
101
+ }
102
+ function dim(msg) {
103
+ console.log(` ${c.gray}${msg}${c.reset}`);
104
+ }
105
+
106
+ function header(title) {
107
+ console.log('');
108
+ console.log(`${c.bold}${c.cyan}${title}${c.reset}`);
109
+ console.log(`${c.gray}${'─'.repeat(Math.min(60, title.length + 10))}${c.reset}`);
110
+ }
111
+
112
+ function divider() {
113
+ console.log(`${c.gray}${'─'.repeat(60)}${c.reset}`);
114
+ }
115
+
116
+ // Spinner
117
+ const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
118
+
119
+ function spinner(msg) {
120
+ if (!isTTY) {
121
+ console.log(`${sym.arrow} ${msg}...`);
122
+ return {
123
+ stop: () => {},
124
+ success: (s) => ok(s || msg),
125
+ fail: (s) => fail(s || msg),
126
+ };
127
+ }
128
+
129
+ let i = 0;
130
+ let active = true;
131
+ const interval = setInterval(() => {
132
+ if (!active) return;
133
+ process.stdout.write(`\r${c.cyan}${SPINNER_FRAMES[i]}${c.reset} ${msg} `);
134
+ i = (i + 1) % SPINNER_FRAMES.length;
135
+ }, 80);
136
+
137
+ return {
138
+ stop: () => {
139
+ active = false;
140
+ clearInterval(interval);
141
+ process.stdout.write('\r' + ' '.repeat(80) + '\r');
142
+ },
143
+ success: (s) => {
144
+ active = false;
145
+ clearInterval(interval);
146
+ process.stdout.write('\r' + ' '.repeat(80) + '\r');
147
+ ok(s || msg);
148
+ },
149
+ fail: (s) => {
150
+ active = false;
151
+ clearInterval(interval);
152
+ process.stdout.write('\r' + ' '.repeat(80) + '\r');
153
+ fail(s || msg);
154
+ },
155
+ };
156
+ }
157
+
158
+ // Pretty success summary box
159
+ function successSummary(title, lines) {
160
+ console.log('');
161
+ box(`${c.green}${title}${c.reset}`, lines, { color: c.green });
162
+ }
163
+
164
+ function errorSummary(title, lines) {
165
+ console.log('');
166
+ box(`${c.red}${title}${c.reset}`, lines, { color: c.red });
167
+ }
168
+
169
+ // Hint pra proximo passo
170
+ function nextSteps(steps) {
171
+ console.log('');
172
+ console.log(`${c.bold}${c.cyan}Proximos passos:${c.reset}`);
173
+ for (let i = 0; i < steps.length; i++) {
174
+ console.log(` ${c.cyan}${i + 1}.${c.reset} ${steps[i]}`);
175
+ }
176
+ console.log('');
177
+ }
178
+
179
+ module.exports = {
180
+ c,
181
+ sym,
182
+ banner,
183
+ box,
184
+ step,
185
+ ok,
186
+ fail,
187
+ warn,
188
+ info,
189
+ dim,
190
+ header,
191
+ divider,
192
+ spinner,
193
+ successSummary,
194
+ errorSummary,
195
+ nextSteps,
196
+ stripAnsi,
197
+ };