@mthanhlm/autodev 0.4.3 → 0.4.4

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.
@@ -6,6 +6,8 @@ Current Step: initialized
6
6
  Current Task: none
7
7
  Current Task Status: idle
8
8
  Status: active
9
+ Run Mode: checkpointed
10
+ Auto Retry Count: 0
9
11
  Next Command: /autodev
10
12
  Last Updated: [ISO timestamp]
11
13
 
@@ -6,6 +6,8 @@ Current Step: initialized
6
6
  Current Task: none
7
7
  Current Task Status: idle
8
8
  Status: active
9
+ Run Mode: checkpointed
10
+ Auto Retry Count: 0
9
11
  Next Command: /autodev
10
12
  Last Updated: [ISO timestamp]
11
13
 
@@ -7,6 +7,8 @@ Current Step: planning
7
7
  Current Task: none
8
8
  Current Task Status: idle
9
9
  Status: active
10
+ Run Mode: checkpointed
11
+ Auto Retry Count: 0
10
12
  Next Command: /autodev
11
13
  Last Updated: [ISO timestamp]
12
14
 
@@ -0,0 +1,62 @@
1
+ <purpose>
2
+ Use `/autodev-auto` as the explicit opt-in continuous entrypoint. Route automatically, keep git read-only, and continue until the track is done or a real stop condition requires the user.
3
+ </purpose>
4
+
5
+ <rules>
6
+ - `/autodev-auto` is opt-in. `/autodev` remains the safer checkpointed default.
7
+ - Never run git write commands.
8
+ - Never use background execution or waves.
9
+ - Use `--auto` when reading autodev router/init/progress payloads.
10
+ - Skip checkpoint-only review stops when the next step is mechanically clear.
11
+ - Stop immediately when `pause_reason` is one of:
12
+ - `missing_intent`
13
+ - `track_selection`
14
+ - `dependency_deadlock`
15
+ - `needs_manual_verification`
16
+ - `cleanup_confirmation`
17
+ - `auto_retry_limit`
18
+ - Review or verification blockers should stay in the same phase. Append remediation work to that phase instead of creating a replacement phase.
19
+ </rules>
20
+
21
+ <process>
22
+ 1. Run:
23
+
24
+ ```bash
25
+ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
26
+ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" status --auto
27
+ ```
28
+
29
+ 2. Inspect `route.kind`, `route.run_mode`, `route.auto_continuable`, `route.pause_reason`, and the active track data.
30
+
31
+ 3. Handle stop conditions first:
32
+ - If `route.kind` is `init_project` and the current prompt still does not clearly define the project and first track, stop for `missing_intent`.
33
+ - If `route.kind` is `init_project` but the current prompt already gives clear project and track intent, treat that pause as resolved and continue into new-project.
34
+ - If `route.pause_reason` is `track_selection`, stop and ask the user which track to continue or whether to create a new one.
35
+ - If `route.pause_reason` is `dependency_deadlock`, stop and tell the user the current phase plan must be repaired before more auto execution can continue.
36
+ - If `route.pause_reason` is `auto_retry_limit`, stop and tell the user the same phase has already auto-replanned twice.
37
+ - If `route.pause_reason` is `cleanup_confirmation`, stop and require the user to start cleanup explicitly.
38
+
39
+ 4. Route as follows:
40
+ - `init_project`: load and perform the new-project workflow in auto mode.
41
+ - `explore_codebase`: load and perform the explore-codebase workflow in auto mode.
42
+ - `plan_phase`: load and perform the plan-phase workflow in auto mode.
43
+ - `execute_phase`: load and perform the execute-phase workflow in auto mode.
44
+ - `review_phase`: load and perform the review-phase workflow in auto mode.
45
+ - `verify_phase`: load and perform the verify-work workflow in auto mode.
46
+
47
+ 5. Do not load `review-plan` or `review-task` in auto mode. The router already skips those checkpoint-only stops when it is safe to continue.
48
+
49
+ 6. After each completed routed step, re-run the auto status command in the same turn and continue if the next route is still auto-continuable.
50
+
51
+ 7. Keep both project-level and track-level state aligned after every step:
52
+ - `Run Mode: auto`
53
+ - `Next Command: /autodev-auto`
54
+ - `Auto Retry Count: 0` after a clean plan or successful review/verification
55
+ - increment `Auto Retry Count` only when auto mode reopens the same phase after review or verification blockers
56
+
57
+ 8. End only when the track is complete or a real pause reason remains. Report:
58
+ - what step just completed
59
+ - why execution stopped or completed
60
+ - `/autodev-auto` as the default next command when more auto work remains
61
+ - `/autodev` only as the manual fallback
62
+ </process>
@@ -4,6 +4,7 @@ Use `/autodev` as the single entrypoint for the normal workflow. Route automatic
4
4
 
