@mthanhlm/autodev 0.3.7 → 0.4.1
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/.claude-plugin/plugin.json +1 -1
- package/PUBLISH.md +1 -1
- package/README.md +15 -2
- package/autodev/bin/autodev-tools.cjs +109 -13
- package/autodev/templates/config.json +1 -5
- package/autodev/templates/plan.md +6 -0
- package/autodev/templates/review.md +3 -0
- package/autodev/workflows/autodev.md +1 -0
- package/autodev/workflows/execute-phase.md +15 -11
- package/autodev/workflows/help.md +17 -1
- package/autodev/workflows/new-project.md +0 -2
- package/autodev/workflows/plan-phase.md +33 -7
- package/autodev/workflows/review-phase.md +3 -1
- package/autodev/workflows/review-plan.md +3 -2
- package/autodev/workflows/review-task.md +70 -0
- package/autodev/workflows/verify-work.md +3 -0
- package/bin/install.js +55 -2
- package/commands/autodev/execute-phase.md +2 -2
- package/commands/autodev/review-task.md +25 -0
- package/hooks/autodev-context-monitor.js +1 -8
- package/hooks/autodev-git-guard.js +1 -9
- package/hooks/autodev-paths.js +60 -0
- package/hooks/autodev-phase-boundary.sh +34 -5
- package/hooks/autodev-read-guard.js +1 -8
- package/hooks/autodev-session-state.sh +35 -6
- package/hooks/autodev-statusline.js +3 -10
- package/hooks/autodev-workflow-guard.js +1 -9
- package/package.json +1 -1
package/PUBLISH.md
CHANGED
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- Keeps project state in `.autodev/`
|
|
9
9
|
- Uses `/autodev` as the main command
|
|
10
10
|
- Organizes work as `project -> track -> phase -> tasks`
|
|
11
|
+
- Resolves `.autodev/` state from the repo root even when Claude is started in a nested subdirectory
|
|
11
12
|
- Maps brownfield repos with foreground delegated agents when the environment supports them
|
|
12
13
|
- Runs a multi-lens review pass, using foreground review agents when the environment supports them
|
|
13
14
|
- Ships manual commands when you want direct control:
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
- `/autodev-explore-codebase`
|
|
17
18
|
- `/autodev-plan-phase`
|
|
18
19
|
- `/autodev-execute-phase`
|
|
20
|
+
- `/autodev-review-task`
|
|
19
21
|
- `/autodev-review-phase`
|
|
20
22
|
- `/autodev-verify-work`
|
|
21
23
|
- `/autodev-cleanup`
|
|
@@ -43,6 +45,12 @@ Local install for one repo:
|
|
|
43
45
|
npx @mthanhlm/autodev@latest --local
|
|
44
46
|
```
|
|
45
47
|
|
|
48
|
+
Install and also disable Claude Code background tasks in the target `settings.json`:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx @mthanhlm/autodev@latest --global --disable-background-tasks
|
|
52
|
+
```
|
|
53
|
+
|
|
46
54
|
Uninstall:
|
|
47
55
|
|
|
48
56
|
```bash
|
|
@@ -64,8 +72,10 @@ Typical brownfield route:
|
|
|
64
72
|
-> explore codebase
|
|
65
73
|
-> plan phase
|
|
66
74
|
-> review phase plan
|
|
67
|
-
-> execute
|
|
68
|
-
->
|
|
75
|
+
-> execute one task
|
|
76
|
+
-> review task
|
|
77
|
+
-> execute one task
|
|
78
|
+
-> review task
|
|
69
79
|
-> review
|
|
70
80
|
-> verify
|
|
71
81
|
```
|
|
@@ -100,9 +110,12 @@ project -> track -> phase -> tasks
|
|
|
100
110
|
- The phase keeps one user-facing orchestration session
|
|
101
111
|
- Each task is preferably executed by a fresh foreground delegated agent
|
|
102
112
|
- After each task, the delegated agent reports back with files changed, verification, and blockers
|
|
113
|
+
- `/autodev` stops after each completed task and reopens a task review checkpoint before any further execution
|
|
114
|
+
- If review or verification finds blockers, the same phase stays open and autodev should append remediation task(s) to that phase instead of replacing it or creating a follow-up phase by default
|
|
103
115
|
- No waves by default
|
|
104
116
|
- No automatic parallel execution
|
|
105
117
|
- If specialized agents are unavailable in the current Claude Code environment, the workflow falls back cleanly to current-session execution instead of stopping on platform wording
|
|
118
|
+
- If you want Claude Code itself to hard-disable background task functionality, install with `--disable-background-tasks`, which writes `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1` into Claude Code `settings.json`
|
|
106
119
|
|
|
107
120
|
## Git Policy
|
|
108
121
|
|
|
@@ -9,12 +9,9 @@ const DEFAULT_CONFIG = {
|
|
|
9
9
|
},
|
|
10
10
|
workflow: {
|
|
11
11
|
research: false,
|
|
12
|
-
review_after_execute: true
|
|
13
|
-
codebase_parallel_agents: 1
|
|
14
|
-
},
|
|
15
|
-
execution: {
|
|
16
|
-
parallel: false
|
|
12
|
+
review_after_execute: true
|
|
17
13
|
},
|
|
14
|
+
execution: {},
|
|
18
15
|
git: {
|
|
19
16
|
mode: 'read-only'
|
|
20
17
|
},
|
|
@@ -31,13 +28,38 @@ const DEFAULT_CONFIG = {
|
|
|
31
28
|
|
|
32
29
|
const CODEBASE_FILES = ['structure.md', 'domain.md', 'runtime.md', 'quality.md', 'summary.md'];
|
|
33
30
|
|
|
31
|
+
function findWorkspaceRoot(startDir) {
|
|
32
|
+
let cursor = path.resolve(startDir || process.cwd());
|
|
33
|
+
let gitRoot = null;
|
|
34
|
+
|
|
35
|
+
while (true) {
|
|
36
|
+
if (fileExists(path.join(cursor, '.autodev'))) {
|
|
37
|
+
return cursor;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!gitRoot && fileExists(path.join(cursor, '.git'))) {
|
|
41
|
+
gitRoot = cursor;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const parent = path.dirname(cursor);
|
|
45
|
+
if (parent === cursor) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
cursor = parent;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return gitRoot || path.resolve(startDir || process.cwd());
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
function autodevDir(cwd) {
|
|
35
|
-
return path.join(cwd, '.autodev');
|
|
55
|
+
return path.join(findWorkspaceRoot(cwd), '.autodev');
|
|
36
56
|
}
|
|
37
57
|
|
|
38
58
|
function rootPaths(cwd) {
|
|
59
|
+
const workspaceRoot = findWorkspaceRoot(cwd);
|
|
39
60
|
const root = autodevDir(cwd);
|
|
40
61
|
return {
|
|
62
|
+
workspaceRoot,
|
|
41
63
|
root,
|
|
42
64
|
config: path.join(root, 'config.json'),
|
|
43
65
|
project: path.join(root, 'PROJECT.md'),
|
|
@@ -86,6 +108,7 @@ function padPhase(number) {
|
|
|
86
108
|
}
|
|
87
109
|
|
|
88
110
|
function detectExistingCodebase(cwd) {
|
|
111
|
+
const workspaceRoot = findWorkspaceRoot(cwd);
|
|
89
112
|
const knownFiles = [
|
|
90
113
|
'package.json',
|
|
91
114
|
'package-lock.json',
|
|
@@ -117,16 +140,16 @@ function detectExistingCodebase(cwd) {
|
|
|
117
140
|
'__tests__'
|
|
118
141
|
];
|
|
119
142
|
|
|
120
|
-
if (knownFiles.some(name => fileExists(path.join(
|
|
143
|
+
if (knownFiles.some(name => fileExists(path.join(workspaceRoot, name)))) {
|
|
121
144
|
return true;
|
|
122
145
|
}
|
|
123
146
|
|
|
124
|
-
if (knownDirs.some(name => fileExists(path.join(
|
|
147
|
+
if (knownDirs.some(name => fileExists(path.join(workspaceRoot, name)))) {
|
|
125
148
|
return true;
|
|
126
149
|
}
|
|
127
150
|
|
|
128
151
|
try {
|
|
129
|
-
const entries = fs.readdirSync(
|
|
152
|
+
const entries = fs.readdirSync(workspaceRoot, { withFileTypes: true });
|
|
130
153
|
return entries.some(entry => {
|
|
131
154
|
if (entry.name === '.autodev' || entry.name === '.claude' || entry.name.startsWith('.')) {
|
|
132
155
|
return false;
|
|
@@ -365,9 +388,20 @@ function listTasksForPhaseDetails(phaseDetails) {
|
|
|
365
388
|
}
|
|
366
389
|
|
|
367
390
|
function nextExecutableTask(tasks) {
|
|
368
|
-
return tasks.find(task => !task.summaryExists && task.ready)
|
|
369
|
-
|
|
370
|
-
|
|
391
|
+
return tasks.find(task => !task.summaryExists && task.ready) || null;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function lastCompletedTask(tasks) {
|
|
395
|
+
const completed = tasks.filter(task => task.summaryExists);
|
|
396
|
+
return completed.length > 0 ? completed[completed.length - 1] : null;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function lastTaskNumber(tasks) {
|
|
400
|
+
return tasks.reduce((highest, task) => Math.max(highest, task.number), 0);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function hasDependencyDeadlock(tasks) {
|
|
404
|
+
return tasks.some(task => !task.summaryExists) && !nextExecutableTask(tasks);
|
|
371
405
|
}
|
|
372
406
|
|
|
373
407
|
function listPhases(cwd, slug = readActiveTrack(cwd)) {
|
|
@@ -443,12 +477,22 @@ function resolvePhase(cwd, slug, requestedPhase, mode) {
|
|
|
443
477
|
}
|
|
444
478
|
|
|
445
479
|
if (mode === 'execute') {
|
|
446
|
-
if (currentStatePhase &&
|
|
480
|
+
if (currentStatePhase && (
|
|
481
|
+
trackState?.currentStep === 'execution'
|
|
482
|
+
|| trackState?.currentStep === 'task_review'
|
|
483
|
+
)) {
|
|
447
484
|
return currentStatePhase;
|
|
448
485
|
}
|
|
449
486
|
return phases.find(phase => phase.planExists && !phase.summaryExists) || null;
|
|
450
487
|
}
|
|
451
488
|
|
|
489
|
+
if (mode === 'task_review') {
|
|
490
|
+
if (currentStatePhase && trackState?.currentStep === 'task_review') {
|
|
491
|
+
return currentStatePhase;
|
|
492
|
+
}
|
|
493
|
+
return phases.find(phase => phase.planExists && !phase.summaryExists && phase.taskDoneCount > 0) || null;
|
|
494
|
+
}
|
|
495
|
+
|
|
452
496
|
if (mode === 'review') {
|
|
453
497
|
if (currentStatePhase && trackState?.currentStep === 'review') {
|
|
454
498
|
return currentStatePhase;
|
|
@@ -563,6 +607,18 @@ function buildRoute(cwd) {
|
|
|
563
607
|
};
|
|
564
608
|
}
|
|
565
609
|
|
|
610
|
+
if (currentStatePhase && trackState?.currentStep === 'task_review') {
|
|
611
|
+
return {
|
|
612
|
+
kind: 'task_review',
|
|
613
|
+
command: '/autodev',
|
|
614
|
+
manualCommand: `/autodev-review-task ${currentStatePhase.number}`,
|
|
615
|
+
reason: 'task_execution_checkpoint_pending_user_review',
|
|
616
|
+
projectType,
|
|
617
|
+
trackSlug: activeTrack,
|
|
618
|
+
phaseNumber: currentStatePhase.number
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
|
|
566
622
|
if (currentStatePhase && trackState?.currentStep === 'plan_review') {
|
|
567
623
|
return {
|
|
568
624
|
kind: 'plan_review',
|
|
@@ -625,6 +681,19 @@ function buildRoute(cwd) {
|
|
|
625
681
|
};
|
|
626
682
|
}
|
|
627
683
|
|
|
684
|
+
const nextTaskReview = phases.find(phase => phase.planExists && !phase.summaryExists && phase.taskDoneCount > 0);
|
|
685
|
+
if (nextTaskReview) {
|
|
686
|
+
return {
|
|
687
|
+
kind: 'task_review',
|
|
688
|
+
command: '/autodev',
|
|
689
|
+
manualCommand: `/autodev-review-task ${nextTaskReview.number}`,
|
|
690
|
+
reason: 'phase_task_completed_awaiting_user_review',
|
|
691
|
+
projectType,
|
|
692
|
+
trackSlug: activeTrack,
|
|
693
|
+
phaseNumber: nextTaskReview.number
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
|
|
628
697
|
const nextPlannedReview = phases.find(phase => phase.planExists && !phase.summaryExists);
|
|
629
698
|
if (nextPlannedReview) {
|
|
630
699
|
return {
|
|
@@ -761,6 +830,7 @@ function buildStatus(cwd) {
|
|
|
761
830
|
|
|
762
831
|
return {
|
|
763
832
|
cwd,
|
|
833
|
+
workspace_root: paths.workspaceRoot,
|
|
764
834
|
autodev_exists: fileExists(paths.root),
|
|
765
835
|
project_exists: fileExists(paths.project),
|
|
766
836
|
existing_code_detected: existingCodebase,
|
|
@@ -824,6 +894,8 @@ function initPayload(cwd, mode, requestedPhase) {
|
|
|
824
894
|
? 'review'
|
|
825
895
|
: mode === 'verify-work'
|
|
826
896
|
? 'verify'
|
|
897
|
+
: mode === 'review-task'
|
|
898
|
+
? 'task_review'
|
|
827
899
|
: mode === 'execute-phase' || mode === 'review-plan'
|
|
828
900
|
? 'execute'
|
|
829
901
|
: mode === 'plan-phase'
|
|
@@ -832,6 +904,18 @@ function initPayload(cwd, mode, requestedPhase) {
|
|
|
832
904
|
const phase = phaseMode && activeTrack ? resolvePhase(cwd, activeTrack, requestedPhase, phaseMode) : null;
|
|
833
905
|
const tasks = phase ? listTasksForPhaseDetails(phase) : [];
|
|
834
906
|
const nextTask = nextExecutableTask(tasks);
|
|
907
|
+
const lastCompleted = lastCompletedTask(tasks);
|
|
908
|
+
const highestTaskNumber = lastTaskNumber(tasks);
|
|
909
|
+
const dependencyDeadlock = hasDependencyDeadlock(tasks);
|
|
910
|
+
const trackStateSnapshot = track ? readStateSnapshot(track.state) : null;
|
|
911
|
+
const currentTaskNumber = (() => {
|
|
912
|
+
const raw = trackStateSnapshot?.currentTask;
|
|
913
|
+
if (raw && /^\d+$/.test(raw)) {
|
|
914
|
+
return Number(raw);
|
|
915
|
+
}
|
|
916
|
+
return lastCompleted ? lastCompleted.number : null;
|
|
917
|
+
})();
|
|
918
|
+
const currentTask = tasks.find(task => task.number === currentTaskNumber) || lastCompleted || null;
|
|
835
919
|
const codebase = codebasePaths(cwd);
|
|
836
920
|
|
|
837
921
|
return {
|
|
@@ -860,6 +944,7 @@ function initPayload(cwd, mode, requestedPhase) {
|
|
|
860
944
|
requirements_path: track ? track.requirements : null,
|
|
861
945
|
roadmap_path: track ? track.roadmap : null,
|
|
862
946
|
track_state_path: track ? track.state : null,
|
|
947
|
+
track_state: trackStateSnapshot,
|
|
863
948
|
phases_dir: track ? track.phasesDir : null,
|
|
864
949
|
route,
|
|
865
950
|
phase_found: Boolean(phase),
|
|
@@ -879,9 +964,16 @@ function initPayload(cwd, mode, requestedPhase) {
|
|
|
879
964
|
task_count: tasks.length,
|
|
880
965
|
task_done_count: tasks.filter(task => task.summaryExists).length,
|
|
881
966
|
all_tasks_done: tasks.length > 0 && tasks.every(task => task.summaryExists),
|
|
967
|
+
dependency_deadlock: dependencyDeadlock,
|
|
968
|
+
last_task_number: highestTaskNumber,
|
|
882
969
|
next_task_number: nextTask ? nextTask.number : null,
|
|
883
970
|
next_task_path: nextTask ? nextTask.taskPath : null,
|
|
884
971
|
next_task_summary_path: nextTask ? nextTask.summaryPath : null,
|
|
972
|
+
current_task_number: currentTask ? currentTask.number : null,
|
|
973
|
+
current_task_path: currentTask ? currentTask.taskPath : null,
|
|
974
|
+
current_task_summary_path: currentTask ? currentTask.summaryPath : null,
|
|
975
|
+
last_completed_task_number: lastCompleted ? lastCompleted.number : null,
|
|
976
|
+
last_completed_task_summary_path: lastCompleted ? lastCompleted.summaryPath : null,
|
|
885
977
|
tasks: tasks.map(task => ({
|
|
886
978
|
number: task.number,
|
|
887
979
|
title: task.title,
|
|
@@ -985,6 +1077,7 @@ module.exports = {
|
|
|
985
1077
|
buildRoute,
|
|
986
1078
|
buildStatus,
|
|
987
1079
|
detectExistingCodebase,
|
|
1080
|
+
findWorkspaceRoot,
|
|
988
1081
|
initPayload,
|
|
989
1082
|
listPhases,
|
|
990
1083
|
listTracks,
|
|
@@ -996,5 +1089,8 @@ module.exports = {
|
|
|
996
1089
|
rootPaths,
|
|
997
1090
|
trackPaths,
|
|
998
1091
|
listTasksForPhaseDetails,
|
|
1092
|
+
lastCompletedTask,
|
|
1093
|
+
lastTaskNumber,
|
|
1094
|
+
hasDependencyDeadlock,
|
|
999
1095
|
nextExecutableTask
|
|
1000
1096
|
};
|
|
@@ -18,6 +18,7 @@ Type: [feature|bugfix|refactor|research|polish]
|
|
|
18
18
|
- Keep one orchestration session for the phase.
|
|
19
19
|
- Execute one task at a time.
|
|
20
20
|
- No waves by default.
|
|
21
|
+
- If review or verification finds blockers, keep the same phase open and append remediation tasks instead of creating a replacement phase.
|
|
21
22
|
|
|
22
23
|
## Phase-Level Risks
|
|
23
24
|
- [Risk]
|
|
@@ -32,6 +33,11 @@ Type: [feature|bugfix|refactor|research|polish]
|
|
|
32
33
|
| 01 | pending | none | [Concrete task goal] |
|
|
33
34
|
| 02 | pending | 01 | [Concrete task goal] |
|
|
34
35
|
|
|
36
|
+
## Revision Rules
|
|
37
|
+
- Preserve completed task rows and summaries as history.
|
|
38
|
+
- Append remediation tasks after the highest existing task number.
|
|
39
|
+
- Only rewrite pending tasks when needed for clarity.
|
|
40
|
+
|
|
35
41
|
## Notes
|
|
36
42
|
- [Anything the delegated agents must know]
|
|
37
43
|
|
|
@@ -27,6 +27,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" status
|
|
|
27
27
|
- `plan_phase`: load and perform the plan-phase workflow.
|
|
28
28
|
- `plan_review`: load and perform the review-plan workflow so the user can review the phase plan before any execution starts.
|
|
29
29
|
- `execute_phase`: load and perform the execute-phase workflow, which should advance one task-sized unit in the current phase session by trying a fresh foreground agent first and falling back cleanly when agent delegation is unavailable.
|
|
30
|
+
- `task_review`: load and perform the review-task workflow so the user can review one completed task before any further execution starts.
|
|
30
31
|
- `review_phase`: load and perform the review-phase workflow.
|
|
31
32
|
- `verify_phase`: load and perform the verify-work workflow.
|
|
32
33
|
|
|
@@ -42,7 +42,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
|
|
|
42
42
|
5. Determine the next executable task:
|
|
43
43
|
- prefer the first task without a summary whose dependencies are already done
|
|
44
44
|
- if no executable task remains and all task summaries exist, move to phase aggregation
|
|
45
|
-
- if
|
|
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
|
|
46
46
|
|
|
47
47
|
6. Before running a task, show the user:
|
|
48
48
|
- task id and title
|
|
@@ -71,7 +71,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
|
|
|
71
71
|
- tell the user plainly that delegated-agent execution is unavailable in this environment
|
|
72
72
|
- continue with the same task in the current session
|
|
73
73
|
- keep the same task boundaries
|
|
74
|
-
- still write the task summary before
|
|
74
|
+
- still write the task summary before stopping
|
|
75
75
|
|
|
76
76
|
9. After the delegated agent returns, or after the current-session fallback completes:
|
|
77
77
|
- confirm `TASK-NN-SUMMARY.md` exists
|
|
@@ -80,11 +80,12 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
|
|
|
80
80
|
|
|
81
81
|
10. If more tasks remain:
|
|
82
82
|
- update project and track state to:
|
|
83
|
-
- `Current Step:
|
|
84
|
-
- `Current Task: <
|
|
85
|
-
- `Current Task Status:
|
|
83
|
+
- `Current Step: task_review`
|
|
84
|
+
- `Current Task: <current-task>`
|
|
85
|
+
- `Current Task Status: complete`
|
|
86
86
|
- `Next Command: /autodev`
|
|
87
|
-
-
|
|
87
|
+
- stop after this task
|
|
88
|
+
- end by telling the user `/autodev` will open the task review checkpoint before any next-task execution
|
|
88
89
|
|
|
89
90
|
11. If all tasks are done:
|
|
90
91
|
- write or update `NN-SUMMARY.md` from the template with:
|
|
@@ -97,16 +98,16 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
|
|
|
97
98
|
12. Update the active track `STATE.md` so it points to:
|
|
98
99
|
- `Current Phase: N`
|
|
99
100
|
- `Current Phase Type: <type>`
|
|
100
|
-
- `Current Step:
|
|
101
|
-
- `Current Task:
|
|
101
|
+
- `Current Step: task_review`
|
|
102
|
+
- `Current Task: <current-task>`
|
|
102
103
|
- `Current Task Status: complete`
|
|
103
104
|
- `Next Command: /autodev`
|
|
104
105
|
- current ISO timestamp
|
|
105
106
|
|
|
106
107
|
13. Update `.autodev/STATE.md` so it points to:
|
|
107
108
|
- `Active Track: <slug>`
|
|
108
|
-
- `Current Step:
|
|
109
|
-
- `Current Task:
|
|
109
|
+
- `Current Step: task_review`
|
|
110
|
+
- `Current Task: <current-task>`
|
|
110
111
|
- `Current Task Status: complete`
|
|
111
112
|
- `Next Command: /autodev`
|
|
112
113
|
- current ISO timestamp
|
|
@@ -119,5 +120,8 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init execute-phase "$ARGUMENT
|
|
|
119
120
|
- keep `Next Command: /autodev`
|
|
120
121
|
- tell the user the phase should be revised before more execution
|
|
121
122
|
|
|
122
|
-
15. End with a short outcome summary and the next recommended command.
|
|
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.
|
|
123
127
|
</process>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# autodev
|
|
2
2
|
|
|
3
3
|
Lean Claude Code workflow. No automatic commits. No branches. No worktrees. Git is read-only.
|
|
4
|
+
It resolves `.autodev/` state from the repo root even when you start Claude in a nested subdirectory.
|
|
4
5
|
|
|
5
6
|
## Main Entry
|
|
6
7
|
|
|
@@ -18,7 +19,9 @@ Lean Claude Code workflow. No automatic commits. No branches. No worktrees. Git
|
|
|
18
19
|
- `/autodev-plan-phase [phase]`
|
|
19
20
|
Creates or revises one phase plan plus task files in `.autodev/tracks/<track>/phases/NN-type-name/`.
|
|
20
21
|
- `/autodev-execute-phase [phase]`
|
|
21
|
-
Orchestrates one phase
|
|
22
|
+
Orchestrates exactly one task for the phase, preferring a fresh foreground delegated agent, and writes `TASK-NN-SUMMARY.md`.
|
|
23
|
+
- `/autodev-review-task [phase]`
|
|
24
|
+
Pauses after one completed task so the user can review the result before executing the next task or starting phase review.
|
|
22
25
|
- `/autodev-review-phase [phase]`
|
|
23
26
|
Uses foreground review agents, one at a time when available, for code quality, security, integration, and polish, then writes `NN-REVIEW.md`.
|
|
24
27
|
- `/autodev-verify-work [phase]`
|
|
@@ -43,6 +46,13 @@ project -> track -> phase -> tasks
|
|
|
43
46
|
- `task`
|
|
44
47
|
Reviewable execution units inside a phase.
|
|
45
48
|
|
|
49
|
+
## Blocker Recovery
|
|
50
|
+
|
|
51
|
+
- Review or verification blockers should normally stay in the same phase.
|
|
52
|
+
- Preserve completed task history.
|
|
53
|
+
- Append `TASK-XX` remediation work to the same phase.
|
|
54
|
+
- Only create a new phase when the blocker reveals genuinely new scope.
|
|
55
|
+
|
|
46
56
|
## Default Flow
|
|
47
57
|
|
|
48
58
|
```text
|
|
@@ -58,6 +68,9 @@ Typical brownfield route:
|
|
|
58
68
|
-> plan
|
|
59
69
|
-> review plan
|
|
60
70
|
-> execute
|
|
71
|
+
-> review task
|
|
72
|
+
-> execute
|
|
73
|
+
-> review task
|
|
61
74
|
-> review
|
|
62
75
|
-> verify
|
|
63
76
|
-> next track or cleanup
|
|
@@ -85,9 +98,12 @@ Blocked:
|
|
|
85
98
|
- `git merge`
|
|
86
99
|
- `git rebase`
|
|
87
100
|
- `git worktree`
|
|
101
|
+
- `git clean`
|
|
102
|
+
- `git cherry-pick`
|
|
88
103
|
- `git push`
|
|
89
104
|
- `git pull`
|
|
90
105
|
- `git stash`
|
|
91
106
|
- `git reset`
|
|
92
107
|
- `git fetch`
|
|
93
108
|
- `git clone`
|
|
109
|
+
- mutating `git branch`, `git tag`, and `git remote` commands
|
|
@@ -31,8 +31,6 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init new-project
|
|
|
31
31
|
- `project.type: "greenfield"` or `"brownfield"`
|
|
32
32
|
- `workflow.research: false`
|
|
33
33
|
- `workflow.review_after_execute: true`
|
|
34
|
-
- `workflow.codebase_parallel_agents: 1`
|
|
35
|
-
- `execution.parallel: false`
|
|
36
34
|
- `git.mode: "read-only"`
|
|
37
35
|
|
|
38
36
|
6. Write `.autodev/PROJECT.md` with:
|
|
@@ -9,6 +9,7 @@ Create one practical phase plan for the active track, then break it into reviewa
|
|
|
9
9
|
- Optional research is allowed only when the user asks for it or `workflow.research` is true.
|
|
10
10
|
- Never include git write commands in the plan.
|
|
11
11
|
- Do not use waves by default.
|
|
12
|
+
- When revising a blocked phase, preserve the same phase, the same phase goal, and all completed task history.
|
|
12
13
|
</rules>
|
|
13
14
|
|
|
14
15
|
<process>
|
|
@@ -32,6 +33,10 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init plan-phase "$ARGUMENTS"
|
|
|
32
33
|
- `.autodev/tracks/<active-track>/ROADMAP.md`
|
|
33
34
|
- `.autodev/tracks/<active-track>/STATE.md`
|
|
34
35
|
- the target phase section
|
|
36
|
+
- any existing `TASK-*.md`
|
|
37
|
+
- any existing `TASK-*-SUMMARY.md`
|
|
38
|
+
- `NN-REVIEW.md` if it exists
|
|
39
|
+
- `NN-UAT.md` if it exists
|
|
35
40
|
- any existing code relevant to this phase
|
|
36
41
|
|
|
37
42
|
5. If research is enabled or explicitly requested, do targeted read-only research only. Keep the output folded into the plan instead of producing a separate research artifact.
|
|
@@ -42,14 +47,28 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init plan-phase "$ARGUMENTS"
|
|
|
42
47
|
.autodev/tracks/<active-track>/phases/NN-type-name/
|
|
43
48
|
```
|
|
44
49
|
|
|
45
|
-
7. Write or
|
|
50
|
+
7. Write or update `NN-PLAN.md` from the template. The plan must include:
|
|
46
51
|
- phase type
|
|
47
52
|
- goal
|
|
48
53
|
- shared verification commands
|
|
49
54
|
- task list overview
|
|
50
55
|
- explicit git read-only reminder
|
|
51
56
|
|
|
52
|
-
8.
|
|
57
|
+
8. If this phase is being reopened because of `blocked_review`, `blocked_verification`, `blocked_dependencies`, or another blocker status:
|
|
58
|
+
- keep the same phase directory and phase goal
|
|
59
|
+
- do not create a new phase for ordinary blockers
|
|
60
|
+
- do not delete or rewrite completed task summaries
|
|
61
|
+
- do not renumber completed tasks
|
|
62
|
+
- preserve already-completed task rows in the phase plan
|
|
63
|
+
- append new remediation tasks after `last_task_number`
|
|
64
|
+
- default to one appended remediation task when the blockers are tightly related
|
|
65
|
+
- split into multiple appended remediation tasks only when the blockers are clearly separate
|
|
66
|
+
- only rewrite still-pending tasks when that improves clarity
|
|
67
|
+
- make the new task titles explicit, for example:
|
|
68
|
+
- `TASK-03: Fix review blockers from 01-REVIEW.md`
|
|
69
|
+
- `TASK-04: Fix verification gaps from 01-UAT.md`
|
|
70
|
+
|
|
71
|
+
9. Create or update task files in the same phase directory:
|
|
53
72
|
|
|
54
73
|
```text
|
|
55
74
|
TASK-01.md
|
|
@@ -75,26 +94,33 @@ Each task file must include:
|
|
|
75
94
|
- verification
|
|
76
95
|
- done looks like
|
|
77
96
|
|
|
78
|
-
|
|
97
|
+
10. When revising a blocked phase:
|
|
98
|
+
- point `Current Task` to the first still-pending executable task after the revision
|
|
99
|
+
- if all existing tasks are completed and you add remediation work, `Current Task` should be the first newly appended fix task
|
|
100
|
+
- never reset `Current Task` back to `01` just because the phase was replanned
|
|
101
|
+
|
|
102
|
+
11. Update the active track `STATE.md` so it points to:
|
|
79
103
|
- `Current Phase: N`
|
|
80
104
|
- `Current Phase Type: <type>`
|
|
81
105
|
- `Current Step: plan_review`
|
|
82
|
-
- `Current Task:
|
|
106
|
+
- `Current Task: <first-pending-task>` if tasks exist, otherwise `none`
|
|
83
107
|
- `Current Task Status: pending_review`
|
|
84
108
|
- `Next Command: /autodev`
|
|
85
109
|
- current ISO timestamp
|
|
86
110
|
|
|
87
|
-
|
|
111
|
+
12. Update `.autodev/STATE.md` so it points to:
|
|
88
112
|
- `Active Track: <slug>`
|
|
89
113
|
- `Current Step: plan_review`
|
|
90
|
-
- `Current Task:
|
|
114
|
+
- `Current Task: <first-pending-task>` if tasks exist, otherwise `none`
|
|
91
115
|
- `Current Task Status: pending_review`
|
|
92
116
|
- `Next Command: /autodev`
|
|
93
117
|
- current ISO timestamp
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
13. End with a short summary and stop for review.
|
|
96
120
|
Tell the user:
|
|
97
121
|
- the plan and task files are ready for review
|
|
122
|
+
- completed task history from the phase was preserved
|
|
123
|
+
- any blocker remediation was added as appended task work inside the same phase
|
|
98
124
|
- `/autodev` will open the review checkpoint before any execution starts
|
|
99
125
|
- `/autodev-execute-phase N` is only the optional manual bypass after review
|
|
100
126
|
</process>
|
|
@@ -58,7 +58,9 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init review-phase "$ARGUMENTS
|
|
|
58
58
|
- set `Current Task: none`
|
|
59
59
|
- set `Current Task Status: blocked_review`
|
|
60
60
|
- keep `Next Command: /autodev`
|
|
61
|
-
- make the recommendation point back to revising the same phase with blocker-fix tasks
|
|
61
|
+
- make the recommendation point back to revising the same phase with appended blocker-fix tasks
|
|
62
|
+
- do not recommend creating a new phase for ordinary review blockers
|
|
63
|
+
- preserve completed task history and phase goal
|
|
62
64
|
|
|
63
65
|
9. If blockers are not found:
|
|
64
66
|
- set project and track state to `Current Step: verification`
|
|
@@ -32,13 +32,14 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init review-plan "$ARGUMENTS"
|
|
|
32
32
|
- shared verification plan
|
|
33
33
|
|
|
34
34
|
5. Ask the user what to do next with `AskUserQuestion`:
|
|
35
|
-
- execute
|
|
35
|
+
- execute one task now
|
|
36
36
|
- revise the phase plan
|
|
37
37
|
- stop here
|
|
38
38
|
|
|
39
39
|
6. If the user chooses to execute now:
|
|
40
40
|
- load the execute-phase workflow
|
|
41
|
-
- perform
|
|
41
|
+
- perform exactly one task in the same turn
|
|
42
|
+
- stop after that task completes
|
|
42
43
|
|
|
43
44
|
7. If the user chooses to revise the plan:
|
|
44
45
|
- load the plan-phase workflow
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Pause after one completed task so the user can review the outcome before more execution happens in the same phase.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<rules>
|
|
6
|
+
- This is a control checkpoint, not an execution step.
|
|
7
|
+
- Do not auto-run the next task from this checkpoint without explicit user approval.
|
|
8
|
+
- Prefer `/autodev` as the entrypoint even at this checkpoint.
|
|
9
|
+
- If all tasks are done, do not auto-start phase review without explicit user approval.
|
|
10
|
+
</rules>
|
|
11
|
+
|
|
12
|
+
<process>
|
|
13
|
+
1. Run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
AUTODEV_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}"
|
|
17
|
+
node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init review-task "$ARGUMENTS"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. If no phase is found, stop and direct the user to `/autodev`.
|
|
21
|
+
|
|
22
|
+
3. Read:
|
|
23
|
+
- `.autodev/STATE.md`
|
|
24
|
+
- the active track `STATE.md`
|
|
25
|
+
- `NN-PLAN.md`
|
|
26
|
+
- all `TASK-*.md`
|
|
27
|
+
- the current task summary from `current_task_summary_path`
|
|
28
|
+
- if `Current Task` is missing or stale, infer the checkpoint task from the most recent existing `TASK-*-SUMMARY.md`
|
|
29
|
+
- `NN-SUMMARY.md` if it exists
|
|
30
|
+
|
|
31
|
+
4. Show the user a concise checkpoint summary:
|
|
32
|
+
- completed task id and title
|
|
33
|
+
- what changed
|
|
34
|
+
- verification run
|
|
35
|
+
- blockers or open concerns
|
|
36
|
+
- the next ready task, if any
|
|
37
|
+
|
|
38
|
+
5. If more tasks remain, ask the user what to do next with `AskUserQuestion`:
|
|
39
|
+
- execute the next task now
|
|
40
|
+
- revise the phase plan
|
|
41
|
+
- stop here
|
|
42
|
+
|
|
43
|
+
6. If all tasks are done, ask the user what to do next with `AskUserQuestion`:
|
|
44
|
+
- run phase review now
|
|
45
|
+
- revise the phase plan
|
|
46
|
+
- stop here
|
|
47
|
+
|
|
48
|
+
7. If the user chooses to execute the next task:
|
|
49
|
+
- load the execute-phase workflow
|
|
50
|
+
- perform exactly one task in the same turn
|
|
51
|
+
- stop again after that task completes
|
|
52
|
+
|
|
53
|
+
8. If the user chooses to run phase review:
|
|
54
|
+
- load the review-phase workflow
|
|
55
|
+
- perform it in the same turn
|
|
56
|
+
|
|
57
|
+
9. If the user chooses to revise the plan:
|
|
58
|
+
- load the plan-phase workflow
|
|
59
|
+
- revise the same phase in the same turn
|
|
60
|
+
|
|
61
|
+
10. If the user chooses to stop here:
|
|
62
|
+
- keep both state files on:
|
|
63
|
+
- `Current Step: task_review`
|
|
64
|
+
- `Current Task: <current-task>`
|
|
65
|
+
- `Current Task Status: complete`
|
|
66
|
+
- `Next Command: /autodev`
|
|
67
|
+
- end with a short note that no further execution has started
|
|
68
|
+
|
|
69
|
+
11. End with a short outcome summary and `/autodev` as the default next command.
|
|
70
|
+
</process>
|
|
@@ -6,6 +6,7 @@ Run lightweight user acceptance testing after review and keep the next action ob
|
|
|
6
6
|
- Verify against what the phase plan, summary, and review claim.
|
|
7
7
|
- Keep the interaction concise and test-oriented.
|
|
8
8
|
- Do not auto-generate a new plan unless a real gap appears.
|
|
9
|
+
- Verification failures should normally reopen the same phase with appended remediation tasks, not create a new phase.
|
|
9
10
|
</rules>
|
|
10
11
|
|
|
11
12
|
<process>
|
|
@@ -38,6 +39,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init verify-work "$ARGUMENTS"
|
|
|
38
39
|
- exact failed behaviors
|
|
39
40
|
- reproduction notes
|
|
40
41
|
- the smallest acceptable fix target
|
|
42
|
+
- a note that the follow-up should be appended to the same phase as remediation task work unless scope truly changed
|
|
41
43
|
|
|
42
44
|
7. Update the active track `STATE.md`:
|
|
43
45
|
- if verification passed and another phase remains, move to the next phase and set `Current Step: planning`
|
|
@@ -47,6 +49,7 @@ node "$AUTODEV_ROOT/autodev/bin/autodev-tools.cjs" init verify-work "$ARGUMENTS"
|
|
|
47
49
|
- when verification failed, set `Current Task: none` and `Current Task Status: blocked_verification`
|
|
48
50
|
- always set `Next Command: /autodev`
|
|
49
51
|
- always refresh the ISO timestamp
|
|
52
|
+
- when verification failed, the next planning pass should preserve completed tasks and append remediation tasks to the same phase
|
|
50
53
|
|
|
51
54
|
8. Update `.autodev/STATE.md` with the matching project-level status and refreshed timestamp.
|
|
52
55
|
|
package/bin/install.js
CHANGED
|
@@ -14,6 +14,7 @@ const MANAGED_PREFIX = 'autodev-';
|
|
|
14
14
|
const ROOT_COMMAND = 'autodev';
|
|
15
15
|
const HOOK_FILES = [
|
|
16
16
|
'hooks.json',
|
|
17
|
+
'autodev-paths.js',
|
|
17
18
|
'autodev-context-monitor.js',
|
|
18
19
|
'autodev-git-guard.js',
|
|
19
20
|
'autodev-phase-boundary.sh',
|
|
@@ -268,6 +269,13 @@ function removeManagedSettings(settings) {
|
|
|
268
269
|
delete settings.statusLine;
|
|
269
270
|
}
|
|
270
271
|
|
|
272
|
+
if (settings.env && typeof settings.env === 'object') {
|
|
273
|
+
delete settings.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS;
|
|
274
|
+
if (Object.keys(settings.env).length === 0) {
|
|
275
|
+
delete settings.env;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
271
279
|
if (!settings.hooks || typeof settings.hooks !== 'object') {
|
|
272
280
|
return settings;
|
|
273
281
|
}
|
|
@@ -321,6 +329,13 @@ function ensureHook(settings, eventName, matcher, command, timeout) {
|
|
|
321
329
|
settings.hooks[eventName].push(entry);
|
|
322
330
|
}
|
|
323
331
|
|
|
332
|
+
function ensureEnvSetting(settings, name, value) {
|
|
333
|
+
if (!settings.env || typeof settings.env !== 'object') {
|
|
334
|
+
settings.env = {};
|
|
335
|
+
}
|
|
336
|
+
settings.env[name] = String(value);
|
|
337
|
+
}
|
|
338
|
+
|
|
324
339
|
function setExecutableBits(targetDir) {
|
|
325
340
|
const candidates = [
|
|
326
341
|
path.join(targetDir, 'hooks', 'autodev-phase-boundary.sh'),
|
|
@@ -397,6 +412,10 @@ function configureSettings(targetDir, isGlobal, options = {}) {
|
|
|
397
412
|
};
|
|
398
413
|
}
|
|
399
414
|
|
|
415
|
+
if (options.disableBackgroundTasks) {
|
|
416
|
+
ensureEnvSetting(settings, 'CLAUDE_CODE_DISABLE_BACKGROUND_TASKS', '1');
|
|
417
|
+
}
|
|
418
|
+
|
|
400
419
|
writeSettings(settingsPath, settings);
|
|
401
420
|
return settingsPath;
|
|
402
421
|
}
|
|
@@ -546,6 +565,8 @@ function printHelp() {
|
|
|
546
565
|
Options:
|
|
547
566
|
--global Install to Claude Code config directory
|
|
548
567
|
--local Install to the current project (.claude/)
|
|
568
|
+
--disable-background-tasks
|
|
569
|
+
Set CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1 in Claude Code settings.json
|
|
549
570
|
--uninstall Remove autodev from the selected location
|
|
550
571
|
--help Show this help
|
|
551
572
|
|
|
@@ -553,6 +574,7 @@ Examples:
|
|
|
553
574
|
npx @mthanhlm/autodev@latest
|
|
554
575
|
npx @mthanhlm/autodev@latest --global
|
|
555
576
|
npx @mthanhlm/autodev@latest --local
|
|
577
|
+
npx @mthanhlm/autodev@latest --global --disable-background-tasks
|
|
556
578
|
npx @mthanhlm/autodev@latest --global --uninstall
|
|
557
579
|
`);
|
|
558
580
|
}
|
|
@@ -582,6 +604,27 @@ Location:
|
|
|
582
604
|
});
|
|
583
605
|
}
|
|
584
606
|
|
|
607
|
+
function askDisableBackgroundTasks() {
|
|
608
|
+
return new Promise(resolve => {
|
|
609
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
610
|
+
console.log(`
|
|
611
|
+
Background tasks:
|
|
612
|
+
${cyan}1${reset}) Disable in Claude Code settings ${yellow}(Recommended for autodev)${reset}
|
|
613
|
+
-> sets CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1
|
|
614
|
+
${cyan}2${reset}) Leave background-task settings unchanged
|
|
615
|
+
`);
|
|
616
|
+
rl.question(`Select background-task policy ${yellow}[1]${reset}: `, answer => {
|
|
617
|
+
rl.close();
|
|
618
|
+
const trimmed = answer.trim().toLowerCase();
|
|
619
|
+
if (trimmed === '2' || trimmed === 'n' || trimmed === 'no' || trimmed === 'leave') {
|
|
620
|
+
resolve(false);
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
resolve(true);
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
585
628
|
async function main() {
|
|
586
629
|
const args = process.argv.slice(2);
|
|
587
630
|
if (args.includes('--help') || args.includes('-h')) {
|
|
@@ -590,20 +633,30 @@ async function main() {
|
|
|
590
633
|
}
|
|
591
634
|
|
|
592
635
|
let scope = null;
|
|
636
|
+
let scopeWasExplicit = false;
|
|
593
637
|
if (args.includes('--global') || args.includes('-g')) {
|
|
594
638
|
scope = 'global';
|
|
639
|
+
scopeWasExplicit = true;
|
|
595
640
|
} else if (args.includes('--local') || args.includes('-l')) {
|
|
596
641
|
scope = 'local';
|
|
642
|
+
scopeWasExplicit = true;
|
|
597
643
|
}
|
|
598
644
|
|
|
599
645
|
if (!scope) {
|
|
600
646
|
scope = await askScope();
|
|
601
647
|
}
|
|
602
648
|
|
|
603
|
-
|
|
649
|
+
const uninstallRequested = args.includes('--uninstall') || args.includes('-u');
|
|
650
|
+
const disableBackgroundTasks = args.includes('--disable-background-tasks')
|
|
651
|
+
? true
|
|
652
|
+
: uninstallRequested || scopeWasExplicit
|
|
653
|
+
? false
|
|
654
|
+
: await askDisableBackgroundTasks();
|
|
655
|
+
|
|
656
|
+
if (uninstallRequested) {
|
|
604
657
|
uninstall({ scope });
|
|
605
658
|
} else {
|
|
606
|
-
install({ scope });
|
|
659
|
+
install({ scope, disableBackgroundTasks });
|
|
607
660
|
}
|
|
608
661
|
}
|
|
609
662
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autodev:execute-phase
|
|
3
|
-
description: Execute
|
|
3
|
+
description: Execute exactly one active-track task at a time, preferring a fresh foreground agent with clean fallback when unavailable
|
|
4
4
|
argument-hint: "[phase-number]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- Read
|
|
@@ -14,7 +14,7 @@ allowed-tools:
|
|
|
14
14
|
- Agent
|
|
15
15
|
---
|
|
16
16
|
<objective>
|
|
17
|
-
Execute one
|
|
17
|
+
Execute exactly one task-sized unit for the active phase, then stop at the post-task checkpoint.
|
|
18
18
|
</objective>
|
|
19
19
|
|
|
20
20
|
<execution_context>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autodev:review-task
|
|
3
|
+
description: Pause after one completed task so the user can review it before any further phase execution
|
|
4
|
+
argument-hint: "[phase-number]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Grep
|
|
11
|
+
- Glob
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
- TodoWrite
|
|
14
|
+
---
|
|
15
|
+
<objective>
|
|
16
|
+
Review one completed task and decide whether to continue execution, revise the phase, or stop here.
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<execution_context>
|
|
20
|
+
@~/.claude/autodev/workflows/review-task.md
|
|
21
|
+
</execution_context>
|
|
22
|
+
|
|
23
|
+
<process>
|
|
24
|
+
Execute the workflow in @~/.claude/autodev/workflows/review-task.md end-to-end.
|
|
25
|
+
</process>
|
|
@@ -3,18 +3,11 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const { readProjectConfig } = require('./autodev-paths.js');
|
|
6
7
|
|
|
7
8
|
const WARNING_THRESHOLD = 35;
|
|
8
9
|
const CRITICAL_THRESHOLD = 20;
|
|
9
10
|
|
|
10
|
-
function readProjectConfig(cwd) {
|
|
11
|
-
try {
|
|
12
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, '.autodev', 'config.json'), 'utf8'));
|
|
13
|
-
} catch {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
11
|
let input = '';
|
|
19
12
|
const stdinTimeout = setTimeout(() => process.exit(0), 10000);
|
|
20
13
|
process.stdin.setEncoding('utf8');
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
function readProjectConfig(cwd) {
|
|
7
|
-
try {
|
|
8
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, '.autodev', 'config.json'), 'utf8'));
|
|
9
|
-
} catch {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
const { readProjectConfig } = require('./autodev-paths.js');
|
|
13
5
|
|
|
14
6
|
function shouldBlock(command) {
|
|
15
7
|
const blockedPatterns = [
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function fileExists(filePath) {
|
|
7
|
+
try {
|
|
8
|
+
return fs.existsSync(filePath);
|
|
9
|
+
} catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function findWorkspaceRoot(startDir) {
|
|
15
|
+
let cursor = path.resolve(startDir || process.cwd());
|
|
16
|
+
let gitRoot = null;
|
|
17
|
+
|
|
18
|
+
while (true) {
|
|
19
|
+
if (fileExists(path.join(cursor, '.autodev'))) {
|
|
20
|
+
return cursor;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!gitRoot && fileExists(path.join(cursor, '.git'))) {
|
|
24
|
+
gitRoot = cursor;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const parent = path.dirname(cursor);
|
|
28
|
+
if (parent === cursor) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
cursor = parent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return gitRoot || path.resolve(startDir || process.cwd());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function findAutodevRoot(startDir) {
|
|
38
|
+
const workspaceRoot = findWorkspaceRoot(startDir);
|
|
39
|
+
const autodevRoot = path.join(workspaceRoot, '.autodev');
|
|
40
|
+
return fileExists(autodevRoot) ? autodevRoot : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function readProjectConfig(startDir) {
|
|
44
|
+
const autodevRoot = findAutodevRoot(startDir);
|
|
45
|
+
if (!autodevRoot) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(fs.readFileSync(path.join(autodevRoot, 'config.json'), 'utf8'));
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
findAutodevRoot,
|
|
58
|
+
findWorkspaceRoot,
|
|
59
|
+
readProjectConfig
|
|
60
|
+
};
|
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
find_workspace_root() {
|
|
4
|
+
local cursor
|
|
5
|
+
cursor="$(pwd -P)"
|
|
6
|
+
local git_root=""
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
while true; do
|
|
9
|
+
if [ -d "$cursor/.autodev" ]; then
|
|
10
|
+
printf '%s\n' "$cursor"
|
|
11
|
+
return 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [ -z "$git_root" ] && [ -e "$cursor/.git" ]; then
|
|
15
|
+
git_root="$cursor"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [ "$cursor" = "/" ]; then
|
|
19
|
+
break
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
cursor="$(dirname "$cursor")"
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
if [ -n "$git_root" ]; then
|
|
26
|
+
printf '%s\n' "$git_root"
|
|
27
|
+
return 0
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
return 1
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
WORKSPACE_ROOT="$(find_workspace_root)" || exit 0
|
|
34
|
+
CONFIG="$WORKSPACE_ROOT/.autodev/config.json"
|
|
35
|
+
|
|
36
|
+
[ -f "$CONFIG" ] || exit 0
|
|
8
37
|
|
|
9
|
-
ENABLED=$(node -e "try{const c=
|
|
38
|
+
ENABLED=$(node -e "const fs=require('fs');const p=process.argv[1];try{const c=JSON.parse(fs.readFileSync(p,'utf8'));process.stdout.write(c.hooks?.phase_boundary===false?'0':'1')}catch{process.stdout.write('0')}" "$CONFIG" 2>/dev/null)
|
|
10
39
|
if [ "$ENABLED" != "1" ]; then
|
|
11
40
|
exit 0
|
|
12
41
|
fi
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
|
|
6
|
-
function readProjectConfig(cwd) {
|
|
7
|
-
try {
|
|
8
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, '.autodev', 'config.json'), 'utf8'));
|
|
9
|
-
} catch {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
5
|
+
const { readProjectConfig } = require('./autodev-paths.js');
|
|
13
6
|
|
|
14
7
|
let input = '';
|
|
15
8
|
const stdinTimeout = setTimeout(() => process.exit(0), 3000);
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
find_workspace_root() {
|
|
4
|
+
local cursor
|
|
5
|
+
cursor="$(pwd -P)"
|
|
6
|
+
local git_root=""
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
while true; do
|
|
9
|
+
if [ -d "$cursor/.autodev" ]; then
|
|
10
|
+
printf '%s\n' "$cursor"
|
|
11
|
+
return 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [ -z "$git_root" ] && [ -e "$cursor/.git" ]; then
|
|
15
|
+
git_root="$cursor"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [ "$cursor" = "/" ]; then
|
|
19
|
+
break
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
cursor="$(dirname "$cursor")"
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
if [ -n "$git_root" ]; then
|
|
26
|
+
printf '%s\n' "$git_root"
|
|
27
|
+
return 0
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
return 1
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
WORKSPACE_ROOT="$(find_workspace_root)" || exit 0
|
|
34
|
+
CONFIG="$WORKSPACE_ROOT/.autodev/config.json"
|
|
35
|
+
STATE="$WORKSPACE_ROOT/.autodev/STATE.md"
|
|
36
|
+
|
|
37
|
+
[ -f "$CONFIG" ] || exit 0
|
|
9
38
|
|
|
10
|
-
ENABLED=$(node -e "try{const c=
|
|
39
|
+
ENABLED=$(node -e "const fs=require('fs');const p=process.argv[1];try{const c=JSON.parse(fs.readFileSync(p,'utf8'));process.stdout.write(c.hooks?.session_state===false?'0':'1')}catch{process.stdout.write('0')}" "$CONFIG" 2>/dev/null)
|
|
11
40
|
if [ "$ENABLED" != "1" ]; then
|
|
12
41
|
exit 0
|
|
13
42
|
fi
|
|
@@ -3,19 +3,12 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const { findAutodevRoot } = require('./autodev-paths.js');
|
|
6
7
|
|
|
7
8
|
function readStateFields(cwd) {
|
|
8
9
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
while (cursor && cursor !== path.dirname(cursor)) {
|
|
12
|
-
const candidate = path.join(cursor, '.autodev', 'STATE.md');
|
|
13
|
-
if (fs.existsSync(candidate)) {
|
|
14
|
-
statePath = candidate;
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
cursor = path.dirname(cursor);
|
|
18
|
-
}
|
|
10
|
+
const autodevRoot = findAutodevRoot(cwd);
|
|
11
|
+
const statePath = autodevRoot ? path.join(autodevRoot, 'STATE.md') : null;
|
|
19
12
|
|
|
20
13
|
if (!statePath) {
|
|
21
14
|
return {
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
4
3
|
const path = require('path');
|
|
5
|
-
|
|
6
|
-
function readProjectConfig(cwd) {
|
|
7
|
-
try {
|
|
8
|
-
return JSON.parse(fs.readFileSync(path.join(cwd, '.autodev', 'config.json'), 'utf8'));
|
|
9
|
-
} catch {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
4
|
+
const { readProjectConfig } = require('./autodev-paths.js');
|
|
13
5
|
|
|
14
6
|
let input = '';
|
|
15
7
|
const stdinTimeout = setTimeout(() => process.exit(0), 3000);
|
package/package.json
CHANGED