@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.
- package/README.md +431 -0
- package/action/action.yml +116 -0
- package/action/workflow-template.yml +242 -0
- package/dist/index.js +12860 -0
- package/framework/adapters/generic.yaml +23 -0
- package/framework/adapters/laravel.yaml +46 -0
- package/framework/adapters/nextjs.yaml +36 -0
- package/framework/adapters/node.yaml +29 -0
- package/framework/agents/jdi-architect.md +147 -0
- package/framework/agents/jdi-backend.md +79 -0
- package/framework/agents/jdi-codebase-mapper.md +59 -0
- package/framework/agents/jdi-committer.md +83 -0
- package/framework/agents/jdi-debugger.md +73 -0
- package/framework/agents/jdi-devops.md +78 -0
- package/framework/agents/jdi-feedback-learner.md +93 -0
- package/framework/agents/jdi-frontend.md +78 -0
- package/framework/agents/jdi-head-engineering.md +30 -0
- package/framework/agents/jdi-perf-analyst.md +116 -0
- package/framework/agents/jdi-phase-researcher.md +59 -0
- package/framework/agents/jdi-plan-checker.md +80 -0
- package/framework/agents/jdi-planner.md +271 -0
- package/framework/agents/jdi-pr-feedback.md +120 -0
- package/framework/agents/jdi-pr-generator.md +100 -0
- package/framework/agents/jdi-producer.md +196 -0
- package/framework/agents/jdi-product-lead.md +44 -0
- package/framework/agents/jdi-programmer.md +104 -0
- package/framework/agents/jdi-qa-tester.md +113 -0
- package/framework/agents/jdi-quality.md +106 -0
- package/framework/agents/jdi-researcher.md +70 -0
- package/framework/agents/jdi-security.md +118 -0
- package/framework/agents/jdi-ux-designer.md +78 -0
- package/framework/agents/jdi-verifier.md +80 -0
- package/framework/commands/build.md +148 -0
- package/framework/commands/commit.md +71 -0
- package/framework/commands/create-plan.md +192 -0
- package/framework/commands/generate-pr.md +91 -0
- package/framework/commands/implement-plan.md +218 -0
- package/framework/commands/init.md +65 -0
- package/framework/commands/pr-feedback.md +75 -0
- package/framework/commands/pr-review.md +92 -0
- package/framework/commands/quick.md +124 -0
- package/framework/commands/status.md +13 -0
- package/framework/commands/worktree-remove.md +32 -0
- package/framework/commands/worktree.md +52 -0
- package/framework/components/execution/CodebaseContext.md +36 -0
- package/framework/components/execution/Commit.md +121 -0
- package/framework/components/execution/Verify.md +140 -0
- package/framework/components/execution/VerifyAdvanced.md +43 -0
- package/framework/components/meta/AgentBase.md +121 -0
- package/framework/components/meta/AgentRouter.md +318 -0
- package/framework/components/meta/AgentTeamsOrchestration.md +115 -0
- package/framework/components/meta/ComplexityRouter.md +116 -0
- package/framework/components/meta/SilentDiscovery.md +79 -0
- package/framework/components/meta/StateUpdate.md +56 -0
- package/framework/components/meta/StrictnessProtocol.md +60 -0
- package/framework/components/meta/TeamRouter.md +86 -0
- package/framework/components/planning/TaskBreakdown.md +95 -0
- package/framework/components/planning/WaveComputation.md +59 -0
- package/framework/components/quality/PRReview.md +225 -0
- package/framework/config/jdi-config.yaml +159 -0
- package/framework/config/state.yaml +72 -0
- package/framework/config/variables.yaml +43 -0
- package/framework/hooks/checkpoint.md +196 -0
- package/framework/hooks/jdi-worktree-cleanup.md +123 -0
- package/framework/hooks/lint-fix-frontend.md +59 -0
- package/framework/hooks/on-pause.md +213 -0
- package/framework/hooks/pre-commit.md +143 -0
- package/framework/jdi.md +336 -0
- package/framework/learnings/backend.md +3 -0
- package/framework/learnings/devops.md +3 -0
- package/framework/learnings/frontend.md +3 -0
- package/framework/learnings/general.md +3 -0
- package/framework/learnings/testing.md +3 -0
- package/framework/rules/commit-rules.md +24 -0
- package/framework/rules/deviation-rules.md +221 -0
- package/framework/teams/devops.md +26 -0
- package/framework/teams/engineering.md +29 -0
- package/framework/teams/micro-management.md +26 -0
- package/framework/teams/product-research.md +29 -0
- package/framework/teams/quality-assurance.md +27 -0
- package/framework/templates/CLAUDE-SHARED.md +60 -0
- package/framework/templates/PLAN-TASK.md +35 -0
- package/framework/templates/PLAN.md +158 -0
- package/framework/templates/PROJECT.yaml +16 -0
- package/framework/templates/REQUIREMENTS.yaml +27 -0
- package/framework/templates/ROADMAP.yaml +24 -0
- package/framework/templates/SUMMARY.md +201 -0
- package/framework/workflows/README.md +87 -0
- package/package.json +40 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
session:
|
|
2
|
+
id: null
|
|
3
|
+
started_at: null
|
|
4
|
+
last_activity: null
|
|
5
|
+
|
|
6
|
+
project:
|
|
7
|
+
name: null
|
|
8
|
+
root: null
|
|
9
|
+
initialised: false
|
|
10
|
+
initialised_at: null
|
|
11
|
+
|
|
12
|
+
position:
|
|
13
|
+
phase: null
|
|
14
|
+
phase_name: null
|
|
15
|
+
plan: null
|
|
16
|
+
plan_name: null
|
|
17
|
+
task: null
|
|
18
|
+
task_name: null
|
|
19
|
+
status: idle
|
|
20
|
+
|
|
21
|
+
progress:
|
|
22
|
+
phases_total: 0
|
|
23
|
+
phases_completed: 0
|
|
24
|
+
plans_total: 0
|
|
25
|
+
plans_completed: 0
|
|
26
|
+
tasks_total: 0
|
|
27
|
+
tasks_completed: 0
|
|
28
|
+
|
|
29
|
+
current_plan:
|
|
30
|
+
path: null
|
|
31
|
+
tasks: []
|
|
32
|
+
completed_tasks: []
|
|
33
|
+
current_task_index: null
|
|
34
|
+
|
|
35
|
+
current_phase:
|
|
36
|
+
waves:
|
|
37
|
+
computed: false
|
|
38
|
+
total_waves: 0
|
|
39
|
+
current_wave: null
|
|
40
|
+
structure: []
|
|
41
|
+
plans_by_wave: {}
|
|
42
|
+
|
|
43
|
+
worktree:
|
|
44
|
+
active: false
|
|
45
|
+
path: null
|
|
46
|
+
branch: null
|
|
47
|
+
created_at: null
|
|
48
|
+
type: null
|
|
49
|
+
|
|
50
|
+
continuation:
|
|
51
|
+
file: null
|
|
52
|
+
paused_at: null
|
|
53
|
+
resume_action: null
|
|
54
|
+
|
|
55
|
+
commits:
|
|
56
|
+
session_commits: []
|
|
57
|
+
last_commit_hash: null
|
|
58
|
+
last_commit_message: null
|
|
59
|
+
|
|
60
|
+
checkpoints:
|
|
61
|
+
last_checkpoint: null
|
|
62
|
+
checkpoint_type: null
|
|
63
|
+
awaiting_response: false
|
|
64
|
+
|
|
65
|
+
deviations: []
|
|
66
|
+
|
|
67
|
+
blockers: []
|
|
68
|
+
|
|
69
|
+
metadata:
|
|
70
|
+
context_usage_estimate: 0
|
|
71
|
+
agent_spawns: 0
|
|
72
|
+
errors_encountered: 0
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
feature:
|
|
2
|
+
name: null
|
|
3
|
+
description: null
|
|
4
|
+
type: null
|
|
5
|
+
branch: null
|
|
6
|
+
pr_number: null
|
|
7
|
+
pr_url: null
|
|
8
|
+
|
|
9
|
+
context:
|
|
10
|
+
clickup_task_id: null
|
|
11
|
+
clickup_task_url: null
|
|
12
|
+
figma_url: null
|
|
13
|
+
figma_node_id: null
|
|
14
|
+
requirements_source: null
|
|
15
|
+
|
|
16
|
+
implementation:
|
|
17
|
+
approach: null
|
|
18
|
+
key_decisions: []
|
|
19
|
+
files_created: []
|
|
20
|
+
files_modified: []
|
|
21
|
+
dependencies_added: []
|
|
22
|
+
|
|
23
|
+
review:
|
|
24
|
+
reviewer: null
|
|
25
|
+
review_status: null
|
|
26
|
+
comments_total: 0
|
|
27
|
+
comments_resolved: 0
|
|
28
|
+
changes_requested: []
|
|
29
|
+
|
|
30
|
+
testing:
|
|
31
|
+
test_files: []
|
|
32
|
+
coverage_before: null
|
|
33
|
+
coverage_after: null
|
|
34
|
+
tests_added: 0
|
|
35
|
+
tests_passed: null
|
|
36
|
+
|
|
37
|
+
references:
|
|
38
|
+
related_files: []
|
|
39
|
+
related_components: []
|
|
40
|
+
documentation_urls: []
|
|
41
|
+
api_endpoints: []
|
|
42
|
+
|
|
43
|
+
custom: {}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: checkpoint
|
|
3
|
+
description: Handles checkpoint interactions
|
|
4
|
+
trigger: checkpoint_reached
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Checkpoint Hook
|
|
8
|
+
|
|
9
|
+
Handles pausing execution and managing user interaction at checkpoints.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Trigger
|
|
14
|
+
|
|
15
|
+
Fires when:
|
|
16
|
+
- Task type is `checkpoint:human-verify`
|
|
17
|
+
- Task type is `checkpoint:decision`
|
|
18
|
+
- Task type is `checkpoint:human-action`
|
|
19
|
+
- Auth gate or credential requirement detected
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Checkpoint Types
|
|
24
|
+
|
|
25
|
+
### human-verify
|
|
26
|
+
|
|
27
|
+
User needs to test/verify something.
|
|
28
|
+
|
|
29
|
+
**Flow:**
|
|
30
|
+
1. Present what was built
|
|
31
|
+
2. Provide verification steps
|
|
32
|
+
3. Wait for "approved" or issues
|
|
33
|
+
|
|
34
|
+
**Template:**
|
|
35
|
+
```
|
|
36
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
37
|
+
JDI ► CHECKPOINT: Verification Required
|
|
38
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
|
|
40
|
+
**Phase:** {phase} | **Plan:** {plan} | **Task:** {n}/{total}
|
|
41
|
+
|
|
42
|
+
## What Was Built
|
|
43
|
+
|
|
44
|
+
{Summary of completed work}
|
|
45
|
+
|
|
46
|
+
## Please Verify
|
|
47
|
+
|
|
48
|
+
1. {Step 1}
|
|
49
|
+
2. {Step 2}
|
|
50
|
+
3. {Step 3}
|
|
51
|
+
|
|
52
|
+
## Expected Behaviour
|
|
53
|
+
|
|
54
|
+
{What you should see}
|
|
55
|
+
|
|
56
|
+
───────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
Reply "approved" to continue, or describe any issues found.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### decision
|
|
62
|
+
|
|
63
|
+
User needs to make a choice.
|
|
64
|
+
|
|
65
|
+
**Flow:**
|
|
66
|
+
1. Present decision context
|
|
67
|
+
2. Show options with trade-offs
|
|
68
|
+
3. Record choice and rationale
|
|
69
|
+
|
|
70
|
+
**Template:**
|
|
71
|
+
```
|
|
72
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
73
|
+
JDI ► CHECKPOINT: Decision Required
|
|
74
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
75
|
+
|
|
76
|
+
**Decision:** {What needs to be decided}
|
|
77
|
+
|
|
78
|
+
## Context
|
|
79
|
+
|
|
80
|
+
{Why this decision matters}
|
|
81
|
+
|
|
82
|
+
## Options
|
|
83
|
+
|
|
84
|
+
| Option | Pros | Cons |
|
|
85
|
+
|--------|------|------|
|
|
86
|
+
| A: {option} | {pros} | {cons} |
|
|
87
|
+
| B: {option} | {pros} | {cons} |
|
|
88
|
+
| C: {option} | {pros} | {cons} |
|
|
89
|
+
|
|
90
|
+
## Recommendation
|
|
91
|
+
|
|
92
|
+
{If applicable, what we recommend and why}
|
|
93
|
+
|
|
94
|
+
───────────────────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
Reply with your choice (A/B/C) and any additional context.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### human-action
|
|
100
|
+
|
|
101
|
+
User needs to do something manually.
|
|
102
|
+
|
|
103
|
+
**Flow:**
|
|
104
|
+
1. Explain what's needed
|
|
105
|
+
2. Provide steps
|
|
106
|
+
3. Wait for "done" confirmation
|
|
107
|
+
4. Verify action worked
|
|
108
|
+
|
|
109
|
+
**Template:**
|
|
110
|
+
```
|
|
111
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
112
|
+
JDI ► CHECKPOINT: Manual Action Required
|
|
113
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
114
|
+
|
|
115
|
+
**Action:** {What you need to do}
|
|
116
|
+
|
|
117
|
+
## Why This Can't Be Automated
|
|
118
|
+
|
|
119
|
+
{Reason - credentials, external system, etc.}
|
|
120
|
+
|
|
121
|
+
## Steps
|
|
122
|
+
|
|
123
|
+
1. {Step 1}
|
|
124
|
+
2. {Step 2}
|
|
125
|
+
3. {Step 3}
|
|
126
|
+
|
|
127
|
+
## How to Verify
|
|
128
|
+
|
|
129
|
+
{How we'll confirm it worked}
|
|
130
|
+
|
|
131
|
+
───────────────────────────────────────────────────────────────
|
|
132
|
+
|
|
133
|
+
Reply "done" when complete.
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## State Management
|
|
139
|
+
|
|
140
|
+
On checkpoint:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
checkpoints:
|
|
144
|
+
last_checkpoint: "{timestamp}"
|
|
145
|
+
checkpoint_type: "{type}"
|
|
146
|
+
checkpoint_task: "{task_id}"
|
|
147
|
+
awaiting_response: true
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
On response:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
checkpoints:
|
|
154
|
+
awaiting_response: false
|
|
155
|
+
last_response: "{user_response}"
|
|
156
|
+
response_at: "{timestamp}"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Response Handling
|
|
162
|
+
|
|
163
|
+
### "approved" / "done"
|
|
164
|
+
- Continue to next task
|
|
165
|
+
- Clear awaiting_response
|
|
166
|
+
|
|
167
|
+
### Issues described
|
|
168
|
+
- Parse user feedback
|
|
169
|
+
- Return to task with feedback context
|
|
170
|
+
- Address issues
|
|
171
|
+
- Re-present checkpoint
|
|
172
|
+
|
|
173
|
+
### Decision made
|
|
174
|
+
- Record decision
|
|
175
|
+
- Record rationale if provided
|
|
176
|
+
- Apply decision to remaining work
|
|
177
|
+
- Continue execution
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Timeout Behaviour
|
|
182
|
+
|
|
183
|
+
If checkpoint awaits response for extended time:
|
|
184
|
+
- State preserved in state.yaml
|
|
185
|
+
- Can resume with `/jdi-implement-plan --resume`
|
|
186
|
+
- Progress is not lost
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Outputs
|
|
191
|
+
|
|
192
|
+
| Output | Purpose |
|
|
193
|
+
|--------|---------|
|
|
194
|
+
| Checkpoint display | User interaction |
|
|
195
|
+
| State update | Track checkpoint |
|
|
196
|
+
| Decision record | Document choices |
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jdi-worktree-cleanup
|
|
3
|
+
description: Clean up git worktree and associated branch after execution
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Worktree Cleanup Hook
|
|
7
|
+
|
|
8
|
+
Clean up the git worktree and associated branch after worktree-based execution completes.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## When to Execute
|
|
13
|
+
|
|
14
|
+
This hook is invoked after worktree execution completes, either:
|
|
15
|
+
- After a **merge** (branch was merged into current branch)
|
|
16
|
+
- After a **discard** (changes were discarded)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Cleanup Steps
|
|
21
|
+
|
|
22
|
+
### 1. Remove the Git Worktree
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git worktree remove .worktrees/jdi-{plan-id} --force
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The `--force` flag is used to handle cases where the worktree has uncommitted changes (which shouldn't happen in normal flow but provides safety).
|
|
29
|
+
|
|
30
|
+
### 2. Delete the Branch
|
|
31
|
+
|
|
32
|
+
**If branch was merged:**
|
|
33
|
+
```bash
|
|
34
|
+
git branch -d jdi/{plan-id}
|
|
35
|
+
```
|
|
36
|
+
Uses `-d` (safe delete) since the branch was already merged.
|
|
37
|
+
|
|
38
|
+
**If branch was NOT merged (discard):**
|
|
39
|
+
```bash
|
|
40
|
+
git branch -D jdi/{plan-id}
|
|
41
|
+
```
|
|
42
|
+
Uses `-D` (force delete) since the branch was never merged.
|
|
43
|
+
|
|
44
|
+
### 3. Remove Empty Worktrees Directory
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
rmdir .worktrees 2>/dev/null
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Only removes the directory if it's empty. Silently fails if other worktrees exist.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Error Handling
|
|
55
|
+
|
|
56
|
+
### Worktree Removal Fails
|
|
57
|
+
|
|
58
|
+
If the worktree removal fails (e.g., uncommitted changes, locked files):
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
⚠️ Warning: Could not remove worktree automatically.
|
|
62
|
+
|
|
63
|
+
Manual cleanup commands:
|
|
64
|
+
git worktree remove .worktrees/jdi-{plan-id} --force
|
|
65
|
+
rm -rf .worktrees/jdi-{plan-id}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Branch Deletion Fails
|
|
69
|
+
|
|
70
|
+
If the branch deletion fails:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
⚠️ Warning: Could not delete branch automatically.
|
|
74
|
+
|
|
75
|
+
Manual cleanup command:
|
|
76
|
+
git branch -D jdi/{plan-id}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## State Update
|
|
82
|
+
|
|
83
|
+
After cleanup, update `.jdi/config/state.yaml`:
|
|
84
|
+
|
|
85
|
+
1. Read `.jdi/config/state.yaml`
|
|
86
|
+
2. Clear any worktree-related state:
|
|
87
|
+
```yaml
|
|
88
|
+
worktree:
|
|
89
|
+
active: false
|
|
90
|
+
path: null
|
|
91
|
+
branch: null
|
|
92
|
+
```
|
|
93
|
+
3. Write the updated YAML back
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Full Cleanup Sequence
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# 1. Remove worktree
|
|
101
|
+
git worktree remove .worktrees/jdi-{plan-id} --force
|
|
102
|
+
|
|
103
|
+
# 2. Delete branch (use -d if merged, -D if not)
|
|
104
|
+
git branch -d jdi/{plan-id} # or -D for discarded
|
|
105
|
+
|
|
106
|
+
# 3. Clean up empty directory
|
|
107
|
+
rmdir .worktrees 2>/dev/null
|
|
108
|
+
|
|
109
|
+
# 4. Update state (handled by Read/Write tools)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Usage Example
|
|
115
|
+
|
|
116
|
+
Called from `jdi-implement-plan.md` Step 3: Post-Execution:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
After user selects "merge" or "discard":
|
|
120
|
+
1. If merge: git merge jdi/{plan-id}
|
|
121
|
+
2. Invoke this cleanup hook
|
|
122
|
+
3. Report cleanup complete
|
|
123
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lint-fix-frontend
|
|
3
|
+
description: Auto-fix ESLint issues on frontend files after edit
|
|
4
|
+
trigger: PostToolUse (Edit|Write)
|
|
5
|
+
type: claude-code-hook
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Lint Fix Frontend Hook
|
|
9
|
+
|
|
10
|
+
Automatically runs `bun run lint:fix` after Claude Code (or an agent) edits or writes a file.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Trigger
|
|
15
|
+
|
|
16
|
+
Fires when:
|
|
17
|
+
- Claude Code edits a file (Edit tool)
|
|
18
|
+
- Claude Code writes a file (Write tool)
|
|
19
|
+
- Any JDI agent edits/writes files via subagents
|
|
20
|
+
|
|
21
|
+
**Claude Code event:** `PostToolUse` with matcher `Edit|Write`
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Behaviour
|
|
26
|
+
|
|
27
|
+
Runs `bun run lint:fix` (`turbo lint -- --fix`) asynchronously in the background so Claude is not blocked. Covers all frontend workspaces via turbo.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
Registered automatically by `/jdi:init` in `.claude/settings.local.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"hooks": {
|
|
38
|
+
"PostToolUse": [
|
|
39
|
+
{
|
|
40
|
+
"matcher": "Edit|Write",
|
|
41
|
+
"hooks": [
|
|
42
|
+
{
|
|
43
|
+
"type": "command",
|
|
44
|
+
"command": "bun run lint:fix",
|
|
45
|
+
"timeout": 30,
|
|
46
|
+
"async": true
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Manual Override
|
|
58
|
+
|
|
59
|
+
To temporarily disable, remove the `PostToolUse` entry from `.claude/settings.local.json`.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: on-pause
|
|
3
|
+
description: Actions to perform when work is paused, generates continuation file
|
|
4
|
+
trigger: pause_request
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# On-Pause Hook
|
|
8
|
+
|
|
9
|
+
Actions performed when the user requests to pause work or when a session ends naturally.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Trigger
|
|
14
|
+
|
|
15
|
+
Fires when:
|
|
16
|
+
- User explicitly requests to pause (`/jdi:pause`)
|
|
17
|
+
- Session is ending (user leaves)
|
|
18
|
+
- Blocking issue encountered (Rule 4 deviation)
|
|
19
|
+
- Checkpoint requires extended user action
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Purpose
|
|
24
|
+
|
|
25
|
+
Create a continuation file that enables seamless resumption:
|
|
26
|
+
1. Capture current position precisely
|
|
27
|
+
2. Record context that would be lost
|
|
28
|
+
3. Provide clear next action
|
|
29
|
+
4. Enable fresh context resumption
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Actions
|
|
34
|
+
|
|
35
|
+
### 1. Capture Current State
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Read current state
|
|
39
|
+
cat .jdi/config/state.yaml
|
|
40
|
+
|
|
41
|
+
# Extract position
|
|
42
|
+
PHASE=$(yq -r '.position.phase' .jdi/config/state.yaml)
|
|
43
|
+
PLAN=$(yq -r '.position.plan' .jdi/config/state.yaml)
|
|
44
|
+
TASK=$(yq -r '.position.task' .jdi/config/state.yaml)
|
|
45
|
+
STATUS=$(yq -r '.position.status' .jdi/config/state.yaml)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Identify Next Action
|
|
49
|
+
|
|
50
|
+
Based on current status, determine what should happen next:
|
|
51
|
+
|
|
52
|
+
| Status | Next Action |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `planning` | Continue planning |
|
|
55
|
+
| `executing` | Resume task execution |
|
|
56
|
+
| `verifying` | Complete verification |
|
|
57
|
+
| `blocked` | Resolve blocker |
|
|
58
|
+
| `checkpoint` | Await user response |
|
|
59
|
+
|
|
60
|
+
### 3. Capture Session Context
|
|
61
|
+
|
|
62
|
+
Gather context that would be lost:
|
|
63
|
+
- Recent decisions made
|
|
64
|
+
- Key discoveries
|
|
65
|
+
- Warnings or concerns
|
|
66
|
+
- User preferences expressed
|
|
67
|
+
|
|
68
|
+
### 4. Generate Continuation File
|
|
69
|
+
|
|
70
|
+
Create `.jdi/CONTINUE-HERE.md`:
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
---
|
|
74
|
+
paused_at: {ISO timestamp}
|
|
75
|
+
phase: {N}
|
|
76
|
+
plan: {NN}
|
|
77
|
+
task: {N or null}
|
|
78
|
+
status: {status}
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
# Continue Here
|
|
82
|
+
|
|
83
|
+
## Quick Resume
|
|
84
|
+
|
|
85
|
+
**Last completed:** {description of last completed work}
|
|
86
|
+
**Current status:** {what's in progress}
|
|
87
|
+
**Next action:** `{command to run}`
|
|
88
|
+
|
|
89
|
+
## Position
|
|
90
|
+
|
|
91
|
+
| Level | Value | Name |
|
|
92
|
+
|-------|-------|------|
|
|
93
|
+
| Phase | {N} | {phase_name} |
|
|
94
|
+
| Plan | {NN} | {plan_name} |
|
|
95
|
+
| Task | {N} | {task_name or "N/A"} |
|
|
96
|
+
| Status | {status} | |
|
|
97
|
+
|
|
98
|
+
## Context from This Session
|
|
99
|
+
|
|
100
|
+
### Decisions Made
|
|
101
|
+
{List of decisions made during this session}
|
|
102
|
+
|
|
103
|
+
### Key Discoveries
|
|
104
|
+
{Important findings or learnings}
|
|
105
|
+
|
|
106
|
+
### Warnings/Concerns
|
|
107
|
+
{Any issues to be aware of}
|
|
108
|
+
|
|
109
|
+
### User Preferences
|
|
110
|
+
{Any preferences expressed by user}
|
|
111
|
+
|
|
112
|
+
## To Resume
|
|
113
|
+
|
|
114
|
+
### Option 1: Continue Where Left Off
|
|
115
|
+
```bash
|
|
116
|
+
/jdi:resume
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Option 2: Manual Resume
|
|
120
|
+
```bash
|
|
121
|
+
# If task was in progress:
|
|
122
|
+
/jdi:implement-plan {phase}-{plan} --resume-from-task {task}
|
|
123
|
+
|
|
124
|
+
# If planning:
|
|
125
|
+
/jdi:create-plan {phase}
|
|
126
|
+
|
|
127
|
+
# If verifying:
|
|
128
|
+
/jdi:verify {phase}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Recent Commits
|
|
132
|
+
|
|
133
|
+
| Time | Hash | Message |
|
|
134
|
+
|------|------|---------|
|
|
135
|
+
{List recent commits from session}
|
|
136
|
+
|
|
137
|
+
## Files Modified (Uncommitted)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git status --short
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
{Output of uncommitted changes, if any}
|
|
144
|
+
|
|
145
|
+
## Blockers (if any)
|
|
146
|
+
|
|
147
|
+
{Description of any blocking issues}
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
*Generated by JDI on-pause hook at {timestamp}*
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 5. Update State
|
|
155
|
+
|
|
156
|
+
Mark session as paused:
|
|
157
|
+
|
|
158
|
+
```yaml
|
|
159
|
+
position:
|
|
160
|
+
status: paused
|
|
161
|
+
session:
|
|
162
|
+
paused_at: "{timestamp}"
|
|
163
|
+
continuation_file: ".jdi/CONTINUE-HERE.md"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 6. Display Pause Summary
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
170
|
+
JDI ► SESSION PAUSED
|
|
171
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
172
|
+
|
|
173
|
+
Paused at: Phase {N}, Plan {NN}, Task {N}
|
|
174
|
+
Status: {status}
|
|
175
|
+
|
|
176
|
+
Continuation file: .jdi/CONTINUE-HERE.md
|
|
177
|
+
|
|
178
|
+
To resume: /jdi:resume
|
|
179
|
+
|
|
180
|
+
───────────────────────────────────────────────────────
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Continuation File Location
|
|
186
|
+
|
|
187
|
+
The continuation file is always at: `.jdi/CONTINUE-HERE.md`
|
|
188
|
+
|
|
189
|
+
This file is:
|
|
190
|
+
- Overwritten on each pause (only one active)
|
|
191
|
+
- Deleted after successful resume
|
|
192
|
+
- Human-readable for manual recovery
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Integration with Resume
|
|
197
|
+
|
|
198
|
+
The `/jdi:resume` command:
|
|
199
|
+
1. Reads `.jdi/CONTINUE-HERE.md`
|
|
200
|
+
2. Loads context specified in the file
|
|
201
|
+
3. Executes the `next_action`
|
|
202
|
+
4. Deletes the continuation file on success
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Success Criteria
|
|
207
|
+
|
|
208
|
+
- [ ] Current position captured accurately
|
|
209
|
+
- [ ] Next action clearly identified
|
|
210
|
+
- [ ] Session context preserved
|
|
211
|
+
- [ ] Continuation file is self-contained
|
|
212
|
+
- [ ] State updated to paused
|
|
213
|
+
- [ ] User informed of how to resume
|