5
5
  <rules>
6
6
  - Prefer `/autodev` over telling the user to run a different command manually.
7
+ - `/autodev` is the checkpointed mode. Use `/autodev-auto` only when the user explicitly asked for continuous execution.
7
8
  - Manual commands remain valid escape hatches. Mention them only as shortcuts.
8
9
  - Keep the model `project -> track -> phase -> tasks`.
9
10
  - Brownfield repositories should be mapped before detailed phase planning.
@@ -69,7 +70,10 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" status
69
70
 
70
71
  8. When the user chooses a new track at step 7, create it immediately and continue routing in the same turn.
71
72
 
72
- 9. Every time you finish a routed step, keep both project-level and track-level state aligned. Default the state files to `Next Command: /autodev`.
73
+ 9. Every time you finish a routed step, keep both project-level and track-level state aligned. Default the state files to:
74
+ - `Run Mode: checkpointed`
75
+ - `Auto Retry Count: 0` unless a blocked phase is being actively recovered
76
+ - `Next Command: /autodev`
73
77
 
74
78
  10. End with:
75
79
  - what step you completed
@@ -14,6 +14,7 @@ Execute an active-track phase through task-sized delegated runs, keep the main s
14
14
  - The main phase session should remain orchestration-focused whenever delegation works.
15
15
  - The main phase session may update `.autodev/` state and aggregate phase artifacts.
16
16
  - Do not run autodev subagents as background tasks.
17
+ - In `/autodev-auto`, keep executing ready tasks in the same phase until the phase is complete or a real blocker appears.
17
18
  </rules>
18
19
 
19
20
  <process>
