一键导入
jdi-do
Executes phase. Automatic routing to project's doer specialist. Wave-based parallel if phase has >=3 independent tasks. Accepts slug or position.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Executes phase. Automatic routing to project's doer specialist. Wave-based parallel if phase has >=3 independent tasks. Accepts slug or position.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Registers a new phase in ROADMAP.md. Slug-as-ID — multi-developer safe. Validates slug uniqueness and shape. Append at end (default), or position via --before/--after. Atomic commit.
Adopt mode for brownfield projects. Scans existing repo (manifests, layout, git, docs), infers stack/code-design, confirms with user, generates PROJECT.md + ROADMAP.md with adopted=true flag. Replaces /jdi-new for projects with code already written.
Removes a phase from ROADMAP.md. Accepts slug OR position. Refuses to remove done/current/past phases. Archives any existing phase artifacts. Atomic commit.
Upfront pre-roadmap research. Reads user idea, asks key questions, captures project-wide Definition of Done baseline, researches stack/domain, generates initial PROJECT.md + ROADMAP.md. Single agent instead of multiple parallel researchers to save tokens.
Prints a compact summary of where the project is — current phase, what the last action did, and the exact next command to run. --stats adds outcome metrics derived from artifacts (first-pass rate, loop iterations, lead time). Read-only. No agent invoked.
Adaptive question loop to capture locked decisions before planning the phase. Accepts slug or position.
| name | jdi-do |
| description | Executes phase. Automatic routing to project's doer specialist. Wave-based parallel if phase has >=3 independent tasks. Accepts slug or position. |
| argument_hint | <slug|position> [--sequential] |
| runtime_intent | {"invokes_agent":"dynamic"} |
| runtime_overrides | {"claude":{"allowed-tools":["Read","Write","Edit","Bash","Grep","Glob","AskUserQuestion","Agent"]},"copilot":{"tools":["read","write","edit","grep","glob","terminal"]},"opencode":{"subtask":true},"antigravity":{"triggers":["/jdi-do","execute phase"]}} |
test -d .jdi/ || { echo "Not a JDI project. /jdi-new."; exit 1; }
# STATE.md is an untracked advisory cache — absence is normal on a fresh clone
[ -f .jdi/STATE.md ] || echo "note: STATE.md absent — will be rewritten at the end of this command."
# Verify specialist exists
ls .jdi/agents/jdi-doer-*.md 2>/dev/null | head -1 || {
echo "Doer specialist missing. Run /jdi-bootstrap."
exit 1
}
RESOLVED="$(npx -y jdi-cli resolve-phase "$1")" || { echo "Phase '$1' not found."; exit 1; }
eval "$RESOLVED"
PHASE_SLUG="$JDI_PHASE_SLUG"
PHASE_DIR="$JDI_PHASE_DIR"
PHASE_POSITION="$JDI_PHASE_POSITION"
# Verify PLAN.md exists
test -f "$PHASE_DIR/PLAN.md" || { echo "PLAN.md missing for phase $PHASE_SLUG. Run /jdi-plan $PHASE_SLUG."; exit 1; }
# Context budget warm-up
npx -y jdi-cli monitor .jdi/PROJECT.md .jdi/DECISIONS.md "$PHASE_DIR/PLAN.md" "$PHASE_DIR/CONTEXT.md" || true
Read .jdi/specialists.md. Detect single vs multi-stack.
DOER_COUNT=$(grep -cE 'jdi-doer-[a-z0-9-]+' .jdi/specialists.md)
echo "Specialists registered: $DOER_COUNT"
if [ "$DOER_COUNT" -eq 0 ]; then
echo "No doer registered. Run /jdi-bootstrap."
exit 1
fi
Single-stack (DOER_COUNT == 1): take that doer, ignore task.specialist.
DOER=$(grep -oE 'jdi-doer-[a-z0-9-]+' .jdi/specialists.md | head -1)
Multi-stack (DOER_COUNT > 1): for each task in PLAN.md, read its **Specialist:** field (planner set this). Dispatch to that specialist. Tasks in same wave can spawn DIFFERENT specialists in parallel.
TASK_SPEC=$(awk -v t="$task_id" '/^#### '"$task_id"':/{flag=1} flag && /^\*\*Specialist:\*\*/{print $2; exit}' "$PHASE_DIR/PLAN.md")
If task lacks specialist field (legacy PLAN.md pre-1.12) → fallback to first doer registered.
Parse PLAN.md, extract:
status: pending)Fix mode (zero pending tasks): if no task is pending but
$PHASE_DIR/REVIEW.md exists with verdict BLOCKED (gates failed after all
tasks completed — e.g. coverage, lint), do NOT exit. Dispatch ONE doer in fix
mode and skip to Step 7:
Agent(
subagent_type="$DOER",
description="Fix blockers phase $PHASE_SLUG",
prompt="phase_slug=$PHASE_SLUG, phase_dir=$PHASE_DIR, mode=fix_blockers.
All tasks completed; REVIEW.md verdict is BLOCKED. Fix the items in
REVIEW.md ## Blockers, run tests, commit atomically."
)
If no pending tasks and no BLOCKED review → "phase already executed", exit 0.
If --sequential or phase has <3 parallel tasks: use sequential execution (1 doer at a time).
Otherwise: wave-based parallel.
For each wave:
For each wave in order:
[wave {W}/{total}] starting, {N} tasks
If parallel (>=2 tasks in wave + no overlap + not --sequential):
Sequential dispatch — ONE Agent() per message with run_in_background: true. Each task resolves its OWN subagent_type from task.specialist (multi-stack):
TASK_SPECIALIST = <task.specialist field from PLAN.md> OR <single doer fallback>
Agent(
subagent_type="${TASK_SPECIALIST}",
description="Execute T-{X} phase $PHASE_SLUG",
prompt="phase_slug=$PHASE_SLUG, phase_dir=$PHASE_DIR, task=T-{X}, mode=single_task",
run_in_background: true
)
Within a wave, multi-stack projects may spawn DIFFERENT specialists in parallel (different file scopes, disjoint files_modified).
Wait for all to return before next wave.
If sequential: same prompt, no run_in_background, one at a time.
Doer reads PLAN.md/PROJECT.md/CONTEXT.md on its own — specialist convention.
Read updated PLAN.md (doer updates status). Count:
Blocked-task rule (every wave except the last is "critical" by construction — later waves depend on it):
partial, skip to Step 9.partial at the end.Verify SUMMARY.md was created:
test -f "$PHASE_DIR/SUMMARY.md" || { echo "warn: SUMMARY missing"; }
current_phase: $PHASE_POSITION
current_phase_slug: $PHASE_SLUG
phase_status: {executed|partial}
next_step: /jdi-verify $PHASE_SLUG
# STATE.md is gitignored on 0.3.0+ projects (untracked cache) — stage it only
# where legacy projects still track it, and skip the commit when nothing staged
git add .jdi/STATE.md 2>/dev/null || true
git diff --cached --quiet || git commit -m "chore(state): phase $PHASE_SLUG executed"
Phase $PHASE_SLUG: {done}/{total} tasks ({blocked} blocked), {W} waves, {count} files.
SUMMARY: $PHASE_DIR/SUMMARY.md
Next: /jdi-verify $PHASE_SLUG
- pre: PLAN.md exists + doer specialist registered in .jdi/specialists.md
- post: tasks executed (partial or total), SUMMARY.md created, STATE updated
- Doer missing → /jdi-bootstrap
- PLAN missing → /jdi-plan
- Doer fails on task → task stays `blocked`, continue with the rest (does not abort all)
- Entire wave blocked → abort phase, mark `partial`
<runtime_notes>
Claude Code:
run_in_background: true in separate Agent callsCopilot:
--sequential in CopilotOpenCode/Antigravity: