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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jdi-plan
|
|
3
|
+
description: Generates phase PLAN.md. Decomposes into tasks with files_modified, acceptance, parallelism waves.
|
|
4
|
+
argument_hint: "<phase_number> [--review]"
|
|
5
|
+
runtime_intent:
|
|
6
|
+
invokes_agent: jdi-planner
|
|
7
|
+
runtime_overrides:
|
|
8
|
+
claude:
|
|
9
|
+
allowed-tools: [Read, Write, Bash, Grep, Glob, AskUserQuestion, Agent]
|
|
10
|
+
copilot:
|
|
11
|
+
tools: [read, write, grep, glob]
|
|
12
|
+
opencode:
|
|
13
|
+
agent: jdi-planner
|
|
14
|
+
subtask: true
|
|
15
|
+
model: anthropic/claude-sonnet-4-20250514
|
|
16
|
+
antigravity:
|
|
17
|
+
triggers:
|
|
18
|
+
- "/jdi-plan"
|
|
19
|
+
- "plan phase {N}"
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<objective>
|
|
23
|
+
Generates PLAN.md for the given phase. Decomposes into tasks (max 8), groups into parallelism waves, maps files_modified and acceptance.
|
|
24
|
+
</objective>
|
|
25
|
+
|
|
26
|
+
<arguments>
|
|
27
|
+
- `phase_number` (required): phase number, e.g. `1`, `2`
|
|
28
|
+
- `--review` (optional): show preview and ask for approval before saving
|
|
29
|
+
</arguments>
|
|
30
|
+
|
|
31
|
+
<process>
|
|
32
|
+
|
|
33
|
+
### Step 1: Validation
|
|
34
|
+
```bash
|
|
35
|
+
test -d .jdi/ || { echo "Not a JDI project. Run /jdi-new."; exit 1; }
|
|
36
|
+
test -f .jdi/PROJECT.md || { echo "PROJECT.md missing."; exit 1; }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Verify phase CONTEXT.md exists:
|
|
40
|
+
```bash
|
|
41
|
+
ls .jdi/phases/{NN}*/CONTEXT.md 2>/dev/null || { echo "CONTEXT.md missing. Run /jdi-discuss {N}"; exit 1; }
|
|
42
|
+
|
|
43
|
+
# Context budget warm-up (does not block)
|
|
44
|
+
JDI_LIB="$(dirname "$(command -v jdi 2>/dev/null || echo /usr/local/bin/jdi)")/../lib"
|
|
45
|
+
if [ -f "$JDI_LIB/jdi-monitor.sh" ]; then
|
|
46
|
+
bash "$JDI_LIB/jdi-monitor.sh" .jdi/PROJECT.md .jdi/DECISIONS.md .jdi/phases/{NN}*/CONTEXT.md || true
|
|
47
|
+
fi
|
|
48
|
+
# Windows: pwsh -File "$JDI_LIB/jdi-monitor.ps1" -Paths @(...)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 2: Spawn planner
|
|
52
|
+
Invoke `jdi-planner` with phase_number. Wait.
|
|
53
|
+
|
|
54
|
+
### Step 3: Verify
|
|
55
|
+
```bash
|
|
56
|
+
test -f .jdi/phases/{NN}*/PLAN.md || { echo "PLAN.md not created"; exit 1; }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 4: Confirm
|
|
60
|
+
Show plan summary + suggest `/jdi-do {N}`.
|
|
61
|
+
|
|
62
|
+
</process>
|
|
63
|
+
|
|
64
|
+
<gates>
|
|
65
|
+
- pre: `.jdi/PROJECT.md` + `.jdi/phases/{NN-slug}/CONTEXT.md` exist
|
|
66
|
+
- post: PLAN.md created + STATE.md updated + commit
|
|
67
|
+
</gates>
|
|
68
|
+
|
|
69
|
+
<errors>
|
|
70
|
+
- CONTEXT.md missing -> suggest `/jdi-discuss {N}`
|
|
71
|
+
- Phase does not exist in ROADMAP -> error
|
|
72
|
+
- Planner cancelled -> exit clean
|
|
73
|
+
</errors>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jdi-ship
|
|
3
|
+
description: Finalizes phase after verify. Updates ROADMAP.md, marks phase as done, advances pointer to next.
|
|
4
|
+
argument_hint: "<phase_number>"
|
|
5
|
+
runtime_intent:
|
|
6
|
+
invokes_agent: none
|
|
7
|
+
runtime_overrides:
|
|
8
|
+
claude:
|
|
9
|
+
allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion]
|
|
10
|
+
copilot:
|
|
11
|
+
tools: [read, write, edit, grep, glob, terminal]
|
|
12
|
+
opencode:
|
|
13
|
+
subtask: true
|
|
14
|
+
antigravity:
|
|
15
|
+
triggers:
|
|
16
|
+
- "/jdi-ship"
|
|
17
|
+
- "finalize phase {N}"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<objective>
|
|
21
|
+
Finalizes phase after /jdi-verify approves. Updates ROADMAP.md (phase: done), advances STATE to next phase, final commit.
|
|
22
|
+
</objective>
|
|
23
|
+
|
|
24
|
+
<arguments>
|
|
25
|
+
- `phase_number` (required)
|
|
26
|
+
</arguments>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
|
|
30
|
+
### Step 1: Validation
|
|
31
|
+
```bash
|
|
32
|
+
test -d .jdi/ || { echo "Not a JDI project."; exit 1; }
|
|
33
|
+
|
|
34
|
+
# Verify REVIEW.md exists
|
|
35
|
+
ls .jdi/phases/{NN}*/REVIEW.md 2>/dev/null || {
|
|
36
|
+
echo "REVIEW.md missing. /jdi-verify {N}."
|
|
37
|
+
exit 1
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Read verdict
|
|
41
|
+
VERDICT=$(grep -oE 'Verdict:\*\* (APPROVED|APPROVED_WITH_WARNINGS|BLOCKED)' .jdi/phases/{NN}*/REVIEW.md | awk '{print $2}')
|
|
42
|
+
|
|
43
|
+
if [ "$VERDICT" = "BLOCKED" ]; then
|
|
44
|
+
echo "Phase {N} BLOCKED. Fix before ship."
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Step 2: Confirm with user (only if WITH_WARNINGS)
|
|
50
|
+
|
|
51
|
+
If `VERDICT=APPROVED_WITH_WARNINGS`:
|
|
52
|
+
```
|
|
53
|
+
Phase {N} has uncorrected warnings. Ship anyway?
|
|
54
|
+
- Yes, ship (warnings remain in REVIEW.md)
|
|
55
|
+
- No, fix first
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If "No" -> exit clean.
|
|
59
|
+
|
|
60
|
+
### Step 3: Update ROADMAP.md
|
|
61
|
+
|
|
62
|
+
Edit `.jdi/ROADMAP.md`:
|
|
63
|
+
- Phase {N}: `status: done`
|
|
64
|
+
- Phase {N+1}: `status: ready` (if exists)
|
|
65
|
+
|
|
66
|
+
If no phase {N+1}:
|
|
67
|
+
```
|
|
68
|
+
All phases complete.
|
|
69
|
+
Project delivered.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 4: Update STATE.md
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
current_phase: {N+1 or done}
|
|
76
|
+
phase_status: ready (if {N+1} exists) or complete
|
|
77
|
+
next_step: /jdi-discuss {N+1} or done
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 5: Archive old phases (compaction)
|
|
81
|
+
|
|
82
|
+
Read `archive_after` from `.jdi/config.json` (default 5). If current phase advances to `N+1`, and a phase exists with number `<= (N+1) - archive_after`, move to `.jdi/archive/`.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ARCHIVE_AFTER=5
|
|
86
|
+
if [ -f .jdi/config.json ]; then
|
|
87
|
+
if command -v jq >/dev/null 2>&1; then
|
|
88
|
+
ARCHIVE_AFTER=$(jq -r '.compaction.archive_after // 5' .jdi/config.json)
|
|
89
|
+
fi
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
NEXT=$((N + 1))
|
|
93
|
+
THRESHOLD=$((NEXT - ARCHIVE_AFTER))
|
|
94
|
+
|
|
95
|
+
if [ "$THRESHOLD" -ge 1 ]; then
|
|
96
|
+
mkdir -p .jdi/archive
|
|
97
|
+
test -f .jdi/archive/index.md || echo "# Archive index" > .jdi/archive/index.md
|
|
98
|
+
|
|
99
|
+
for dir in .jdi/phases/*/; do
|
|
100
|
+
NN=$(basename "$dir" | grep -oE '^[0-9]+' || true)
|
|
101
|
+
[ -z "$NN" ] && continue
|
|
102
|
+
NN_NUM=$((10#$NN)) # force decimal
|
|
103
|
+
if [ "$NN_NUM" -le "$THRESHOLD" ]; then
|
|
104
|
+
VERDICT_OLD=$(grep -oE 'Verdict:\*\* (APPROVED|APPROVED_WITH_WARNINGS|BLOCKED)' "$dir/REVIEW.md" 2>/dev/null | awk '{print $2}' || echo "UNKNOWN")
|
|
105
|
+
mv "$dir" .jdi/archive/
|
|
106
|
+
echo "- $(basename "$dir"): ${VERDICT_OLD} (archived $(date -u +%F))" >> .jdi/archive/index.md
|
|
107
|
+
fi
|
|
108
|
+
done
|
|
109
|
+
fi
|
|
110
|
+
# Windows: equivalent in PowerShell — Move-Item + Add-Content
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Archived phases remain accessible via `.jdi/archive/` but exit the default read-path. Read-depth rule (`ARCHITECTURE.md > Read-depth scaling`) treats archive as `<= current - 2`.
|
|
114
|
+
|
|
115
|
+
### Step 6: Final commit
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git add .jdi/ROADMAP.md .jdi/STATE.md .jdi/archive/ 2>/dev/null
|
|
119
|
+
git commit -m "feat({NN-slug}): ship phase {N} ({VERDICT})"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Optional tag (if PROJECT.md has `tag_phases: true`):
|
|
123
|
+
```bash
|
|
124
|
+
git tag "phase-{N}-{slug}"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Step 7: Confirm
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
Phase {N} shipped.
|
|
131
|
+
{if more phases:} Next: /jdi-discuss {N+1}
|
|
132
|
+
{if last:} Project delivered. Tag: phase-{N}-{slug}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
</process>
|
|
136
|
+
|
|
137
|
+
<gates>
|
|
138
|
+
- pre: REVIEW.md exists + verdict != BLOCKED
|
|
139
|
+
- post: ROADMAP.md + STATE.md updated + old phases archived (if applicable) + commit (+ optional tag)
|
|
140
|
+
</gates>
|
|
141
|
+
|
|
142
|
+
<errors>
|
|
143
|
+
- REVIEW missing -> /jdi-verify
|
|
144
|
+
- Verdict BLOCKED -> abort
|
|
145
|
+
- Already shipped -> abort with warning
|
|
146
|
+
</errors>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jdi-verify
|
|
3
|
+
description: Runs phase quality gates via reviewer specialist. Build, tests, coverage, lint, security checks. Verdict APPROVED / APPROVED_WITH_WARNINGS / BLOCKED.
|
|
4
|
+
argument_hint: "<phase_number>"
|
|
5
|
+
runtime_intent:
|
|
6
|
+
invokes_agent: dynamic
|
|
7
|
+
runtime_overrides:
|
|
8
|
+
claude:
|
|
9
|
+
allowed-tools: [Read, Bash, Grep, Glob, Agent]
|
|
10
|
+
copilot:
|
|
11
|
+
tools: [read, grep, glob, terminal]
|
|
12
|
+
opencode:
|
|
13
|
+
subtask: true
|
|
14
|
+
model: anthropic/claude-sonnet-4-20250514
|
|
15
|
+
antigravity:
|
|
16
|
+
triggers:
|
|
17
|
+
- "/jdi-verify"
|
|
18
|
+
- "verify phase {N}"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<objective>
|
|
22
|
+
Verifies the phase was delivered correctly. Runs gates defined in the project's reviewer specialist. Verdict blocks or releases the ship.
|
|
23
|
+
</objective>
|
|
24
|
+
|
|
25
|
+
<arguments>
|
|
26
|
+
- `phase_number` (required)
|
|
27
|
+
</arguments>
|
|
28
|
+
|
|
29
|
+
<process>
|
|
30
|
+
|
|
31
|
+
### Step 1: Validation
|
|
32
|
+
```bash
|
|
33
|
+
test -d .jdi/ || { echo "Not a JDI project."; exit 1; }
|
|
34
|
+
|
|
35
|
+
# Verify reviewer exists
|
|
36
|
+
ls .jdi/agents/jdi-reviewer-*.md 2>/dev/null | head -1 || {
|
|
37
|
+
echo "Reviewer missing. /jdi-bootstrap."
|
|
38
|
+
exit 1
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Verify phase was executed
|
|
42
|
+
ls .jdi/phases/{NN}*/SUMMARY.md 2>/dev/null || {
|
|
43
|
+
echo "Phase {N} not executed. /jdi-do {N}."
|
|
44
|
+
exit 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# Context budget warm-up (does not block)
|
|
48
|
+
JDI_LIB="$(dirname "$(command -v jdi 2>/dev/null || echo /usr/local/bin/jdi)")/../lib"
|
|
49
|
+
if [ -f "$JDI_LIB/jdi-monitor.sh" ]; then
|
|
50
|
+
bash "$JDI_LIB/jdi-monitor.sh" .jdi/PROJECT.md .jdi/DECISIONS.md .jdi/phases/{NN}*/PLAN.md .jdi/phases/{NN}*/SUMMARY.md || true
|
|
51
|
+
fi
|
|
52
|
+
# Windows: pwsh -File "$JDI_LIB/jdi-monitor.ps1" -Paths @(...)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Step 2: Resolve reviewer specialist(s)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
REVIEWERS=$(grep -oE 'jdi-reviewer-[a-z0-9-]+' .jdi/reviewers.md | sort -u)
|
|
59
|
+
REVIEWER_COUNT=$(echo "$REVIEWERS" | wc -l)
|
|
60
|
+
echo "Reviewers registered: $REVIEWER_COUNT"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Single-stack** (`REVIEWER_COUNT == 1`): one reviewer, normal flow.
|
|
64
|
+
**Multi-stack** (`REVIEWER_COUNT > 1`): chain reviewers in registry order. Each writes its own REVIEW segment; aggregate verdict = worst-case (1 BLOCK = overall BLOCK).
|
|
65
|
+
|
|
66
|
+
### Step 3: Spawn reviewer(s)
|
|
67
|
+
|
|
68
|
+
**Single-stack:**
|
|
69
|
+
```
|
|
70
|
+
Agent(
|
|
71
|
+
subagent_type="${REVIEWERS}",
|
|
72
|
+
description="Verify phase {N}",
|
|
73
|
+
prompt="phase={N}, mode=verify"
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Multi-stack:** spawn each reviewer in sequence (NOT parallel — build/test commands may conflict on ports, locks, output dirs):
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
for REVIEWER in $REVIEWERS:
|
|
81
|
+
Agent(
|
|
82
|
+
subagent_type="$REVIEWER",
|
|
83
|
+
description="Verify phase {N} ({REVIEWER})",
|
|
84
|
+
prompt="phase={N}, mode=verify, reviewer_segment=${REVIEWER}"
|
|
85
|
+
)
|
|
86
|
+
# Each reviewer appends to .jdi/phases/{NN-slug}/REVIEW.md under section
|
|
87
|
+
# "## Reviewer: {REVIEWER}" with its own gate results and verdict
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Each reviewer scopes its gates to its `file_glob` (from frontmatter `scope.file_glob`). Coverage threshold enforced only on files matching the glob.
|
|
91
|
+
|
|
92
|
+
Reviewers are read-only. Wait for completion before next.
|
|
93
|
+
|
|
94
|
+
### Step 4: Read aggregate verdict
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
test -f .jdi/phases/{NN}*/REVIEW.md || { echo "REVIEW.md not created"; exit 1; }
|
|
98
|
+
|
|
99
|
+
# Collect all per-reviewer verdicts
|
|
100
|
+
VERDICTS=$(grep -oE 'Verdict:\*\* (APPROVED|APPROVED_WITH_WARNINGS|BLOCKED)' .jdi/phases/{NN}*/REVIEW.md | awk '{print $2}')
|
|
101
|
+
|
|
102
|
+
# Worst-case wins: BLOCK > WARNINGS > APPROVED
|
|
103
|
+
if echo "$VERDICTS" | grep -q BLOCKED; then
|
|
104
|
+
VERDICT=BLOCKED
|
|
105
|
+
elif echo "$VERDICTS" | grep -q APPROVED_WITH_WARNINGS; then
|
|
106
|
+
VERDICT=APPROVED_WITH_WARNINGS
|
|
107
|
+
else
|
|
108
|
+
VERDICT=APPROVED
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
# For single-stack, this collapses to the single reviewer's verdict — backward compatible.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 5: Update STATE
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
current_phase: {N}
|
|
118
|
+
phase_status: {verified|blocked}
|
|
119
|
+
phase_verdict: {APPROVED|APPROVED_WITH_WARNINGS|BLOCKED}
|
|
120
|
+
next_step: {if APPROVED or WITH_WARNINGS: /jdi-ship {N}; if BLOCKED: fix and /jdi-do {N} again}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git add .jdi/phases/{NN-slug}/REVIEW.md .jdi/STATE.md
|
|
125
|
+
git commit -m "docs({NN-slug}): verify phase ({VERDICT})"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 6: Confirm
|
|
129
|
+
|
|
130
|
+
**APPROVED:**
|
|
131
|
+
```
|
|
132
|
+
Phase {N}: APPROVED. Next: /jdi-ship {N}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**APPROVED_WITH_WARNINGS:**
|
|
136
|
+
```
|
|
137
|
+
Phase {N}: APPROVED_WITH_WARNINGS ({count} warnings).
|
|
138
|
+
REVIEW.md: .jdi/phases/{NN-slug}/REVIEW.md
|
|
139
|
+
Next: /jdi-ship {N} (or fix first)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**BLOCKED:**
|
|
143
|
+
```
|
|
144
|
+
Phase {N}: BLOCKED ({count} blockers). REVIEW.md: .jdi/phases/{NN-slug}/REVIEW.md
|
|
145
|
+
Fix → /jdi-do {N} → /jdi-verify {N}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
</process>
|
|
149
|
+
|
|
150
|
+
<gates>
|
|
151
|
+
- pre: SUMMARY.md exists + reviewer registered in .jdi/reviewers.md
|
|
152
|
+
- post: REVIEW.md created + STATE updated
|
|
153
|
+
</gates>
|
|
154
|
+
|
|
155
|
+
<errors>
|
|
156
|
+
- Reviewer missing -> /jdi-bootstrap
|
|
157
|
+
- SUMMARY missing -> /jdi-do
|
|
158
|
+
- Reviewer fails -> show error, keep state, suggest retry
|
|
159
|
+
</errors>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// OpenCode config — JDI managed (autonomous mode)
|
|
2
|
+
//
|
|
3
|
+
// Manual edits abaixo desta linha sao preservados quando /jdi-bootstrap rodar
|
|
4
|
+
// de novo (provider e agent.jdi-* sao gerenciados pelo JDI; outros campos sao seus).
|
|
5
|
+
//
|
|
6
|
+
// Schema reference: https://opencode.ai/docs/config
|
|
7
|
+
//
|
|
8
|
+
// JDI default = AUTONOMOUS: comandos seguros (ls, cat, mkdir, git seguros,
|
|
9
|
+
// build/test toolchain) sao auto-permitidos. Comandos perigosos (rm -rf, git push,
|
|
10
|
+
// reset --hard, sudo, curl) ainda pedem confirmacao.
|
|
11
|
+
//
|
|
12
|
+
// Pra paranoid mode (pede permissao em tudo), troca todas linhas "allow" por "ask".
|
|
13
|
+
// Pra YOLO mode (sem nada de seguranca), troca pra "*": "allow" — NAO RECOMENDADO.
|
|
14
|
+
{
|
|
15
|
+
"$schema": "https://opencode.ai/config.json",
|
|
16
|
+
// Custom instructions: arquivos carregados como contexto extra alem do AGENTS.md.
|
|
17
|
+
// Descomente se quiser que TODO prompt do agent default carregue PROJECT.md:
|
|
18
|
+
// "instructions": [".jdi/PROJECT.md", ".jdi/DECISIONS.md"],
|
|
19
|
+
"permission": {
|
|
20
|
+
"edit": "allow",
|
|
21
|
+
"webfetch": "ask",
|
|
22
|
+
"bash": {
|
|
23
|
+
// === Read-only / inspecao — allow ===
|
|
24
|
+
"ls*": "allow",
|
|
25
|
+
"dir*": "allow",
|
|
26
|
+
"cat*": "allow",
|
|
27
|
+
"type*": "allow",
|
|
28
|
+
"pwd": "allow",
|
|
29
|
+
"echo*": "allow",
|
|
30
|
+
"Get-ChildItem*": "allow",
|
|
31
|
+
"Get-Content*": "allow",
|
|
32
|
+
"Get-Location": "allow",
|
|
33
|
+
"Test-Path*": "allow",
|
|
34
|
+
"Select-String*": "allow",
|
|
35
|
+
"head*": "allow",
|
|
36
|
+
"tail*": "allow",
|
|
37
|
+
"grep*": "allow",
|
|
38
|
+
"rg*": "allow",
|
|
39
|
+
"find*": "allow",
|
|
40
|
+
"which*": "allow",
|
|
41
|
+
"where*": "allow",
|
|
42
|
+
// === Filesystem write seguro — allow ===
|
|
43
|
+
"mkdir*": "allow",
|
|
44
|
+
"New-Item*": "allow",
|
|
45
|
+
"touch*": "allow",
|
|
46
|
+
"Set-Content*": "allow",
|
|
47
|
+
"Add-Content*": "allow",
|
|
48
|
+
"Out-File*": "allow",
|
|
49
|
+
"cp*": "allow",
|
|
50
|
+
"Copy-Item*": "allow",
|
|
51
|
+
"mv*": "allow",
|
|
52
|
+
"Move-Item*": "allow",
|
|
53
|
+
"Rename-Item*": "allow",
|
|
54
|
+
// === Git seguro — allow ===
|
|
55
|
+
"git status*": "allow",
|
|
56
|
+
"git log*": "allow",
|
|
57
|
+
"git diff*": "allow",
|
|
58
|
+
"git add*": "allow",
|
|
59
|
+
"git commit*": "allow",
|
|
60
|
+
"git tag*": "allow",
|
|
61
|
+
"git branch*": "allow",
|
|
62
|
+
"git checkout*": "allow",
|
|
63
|
+
"git switch*": "allow",
|
|
64
|
+
"git config*": "allow",
|
|
65
|
+
"git rev-parse*": "allow",
|
|
66
|
+
"git symbolic-ref*": "allow",
|
|
67
|
+
"git init*": "allow",
|
|
68
|
+
"git stash*": "allow",
|
|
69
|
+
"git fetch*": "allow",
|
|
70
|
+
"git pull --ff-only*": "allow",
|
|
71
|
+
"git restore*": "allow",
|
|
72
|
+
"git show*": "allow",
|
|
73
|
+
"git remote -v*": "allow",
|
|
74
|
+
"git ls-files*": "allow",
|
|
75
|
+
// === Build/test toolchain — allow ===
|
|
76
|
+
"dotnet build*": "allow",
|
|
77
|
+
"dotnet test*": "allow",
|
|
78
|
+
"dotnet format*": "allow",
|
|
79
|
+
"dotnet ef*": "allow",
|
|
80
|
+
"dotnet run*": "allow",
|
|
81
|
+
"dotnet new*": "allow",
|
|
82
|
+
"dotnet add*": "allow",
|
|
83
|
+
"dotnet restore*": "allow",
|
|
84
|
+
"pnpm *": "allow",
|
|
85
|
+
"npm run*": "allow",
|
|
86
|
+
"npm test*": "allow",
|
|
87
|
+
"npm install*": "allow",
|
|
88
|
+
"npm ci*": "allow",
|
|
89
|
+
"npx *": "allow",
|
|
90
|
+
"yarn *": "allow",
|
|
91
|
+
"vitest*": "allow",
|
|
92
|
+
"jest*": "allow",
|
|
93
|
+
"playwright*": "allow",
|
|
94
|
+
"pytest*": "allow",
|
|
95
|
+
"poetry *": "allow",
|
|
96
|
+
"uv *": "allow",
|
|
97
|
+
"pip install*": "allow",
|
|
98
|
+
"cargo build*": "allow",
|
|
99
|
+
"cargo test*": "allow",
|
|
100
|
+
"cargo check*": "allow",
|
|
101
|
+
"cargo clippy*": "allow",
|
|
102
|
+
"cargo fmt*": "allow",
|
|
103
|
+
"go build*": "allow",
|
|
104
|
+
"go test*": "allow",
|
|
105
|
+
"go run*": "allow",
|
|
106
|
+
"go fmt*": "allow",
|
|
107
|
+
"make*": "allow",
|
|
108
|
+
// === Container/orquestracao seguro — allow ===
|
|
109
|
+
"docker ps*": "allow",
|
|
110
|
+
"docker images*": "allow",
|
|
111
|
+
"docker logs*": "allow",
|
|
112
|
+
"docker compose ps*": "allow",
|
|
113
|
+
"docker compose logs*": "allow",
|
|
114
|
+
"kubectl get*": "allow",
|
|
115
|
+
"kubectl describe*": "allow",
|
|
116
|
+
"kubectl logs*": "allow",
|
|
117
|
+
// === Perigosos — ask ===
|
|
118
|
+
// "git push*": "ask",
|
|
119
|
+
// "git push --force*": "ask",
|
|
120
|
+
// "git reset --hard*": "ask",
|
|
121
|
+
// "git rebase*": "ask",
|
|
122
|
+
// "git revert*": "ask",
|
|
123
|
+
// "git merge*": "ask",
|
|
124
|
+
// "git clean*": "ask",
|
|
125
|
+
// "rm -rf*": "ask",
|
|
126
|
+
// "rmdir*": "ask",
|
|
127
|
+
// "Remove-Item*": "ask",
|
|
128
|
+
// "del *": "ask",
|
|
129
|
+
// "chmod*": "ask",
|
|
130
|
+
// "chown*": "ask",
|
|
131
|
+
// "sudo*": "ask",
|
|
132
|
+
// "curl*": "ask",
|
|
133
|
+
// "wget*": "ask",
|
|
134
|
+
// "Invoke-WebRequest*": "ask",
|
|
135
|
+
// "Invoke-RestMethod*": "ask",
|
|
136
|
+
// "docker run*": "ask",
|
|
137
|
+
// "docker rm*": "ask",
|
|
138
|
+
// "docker rmi*": "ask",
|
|
139
|
+
// "docker volume rm*": "ask",
|
|
140
|
+
// "docker compose down*": "ask",
|
|
141
|
+
// "kubectl delete*": "ask",
|
|
142
|
+
// "kubectl apply*": "ask",
|
|
143
|
+
// "Set-ExecutionPolicy*": "ask",
|
|
144
|
+
// === Catch-all — ask ===
|
|
145
|
+
"*": "allow"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// ---- INJETADO PELO /jdi-bootstrap (se llm_config customizado em PROJECT.md) ----
|
|
149
|
+
//
|
|
150
|
+
// Exemplo Ollama:
|
|
151
|
+
// "provider": {
|
|
152
|
+
// "ollama": {
|
|
153
|
+
// "npm": "@ai-sdk/openai-compatible",
|
|
154
|
+
// "name": "Ollama",
|
|
155
|
+
// "options": { "baseURL": "http://localhost:11434/v1" },
|
|
156
|
+
// "models": {
|
|
157
|
+
// "glm-5.1:cloud": { "name": "GLM 5.1 Cloud", "tools": true }
|
|
158
|
+
// }
|
|
159
|
+
// }
|
|
160
|
+
// },
|
|
161
|
+
// "model": "ollama/glm-5.1:cloud",
|
|
162
|
+
// "agent": {
|
|
163
|
+
// "jdi-doer-{slug}": { "model": "ollama/glm-5.1:cloud" },
|
|
164
|
+
// "jdi-reviewer-{slug}": { "model": "ollama/glm-5.1:cloud" }
|
|
165
|
+
// }
|
|
166
|
+
// Custom commands sao auto-descobertos em .opencode/commands/*.md
|
|
167
|
+
// Custom agents sao auto-descobertos em .opencode/agents/*.md
|
|
168
|
+
// Custom skills sao auto-descobertos em .opencode/skills/<name>/SKILL.md
|
|
169
|
+
}
|