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/bin/jdi-build.sh
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# jdi-build: gera runtimes/{claude,copilot,antigravity} a partir de core/.
|
|
3
|
+
# Uso: ./bin/jdi-build.sh [runtime]
|
|
4
|
+
# runtime: claude | copilot | antigravity | all (default)
|
|
5
|
+
#
|
|
6
|
+
# Requer: bash, sed, awk, mkdir.
|
|
7
|
+
# Nao requer yq nem jq — parser inline simples.
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
12
|
+
CORE="${ROOT}/core"
|
|
13
|
+
OUT="${ROOT}/runtimes"
|
|
14
|
+
TARGET="${1:-all}"
|
|
15
|
+
|
|
16
|
+
ensure_dirs() {
|
|
17
|
+
mkdir -p "${OUT}/claude/agents" "${OUT}/claude/commands" "${OUT}/claude/skills"
|
|
18
|
+
mkdir -p "${OUT}/copilot/agents" "${OUT}/copilot/prompts"
|
|
19
|
+
mkdir -p "${OUT}/antigravity/skills"
|
|
20
|
+
mkdir -p "${OUT}/opencode/agents" "${OUT}/opencode/commands" "${OUT}/opencode/skills"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# extrai bloco `runtime_overrides.<runtime>` do frontmatter e gera frontmatter
|
|
24
|
+
# alvo no formato do runtime correspondente. parser simples (depth-aware).
|
|
25
|
+
build_claude_agent() {
|
|
26
|
+
local src="$1"
|
|
27
|
+
local name; name=$(basename "$src" .md)
|
|
28
|
+
local dst="${OUT}/claude/agents/${name}.md"
|
|
29
|
+
|
|
30
|
+
awk -v name="$name" '
|
|
31
|
+
BEGIN { in_fm=0; print_after_fm=1 }
|
|
32
|
+
/^---$/ {
|
|
33
|
+
if (in_fm == 0) { in_fm=1; print "---"; print "name: " name; next }
|
|
34
|
+
else { in_fm=0; print "---"; next }
|
|
35
|
+
}
|
|
36
|
+
in_fm == 1 {
|
|
37
|
+
if ($0 ~ /^description:/) print
|
|
38
|
+
else if ($0 ~ /^[[:space:]]*tools:[[:space:]]*\[/) {
|
|
39
|
+
# captura tools claude do override
|
|
40
|
+
next
|
|
41
|
+
}
|
|
42
|
+
next
|
|
43
|
+
}
|
|
44
|
+
{ print }
|
|
45
|
+
' "$src" > "$dst"
|
|
46
|
+
|
|
47
|
+
# extrai claude tools/model do override
|
|
48
|
+
# range explicito por indent: ativa em " claude:" (2 spaces), desativa em proxima chave de 2 spaces
|
|
49
|
+
local claude_tools claude_model
|
|
50
|
+
claude_tools=$(awk '/^ claude:/{f=1;next} f && /^ [a-z]+:/{f=0} f' "$src" | grep -E "^[[:space:]]+tools:" | head -1 | sed 's/^[[:space:]]*tools:[[:space:]]*//' || true)
|
|
51
|
+
claude_model=$(awk '/^ claude:/{f=1;next} f && /^ [a-z]+:/{f=0} f' "$src" | grep -E "^[[:space:]]+model:" | head -1 | sed 's/^[[:space:]]*model:[[:space:]]*//' || true)
|
|
52
|
+
|
|
53
|
+
# injeta tools e model no frontmatter alvo (apos description)
|
|
54
|
+
if [[ -n "$claude_tools" ]]; then
|
|
55
|
+
sed -i "/^description:/a tools: ${claude_tools}" "$dst"
|
|
56
|
+
fi
|
|
57
|
+
if [[ -n "$claude_model" ]]; then
|
|
58
|
+
sed -i "/^description:/a model: ${claude_model}" "$dst"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo " claude/agents/${name}.md"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
build_copilot_agent() {
|
|
65
|
+
local src="$1"
|
|
66
|
+
local name; name=$(basename "$src" .md)
|
|
67
|
+
local dst="${OUT}/copilot/agents/${name}.agent.md"
|
|
68
|
+
|
|
69
|
+
# mesmo principio, mas usa runtime_overrides.copilot
|
|
70
|
+
awk '
|
|
71
|
+
BEGIN { in_fm=0 }
|
|
72
|
+
/^---$/ {
|
|
73
|
+
if (in_fm==0) { in_fm=1; print; next } else { in_fm=0; print; next }
|
|
74
|
+
}
|
|
75
|
+
in_fm==1 && ($0 ~ /^name:|^description:/) { print; next }
|
|
76
|
+
in_fm==1 { next }
|
|
77
|
+
{ print }
|
|
78
|
+
' "$src" > "$dst"
|
|
79
|
+
|
|
80
|
+
local copilot_tools copilot_model
|
|
81
|
+
copilot_tools=$(awk '/^ copilot:/{f=1;next} f && /^ [a-z]+:/{f=0} f' "$src" | grep -E "^[[:space:]]+tools:" | head -1 | sed 's/^[[:space:]]*tools:[[:space:]]*//' || true)
|
|
82
|
+
copilot_model=$(awk '/^ copilot:/{f=1;next} f && /^ [a-z]+:/{f=0} f' "$src" | grep -E "^[[:space:]]+model:" | head -1 | sed 's/^[[:space:]]*model:[[:space:]]*//' || true)
|
|
83
|
+
|
|
84
|
+
[[ -n "$copilot_tools" ]] && sed -i "/^description:/a tools: ${copilot_tools}" "$dst"
|
|
85
|
+
[[ -n "$copilot_model" ]] && sed -i "/^description:/a model: ${copilot_model}" "$dst"
|
|
86
|
+
|
|
87
|
+
echo " copilot/agents/${name}.agent.md"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
build_antigravity_skill() {
|
|
91
|
+
local src="$1"
|
|
92
|
+
local name; name=$(basename "$src" .md)
|
|
93
|
+
local skill_dir="${OUT}/antigravity/skills/${name}"
|
|
94
|
+
local dst="${skill_dir}/SKILL.md"
|
|
95
|
+
|
|
96
|
+
mkdir -p "$skill_dir/references" "$skill_dir/scripts"
|
|
97
|
+
|
|
98
|
+
# mantem frontmatter + corpo. agrega triggers do runtime_overrides.antigravity.triggers_extra
|
|
99
|
+
awk '
|
|
100
|
+
BEGIN { in_fm=0; in_overrides=0 }
|
|
101
|
+
/^---$/ {
|
|
102
|
+
if (in_fm==0) { in_fm=1; print; next } else { in_fm=0; print; next }
|
|
103
|
+
}
|
|
104
|
+
in_fm==1 && ($0 ~ /^name:|^description:|^triggers:/) { print; next }
|
|
105
|
+
in_fm==1 && ($0 ~ /^[[:space:]]*-/) {
|
|
106
|
+
# eh continuacao de triggers. mantem
|
|
107
|
+
print; next
|
|
108
|
+
}
|
|
109
|
+
in_fm==1 { next }
|
|
110
|
+
{ print }
|
|
111
|
+
' "$src" > "$dst"
|
|
112
|
+
|
|
113
|
+
# append triggers_extra do antigravity override em "triggers:" se existir
|
|
114
|
+
local extras
|
|
115
|
+
extras=$(awk '/^[[:space:]]*antigravity:/,/^[[:space:]]*[a-z]+:/' "$src" \
|
|
116
|
+
| awk '/triggers_extra:/,/^[[:space:]]*[a-z_]+:/' \
|
|
117
|
+
| grep -E '^[[:space:]]*-[[:space:]]+"' \
|
|
118
|
+
| sed 's/^[[:space:]]*/ /' || true)
|
|
119
|
+
|
|
120
|
+
if [[ -n "$extras" ]]; then
|
|
121
|
+
# injeta sob "triggers:"
|
|
122
|
+
awk -v extras="$extras" '
|
|
123
|
+
/^triggers:/ { print; print extras; next }
|
|
124
|
+
{ print }
|
|
125
|
+
' "$dst" > "${dst}.tmp" && mv "${dst}.tmp" "$dst"
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
echo " antigravity/skills/${name}/SKILL.md"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
build_opencode_agent() {
|
|
132
|
+
local src="$1"
|
|
133
|
+
local name; name=$(basename "$src" .md)
|
|
134
|
+
local dst="${OUT}/opencode/agents/${name}.md"
|
|
135
|
+
|
|
136
|
+
# OpenCode usa frontmatter proprio (description, mode, model, temperature, permission)
|
|
137
|
+
awk '
|
|
138
|
+
BEGIN { in_fm=0 }
|
|
139
|
+
/^---$/ {
|
|
140
|
+
if (in_fm==0) { in_fm=1; print; next } else { in_fm=0; print; next }
|
|
141
|
+
}
|
|
142
|
+
in_fm==1 && ($0 ~ /^description:/) { print; next }
|
|
143
|
+
in_fm==1 { next }
|
|
144
|
+
{ print }
|
|
145
|
+
' "$src" > "$dst"
|
|
146
|
+
|
|
147
|
+
# Extrai bloco opencode do override
|
|
148
|
+
local oc_block
|
|
149
|
+
oc_block=$(awk '/^[[:space:]]*opencode:/,/^[[:space:]]{2}[a-z]+:|^---/' "$src" \
|
|
150
|
+
| grep -E '^[[:space:]]+(mode|model|temperature|permission):' \
|
|
151
|
+
| sed 's/^[[:space:]]\{4\}//' || true)
|
|
152
|
+
|
|
153
|
+
# permission tem sub-keys, precisa preservar indentacao maior
|
|
154
|
+
local perm_block
|
|
155
|
+
perm_block=$(awk '/^[[:space:]]*opencode:/,/^[[:space:]]{2}[a-z]+:|^---/' "$src" \
|
|
156
|
+
| awk '/permission:/,/^[[:space:]]{4}[a-z]+:|^[[:space:]]{2}[a-z]+:|^---/' \
|
|
157
|
+
| sed 's/^[[:space:]]\{4\}//' || true)
|
|
158
|
+
|
|
159
|
+
# injeta tudo apos description:
|
|
160
|
+
if [[ -n "$oc_block" ]]; then
|
|
161
|
+
awk -v block="$oc_block" '
|
|
162
|
+
/^description:/ { print; print block; next }
|
|
163
|
+
{ print }
|
|
164
|
+
' "$dst" > "${dst}.tmp" && mv "${dst}.tmp" "$dst"
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
echo " opencode/agents/${name}.md"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
build_command() {
|
|
171
|
+
local src="$1"
|
|
172
|
+
local name; name=$(basename "$src" .md)
|
|
173
|
+
|
|
174
|
+
# claude: commands/<name>.md (mesmo formato + frontmatter ajustado)
|
|
175
|
+
cp "$src" "${OUT}/claude/commands/${name}.md"
|
|
176
|
+
|
|
177
|
+
# copilot: prompts/<name>.prompt.md (mode: agent + ajustes)
|
|
178
|
+
cp "$src" "${OUT}/copilot/prompts/${name}.prompt.md"
|
|
179
|
+
|
|
180
|
+
# antigravity: skills/<name>/SKILL.md
|
|
181
|
+
local skill_dir="${OUT}/antigravity/skills/${name}"
|
|
182
|
+
mkdir -p "$skill_dir/scripts"
|
|
183
|
+
cp "$src" "${skill_dir}/SKILL.md"
|
|
184
|
+
|
|
185
|
+
# opencode: commands/<name>.md (formato proprio com agent: e subtask:)
|
|
186
|
+
cp "$src" "${OUT}/opencode/commands/${name}.md"
|
|
187
|
+
|
|
188
|
+
echo " command: ${name}"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Standalone skill em core/skills/<name>/SKILL.md (com optional references/ + scripts/).
|
|
192
|
+
# Diferente de build_antigravity_skill, que converte agent em skill - aqui a skill ja eh skill.
|
|
193
|
+
build_standalone_skill() {
|
|
194
|
+
local src_dir="$1"
|
|
195
|
+
local runtime="$2"
|
|
196
|
+
local dest_root="$3"
|
|
197
|
+
|
|
198
|
+
local name; name=$(basename "$src_dir")
|
|
199
|
+
local src_skill="${src_dir}/SKILL.md"
|
|
200
|
+
|
|
201
|
+
[[ ! -f "$src_skill" ]] && return 0
|
|
202
|
+
|
|
203
|
+
mkdir -p "$dest_root"
|
|
204
|
+
|
|
205
|
+
# Le description do frontmatter base
|
|
206
|
+
local desc
|
|
207
|
+
desc=$(awk '
|
|
208
|
+
BEGIN { in_fm=0 }
|
|
209
|
+
/^---$/ { if (in_fm==0) { in_fm=1; next } else { exit } }
|
|
210
|
+
in_fm==1 && /^description:/ {
|
|
211
|
+
sub(/^description:[[:space:]]*/, "")
|
|
212
|
+
print
|
|
213
|
+
exit
|
|
214
|
+
}
|
|
215
|
+
' "$src_skill")
|
|
216
|
+
|
|
217
|
+
# Constroi frontmatter alvo + body
|
|
218
|
+
{
|
|
219
|
+
echo "---"
|
|
220
|
+
echo "name: ${name}"
|
|
221
|
+
[[ -n "$desc" ]] && echo "description: ${desc}"
|
|
222
|
+
|
|
223
|
+
if [[ "$runtime" == "antigravity" ]]; then
|
|
224
|
+
# Antigravity descobre skills por triggers - extrai runtime_overrides.antigravity.triggers
|
|
225
|
+
local triggers
|
|
226
|
+
triggers=$(awk '
|
|
227
|
+
/^[[:space:]]*antigravity:/ { in_ag=1; next }
|
|
228
|
+
in_ag && /^[[:space:]]{2}[a-z_]+:/ { exit }
|
|
229
|
+
in_ag && /^[[:space:]]+triggers:/ { in_tr=1; next }
|
|
230
|
+
in_ag && in_tr && /^[[:space:]]+-[[:space:]]+/ { print " " $0; next }
|
|
231
|
+
in_ag && in_tr && /^[[:space:]]+[a-z_]+:/ { exit }
|
|
232
|
+
' "$src_skill" | sed 's/^[[:space:]]*-[[:space:]]\+/ - /')
|
|
233
|
+
|
|
234
|
+
if [[ -n "$triggers" ]]; then
|
|
235
|
+
echo "triggers:"
|
|
236
|
+
echo "$triggers"
|
|
237
|
+
fi
|
|
238
|
+
fi
|
|
239
|
+
|
|
240
|
+
echo "---"
|
|
241
|
+
|
|
242
|
+
# Body apos segundo ---
|
|
243
|
+
awk '
|
|
244
|
+
BEGIN { in_fm=0 }
|
|
245
|
+
/^---$/ {
|
|
246
|
+
if (in_fm==0) { in_fm=1; next }
|
|
247
|
+
else if (in_fm==1) { in_fm=2; next }
|
|
248
|
+
}
|
|
249
|
+
in_fm==2 { print }
|
|
250
|
+
' "$src_skill"
|
|
251
|
+
} > "${dest_root}/SKILL.md"
|
|
252
|
+
|
|
253
|
+
# Copia subdirs opcionais
|
|
254
|
+
for subdir in references scripts; do
|
|
255
|
+
if [[ -d "${src_dir}/${subdir}" ]]; then
|
|
256
|
+
rm -rf "${dest_root}/${subdir}"
|
|
257
|
+
cp -r "${src_dir}/${subdir}" "${dest_root}/"
|
|
258
|
+
fi
|
|
259
|
+
done
|
|
260
|
+
|
|
261
|
+
echo " ${runtime}/skills/${name}/SKILL.md"
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
main() {
|
|
265
|
+
ensure_dirs
|
|
266
|
+
|
|
267
|
+
echo "JDI build — gerando runtimes a partir de core/"
|
|
268
|
+
|
|
269
|
+
if [[ "$TARGET" == "claude" || "$TARGET" == "all" ]]; then
|
|
270
|
+
echo
|
|
271
|
+
echo "claude:"
|
|
272
|
+
for f in "$CORE"/agents/*.md; do
|
|
273
|
+
build_claude_agent "$f"
|
|
274
|
+
done
|
|
275
|
+
fi
|
|
276
|
+
|
|
277
|
+
if [[ "$TARGET" == "copilot" || "$TARGET" == "all" ]]; then
|
|
278
|
+
echo
|
|
279
|
+
echo "copilot:"
|
|
280
|
+
for f in "$CORE"/agents/*.md; do
|
|
281
|
+
build_copilot_agent "$f"
|
|
282
|
+
done
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
if [[ "$TARGET" == "antigravity" || "$TARGET" == "all" ]]; then
|
|
286
|
+
echo
|
|
287
|
+
echo "antigravity:"
|
|
288
|
+
for f in "$CORE"/agents/*.md; do
|
|
289
|
+
build_antigravity_skill "$f"
|
|
290
|
+
done
|
|
291
|
+
fi
|
|
292
|
+
|
|
293
|
+
if [[ "$TARGET" == "opencode" || "$TARGET" == "all" ]]; then
|
|
294
|
+
echo
|
|
295
|
+
echo "opencode:"
|
|
296
|
+
for f in "$CORE"/agents/*.md; do
|
|
297
|
+
build_opencode_agent "$f"
|
|
298
|
+
done
|
|
299
|
+
fi
|
|
300
|
+
|
|
301
|
+
echo
|
|
302
|
+
echo "commands (todos os runtimes):"
|
|
303
|
+
for f in "$CORE"/commands/*.md; do
|
|
304
|
+
build_command "$f"
|
|
305
|
+
done
|
|
306
|
+
|
|
307
|
+
# Standalone skills em core/skills/<name>/SKILL.md
|
|
308
|
+
if [[ -d "$CORE/skills" ]] && [[ -n "$(ls -A "$CORE/skills" 2>/dev/null)" ]]; then
|
|
309
|
+
echo
|
|
310
|
+
echo "skills (standalone):"
|
|
311
|
+
for skill_dir in "$CORE"/skills/*/; do
|
|
312
|
+
[[ ! -d "$skill_dir" ]] && continue
|
|
313
|
+
skill_name=$(basename "$skill_dir")
|
|
314
|
+
|
|
315
|
+
if [[ "$TARGET" == "claude" || "$TARGET" == "all" ]]; then
|
|
316
|
+
build_standalone_skill "$skill_dir" "claude" "${OUT}/claude/skills/${skill_name}"
|
|
317
|
+
fi
|
|
318
|
+
if [[ "$TARGET" == "opencode" || "$TARGET" == "all" ]]; then
|
|
319
|
+
build_standalone_skill "$skill_dir" "opencode" "${OUT}/opencode/skills/${skill_name}"
|
|
320
|
+
fi
|
|
321
|
+
if [[ "$TARGET" == "antigravity" || "$TARGET" == "all" ]]; then
|
|
322
|
+
build_standalone_skill "$skill_dir" "antigravity" "${OUT}/antigravity/skills/${skill_name}"
|
|
323
|
+
fi
|
|
324
|
+
# Copilot: nao tem conceito nativo de skill - skip
|
|
325
|
+
done
|
|
326
|
+
fi
|
|
327
|
+
|
|
328
|
+
echo
|
|
329
|
+
echo "Build completo. Veja runtimes/$TARGET/"
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
main
|