@@ -24,6 +25,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
24
25
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENTS"
25
26
  ```
26
27
 
28
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
29
+
27
30
  2. If no phase is found or the plan file is missing, stop and direct the user to `/autodev-plan-phase`.
28
31
 
29
32
  3. Read:
@@ -42,7 +45,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
42
45
  5. Determine the next executable task:
43
46
  - prefer the first task without a summary whose dependencies are already done
44
47
  - if no executable task remains and all task summaries exist, move to phase aggregation
45
- - if `dependency_deadlock` is true, stop before execution, set both state files to `Current Step: planning`, set `Current Task: none`, set `Current Task Status: blocked_dependencies`, keep `Next Command: /autodev`, and ask the user how to repair the plan
48
+ - if `dependency_deadlock` is true, stop before execution, set both state files to `Current Step: planning`, set `Current Task: none`, set `Current Task Status: blocked_dependencies`, keep `Run Mode` aligned to the current command, keep `Next Command` aligned to the current command, and ask the user how to repair the plan
46
49
 
47
50
  6. Before running a task, show the user:
48
51
  - task id and title
@@ -78,16 +81,26 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
78
81
  - inspect whether the task is done or blocked
79
82
  - report the result to the user
80
83
 
81
- 10. If more tasks remain:
84
+ 10. If more tasks remain in checkpointed mode:
82
85
  - update project and track state to:
83
86
  - `Current Step: task_review`
84
87
  - `Current Task: <current-task>`
85
88
  - `Current Task Status: complete`
89
+ - `Run Mode: checkpointed`
86
90
  - `Next Command: /autodev`
87
91
  - stop after this task
88
92
  - end by telling the user `/autodev` will open the task review checkpoint before any next-task execution
89
93
 
90
- 11. If all tasks are done:
94
+ 11. If more tasks remain in auto mode:
95
+ - update project and track state to:
96
+ - `Current Step: execution`
97
+ - `Current Task: <next-ready-task>`
98
+ - `Current Task Status: ready`
99
+ - `Run Mode: auto`
100
+ - `Next Command: /autodev-auto`
101
+ - continue to the next ready task in the same run
102
+ - stop only if a new blocker appears
103
+ 12. If all tasks are done:
91
104
  - write or update `NN-SUMMARY.md` from the template with:
92
105
  - completed tasks
93
106
  - aggregate files changed
@@ -95,33 +108,37 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
95
108
  - remaining risks
96
109
  - next step
97
110
 
98
- 12. Update the active track `STATE.md` so it points to:
111
+ 13. Update the active track `STATE.md` so it points to:
99
112
  - `Current Phase: N`
100
113
  - `Current Phase Type: <type>`
101
- - `Current Step: task_review`
114
+ - `Current Step: task_review` in checkpointed mode, or `Current Step: review` in auto mode
102
115
  - `Current Task: <current-task>`
103
116
  - `Current Task Status: complete`
104
- - `Next Command: /autodev`
117
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
118
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
105
119
  - current ISO timestamp
106
120
 
107
- 13. Update `.autodev/STATE.md` so it points to:
121
+ 14. Update `.autodev/STATE.md` so it points to:
108
122
  - `Active Track: <slug>`
109
- - `Current Step: task_review`
123
+ - `Current Step: task_review` in checkpointed mode, or `Current Step: review` in auto mode
110
124
  - `Current Task: <current-task>`
111
125
  - `Current Task Status: complete`
112
- - `Next Command: /autodev`
126
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
127
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
113
128
  - current ISO timestamp
114
129
 
115
- 14. If the current task is blocked or incomplete:
130
+ 15. If the current task is blocked or incomplete:
116
131
  - say so clearly in the task summary
117
132
  - set both state files to `Current Step: planning`
118
133
  - set `Current Task: <same-task>`
119
134
  - set `Current Task Status: blocked`
120
- - keep `Next Command: /autodev`
135
+ - keep `Run Mode` aligned to the current command
136
+ - keep `Next Command` aligned to the current command
121
137
  - tell the user the phase should be revised before more execution
122
138
 
123
- 15. End with a short outcome summary and the next recommended command.
124
- - Never execute a second task in the same run.
125
- - If all tasks are now done, say `/autodev` will open the phase-review checkpoint next.
126
- - Otherwise, say `/autodev` will open the task-review checkpoint for the completed task.
139
+ 16. End with a short outcome summary and the next recommended command.
140
+ - In checkpointed mode, never execute a second task in the same run.
141
+ - In checkpointed mode, if all tasks are now done, say `/autodev` will open the phase-review checkpoint next.
142
+ - In checkpointed mode, otherwise say `/autodev` will open the task-review checkpoint for the completed task.
143
+ - In auto mode, keep going until the phase completes or a real blocker stops execution.
127
144
  </process>
@@ -20,6 +20,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
20
20
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init explore-codebase
21
21
  ```
22
22
 
23
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
24
+
23
25
  2. If no project exists, stop and tell the user to use `/autodev` or `/autodev-new-project`.
24
26
 
25
27
  3. Read:
@@ -55,7 +57,9 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init explore-codebase
55
57
 
56
58
  9. Update `.autodev/STATE.md` and the active track `STATE.md` so they reflect:
57
59
  - `Current Step: planning`
58
- - `Next Command: /autodev`
60
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
61
+ - `Auto Retry Count: 0`
62
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
59
63
  - refreshed ISO timestamp
60
64
 
61
65
  10. End with:
@@ -3,11 +3,14 @@
3
3
  Lean Claude Code workflow. No automatic commits. No branches. No worktrees. Git is read-only.
4
4
  It resolves `.autodev/` state from the repo root even when you start Claude in a nested subdirectory.
5
5
  It can auto-format edited code after writes when the repo already has a local formatter available.
6
+ Supported runtime is Claude Code with Node plus `sh`/`bash` available.
6
7
 
7
8
  ## Main Entry
8
9
 
9
10
  - `/autodev`
10
- The normal command. It routes automatically through project setup, codebase mapping, planning, plan review, execution, review, verification, and cleanup.
11
+ The default checkpointed command. It routes automatically through project setup, codebase mapping, planning, plan review, execution, review, verification, and cleanup.
12
+ - `/autodev-auto`
13
+ The explicit continuous mode. It keeps going until the track is done or a real stop condition appears, such as missing intent, dependency deadlock, retry-limit exhaustion, or manual verification.
11
14
 
12
15
  ## Manual Commands
13
16
 
@@ -8,6 +8,7 @@ Initialize `.autodev/` with useful project-level context, then create the first
8
8
  - Use concise questioning, but do a short discovery pass before writing project state.
9
9
  - Ask only for details that materially change requirements or roadmap.
10
10
  - Treat the repository as a `project`, then put the current initiative in a `track`.
