@benzotti/jdi 0.1.46

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 (89) hide show
  1. package/README.md +431 -0
  2. package/action/action.yml +116 -0
  3. package/action/workflow-template.yml +242 -0
  4. package/dist/index.js +12860 -0
  5. package/framework/adapters/generic.yaml +23 -0
  6. package/framework/adapters/laravel.yaml +46 -0
  7. package/framework/adapters/nextjs.yaml +36 -0
  8. package/framework/adapters/node.yaml +29 -0
  9. package/framework/agents/jdi-architect.md +147 -0
  10. package/framework/agents/jdi-backend.md +79 -0
  11. package/framework/agents/jdi-codebase-mapper.md +59 -0
  12. package/framework/agents/jdi-committer.md +83 -0
  13. package/framework/agents/jdi-debugger.md +73 -0
  14. package/framework/agents/jdi-devops.md +78 -0
  15. package/framework/agents/jdi-feedback-learner.md +93 -0
  16. package/framework/agents/jdi-frontend.md +78 -0
  17. package/framework/agents/jdi-head-engineering.md +30 -0
  18. package/framework/agents/jdi-perf-analyst.md +116 -0
  19. package/framework/agents/jdi-phase-researcher.md +59 -0
  20. package/framework/agents/jdi-plan-checker.md +80 -0
  21. package/framework/agents/jdi-planner.md +271 -0
  22. package/framework/agents/jdi-pr-feedback.md +120 -0
  23. package/framework/agents/jdi-pr-generator.md +100 -0
  24. package/framework/agents/jdi-producer.md +196 -0
  25. package/framework/agents/jdi-product-lead.md +44 -0
  26. package/framework/agents/jdi-programmer.md +104 -0
  27. package/framework/agents/jdi-qa-tester.md +113 -0
  28. package/framework/agents/jdi-quality.md +106 -0
  29. package/framework/agents/jdi-researcher.md +70 -0
  30. package/framework/agents/jdi-security.md +118 -0
  31. package/framework/agents/jdi-ux-designer.md +78 -0
  32. package/framework/agents/jdi-verifier.md +80 -0
  33. package/framework/commands/build.md +148 -0
  34. package/framework/commands/commit.md +71 -0
  35. package/framework/commands/create-plan.md +192 -0
  36. package/framework/commands/generate-pr.md +91 -0
  37. package/framework/commands/implement-plan.md +218 -0
  38. package/framework/commands/init.md +65 -0
  39. package/framework/commands/pr-feedback.md +75 -0
  40. package/framework/commands/pr-review.md +92 -0
  41. package/framework/commands/quick.md +124 -0
  42. package/framework/commands/status.md +13 -0
  43. package/framework/commands/worktree-remove.md +32 -0
  44. package/framework/commands/worktree.md +52 -0
  45. package/framework/components/execution/CodebaseContext.md +36 -0
  46. package/framework/components/execution/Commit.md +121 -0
  47. package/framework/components/execution/Verify.md +140 -0
  48. package/framework/components/execution/VerifyAdvanced.md +43 -0
  49. package/framework/components/meta/AgentBase.md +121 -0
  50. package/framework/components/meta/AgentRouter.md +318 -0
  51. package/framework/components/meta/AgentTeamsOrchestration.md +115 -0
  52. package/framework/components/meta/ComplexityRouter.md +116 -0
  53. package/framework/components/meta/SilentDiscovery.md +79 -0
  54. package/framework/components/meta/StateUpdate.md +56 -0
  55. package/framework/components/meta/StrictnessProtocol.md +60 -0
  56. package/framework/components/meta/TeamRouter.md +86 -0
  57. package/framework/components/planning/TaskBreakdown.md +95 -0
  58. package/framework/components/planning/WaveComputation.md +59 -0
  59. package/framework/components/quality/PRReview.md +225 -0
  60. package/framework/config/jdi-config.yaml +159 -0
  61. package/framework/config/state.yaml +72 -0
  62. package/framework/config/variables.yaml +43 -0
  63. package/framework/hooks/checkpoint.md +196 -0
  64. package/framework/hooks/jdi-worktree-cleanup.md +123 -0
  65. package/framework/hooks/lint-fix-frontend.md +59 -0
  66. package/framework/hooks/on-pause.md +213 -0
  67. package/framework/hooks/pre-commit.md +143 -0
  68. package/framework/jdi.md +336 -0
  69. package/framework/learnings/backend.md +3 -0
  70. package/framework/learnings/devops.md +3 -0
  71. package/framework/learnings/frontend.md +3 -0
  72. package/framework/learnings/general.md +3 -0
  73. package/framework/learnings/testing.md +3 -0
  74. package/framework/rules/commit-rules.md +24 -0
  75. package/framework/rules/deviation-rules.md +221 -0
  76. package/framework/teams/devops.md +26 -0
  77. package/framework/teams/engineering.md +29 -0
  78. package/framework/teams/micro-management.md +26 -0
  79. package/framework/teams/product-research.md +29 -0
  80. package/framework/teams/quality-assurance.md +27 -0
  81. package/framework/templates/CLAUDE-SHARED.md +60 -0
  82. package/framework/templates/PLAN-TASK.md +35 -0
  83. package/framework/templates/PLAN.md +158 -0
  84. package/framework/templates/PROJECT.yaml +16 -0
  85. package/framework/templates/REQUIREMENTS.yaml +27 -0
  86. package/framework/templates/ROADMAP.yaml +24 -0
  87. package/framework/templates/SUMMARY.md +201 -0
  88. package/framework/workflows/README.md +87 -0
  89. package/package.json +40 -0
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: implement-plan
3
+ description: "JDI: Execute implementation plan"
4
+ allowed-tools: Read, Glob, Grep, Bash, Write, Edit, Task
5
+ argument-hint: "[--team | --single | --dry-run | --skip-qa]"
6
+ context: |
7
+ !cat .jdi/config/state.yaml 2>/dev/null | head -30
8
+ ---
9
+
10
+ # /jdi:implement-plan
11
+
12
+ Execute an approved plan with complexity-based routing. Deterministic workflow — every invocation follows the same numbered steps, in order, without skipping.
13
+
14
+ **This skill follows `<JDI:StrictnessProtocol />` and `<JDI:SilentDiscovery />`. Read those components before executing any step below.**
15
+
16
+ ---
17
+
18
+ ## Flags
19
+
20
+ - `--team` — Force Agent Teams mode regardless of complexity signals
21
+ - `--single` — Force single-agent mode regardless of complexity signals
22
+ - `--dry-run` — Preview without writing: list files that would change and agents that would be spawned, then STOP
23
+ - `--skip-qa` — Skip the post-task `jdi-qa-tester` verification pass
24
+
25
+ > **Do NOT use the built-in `EnterWorktree` tool.** If `state.yaml` has `worktree.active: true`, just `cd` into `worktree.path`.
26
+
27
+ ---
28
+
29
+ ## Orchestration
30
+
31
+ The steps below are numbered and ordered. Do NOT skip, merge, or reorder them. Each step ends with a clear state transition — if you cannot produce that transition, STOP and ask.
32
+
33
+ ### 1. Silent Discovery
34
+
35
+ Execute `<JDI:SilentDiscovery />` now. Read the scaffolding files listed in that component and store the result internally as `DISCOVERED_STATE`. Do NOT print the discovery output to the user.
36
+
37
+ **Additional reads for this skill:**
38
+ - `.jdi/codebase/SUMMARY.md` if it exists
39
+ - `.jdi/framework/learnings/general.md` (always)
40
+ - Domain-specific learnings based on `DISCOVERED_STATE.tech_stack`: PHP → `backend.md`, TS/React → `frontend.md`, testing → `testing.md`, devops → `devops.md`
41
+
42
+ Learnings override defaults. Record which learnings files were found in `DISCOVERED_STATE.learnings_loaded`.
43
+
44
+ ### 2. Load Plan
45
+
46
+ Read the plan index file (path from `$ARGUMENTS` or from `DISCOVERED_STATE.current_plan.path`). Parse the frontmatter for:
47
+
48
+ - `tasks:` or `task_files:` (legacy monolithic vs split plan)
49
+ - `deps:` and `waves:`
50
+ - `tech_stack:`
51
+ - `available_agents:` catalogue
52
+ - `primary_agent:` pin
53
+
54
+ **Format detection:** if frontmatter contains `task_files:`, this is a split plan — read each task file's frontmatter in a single batch. If absent, this is a legacy monolithic plan — all tasks are inline in the index.
55
+
56
+ **Plan status gate:** if the plan's status in `state.yaml` is not `approved`, STOP and tell the user: "Plan is in status `{status}` — run `/jdi:create-plan` (or the review loop) to reach `approved` before implementing."
57
+
58
+ ### 3. Resolve Per-Task Agents
59
+
60
+ For every task file listed in `task_files:`, record the `agent:` field from its frontmatter. This is the `subagent_type` you will pass to the Task tool when spawning.
61
+
62
+ **Resolution order:**
63
+ 1. Task-level `agent:` pin from the task file frontmatter
64
+ 2. Plan-level `primary_agent:` from the index frontmatter
65
+ 3. Tech-stack default: PHP → `jdi-backend`, TS/React → `jdi-frontend`, otherwise → `general-purpose`
66
+
67
+ **NEVER default everything to `general-purpose` silently.** See `framework/components/meta/AgentRouter.md`.
68
+
69
+ ### 4. Agent Existence Check
70
+
71
+ For each pinned agent, read the matching `source:` from the plan's `available_agents` catalogue and confirm the spec exists:
72
+
73
+ - **`source: jdi`** — check `.jdi/framework/agents/{name}.md` (installed projects) or `framework/agents/{name}.md` (self-hosting JDI repo)
74
+ - **`source: claude-code`** — check `.claude/agents/{name}.md` (project-local) or `~/.claude/agents/{name}.md` (user-global)
75
+
76
+ If the spec is NOT found, downgrade to `general-purpose` (with a `jdi-backend` / `jdi-frontend` spec load in the prompt) and record an `agent_downgrade:` entry listing the original pin, the downgrade target, and the reason. This entry MUST appear in the final summary — never silently change a pin.
77
+
78
+ ### 5. Complexity Routing
79
+
80
+ Apply `<JDI:ComplexityRouter />`:
81
+ - **Simple** (≤3 tasks, single stack/wave) → single-agent mode
82
+ - **Complex** (>3 tasks OR multi-stack OR multi-wave) → Agent Teams swarm
83
+
84
+ **Override flags:** `--team` forces Agent Teams mode; `--single` forces single-agent mode. Overrides win over complexity signals.
85
+
86
+ Record the routing decision and reasoning in `DISCOVERED_STATE.routing`.
87
+
88
+ ### 6. Dry Run Check
89
+
90
+ If `--dry-run` is present, output:
91
+ - The resolved agent per task
92
+ - Any `agent_downgrade:` entries
93
+ - The routing decision
94
+ - The list of files each task claims to touch (from task spec)
95
+
96
+ Then **STOP**. Do NOT spawn agents, do NOT advance state, do NOT edit files.
97
+
98
+ ### 7. Advance State to Executing
99
+
100
+ Run `bun run src/index.ts state executing` (in installed projects: `npx jdi state executing`). Do NOT manually edit `state.yaml`.
101
+
102
+ ### 8. Spawn and Execute
103
+
104
+ **Platform constraint:** JDI specialists (`source: jdi`) are NOT registered Claude Code subagents and MUST be spawned via `subagent_type="general-purpose"` with identity injected via prompt text (`"You are {agent}. Read .jdi/framework/agents/{agent}.md..."`). Registered Claude Code subagents (`source: claude-code`) are spawned directly by name. See `framework/jdi.md` Critical Constraints and `framework/components/meta/AgentRouter.md` §4.
105
+
106
+ **Single-agent mode:**
107
+ - `source: jdi` → `Task(subagent_type="general-purpose", prompt="You are {plan.primary_agent}. Read .jdi/framework/agents/{plan.primary_agent}.md... PLAN: {index-path}")`
108
+ - `source: claude-code` → `Task(subagent_type="{plan.primary_agent}", prompt="<standard spawn prompt> PLAN: {index-path}")`
109
+
110
+ For split plans, the agent reads task files one at a time via the `file:` field in `state.yaml`.
111
+
112
+ **Agent Teams mode:** Spawn ONE Task call per task using the source-aware pattern above. Pass `TASK_FILE: {task-file-path}` so the agent loads only its assigned task.
113
+
114
+ **Prompt scoping rules (non-negotiable):**
115
+ - One task = one spawn. Never bundle multiple tasks into one prompt.
116
+ - Give exact file paths. Cap exploration explicitly: "read only your TASK_FILE and the files it names."
117
+ - Request short reports (<400 words). Agents can be truncated mid-task; scoped prompts survive the budget ceiling.
118
+ - Include a `## Project Context` block in every spawn prompt: type, tech stack, quality gates, working directory. Saves 2-3 discovery tool calls per spawn.
119
+ - For split plans, the agent reads the `TASK_FILE` itself — do not inline task content into the prompt.
120
+
121
+ **Wave-based execution:** honour `waves:` from the plan frontmatter. Spawn all tasks in wave N in parallel; wait for all returns before starting wave N+1.
122
+
123
+ ### 9. Advance Task State
124
+
125
+ After each task's programmer returns successfully, run:
126
+
127
+ ```bash
128
+ bun run src/index.ts state advance-task {task-id}
129
+ ```
130
+
131
+ Do NOT advance state for tasks that failed or were skipped. Do NOT batch advance calls — advance per task, in order.
132
+
133
+ ### 10. Post-Task Verify (jdi-qa-tester)
134
+
135
+ After each task's programmer returns, invoke `jdi-qa-tester` in `post-task-verify` mode with the task's `done_when` criteria and `files_modified` list. If verification fails with **S1** or **S2** severity, **halt the plan** and escalate to the user. Otherwise record the verification result in the task summary and proceed to commit.
136
+
137
+ - **a11y-check trigger:** if `files_modified` includes UI files (components, views, templates, CSS affecting render), additionally invoke `jdi-qa-tester` in `a11y-check` mode and record the result in the same task summary.
138
+ - **contract-check trigger:** if `files_modified` includes contract-bearing files — API routes, Controllers/Actions, DTOs, FormRequests, OpenAPI specs, exported TypeScript types, `packages/*/src/index.ts`, DB migrations, generated client code — additionally invoke `jdi-qa-tester` in `contract-check` mode. Treat any contract failure as at least **S2** and halt the plan.
139
+ - **Skip rules:** Skipped entirely if `--skip-qa` is passed. Also skipped automatically if `files_modified` contains ONLY `.md`, `.yaml`, or `.yml` files (documentation/config doesn't get regression-tested). The programmer's structured return field `qa_verification_needed: false` is also honoured.
140
+ - **Contract-check exception to the skip rule:** if any file in `files_modified` is a contract-bearing YAML/JSON spec (OpenAPI / Swagger — e.g. `openapi.yaml`, `swagger.json`, `api/*.yaml`, `**/openapi*.{yml,yaml,json}`; GraphQL SDL — `**/*.graphql`, `**/schema.gql`; JSON Schema — `**/schemas/**/*.json`), still invoke `contract-check` even when the doc-only skip rule would otherwise apply. `post-task-verify` and `a11y-check` remain skipped in this case — only `contract-check` runs.
141
+
142
+ ### 11. Execute Deferred Ops
143
+
144
+ Collect `files_to_create` returns from every agent and execute them via Write tool. Apply any pending commit operations. Do NOT skip this step — sandbox-returned artefacts are real work.
145
+
146
+ ### 12. Run Verification Gates
147
+
148
+ Execute the project's quality gates in order: tests, lint, typecheck (exact commands come from `DISCOVERED_STATE.quality_gates`). Record pass/fail per gate.
149
+
150
+ If any gate fails, STOP — do not advance state to `complete`. Report the failure and enter the review loop at step 14.
151
+
152
+ ### 13. Advance State to Complete
153
+
154
+ Run `bun run src/index.ts state complete`. Do NOT manually edit `state.yaml`.
155
+
156
+ ### 14. Present Summary
157
+
158
+ Present the implementation summary to the user:
159
+
160
+ - Tasks completed (with per-task agent and verification result)
161
+ - Files changed (grouped by task)
162
+ - Quality gate results
163
+ - Any `agent_downgrade:` events
164
+ - Deviations from the spec
165
+
166
+ End with the exact prompt: _"Provide feedback to adjust, or say **approved** to finalise."_
167
+
168
+ **Wait for the user's answer. Do NOT suggest commits or PRs yet.**
169
+
170
+ ### 15. Review Loop
171
+
172
+ - **Feedback:** apply the requested code changes, re-run verification gates, increment the revision counter, and re-present the summary.
173
+ - **Approval:** suggest a conventional commit or PR generation as the next step. Do NOT auto-run either — the user decides.
174
+
175
+ **Never loop back to step 8.** Feedback refines existing tasks; it does not re-spawn agents for tasks that already completed.
176
+
177
+ ---
178
+
179
+ ## Edge Cases
180
+
181
+ Pre-written responses for known deviations. When one applies, follow the scripted response rather than improvising.
182
+
183
+ | Situation | Response |
184
+ |-----------|----------|
185
+ | Plan status is not `approved` | STOP at step 2. Tell the user to approve the plan first. Do NOT force-advance. |
186
+ | Pinned agent not installed | Downgrade to `general-purpose`, record the downgrade, continue. Surface in the final summary. |
187
+ | Task file missing (listed in `task_files:` but not on disk) | STOP. Report the missing file. Do NOT advance state. |
188
+ | Programmer returns with `status: blocked` | HALT the plan. Do NOT advance task state. Surface the blocker to the user and wait. |
189
+ | QA verification S1 or S2 failure | HALT the plan immediately. Record the failure in state. Wait for user direction before continuing. |
190
+ | Verification gate failure at step 12 | STOP before completing. Report the failure, enter review loop. Do NOT advance state to `complete`. |
191
+ | `--dry-run` with no changes needed | Output "no-op: plan is already at target state" and STOP. |
192
+ | Worktree active but path missing | Ask the user: recreate the worktree, or proceed in current directory? Do NOT silently proceed. |
193
+ | Wave has zero tasks ready | Skip the empty wave, log it, continue to the next wave. |
194
+ | User asks to skip verification during review | Remind them of `--skip-qa` flag semantics. Do NOT skip silently. |
195
+
196
+ ---
197
+
198
+ ## HARD STOP — Verification Gate
199
+
200
+ Before presenting the summary (step 14), all three must be true:
201
+
202
+ 1. Every task has either `advance-task` applied OR a documented failure in the summary
203
+ 2. Every QA verification trigger that fired has a recorded result
204
+ 3. Every quality gate has passed OR been explicitly flagged as failing in the summary
205
+
206
+ If ANY of these is not true, STOP. Do not present a summary that implies success when work remains. Silent gaps are the failure mode this gate exists to prevent.
207
+
208
+ ---
209
+
210
+ ## Collaborative Protocol
211
+
212
+ <JDI:StrictnessProtocol />
213
+
214
+ ---
215
+
216
+ **References:** Agent base (read FIRST for cache): `.jdi/framework/components/meta/AgentBase.md` | Agent specs: `.jdi/framework/agents/jdi-backend.md`, `.jdi/framework/agents/jdi-frontend.md` | Orchestration: `.jdi/framework/components/meta/AgentTeamsOrchestration.md` | Routing: `.jdi/framework/components/meta/ComplexityRouter.md`, `.jdi/framework/components/meta/AgentRouter.md`
217
+
218
+ **Plan to execute:** $ARGUMENTS
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: init
3
+ description: "JDI: Initialise JDI commands in the current project"
4
+ ---
5
+
6
+ # /jdi:init
7
+
8
+ Initialise the JDI slash commands in the current project.
9
+
10
+ ## Direct Execution
11
+
12
+ ### Step 1: Create Directories
13
+
14
+ ```bash
15
+ mkdir -p .claude/commands/jdi
16
+ mkdir -p .jdi/plans .jdi/research .jdi/codebase .jdi/reviews .jdi/config .jdi/persistence .jdi/feedback
17
+ ```
18
+
19
+ ### Step 2: Copy Command Stubs
20
+
21
+ Copy all command stubs from the framework to the project. Skip files that already exist and are >500 bytes (unless `--force`).
22
+
23
+ ```bash
24
+ for file in .jdi/framework/commands/*.md; do
25
+ dest=".claude/commands/jdi/$(basename "$file")"
26
+ if [ ! -f "$dest" ] || [ "$(wc -c < "$dest")" -le 500 ] || [ "$FORCE" = "true" ]; then
27
+ cp "$file" "$dest"
28
+ fi
29
+ done
30
+ ```
31
+
32
+ > **Do NOT embed command stub content inline.** The source of truth is `.jdi/framework/commands/`. Copy from there.
33
+
34
+ ### Step 3: Register Claude Code Hooks
35
+
36
+ Ensure `PostToolUse` lint-fix hook is in `.claude/settings.local.json` (runs `bun run lint:fix` async after Edit/Write). Merge into existing hooks, don't overwrite.
37
+
38
+ Reference: `.jdi/framework/hooks/lint-fix-frontend.md`
39
+
40
+ ### Step 4: Register Natural Language Routing
41
+
42
+ Append JDI routing block to `.claude/CLAUDE.md` if not already present (check for `## JDI Workflow Routing`). Content includes intent→skill mapping and iterative refinement instructions.
43
+
44
+ ### Step 5: Initialise Config Files
45
+
46
+ ```bash
47
+ cp .jdi/framework/config/state.yaml .jdi/config/state.yaml
48
+ cp .jdi/framework/config/variables.yaml .jdi/config/variables.yaml
49
+ cp .jdi/framework/config/jdi-config.yaml .jdi/config/jdi-config.yaml
50
+ ```
51
+
52
+ ### Step 6: Generate Markdown Scaffolding
53
+
54
+ Read templates from `.jdi/framework/templates/` and write to `.jdi/` (only if missing):
55
+ - PROJECT.yaml, REQUIREMENTS.yaml, ROADMAP.yaml
56
+
57
+ ### Step 7: Display Completion
58
+
59
+ List all available commands and suggest `/jdi:create-plan "your feature"` to get started.
60
+
61
+ ## Arguments
62
+
63
+ | Argument | Description |
64
+ |----------|-------------|
65
+ | `--force` | Overwrite existing command files |
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: pr-feedback
3
+ description: "JDI: Address PR review comments systematically"
4
+ allowed-tools: Read, Bash, Task
5
+ argument-hint: "<pr-number-or-url>"
6
+ context: |
7
+ !git branch --show-current 2>/dev/null
8
+ ---
9
+
10
+ # /jdi:pr-feedback
11
+
12
+ Address review comments on a pull request via the `jdi-pr-feedback` specialist.
13
+
14
+ **This skill follows `<JDI:StrictnessProtocol />`. Read that component before executing any step below.**
15
+
16
+ ---
17
+
18
+ ## Orchestration
19
+
20
+ ### 1. Parse PR Reference
21
+
22
+ Extract the PR number from `$ARGUMENTS`. Accept a bare number or a full GitHub URL. If neither is present, STOP and ask for one.
23
+
24
+ ### 2. Fetch Unresolved Comments
25
+
26
+ Run `gh api repos/{owner}/{repo}/pulls/{number}/comments` (or equivalent) to confirm there are unresolved comments. If there are none, STOP:
27
+
28
+ > "PR #{number} has no unresolved review comments. Nothing to address."
29
+
30
+ ### 3. Delegate to jdi-pr-feedback
31
+
32
+ Spawn the specialist via Task tool. JDI specialists spawn as `general-purpose` with identity injected via prompt text:
33
+
34
+ ```
35
+ Task(
36
+ subagent_type="general-purpose",
37
+ prompt="You are jdi-pr-feedback. Read .jdi/framework/agents/jdi-pr-feedback.md
38
+ for your full role and instructions. Also read
39
+ .jdi/framework/components/meta/AgentBase.md for the JDI base protocol.
40
+ If your spec has requires_components in frontmatter, batch-read all listed
41
+ components before starting.
42
+
43
+ Address feedback for PR: {pr-number}"
44
+ )
45
+ ```
46
+
47
+ ### 4. Present Result
48
+
49
+ After the specialist returns, summarise: comments addressed, files touched, commits made. End with:
50
+
51
+ > "Feedback applied. Review the diff, then run `/jdi:commit` or push when ready."
52
+
53
+ **Wait for the user's response. Do NOT auto-push.**
54
+
55
+ ---
56
+
57
+ ## Edge Cases
58
+
59
+ | Situation | Response |
60
+ |-----------|----------|
61
+ | No PR reference | STOP at step 1. Ask for a number or URL. |
62
+ | No unresolved comments | STOP at step 2. Nothing to do. |
63
+ | Specialist cannot address a specific comment | Surface the blocker; the user decides whether to override or defer. |
64
+ | Working tree dirty before start | Ask whether to stash, commit, or abort. Do NOT silently mix unrelated changes. |
65
+ | PR is closed or merged | STOP and report — feedback on closed PRs is not actionable via this skill. |
66
+
67
+ ---
68
+
69
+ ## Collaborative Protocol
70
+
71
+ <JDI:StrictnessProtocol />
72
+
73
+ ---
74
+
75
+ **PR to address:** $ARGUMENTS
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: pr-review
3
+ description: "JDI: Review pull request with learnings-aware analysis"
4
+ allowed-tools: Read, Bash, Task
5
+ argument-hint: "<pr-number-or-url> [--no-comments]"
6
+ context: |
7
+ !git branch --show-current 2>/dev/null
8
+ ---
9
+
10
+ # /jdi:pr-review
11
+
12
+ Review a pull request against the team's learnings and coding standards.
13
+
14
+ **This skill follows `<JDI:StrictnessProtocol />`. Read that component before executing any step below.**
15
+
16
+ ---
17
+
18
+ ## Flags
19
+
20
+ - `--no-comments` — Do not post comments to GitHub. Write the review to `.jdi/reviews/PR-{number}-review.md` instead.
21
+
22
+ ---
23
+
24
+ ## Orchestration
25
+
26
+ ### 1. Parse PR Reference
27
+
28
+ Extract the PR number from `$ARGUMENTS`. Accept either a bare number (`123`) or a GitHub URL (`https://github.com/org/repo/pull/123`). If neither form is present, STOP:
29
+
30
+ > "I need a PR number or URL. Try `/jdi:pr-review 123` or `/jdi:pr-review https://github.com/org/repo/pull/123`."
31
+
32
+ ### 2. Parse Flags
33
+
34
+ Check for `--no-comments`. Map to the `post="false"` parameter for the `PRReview` component.
35
+
36
+ ### 3. Verify PR Exists
37
+
38
+ Run `gh pr view {number}` to confirm the PR is reachable. If `gh` errors, STOP and report the failure — do NOT fabricate a review.
39
+
40
+ ### 4. Delegate to Reviewer
41
+
42
+ Spawn the reviewer via Task tool. JDI specialists spawn as `general-purpose` with identity injected via prompt text:
43
+
44
+ ```
45
+ Task(
46
+ subagent_type="general-purpose",
47
+ prompt="Read .jdi/framework/components/meta/AgentBase.md for the base protocol.
48
+
49
+ Read learnings before reviewing — these represent the team's coding standards
50
+ and MUST be cross-referenced during review:
51
+ - Always: .jdi/framework/learnings/general.md
52
+ - PHP/Laravel PRs: also .jdi/framework/learnings/backend.md
53
+ - React/TypeScript PRs: also .jdi/framework/learnings/frontend.md
54
+ - Test changes: also .jdi/framework/learnings/testing.md
55
+ - CI/Docker changes: also .jdi/framework/learnings/devops.md
56
+
57
+ Apply learnings as additional review criteria — flag violations and praise adherence.
58
+
59
+ Read .jdi/framework/components/quality/PRReview.md for review instructions.
60
+ {If --no-comments: invoke as <JDI:PRReview post=\"false\" />}
61
+
62
+ Review PR: {pr-number}"
63
+ )
64
+ ```
65
+
66
+ ### 5. Present Result
67
+
68
+ After the reviewer returns, summarise: number of comments posted (or file path of the written review), severity breakdown, and any blocking issues.
69
+
70
+ Then **STOP**. Do NOT merge, approve, or take any follow-up action.
71
+
72
+ ---
73
+
74
+ ## Edge Cases
75
+
76
+ | Situation | Response |
77
+ |-----------|----------|
78
+ | No PR reference in arguments | STOP at step 1. Ask for a number or URL. |
79
+ | `gh pr view` fails (not logged in, wrong repo) | Report the error verbatim. Do NOT attempt a workaround. |
80
+ | PR is already merged | Note it in the summary and review anyway — learnings may still apply. |
81
+ | PR is a draft | Review as normal; flag that the PR is draft in the summary. |
82
+ | `.jdi/framework/learnings/` missing | Reviewer falls back to base review criteria. Record the missing learnings in the summary. |
83
+
84
+ ---
85
+
86
+ ## Collaborative Protocol
87
+
88
+ <JDI:StrictnessProtocol />
89
+
90
+ ---
91
+
92
+ **PR to review:** $ARGUMENTS
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: quick
3
+ description: "JDI: Quick focused change (skips planner, relaxed standards)"
4
+ allowed-tools: Read, Glob, Grep, Bash, Write, Edit
5
+ argument-hint: "<task description> [--dry-run]"
6
+ context: |
7
+ !git status --short 2>/dev/null | head -20
8
+ ---
9
+
10
+ # /jdi:quick
11
+
12
+ Execute a small, focused change directly without full orchestration. For trivial or prototype work only — no planner, no agent spawn, no waves.
13
+
14
+ **This skill follows `<JDI:StrictnessProtocol />`. Read that component before executing any step below.**
15
+
16
+ ---
17
+
18
+ ## Flags
19
+
20
+ - `--dry-run` — Preview the change without writing files. List intended edits and STOP.
21
+
22
+ ---
23
+
24
+ ## Scope Gate (read first)
25
+
26
+ `/jdi:quick` is for:
27
+
28
+ - Single-file edits, typo fixes, log lines, variable renames
29
+ - Prototype / exploration code where throwaway is acceptable
30
+ - Tasks under ~30 minutes with no architectural impact
31
+
32
+ `/jdi:quick` is NOT for:
33
+
34
+ - Production code requiring tests, review, or sign-off
35
+ - Multi-file refactors or anything touching contracts (API routes, DTOs, exported types, migrations)
36
+ - Work that spans tech stacks or layers
37
+
38
+ If the task doesn't fit, redirect to `/jdi:create-plan "<feature>"` before writing any code.
39
+
40
+ ---
41
+
42
+ ## Orchestration
43
+
44
+ The steps below are numbered and ordered. Do NOT skip, merge, or reorder them.
45
+
46
+ ### 1. Parse and Classify
47
+
48
+ Read `$ARGUMENTS`. If the task description suggests production-grade work (tests required, multi-file, architectural), STOP and redirect:
49
+
50
+ > "This looks bigger than `/jdi:quick` is meant for. Run `/jdi:create-plan "<feature>"` instead so we agree on scope before writing code."
51
+
52
+ **Wait for the user's answer. Do not proceed until they confirm `/jdi:quick` is still the right fit.**
53
+
54
+ ### 2. Detect Tech Stack
55
+
56
+ Read the target files (inferred from `$ARGUMENTS` or the user's follow-up). Identify the stack. Record in working memory.
57
+
58
+ ### 3. Dry Run Check
59
+
60
+ If `--dry-run` is present, list the files you would edit and the intended change per file. Then **STOP**. Do NOT write anything.
61
+
62
+ ### 4. Execute Change
63
+
64
+ Apply the edit directly via Edit tool. No agent spawn. No TaskCreate. Scope is intentionally narrow — one concern per invocation.
65
+
66
+ ### 5. Verification
67
+
68
+ Run only the quality gates that are cheap and relevant:
69
+
70
+ - Typecheck for TS changes (`tsc --noEmit` or project-equivalent)
71
+ - Lint for the touched file only (not the whole repo)
72
+ - Tests only if the user explicitly asked for them — `/jdi:quick` defaults to skipping
73
+
74
+ If a gate fails, STOP and report. Do NOT auto-fix beyond the scope the user requested.
75
+
76
+ ### 6. Report
77
+
78
+ Present a 3-line summary: files changed, gates run, next suggested action. End with:
79
+
80
+ > "Commit as `proto:` / `quick:` / leave uncommitted? Your call."
81
+
82
+ **Wait for the user's answer. Do NOT auto-commit.**
83
+
84
+ ---
85
+
86
+ ## Relaxed Standards Mode
87
+
88
+ - Prototype / throwaway code accepted
89
+ - Tests optional (default: skip)
90
+ - Commit message prefix: `proto:` or `quick:`
91
+ - Framed as exploration — NOT production
92
+ - `jdi-qa-tester` is NOT invoked in `/jdi:quick` mode. If regression checks matter, route through `/jdi:implement-plan` instead.
93
+
94
+ ---
95
+
96
+ ## Edge Cases
97
+
98
+ | Situation | Response |
99
+ |-----------|----------|
100
+ | Task description implies production work | Redirect to `/jdi:create-plan` at step 1. Do NOT proceed. |
101
+ | `.jdi/` directory doesn't exist | Proceed anyway — `/jdi:quick` does not require JDI scaffolding. Skip any state updates. |
102
+ | Typecheck or lint fails after edit | Report the failure. Do NOT auto-fix unrelated issues. |
103
+ | User asks for tests mid-task | Honour the request; run the test command once, report, then stop. |
104
+ | Target file doesn't exist | Ask the user: create it, or did they mean a different path? |
105
+
106
+ ---
107
+
108
+ ## HARD STOP
109
+
110
+ Once the edit is applied and gates have run, the skill is **DONE**.
111
+
112
+ - Do NOT auto-commit.
113
+ - Do NOT advance state.
114
+ - Do NOT invoke any other skill.
115
+
116
+ ---
117
+
118
+ ## Collaborative Protocol
119
+
120
+ <JDI:StrictnessProtocol />
121
+
122
+ ---
123
+
124
+ **Task:** $ARGUMENTS
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: status
3
+ description: "JDI: Show framework status"
4
+ ---
5
+
6
+ # /jdi:status
7
+
8
+ ## Direct Execution
9
+
10
+ 1. Read `.jdi/config/state.yaml`
11
+ 2. Display current position and progress
12
+ 3. Show recent commits
13
+ 4. Suggest next action
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: worktree-remove
3
+ description: "JDI: Remove git worktree and clean up"
4
+ ---
5
+
6
+ # /jdi:worktree-remove
7
+
8
+ Remove a git worktree and clean up all associated resources.
9
+
10
+ ## Direct Execution
11
+
12
+ 1. **Identify worktree** from `$ARGUMENTS`:
13
+ - If name provided: use `.worktrees/<name>`
14
+ - If no arguments: read `worktree.path` from `.jdi/config/state.yaml`
15
+ - If neither: list worktrees via `git worktree list`, prompt which to remove
16
+ - `--force` flag: skip confirmation prompt
17
+ - `--keep-branch` flag: don't delete the git branch after removal
18
+ 2. **Confirm** with user (unless `--force`): show worktree path, branch, resources that will be cleaned up
19
+ 3. **Project-specific cleanup** (from adapter config):
20
+ - Drop databases per adapter config
21
+ - Remove web server configuration per adapter config
22
+ 4. **Remove worktree**: `git worktree remove .worktrees/<name> --force`
23
+ 5. **Delete branch** (unless `--keep-branch`):
24
+ - Merged: `git branch -d <name>`
25
+ - Unmerged: `git branch -D <name>` (warn user first)
26
+ 6. **Clean up**: `rmdir .worktrees 2>/dev/null` (only if empty)
27
+ 7. **Update state**: set `worktree.active: false`, clear `worktree.path`, `worktree.branch` in `.jdi/config/state.yaml`
28
+ 8. **Report**: what was removed
29
+
30
+ Reference: .jdi/framework/hooks/jdi-worktree-cleanup.md
31
+
32
+ Worktree to remove: $ARGUMENTS
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: worktree
3
+ description: "JDI: Create git worktree with full environment"
4
+ ---
5
+
6
+ # /jdi:worktree
7
+
8
+ Create an isolated git worktree with full project environment from a ticket, task name, or description.
9
+
10
+ > **CRITICAL: Do NOT use the built-in `EnterWorktree` tool.** It creates a bare worktree without project-specific setup. Always follow the Direct Execution steps below.
11
+
12
+ ## Direct Execution
13
+
14
+ > **CRITICAL: Ordering matters.** Steps 4–7 are sequential — do NOT parallelise setup steps that depend on configuration being complete first.
15
+
16
+ 1. **Parse name** from `$ARGUMENTS`:
17
+ - Extract ticket ID if present (e.g. "PROJ-1234") — use as prefix
18
+ - Slugify the rest: lowercase, spaces/special chars to hyphens, strip trailing hyphens, max 40 chars
19
+ - Examples: `"PROJ-1234 Add user auth"` → `proj-1234-add-user-auth`
20
+ - Examples: `"fix broken calculator"` → `fix-broken-calculator`
21
+ - If no arguments, generate random adjective-noun name
22
+ - `--lightweight` flag: skip databases, web server setup, SSL (deps + migrate only)
23
+ - `--base <branch>` flag: base branch (default: main)
24
+ 2. **Validate**: check git repo, branch doesn't exist, required tools available
25
+ 3. **Create worktree**:
26
+ ```bash
27
+ mkdir -p .worktrees
28
+ git worktree add -b <name> .worktrees/<name> <base-branch>
29
+ ```
30
+ 4. **`cd` into worktree** — all subsequent commands run from inside the worktree:
31
+ ```bash
32
+ cd .worktrees/<name>
33
+ ```
34
+ 5. **Project-specific setup** (from adapter config, skip if `--lightweight`):
35
+ - Create databases per adapter config
36
+ - Configure environment files per adapter config
37
+ - Run project-specific web server setup per adapter config
38
+ 6. **Install dependencies** — these CAN run in parallel:
39
+ ```bash
40
+ # Run dependency install commands from adapter config
41
+ # e.g. composer install, bun install, npm install, etc.
42
+ ```
43
+ 7. **Project bootstrap** (run sequentially, AFTER environment is configured):
44
+ - Run migration commands per adapter config
45
+ - Run seed commands per adapter config (in dependency order)
46
+ - Run post-setup commands per adapter config
47
+ 8. **Update state**: set `worktree.active: true`, `worktree.path`, `worktree.branch`, `worktree.created_at`, `worktree.type` in `.jdi/config/state.yaml`
48
+ 9. **Report**: worktree path, branch, setup summary
49
+
50
+ **On error**: clean up (reverse database creation, remove worktree, reverse web server setup).
51
+
52
+ Worktree to create: $ARGUMENTS