11
+ - If this workflow was entered from `/autodev-auto`, continue automatically only when the current prompt is specific enough to define the project and first track without guessing.
11
12
  </rules>
12
13
 
13
14
  <process>
@@ -18,6 +19,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
18
19
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init new-project
19
20
  ```
20
21
 
22
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
23
+
21
24
  2. If `.autodev/PROJECT.md` already exists, stop and tell the user to use `/autodev`.
22
25
 
23
26
  3. Do a short discovery pass before writing project or track files.
@@ -58,7 +61,9 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init new-project
58
61
  - `Current Task: none`
59
62
  - `Current Task Status: idle`
60
63
  - `Status: active`
61
- - `Next Command: /autodev`
64
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
65
+ - `Auto Retry Count: 0`
66
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
62
67
  - current ISO timestamp
63
68
 
64
69
  9. Create `.autodev/tracks/<slug>/TRACK.md` with:
@@ -92,7 +97,9 @@ Each phase must include:
92
97
  - `Current Task: none`
93
98
  - `Current Task Status: idle`
94
99
  - `Status: active`
95
- - `Next Command: /autodev`
100
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
101
+ - `Auto Retry Count: 0`
102
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
96
103
  - current ISO timestamp
97
104
 
98
105
  13. If the project is brownfield, do not fake a codebase map. Continue into codebase exploration inside `/autodev` by default. Mention `/autodev-explore-codebase` only as a manual shortcut. Otherwise, the next step is planning phase 1 through `/autodev`.
@@ -10,6 +10,7 @@ Create one practical phase plan for the active track, then break it into reviewa
10
10
  - Never include git write commands in the plan.
11
11
  - Do not use waves by default.
12
12
  - When revising a blocked phase, preserve the same phase, the same phase goal, and all completed task history.
13
+ - In `/autodev-auto`, a freshly written or repaired plan should continue automatically unless the plan itself still depends on unresolved user intent.
13
14
  </rules>
14
15
 
15
16
  <process>
@@ -20,6 +21,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
20
21
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init plan-phase "$ARGUMENTS"
21
22
  ```
22
23
 
24
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
25
+
23
26
  2. If there is no active track or no roadmap for it, stop and tell the user to run `/autodev`.
24
27
 
25
28
  3. If no phase is found, tell the user all phases already have plans and show `/autodev-progress`.
@@ -105,7 +108,9 @@ Each task file must include:
105
108
  - `Current Step: plan_review`
106
109
  - `Current Task: <first-pending-task>` if tasks exist, otherwise `none`
107
110
  - `Current Task Status: pending_review`
108
- - `Next Command: /autodev`
111
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
112
+ - `Auto Retry Count: 0`
113
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
109
114
  - current ISO timestamp
110
115
 
111
116
  12. Update `.autodev/STATE.md` so it points to:
@@ -113,7 +118,9 @@ Each task file must include:
113
118
  - `Current Step: plan_review`
114
119
  - `Current Task: <first-pending-task>` if tasks exist, otherwise `none`
115
120
  - `Current Task Status: pending_review`
116
- - `Next Command: /autodev`
121
+ - `Run Mode: checkpointed` for `/autodev`, or `Run Mode: auto` for `/autodev-auto`
122
+ - `Auto Retry Count: 0`
123
+ - `Next Command: /autodev` for checkpointed mode, or `/autodev-auto` for auto mode
117
124
  - current ISO timestamp
118
125
 
119
126
  13. End with a short summary and stop for review.
@@ -121,6 +128,7 @@ Each task file must include:
121
128
  - the plan and task files are ready for review
122
129
  - completed task history from the phase was preserved
123
130
  - any blocker remediation was added as appended task work inside the same phase
124
- - `/autodev` will open the review checkpoint before any execution starts
131
+ - in checkpointed mode, `/autodev` will open the review checkpoint before any execution starts
132
+ - in auto mode, `/autodev-auto` should continue directly into execution unless a real ambiguity remains
125
133
  - `/autodev-execute-phase N` is only the optional manual bypass after review
126
134
  </process>
@@ -7,6 +7,7 @@ Run the automatic review bundle after execution so the user sees code quality, s
7
7
  - Review findings should be concrete and evidence-based.
8
8
  - Do not edit repository code in this step unless the user explicitly asks for fixes.
9
9
  - Write one consolidated review artifact for the phase.
10
+ - In `/autodev-auto`, blockers should reopen the same phase automatically unless the auto retry limit has already been reached.
10
11
  </rules>
11
12
 
12
13
  <process>
@@ -17,6 +18,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
17
18
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init review-phase "$ARGUMENTS"
18
19
  ```
19
20
 
21
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
22
+
20
23
  2. If no executed phase is found, stop and direct the user to `/autodev-execute-phase`.
21
24
 
22
25
  3. Read:
@@ -57,14 +60,18 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init review-phase "$ARGUMENTS
57
60
  - set project and track state back to `Current Step: planning`
58
61
  - set `Current Task: none`
59
62
  - set `Current Task Status: blocked_review`
60
- - keep `Next Command: /autodev`
63
+ - keep `Run Mode` aligned to the current command
64
+ - if this is `/autodev-auto`, increment `Auto Retry Count` by `1`
65
+ - keep `Next Command` aligned to the current command
61
66
  - make the recommendation point back to revising the same phase with appended blocker-fix tasks
62
67
  - do not recommend creating a new phase for ordinary review blockers
63
68
  - preserve completed task history and phase goal
64
69
 
65
70
  9. If blockers are not found:
66
71
  - set project and track state to `Current Step: verification`
67
- - keep `Next Command: /autodev`
72
+ - reset `Auto Retry Count` to `0`
73
+ - keep `Run Mode` aligned to the current command
74
+ - keep `Next Command` aligned to the current command
68
75
 
69
76
  10. End with a short review result:
70
77
  - ready for verification, or
@@ -7,6 +7,7 @@ Run lightweight user acceptance testing after review and keep the next action ob
7
7
  - Keep the interaction concise and test-oriented.
8
8
  - Do not auto-generate a new plan unless a real gap appears.
9
9
  - Verification failures should normally reopen the same phase with appended remediation tasks, not create a new phase.
10
+ - In `/autodev-auto`, prefer fully automatable verification first and stop only when verification truly requires human observation or judgment.
10
11
  </rules>
11
12
 
12
13
  <process>
@@ -17,6 +18,8 @@ AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
17
18
  node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init verify-work "$ARGUMENTS"
18
19
  ```
19
20
 
21
+ If this run came from `/autodev-auto`, append `--auto` to the same command.
22
+
20
23
  2. If no reviewed phase is found, stop and direct the user to `/autodev-review-phase`.
21
24
 
22
25
  3. Read:
@@ -27,7 +30,10 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init verify-work "$ARGUMENTS"
27
30
  - `NN-REVIEW.md`
28
31
  - relevant code or UI files
29
32
 
30
- 4. Present a short manual verification flow. Keep it one check at a time when user input is needed.
33
+ 4. Choose the verification lane:
34
+ - If the phase can be verified with concrete commands or deterministic checks that do not require human observation, run those checks directly.
35
+ - If the phase still depends on visual inspection, human judgment, credentials the assistant does not have, or missing reproducible checks, stop and treat it as `needs_manual_verification`.
36
+ - When user input is needed, present a short manual verification flow one check at a time.
31
37
 
32
38
  5. Write or update `NN-UAT.md` from the template with:
33
39
  - test cases
@@ -47,11 +53,19 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init verify-work "$ARGUMENTS"
47
53
  - if verification failed, keep the same phase active and set `Current Step: planning`
48
54
  - when moving to another phase, set `Current Task: none` and `Current Task Status: idle`
49
55
  - when verification failed, set `Current Task: none` and `Current Task Status: blocked_verification`
50
- - always set `Next Command: /autodev`
56
+ - keep `Run Mode` aligned to the current command
57
+ - reset `Auto Retry Count` to `0` on success, or increment it by `1` for `/autodev-auto` verification failures
58
+ - always set `Next Command` aligned to the current command
51
59
  - always refresh the ISO timestamp
52
60
  - when verification failed, the next planning pass should preserve completed tasks and append remediation tasks to the same phase
53
61
 
54
62
  8. Update `.autodev/STATE.md` with the matching project-level status and refreshed timestamp.
55
63
 
56
- 9. End with the verification result and the next command. Mention the manual shortcut only if it helps.
64
+ 9. In `/autodev-auto`, if verification cannot be completed without human judgment:
65
+ - stop instead of guessing
66
+ - keep the current phase active
67
+ - tell the user this pause reason is `needs_manual_verification`
68
+ - recommend `/autodev` for manual verification or `/autodev-auto` again after the missing checks are made automatable
69
+
70
+ 10. End with the verification result and the next command. Mention the manual shortcut only if it helps.
57
71
  </process>
package/bin/install.js CHANGED
@@ -10,7 +10,6 @@ const yellow = '\x1b[33m';
10
10
  const cyan = '\x1b[36m';
11
11
  const reset = '\x1b[0m';
12
12
 
13
- const MANAGED_PREFIX = 'autodev-';
14
13
  const ROOT_COMMAND = 'autodev';
15
14
  const HOOK_FILES = [
16
15
  'hooks.json',
@@ -223,9 +222,12 @@ function copyCommandsAsLocal(srcDir, destDir, transform) {
223
222
 
224
223
  function copyCommandsAsGlobalSkills(srcDir, skillsDir, prefix, transform) {
225
224
  fs.mkdirSync(skillsDir, { recursive: true });
225
+ const managedSkillNames = fs.readdirSync(srcDir, { withFileTypes: true })
226
+ .filter(entry => entry.isFile() && entry.name.endsWith('.md'))
227
+ .map(entry => skillNameFromSourceFile(entry.name, prefix));
226
228
 
227
229
  for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
228
- if (entry.isDirectory() && (entry.name === prefix || entry.name.startsWith(`${prefix}-`))) {
230
+ if (entry.isDirectory() && managedSkillNames.includes(entry.name)) {
229
231
  fs.rmSync(path.join(skillsDir, entry.name), { recursive: true, force: true });
230
232
  }
231
233
  }
@@ -265,8 +267,91 @@ function copyAgents(srcDir, destDir, transform) {
265
267
  }
266
268
  }
267
269
 
268
- function removeManagedSettings(settings) {
269
- if (settings.statusLine?.command && settings.statusLine.command.includes('autodev-statusline')) {
270
+ function managedAgents(srcRoot = path.resolve(__dirname, '..')) {
271
+ const agentsDir = path.join(srcRoot, 'agents');
272
+ if (!fs.existsSync(agentsDir)) {
273
+ return [];
274
+ }
275
+
276
+ return fs.readdirSync(agentsDir, { withFileTypes: true })
277
+ .filter(entry => entry.isFile() && entry.name.endsWith('.md'))
278
+ .map(entry => entry.name);
279
+ }
280
+
281
+ function managedCommandNames(srcRoot = path.resolve(__dirname, '..')) {
282
+ const commandsDir = path.join(srcRoot, 'commands', 'autodev');
283
+ if (!fs.existsSync(commandsDir)) {
284
+ return [];
285
+ }
286
+
287
+ return fs.readdirSync(commandsDir, { withFileTypes: true })
288
+ .filter(entry => entry.isFile() && entry.name.endsWith('.md'))
289
+ .map(entry => commandNameFromSourceFile(entry.name));
290
+ }
291
+
292
+ function managedSkillNames(srcRoot = path.resolve(__dirname, '..')) {
293
+ const commandsDir = path.join(srcRoot, 'commands', 'autodev');
294
+ if (!fs.existsSync(commandsDir)) {
295
+ return [];
296
+ }
297
+
298
+ return fs.readdirSync(commandsDir, { withFileTypes: true })
299
+ .filter(entry => entry.isFile() && entry.name.endsWith('.md'))
300
+ .map(entry => skillNameFromSourceFile(entry.name, ROOT_COMMAND));
301
+ }
302
+
303
+ function managedCommandStrings(targetDir, isGlobal) {
304
+ return {
305
+ statusLine: isGlobal
306
+ ? buildGlobalCommand(targetDir, 'autodev-statusline.js')
307
+ : buildLocalCommand('autodev-statusline.js'),
308
+ hooks: [
309
+ isGlobal
310
+ ? buildGlobalCommand(targetDir, 'autodev-session-state.sh', 'bash')
311
+ : buildLocalCommand('autodev-session-state.sh', 'bash'),
312
+ isGlobal
313
+ ? buildGlobalCommand(targetDir, 'autodev-prompt-guard.js')
314
+ : buildLocalCommand('autodev-prompt-guard.js'),
315
+ isGlobal
316
+ ? buildGlobalCommand(targetDir, 'autodev-read-guard.js')
317
+ : buildLocalCommand('autodev-read-guard.js'),
318
+ isGlobal
319
+ ? buildGlobalCommand(targetDir, 'autodev-workflow-guard.js')
320
+ : buildLocalCommand('autodev-workflow-guard.js'),
321
+ isGlobal
322
+ ? buildGlobalCommand(targetDir, 'autodev-git-guard.js')
323
+ : buildLocalCommand('autodev-git-guard.js'),
324
+ isGlobal
325
+ ? buildGlobalCommand(targetDir, 'autodev-auto-format.js')
326
+ : buildLocalCommand('autodev-auto-format.js'),
327
+ isGlobal
328
+ ? buildGlobalCommand(targetDir, 'autodev-context-monitor.js')
329
+ : buildLocalCommand('autodev-context-monitor.js'),
330
+ isGlobal
331
+ ? buildGlobalCommand(targetDir, 'autodev-phase-boundary.sh', 'bash')
332
+ : buildLocalCommand('autodev-phase-boundary.sh', 'bash')
333
+ ]
334
+ };
335
+ }
336
+
337
+ function isManagedCommand(command, managedCommands = null) {
338
+ if (typeof command !== 'string') {
339
+ return false;
340
+ }
341
+
342
+ if (managedCommands && managedCommands.includes(command)) {
343
+ return true;
344
+ }
345
+
346
+ return /(?:^|[/"\s])autodev-(?:auto-format|context-monitor|git-guard|phase-boundary|prompt-guard|read-guard|session-state|statusline|workflow-guard)\.(?:js|sh)(?:"|$)/.test(command);
347
+ }
348
+
349
+ function removeManagedSettings(settings, options = {}) {
350
+ const managedStrings = options.targetDir
351
+ ? managedCommandStrings(options.targetDir, Boolean(options.isGlobal))
352
+ : null;
353
+
354
+ if (settings.statusLine?.command && isManagedCommand(settings.statusLine.command, managedStrings ? [managedStrings.statusLine] : null)) {
270
355
  delete settings.statusLine;
271
356
  }
272
357
 
@@ -285,7 +370,7 @@ function removeManagedSettings(settings) {
285
370
  const entries = Array.isArray(settings.hooks[eventName]) ? settings.hooks[eventName] : [];
286
371
  const filtered = entries.filter(entry => {
287
372
  const hooks = Array.isArray(entry?.hooks) ? entry.hooks : [];
288
- return !hooks.some(hook => typeof hook.command === 'string' && hook.command.includes('autodev-'));
373
+ return !hooks.some(hook => isManagedCommand(hook?.command, managedStrings?.hooks || null));
289
374
  });
290
375
 
291
376
  if (filtered.length > 0) {
@@ -367,7 +452,7 @@ function configureSettings(targetDir, isGlobal, options = {}) {
367
452
  return null;
368
453
  }
369
454
 
370
- removeManagedSettings(settings);
455
+ removeManagedSettings(settings, { targetDir, isGlobal });
371
456
 
372
457
  const preToolEvent = 'PreToolUse';
373
458
  const postToolEvent = 'PostToolUse';
@@ -402,13 +487,13 @@ function configureSettings(targetDir, isGlobal, options = {}) {
402
487
  : buildLocalCommand('autodev-statusline.js');
403
488
 
404
489
  ensureHook(settings, sessionStartEvent, null, sessionStateCommand);
405
- ensureHook(settings, preToolEvent, 'Write|Edit', promptGuardCommand, 5);
406
- ensureHook(settings, preToolEvent, 'Write|Edit', readGuardCommand, 5);
407
- ensureHook(settings, preToolEvent, 'Write|Edit', workflowGuardCommand, 5);
490
+ ensureHook(settings, preToolEvent, 'Write|Edit|MultiEdit', promptGuardCommand, 5);
491
+ ensureHook(settings, preToolEvent, 'Write|Edit|MultiEdit', readGuardCommand, 5);
492
+ ensureHook(settings, preToolEvent, 'Write|Edit|MultiEdit', workflowGuardCommand, 5);
408
493
  ensureHook(settings, preToolEvent, 'Bash', gitGuardCommand, 5);
409
494
  ensureHook(settings, postToolEvent, 'Edit|Write|MultiEdit', autoFormatCommand, 10);
410
495
  ensureHook(settings, postToolEvent, 'Bash|Edit|Write|MultiEdit|Agent|Task', contextMonitorCommand, 10);
411
- ensureHook(settings, postToolEvent, 'Write|Edit', phaseBoundaryCommand, 5);
496
+ ensureHook(settings, postToolEvent, 'Write|Edit|MultiEdit', phaseBoundaryCommand, 5);
412
497
 
413
498
  if (options.installStatusLine !== false) {
414
499
  settings.statusLine = {
@@ -426,6 +511,7 @@ function configureSettings(targetDir, isGlobal, options = {}) {
426
511
  }
427
512
 
428
513
  function removeInstalledFiles(targetDir, isGlobal) {
514
+ const srcRoot = path.resolve(__dirname, '..');
429
515
  const supportDir = path.join(targetDir, 'autodev');
430
516
  if (fs.existsSync(supportDir)) {
431
517
  fs.rmSync(supportDir, { recursive: true, force: true });
@@ -433,9 +519,10 @@ function removeInstalledFiles(targetDir, isGlobal) {
433
519
 
434
520
  const agentsDir = path.join(targetDir, 'agents');
435
521
  if (fs.existsSync(agentsDir)) {
436
- for (const entry of fs.readdirSync(agentsDir, { withFileTypes: true })) {
437
- if (entry.isFile() && entry.name.startsWith(MANAGED_PREFIX) && entry.name.endsWith('.md')) {
438
- fs.rmSync(path.join(agentsDir, entry.name), { force: true });
522
+ for (const agentFile of managedAgents(srcRoot)) {
523
+ const agentPath = path.join(agentsDir, agentFile);
524
+ if (fs.existsSync(agentPath)) {
525
+ fs.rmSync(agentPath, { force: true });
439
526
  }
440
527
  }
441
528
  }
@@ -451,18 +538,20 @@ function removeInstalledFiles(targetDir, isGlobal) {
451
538
  if (isGlobal) {
452
539
  const skillsDir = path.join(targetDir, 'skills');
453
540
  if (fs.existsSync(skillsDir)) {
454
- for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
455
- if (entry.isDirectory() && (entry.name === ROOT_COMMAND || entry.name.startsWith(MANAGED_PREFIX))) {
456
- fs.rmSync(path.join(skillsDir, entry.name), { recursive: true, force: true });
541
+ for (const skillName of managedSkillNames(srcRoot)) {
542
+ const skillPath = path.join(skillsDir, skillName);
543
+ if (fs.existsSync(skillPath)) {
544
+ fs.rmSync(skillPath, { recursive: true, force: true });
457
545
  }
458
546
  }
459
547
  }
460
548
  } else {
461
549
  const commandsDir = path.join(targetDir, 'commands');
462
550
  if (fs.existsSync(commandsDir)) {
463
- for (const entry of fs.readdirSync(commandsDir, { withFileTypes: true })) {
464
- if (entry.isFile() && entry.name.startsWith(ROOT_COMMAND) && entry.name.endsWith('.md')) {
465
- fs.rmSync(path.join(commandsDir, entry.name), { force: true });
551
+ for (const commandName of managedCommandNames(srcRoot)) {
552
+ const commandPath = path.join(commandsDir, `${commandName}.md`);
553
+ if (fs.existsSync(commandPath)) {
554
+ fs.rmSync(commandPath, { force: true });
466
555
  }
467
556
  }
468
557
  }
@@ -472,9 +561,10 @@ function removeInstalledFiles(targetDir, isGlobal) {
472
561
  }
473
562
  const skillsDir = path.join(targetDir, 'skills');
474
563
  if (fs.existsSync(skillsDir)) {
475
- for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
476
- if (entry.isDirectory() && (entry.name === ROOT_COMMAND || entry.name.startsWith(MANAGED_PREFIX))) {
477
- fs.rmSync(path.join(skillsDir, entry.name), { recursive: true, force: true });
564
+ for (const skillName of managedSkillNames(srcRoot)) {
565
+ const skillPath = path.join(skillsDir, skillName);
566
+ if (fs.existsSync(skillPath)) {
567
+ fs.rmSync(skillPath, { recursive: true, force: true });
478
568
  }
479
569
  }
480
570
  }
@@ -553,7 +643,7 @@ function uninstall(options = {}) {
553
643
  const settingsPath = path.join(targetDir, 'settings.json');
554
644
  const settings = readSettings(settingsPath);
555
645
  if (settings) {
556
- removeManagedSettings(settings);
646
+ removeManagedSettings(settings, { targetDir, isGlobal });
557
647
  writeSettings(settingsPath, settings);
558
648
  }
559
649