oh-my-claude-sisyphus 3.0.11 → 3.2.0
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 +26 -2
- package/agents/build-fixer-low.md +83 -0
- package/agents/build-fixer.md +160 -0
- package/agents/code-reviewer-low.md +82 -0
- package/agents/code-reviewer.md +115 -0
- package/agents/planner.md +83 -0
- package/agents/security-reviewer-low.md +83 -0
- package/agents/security-reviewer.md +186 -0
- package/agents/tdd-guide-low.md +81 -0
- package/agents/tdd-guide.md +165 -0
- package/commands/autopilot.md +131 -0
- package/commands/build-fix.md +55 -0
- package/commands/cancel-autopilot.md +35 -0
- package/commands/code-review.md +47 -0
- package/commands/ralph.md +9 -0
- package/commands/security-review.md +47 -0
- package/commands/tdd.md +54 -0
- package/dist/__tests__/hud-agents.test.js +13 -10
- package/dist/__tests__/hud-agents.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +1 -1
- package/dist/__tests__/skills.test.js +8 -4
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +32 -0
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +93 -1
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/delegation-validator.d.ts +31 -0
- package/dist/agents/delegation-validator.d.ts.map +1 -0
- package/dist/agents/delegation-validator.js +75 -0
- package/dist/agents/delegation-validator.js.map +1 -0
- package/dist/agents/prompt-generator.d.ts +95 -0
- package/dist/agents/prompt-generator.d.ts.map +1 -0
- package/dist/agents/prompt-generator.js +140 -0
- package/dist/agents/prompt-generator.js.map +1 -0
- package/dist/agents/prompt-sections/index.d.ts +44 -0
- package/dist/agents/prompt-sections/index.d.ts.map +1 -0
- package/dist/agents/prompt-sections/index.js +194 -0
- package/dist/agents/prompt-sections/index.js.map +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/types.js.map +1 -1
- package/dist/features/background-agent/manager.d.ts +10 -1
- package/dist/features/background-agent/manager.d.ts.map +1 -1
- package/dist/features/background-agent/manager.js +79 -11
- package/dist/features/background-agent/manager.js.map +1 -1
- package/dist/features/background-agent/types.d.ts +30 -1
- package/dist/features/background-agent/types.d.ts.map +1 -1
- package/dist/features/delegation-categories/index.d.ts +116 -0
- package/dist/features/delegation-categories/index.d.ts.map +1 -0
- package/dist/features/delegation-categories/index.js +287 -0
- package/dist/features/delegation-categories/index.js.map +1 -0
- package/dist/features/delegation-categories/test-categories.d.ts +7 -0
- package/dist/features/delegation-categories/test-categories.d.ts.map +1 -0
- package/dist/features/delegation-categories/test-categories.js +88 -0
- package/dist/features/delegation-categories/test-categories.js.map +1 -0
- package/dist/features/delegation-categories/types.d.ts +51 -0
- package/dist/features/delegation-categories/types.d.ts.map +1 -0
- package/dist/features/delegation-categories/types.js +8 -0
- package/dist/features/delegation-categories/types.js.map +1 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +10 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/model-routing/prompts/index.d.ts +2 -0
- package/dist/features/model-routing/prompts/index.d.ts.map +1 -1
- package/dist/features/model-routing/prompts/index.js +6 -0
- package/dist/features/model-routing/prompts/index.js.map +1 -1
- package/dist/features/notepad-wisdom/extractor.d.ts +30 -0
- package/dist/features/notepad-wisdom/extractor.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/extractor.js +68 -0
- package/dist/features/notepad-wisdom/extractor.js.map +1 -0
- package/dist/features/notepad-wisdom/index.d.ts +39 -0
- package/dist/features/notepad-wisdom/index.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/index.js +169 -0
- package/dist/features/notepad-wisdom/index.js.map +1 -0
- package/dist/features/notepad-wisdom/types.d.ts +18 -0
- package/dist/features/notepad-wisdom/types.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/types.js +7 -0
- package/dist/features/notepad-wisdom/types.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.js +397 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.js +74 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/state.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.js +75 -0
- package/dist/hooks/autopilot/__tests__/state.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/summary.test.js +289 -0
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/transition.test.js +59 -0
- package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/validation.test.js +450 -0
- package/dist/hooks/autopilot/__tests__/validation.test.js.map +1 -0
- package/dist/hooks/autopilot/cancel.d.ts +42 -0
- package/dist/hooks/autopilot/cancel.d.ts.map +1 -0
- package/dist/hooks/autopilot/cancel.js +156 -0
- package/dist/hooks/autopilot/cancel.js.map +1 -0
- package/dist/hooks/autopilot/index.d.ts +15 -0
- package/dist/hooks/autopilot/index.d.ts.map +1 -0
- package/dist/hooks/autopilot/index.js +20 -0
- package/dist/hooks/autopilot/index.js.map +1 -0
- package/dist/hooks/autopilot/prompts.d.ts +37 -0
- package/dist/hooks/autopilot/prompts.d.ts.map +1 -0
- package/dist/hooks/autopilot/prompts.js +353 -0
- package/dist/hooks/autopilot/prompts.js.map +1 -0
- package/dist/hooks/autopilot/state.d.ts +67 -0
- package/dist/hooks/autopilot/state.d.ts.map +1 -0
- package/dist/hooks/autopilot/state.js +244 -0
- package/dist/hooks/autopilot/state.js.map +1 -0
- package/dist/hooks/autopilot/summary.d.ts +27 -0
- package/dist/hooks/autopilot/summary.d.ts.map +1 -0
- package/dist/hooks/autopilot/summary.js +160 -0
- package/dist/hooks/autopilot/summary.js.map +1 -0
- package/dist/hooks/autopilot/transition.d.ts +39 -0
- package/dist/hooks/autopilot/transition.d.ts.map +1 -0
- package/dist/hooks/autopilot/transition.js +216 -0
- package/dist/hooks/autopilot/transition.js.map +1 -0
- package/dist/hooks/autopilot/types.d.ts +211 -0
- package/dist/hooks/autopilot/types.d.ts.map +1 -0
- package/dist/hooks/autopilot/types.js +30 -0
- package/dist/hooks/autopilot/types.js.map +1 -0
- package/dist/hooks/autopilot/validation.d.ts +43 -0
- package/dist/hooks/autopilot/validation.d.ts.map +1 -0
- package/dist/hooks/autopilot/validation.js +191 -0
- package/dist/hooks/autopilot/validation.js.map +1 -0
- package/dist/hooks/bridge.d.ts +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +79 -6
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +39 -2
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +2 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +13 -3
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/ralph-loop/index.d.ts +0 -20
- package/dist/hooks/ralph-loop/index.d.ts.map +1 -1
- package/dist/hooks/ralph-loop/index.js +6 -40
- package/dist/hooks/ralph-loop/index.js.map +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +31 -1
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +38 -1
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hooks/ultrawork-state/index.d.ts +3 -1
- package/dist/hooks/ultrawork-state/index.d.ts.map +1 -1
- package/dist/hooks/ultrawork-state/index.js +3 -2
- package/dist/hooks/ultrawork-state/index.js.map +1 -1
- package/dist/hud/elements/autopilot.d.ts +29 -0
- package/dist/hud/elements/autopilot.d.ts.map +1 -0
- package/dist/hud/elements/autopilot.js +97 -0
- package/dist/hud/elements/autopilot.js.map +1 -0
- package/dist/hud/elements/index.d.ts +1 -0
- package/dist/hud/elements/index.d.ts.map +1 -1
- package/dist/hud/elements/index.js +1 -0
- package/dist/hud/elements/index.js.map +1 -1
- package/dist/hud/elements/limits.d.ts +1 -1
- package/dist/hud/elements/limits.d.ts.map +1 -1
- package/dist/hud/elements/limits.js +35 -2
- package/dist/hud/elements/limits.js.map +1 -1
- package/dist/hud/elements/todos.d.ts +1 -1
- package/dist/hud/elements/todos.js +3 -3
- package/dist/hud/elements/todos.js.map +1 -1
- package/dist/hud/render.js +6 -6
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/types.d.ts +4 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +32 -6
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/installer/hooks.d.ts +5 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +20 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.js +2 -2
- package/dist/installer/index.js.map +1 -1
- package/dist/tools/diagnostics/index.d.ts +29 -0
- package/dist/tools/diagnostics/index.d.ts.map +1 -0
- package/dist/tools/diagnostics/index.js +118 -0
- package/dist/tools/diagnostics/index.js.map +1 -0
- package/dist/tools/diagnostics/lsp-aggregator.d.ts +26 -0
- package/dist/tools/diagnostics/lsp-aggregator.d.ts.map +1 -0
- package/dist/tools/diagnostics/lsp-aggregator.js +99 -0
- package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -0
- package/dist/tools/diagnostics/tsc-runner.d.ts +26 -0
- package/dist/tools/diagnostics/tsc-runner.d.ts.map +1 -0
- package/dist/tools/diagnostics/tsc-runner.js +70 -0
- package/dist/tools/diagnostics/tsc-runner.js.map +1 -0
- package/dist/tools/lsp-tools.d.ts +10 -0
- package/dist/tools/lsp-tools.d.ts.map +1 -1
- package/dist/tools/lsp-tools.js +43 -1
- package/dist/tools/lsp-tools.js.map +1 -1
- package/dist/tools/resume-session.d.ts +63 -0
- package/dist/tools/resume-session.d.ts.map +1 -0
- package/dist/tools/resume-session.js +106 -0
- package/dist/tools/resume-session.js.map +1 -0
- package/dist/utils/__tests__/paths.test.d.ts +2 -0
- package/dist/utils/__tests__/paths.test.d.ts.map +1 -0
- package/dist/utils/__tests__/paths.test.js +88 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -0
- package/dist/utils/paths.d.ts +32 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +55 -0
- package/dist/utils/paths.js.map +1 -0
- package/docs/ARCHITECTURE.md +80 -1
- package/docs/CLAUDE.md +97 -3
- package/docs/FEATURES.md +2167 -0
- package/docs/FULL-README.md +69 -1
- package/package.json +1 -1
- package/skills/autopilot/SKILL.md +168 -0
- package/skills/cancel-autopilot/SKILL.md +53 -0
- package/skills/omc-setup/SKILL.md +95 -0
- package/skills/ralph/SKILL.md +9 -0
- package/skills/ultrawork/SKILL.md +9 -5
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Cancellation
|
|
3
|
+
*
|
|
4
|
+
* Handles cancellation of autopilot, cleaning up all related state
|
|
5
|
+
* including any active Ralph or UltraQA modes.
|
|
6
|
+
*/
|
|
7
|
+
import { readAutopilotState, clearAutopilotState, writeAutopilotState } from './state.js';
|
|
8
|
+
import { clearRalphState, clearLinkedUltraworkState, readRalphState } from '../ralph-loop/index.js';
|
|
9
|
+
import { clearUltraQAState, readUltraQAState } from '../ultraqa-loop/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Cancel autopilot and clean up all related state
|
|
12
|
+
* Progress is preserved for potential resume
|
|
13
|
+
*/
|
|
14
|
+
export function cancelAutopilot(directory) {
|
|
15
|
+
const state = readAutopilotState(directory);
|
|
16
|
+
if (!state) {
|
|
17
|
+
return {
|
|
18
|
+
success: false,
|
|
19
|
+
message: 'No active autopilot session found'
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (!state.active) {
|
|
23
|
+
return {
|
|
24
|
+
success: false,
|
|
25
|
+
message: 'Autopilot is not currently active'
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// Track what we cleaned up
|
|
29
|
+
const cleanedUp = [];
|
|
30
|
+
// Clean up any active Ralph state
|
|
31
|
+
const ralphState = readRalphState(directory);
|
|
32
|
+
if (ralphState?.active) {
|
|
33
|
+
if (ralphState.linked_ultrawork) {
|
|
34
|
+
clearLinkedUltraworkState(directory);
|
|
35
|
+
cleanedUp.push('ultrawork');
|
|
36
|
+
}
|
|
37
|
+
clearRalphState(directory);
|
|
38
|
+
cleanedUp.push('ralph');
|
|
39
|
+
}
|
|
40
|
+
// Clean up any active UltraQA state
|
|
41
|
+
const ultraqaState = readUltraQAState(directory);
|
|
42
|
+
if (ultraqaState?.active) {
|
|
43
|
+
clearUltraQAState(directory);
|
|
44
|
+
cleanedUp.push('ultraqa');
|
|
45
|
+
}
|
|
46
|
+
// Mark autopilot as inactive but preserve state for resume
|
|
47
|
+
state.active = false;
|
|
48
|
+
writeAutopilotState(directory, state);
|
|
49
|
+
const cleanupMsg = cleanedUp.length > 0
|
|
50
|
+
? ` Cleaned up: ${cleanedUp.join(', ')}.`
|
|
51
|
+
: '';
|
|
52
|
+
return {
|
|
53
|
+
success: true,
|
|
54
|
+
message: `Autopilot cancelled at phase: ${state.phase}.${cleanupMsg} Progress preserved for resume.`,
|
|
55
|
+
preservedState: state
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fully clear autopilot state (no preserve)
|
|
60
|
+
*/
|
|
61
|
+
export function clearAutopilot(directory) {
|
|
62
|
+
const state = readAutopilotState(directory);
|
|
63
|
+
if (!state) {
|
|
64
|
+
return {
|
|
65
|
+
success: true,
|
|
66
|
+
message: 'No autopilot state to clear'
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// Clean up all related state
|
|
70
|
+
const ralphState = readRalphState(directory);
|
|
71
|
+
if (ralphState) {
|
|
72
|
+
if (ralphState.linked_ultrawork) {
|
|
73
|
+
clearLinkedUltraworkState(directory);
|
|
74
|
+
}
|
|
75
|
+
clearRalphState(directory);
|
|
76
|
+
}
|
|
77
|
+
const ultraqaState = readUltraQAState(directory);
|
|
78
|
+
if (ultraqaState) {
|
|
79
|
+
clearUltraQAState(directory);
|
|
80
|
+
}
|
|
81
|
+
// Clear autopilot state completely
|
|
82
|
+
clearAutopilotState(directory);
|
|
83
|
+
return {
|
|
84
|
+
success: true,
|
|
85
|
+
message: 'Autopilot state cleared completely'
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check if autopilot can be resumed
|
|
90
|
+
*/
|
|
91
|
+
export function canResumeAutopilot(directory) {
|
|
92
|
+
const state = readAutopilotState(directory);
|
|
93
|
+
if (!state) {
|
|
94
|
+
return { canResume: false };
|
|
95
|
+
}
|
|
96
|
+
// Can resume if state exists and is not complete/failed
|
|
97
|
+
const canResume = state.phase !== 'complete' && state.phase !== 'failed';
|
|
98
|
+
return {
|
|
99
|
+
canResume,
|
|
100
|
+
state,
|
|
101
|
+
resumePhase: state.phase
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Resume a paused autopilot session
|
|
106
|
+
*/
|
|
107
|
+
export function resumeAutopilot(directory) {
|
|
108
|
+
const { canResume, state } = canResumeAutopilot(directory);
|
|
109
|
+
if (!canResume || !state) {
|
|
110
|
+
return {
|
|
111
|
+
success: false,
|
|
112
|
+
message: 'No autopilot session available to resume'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// Re-activate
|
|
116
|
+
state.active = true;
|
|
117
|
+
state.iteration++;
|
|
118
|
+
if (!writeAutopilotState(directory, state)) {
|
|
119
|
+
return {
|
|
120
|
+
success: false,
|
|
121
|
+
message: 'Failed to update autopilot state'
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
success: true,
|
|
126
|
+
message: `Resuming autopilot at phase: ${state.phase}`,
|
|
127
|
+
state
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Format cancel message for display
|
|
132
|
+
*/
|
|
133
|
+
export function formatCancelMessage(result) {
|
|
134
|
+
if (!result.success) {
|
|
135
|
+
return `[AUTOPILOT] ${result.message}`;
|
|
136
|
+
}
|
|
137
|
+
const lines = [
|
|
138
|
+
'',
|
|
139
|
+
'[AUTOPILOT CANCELLED]',
|
|
140
|
+
'',
|
|
141
|
+
result.message,
|
|
142
|
+
''
|
|
143
|
+
];
|
|
144
|
+
if (result.preservedState) {
|
|
145
|
+
const state = result.preservedState;
|
|
146
|
+
lines.push('Progress Summary:');
|
|
147
|
+
lines.push(`- Phase reached: ${state.phase}`);
|
|
148
|
+
lines.push(`- Files created: ${state.execution.files_created.length}`);
|
|
149
|
+
lines.push(`- Files modified: ${state.execution.files_modified.length}`);
|
|
150
|
+
lines.push(`- Agents used: ${state.total_agents_spawned}`);
|
|
151
|
+
lines.push('');
|
|
152
|
+
lines.push('Run /autopilot to resume from where you left off.');
|
|
153
|
+
}
|
|
154
|
+
return lines.join('\n');
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/hooks/autopilot/cancel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAS/E;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,mCAAmC;SAC7C,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,mCAAmC;SAC7C,CAAC;IACJ,CAAC;IAED,2BAA2B;IAC3B,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,kCAAkC;IAClC,MAAM,UAAU,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,UAAU,EAAE,MAAM,EAAE,CAAC;QACvB,IAAI,UAAU,CAAC,gBAAgB,EAAE,CAAC;YAChC,yBAAyB,CAAC,SAAS,CAAC,CAAC;YACrC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QACD,eAAe,CAAC,SAAS,C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C;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAoB;IACtD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,eAAe,MAAM,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,uBAAuB;QACvB,EAAE;QACF,MAAM,CAAC,OAAO;QACd,EAAE;KACH,CAAC;IAEF,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;QACvE,KAAK,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,KAAK,CAAC,IAAI,CAAC,kBAAkB,KAAK,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Hook Module
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the /autopilot command - autonomous execution
|
|
5
|
+
* from idea to working code.
|
|
6
|
+
*/
|
|
7
|
+
export type { AutopilotPhase, AutopilotState, AutopilotConfig, AutopilotResult, AutopilotSummary, AutopilotExpansion, AutopilotPlanning, AutopilotExecution, AutopilotQA, AutopilotValidation, ValidationResult, ValidationVerdictType, ValidationVerdict, QAStatus, AutopilotSignal } from './types.js';
|
|
8
|
+
export { DEFAULT_CONFIG } from './types.js';
|
|
9
|
+
export { readAutopilotState, writeAutopilotState, clearAutopilotState, isAutopilotActive, initAutopilot, transitionPhase, incrementAgentCount, updateExpansion, updatePlanning, updateExecution, updateQA, updateValidation, ensureAutopilotDir, getSpecPath, getPlanPath } from './state.js';
|
|
10
|
+
export { transitionRalphToUltraQA, transitionUltraQAToValidation, transitionToComplete, transitionToFailed, getTransitionPrompt, type TransitionResult } from './transition.js';
|
|
11
|
+
export { getExpansionPrompt, getDirectPlanningPrompt, getExecutionPrompt, getQAPrompt, getValidationPrompt, getPhasePrompt } from './prompts.js';
|
|
12
|
+
export { recordValidationVerdict, getValidationStatus, startValidationRound, shouldRetryValidation, getIssuesToFix, getValidationSpawnPrompt, formatValidationResults, type ValidationCoordinatorResult } from './validation.js';
|
|
13
|
+
export { generateSummary, formatSummary, formatCompactSummary, formatFailureSummary, formatFileList } from './summary.js';
|
|
14
|
+
export { cancelAutopilot, clearAutopilot, canResumeAutopilot, resumeAutopilot, formatCancelMessage, type CancelResult } from './cancel.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/autopilot/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,EACR,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,gBAAgB,EACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,2BAA2B,EACjC,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Hook Module
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for the /autopilot command - autonomous execution
|
|
5
|
+
* from idea to working code.
|
|
6
|
+
*/
|
|
7
|
+
export { DEFAULT_CONFIG } from './types.js';
|
|
8
|
+
// State management
|
|
9
|
+
export { readAutopilotState, writeAutopilotState, clearAutopilotState, isAutopilotActive, initAutopilot, transitionPhase, incrementAgentCount, updateExpansion, updatePlanning, updateExecution, updateQA, updateValidation, ensureAutopilotDir, getSpecPath, getPlanPath } from './state.js';
|
|
10
|
+
// Phase transitions
|
|
11
|
+
export { transitionRalphToUltraQA, transitionUltraQAToValidation, transitionToComplete, transitionToFailed, getTransitionPrompt } from './transition.js';
|
|
12
|
+
// Prompt generation
|
|
13
|
+
export { getExpansionPrompt, getDirectPlanningPrompt, getExecutionPrompt, getQAPrompt, getValidationPrompt, getPhasePrompt } from './prompts.js';
|
|
14
|
+
// Validation coordination
|
|
15
|
+
export { recordValidationVerdict, getValidationStatus, startValidationRound, shouldRetryValidation, getIssuesToFix, getValidationSpawnPrompt, formatValidationResults } from './validation.js';
|
|
16
|
+
// Summary generation
|
|
17
|
+
export { generateSummary, formatSummary, formatCompactSummary, formatFailureSummary, formatFileList } from './summary.js';
|
|
18
|
+
// Cancellation
|
|
19
|
+
export { cancelAutopilot, clearAutopilot, canResumeAutopilot, resumeAutopilot, formatCancelMessage } from './cancel.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/autopilot/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,mBAAmB;AACnB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,oBAAoB;AACpB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AAEzB,oBAAoB;AACpB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,0BAA0B;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EAExB,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,eAAe;AACf,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EAEpB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Prompt Generation
|
|
3
|
+
*
|
|
4
|
+
* Generates phase-specific prompts that include Task tool invocations
|
|
5
|
+
* for Claude to execute. This is the core of the agent invocation mechanism.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Generate the expansion phase prompt (Phase 0)
|
|
9
|
+
* Analyst extracts requirements, Architect creates technical spec
|
|
10
|
+
*/
|
|
11
|
+
export declare function getExpansionPrompt(idea: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Generate the direct planning prompt (Phase 1)
|
|
14
|
+
* Uses Architect instead of Planner to create plan directly from spec
|
|
15
|
+
*/
|
|
16
|
+
export declare function getDirectPlanningPrompt(specPath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Generate the execution phase prompt (Phase 2)
|
|
19
|
+
*/
|
|
20
|
+
export declare function getExecutionPrompt(planPath: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Generate the QA phase prompt (Phase 3)
|
|
23
|
+
*/
|
|
24
|
+
export declare function getQAPrompt(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Generate the validation phase prompt (Phase 4)
|
|
27
|
+
*/
|
|
28
|
+
export declare function getValidationPrompt(specPath: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Get the prompt for the current phase
|
|
31
|
+
*/
|
|
32
|
+
export declare function getPhasePrompt(phase: string, context: {
|
|
33
|
+
idea?: string;
|
|
34
|
+
specPath?: string;
|
|
35
|
+
planPath?: string;
|
|
36
|
+
}): string;
|
|
37
|
+
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/hooks/autopilot/prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyDvD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6EhE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAyC3D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CA4CpC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA4E5D;AAaD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,MAAM,CAeR"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot Prompt Generation
|
|
3
|
+
*
|
|
4
|
+
* Generates phase-specific prompts that include Task tool invocations
|
|
5
|
+
* for Claude to execute. This is the core of the agent invocation mechanism.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Generate the expansion phase prompt (Phase 0)
|
|
9
|
+
* Analyst extracts requirements, Architect creates technical spec
|
|
10
|
+
*/
|
|
11
|
+
export function getExpansionPrompt(idea) {
|
|
12
|
+
return `## AUTOPILOT PHASE 0: IDEA EXPANSION
|
|
13
|
+
|
|
14
|
+
Your task: Expand this product idea into detailed requirements and technical spec.
|
|
15
|
+
|
|
16
|
+
**Original Idea:** "${idea}"
|
|
17
|
+
|
|
18
|
+
### Step 1: Spawn Analyst for Requirements
|
|
19
|
+
|
|
20
|
+
\`\`\`
|
|
21
|
+
Task(
|
|
22
|
+
subagent_type="oh-my-claudecode:analyst",
|
|
23
|
+
model="opus",
|
|
24
|
+
prompt="REQUIREMENTS ANALYSIS for: ${escapeForPrompt(idea)}
|
|
25
|
+
|
|
26
|
+
Extract and document:
|
|
27
|
+
1. Functional requirements (what it must do)
|
|
28
|
+
2. Non-functional requirements (performance, UX, etc.)
|
|
29
|
+
3. Implicit requirements (things user didn't say but needs)
|
|
30
|
+
4. Out of scope items
|
|
31
|
+
|
|
32
|
+
Output as structured markdown with clear sections."
|
|
33
|
+
)
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
WAIT for Analyst to complete before proceeding.
|
|
37
|
+
|
|
38
|
+
### Step 2: Spawn Architect for Technical Spec
|
|
39
|
+
|
|
40
|
+
After Analyst completes, spawn Architect:
|
|
41
|
+
|
|
42
|
+
\`\`\`
|
|
43
|
+
Task(
|
|
44
|
+
subagent_type="oh-my-claudecode:architect",
|
|
45
|
+
model="opus",
|
|
46
|
+
prompt="TECHNICAL SPECIFICATION for: ${escapeForPrompt(idea)}
|
|
47
|
+
|
|
48
|
+
Based on the requirements analysis above, create:
|
|
49
|
+
1. Tech stack decisions with rationale
|
|
50
|
+
2. Architecture overview (patterns, layers)
|
|
51
|
+
3. File structure (directory tree)
|
|
52
|
+
4. Dependencies list (packages)
|
|
53
|
+
5. API/interface definitions
|
|
54
|
+
|
|
55
|
+
Output as structured markdown."
|
|
56
|
+
)
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
### Step 3: Save Combined Spec
|
|
60
|
+
|
|
61
|
+
Combine Analyst requirements + Architect technical spec into a single document.
|
|
62
|
+
Save to: \`.omc/autopilot/spec.md\`
|
|
63
|
+
|
|
64
|
+
### Step 4: Signal Completion
|
|
65
|
+
|
|
66
|
+
When the spec is saved, signal: EXPANSION_COMPLETE
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generate the direct planning prompt (Phase 1)
|
|
71
|
+
* Uses Architect instead of Planner to create plan directly from spec
|
|
72
|
+
*/
|
|
73
|
+
export function getDirectPlanningPrompt(specPath) {
|
|
74
|
+
return `## AUTOPILOT PHASE 1: DIRECT PLANNING
|
|
75
|
+
|
|
76
|
+
The spec is complete from Phase 0. Create implementation plan directly (no interview needed).
|
|
77
|
+
|
|
78
|
+
### Step 1: Read Spec
|
|
79
|
+
|
|
80
|
+
Read the specification at: ${specPath}
|
|
81
|
+
|
|
82
|
+
### Step 2: Create Plan via Architect
|
|
83
|
+
|
|
84
|
+
Spawn Architect to create the implementation plan:
|
|
85
|
+
|
|
86
|
+
\`\`\`
|
|
87
|
+
Task(
|
|
88
|
+
subagent_type="oh-my-claudecode:architect",
|
|
89
|
+
model="opus",
|
|
90
|
+
prompt="CREATE IMPLEMENTATION PLAN
|
|
91
|
+
|
|
92
|
+
Read the specification at: ${specPath}
|
|
93
|
+
|
|
94
|
+
Generate a comprehensive implementation plan with:
|
|
95
|
+
|
|
96
|
+
1. **Task Breakdown**
|
|
97
|
+
- Each task must be atomic (one clear deliverable)
|
|
98
|
+
- Include file paths for each task
|
|
99
|
+
- Estimate complexity (simple/medium/complex)
|
|
100
|
+
|
|
101
|
+
2. **Dependency Graph**
|
|
102
|
+
- Which tasks depend on others
|
|
103
|
+
- Optimal execution order
|
|
104
|
+
- Tasks that can run in parallel
|
|
105
|
+
|
|
106
|
+
3. **Acceptance Criteria**
|
|
107
|
+
- Testable criteria for each task
|
|
108
|
+
- Definition of done
|
|
109
|
+
|
|
110
|
+
4. **Risk Register**
|
|
111
|
+
- Identified risks
|
|
112
|
+
- Mitigation strategies
|
|
113
|
+
|
|
114
|
+
Save to: .omc/plans/autopilot-impl.md
|
|
115
|
+
|
|
116
|
+
Signal completion with: PLAN_CREATED"
|
|
117
|
+
)
|
|
118
|
+
\`\`\`
|
|
119
|
+
|
|
120
|
+
### Step 3: Validate Plan via Critic
|
|
121
|
+
|
|
122
|
+
After Architect creates the plan:
|
|
123
|
+
|
|
124
|
+
\`\`\`
|
|
125
|
+
Task(
|
|
126
|
+
subagent_type="oh-my-claudecode:critic",
|
|
127
|
+
model="opus",
|
|
128
|
+
prompt="REVIEW IMPLEMENTATION PLAN
|
|
129
|
+
|
|
130
|
+
Plan file: .omc/plans/autopilot-impl.md
|
|
131
|
+
Original spec: ${specPath}
|
|
132
|
+
|
|
133
|
+
Verify:
|
|
134
|
+
1. All requirements from spec have corresponding tasks
|
|
135
|
+
2. No ambiguous task descriptions
|
|
136
|
+
3. Acceptance criteria are testable
|
|
137
|
+
4. Dependencies are correctly identified
|
|
138
|
+
5. Risks are addressed
|
|
139
|
+
|
|
140
|
+
Verdict: OKAY or REJECT with specific issues"
|
|
141
|
+
)
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
### Iteration Loop
|
|
145
|
+
|
|
146
|
+
If Critic rejects, feed feedback back to Architect and retry (max 5 iterations).
|
|
147
|
+
|
|
148
|
+
When Critic approves: PLANNING_COMPLETE
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Generate the execution phase prompt (Phase 2)
|
|
153
|
+
*/
|
|
154
|
+
export function getExecutionPrompt(planPath) {
|
|
155
|
+
return `## AUTOPILOT PHASE 2: EXECUTION
|
|
156
|
+
|
|
157
|
+
Execute the plan at ${planPath} using Ralph+Ultrawork mode.
|
|
158
|
+
|
|
159
|
+
### Activation
|
|
160
|
+
|
|
161
|
+
Ralph and Ultrawork are now active. Execute tasks in parallel where possible.
|
|
162
|
+
|
|
163
|
+
### Execution Rules
|
|
164
|
+
|
|
165
|
+
- Read the plan from ${planPath}
|
|
166
|
+
- Identify independent tasks that can run in parallel
|
|
167
|
+
- Spawn multiple executor agents for parallel work
|
|
168
|
+
- Track progress in the TODO list
|
|
169
|
+
- Use appropriate agent tiers based on task complexity
|
|
170
|
+
|
|
171
|
+
### Agent Spawning Pattern
|
|
172
|
+
|
|
173
|
+
\`\`\`
|
|
174
|
+
// For simple tasks (single file, straightforward logic)
|
|
175
|
+
Task(subagent_type="oh-my-claudecode:executor-low", model="haiku", prompt="...")
|
|
176
|
+
|
|
177
|
+
// For standard implementation (feature, multiple methods)
|
|
178
|
+
Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="...")
|
|
179
|
+
|
|
180
|
+
// For complex work (architecture, debugging, refactoring)
|
|
181
|
+
Task(subagent_type="oh-my-claudecode:executor-high", model="opus", prompt="...")
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
### Progress Tracking
|
|
185
|
+
|
|
186
|
+
Update TODO list as tasks complete:
|
|
187
|
+
- Mark task in_progress when starting
|
|
188
|
+
- Mark task completed when done
|
|
189
|
+
- Add new tasks if discovered during implementation
|
|
190
|
+
|
|
191
|
+
### Completion
|
|
192
|
+
|
|
193
|
+
When all tasks from the plan are complete: EXECUTION_COMPLETE
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Generate the QA phase prompt (Phase 3)
|
|
198
|
+
*/
|
|
199
|
+
export function getQAPrompt() {
|
|
200
|
+
return `## AUTOPILOT PHASE 3: QUALITY ASSURANCE
|
|
201
|
+
|
|
202
|
+
Run UltraQA cycles until build/lint/tests pass.
|
|
203
|
+
|
|
204
|
+
### QA Sequence
|
|
205
|
+
|
|
206
|
+
1. **Build**: npm run build (or equivalent for the project type)
|
|
207
|
+
2. **Lint**: npm run lint (or equivalent)
|
|
208
|
+
3. **Test**: npm test (or equivalent)
|
|
209
|
+
|
|
210
|
+
### Fix Cycle
|
|
211
|
+
|
|
212
|
+
For each failure:
|
|
213
|
+
|
|
214
|
+
1. **Diagnose** - Understand the error
|
|
215
|
+
\`\`\`
|
|
216
|
+
Task(
|
|
217
|
+
subagent_type="oh-my-claudecode:architect-low",
|
|
218
|
+
model="haiku",
|
|
219
|
+
prompt="Diagnose this error and suggest fix: [ERROR]"
|
|
220
|
+
)
|
|
221
|
+
\`\`\`
|
|
222
|
+
|
|
223
|
+
2. **Fix** - Apply the fix
|
|
224
|
+
\`\`\`
|
|
225
|
+
Task(
|
|
226
|
+
subagent_type="oh-my-claudecode:build-fixer",
|
|
227
|
+
model="sonnet",
|
|
228
|
+
prompt="Fix this error with minimal changes: [ERROR]"
|
|
229
|
+
)
|
|
230
|
+
\`\`\`
|
|
231
|
+
|
|
232
|
+
3. **Re-run** - Verify the fix worked
|
|
233
|
+
4. **Repeat** - Until pass or max cycles (5)
|
|
234
|
+
|
|
235
|
+
### Exit Conditions
|
|
236
|
+
|
|
237
|
+
- All checks pass → QA_COMPLETE
|
|
238
|
+
- Max cycles reached → Report failures
|
|
239
|
+
- Same error 3 times → Escalate to user
|
|
240
|
+
|
|
241
|
+
When all checks pass: QA_COMPLETE
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Generate the validation phase prompt (Phase 4)
|
|
246
|
+
*/
|
|
247
|
+
export function getValidationPrompt(specPath) {
|
|
248
|
+
return `## AUTOPILOT PHASE 4: VALIDATION
|
|
249
|
+
|
|
250
|
+
Spawn parallel validation architects for comprehensive review.
|
|
251
|
+
|
|
252
|
+
### Parallel Validation Spawns
|
|
253
|
+
|
|
254
|
+
Spawn all three architects in parallel:
|
|
255
|
+
|
|
256
|
+
\`\`\`
|
|
257
|
+
// Functional Completeness Review
|
|
258
|
+
Task(
|
|
259
|
+
subagent_type="oh-my-claudecode:architect",
|
|
260
|
+
model="opus",
|
|
261
|
+
prompt="FUNCTIONAL COMPLETENESS REVIEW
|
|
262
|
+
|
|
263
|
+
Read the original spec at: ${specPath}
|
|
264
|
+
|
|
265
|
+
Verify:
|
|
266
|
+
1. All functional requirements are implemented
|
|
267
|
+
2. All non-functional requirements are addressed
|
|
268
|
+
3. All acceptance criteria from the plan are met
|
|
269
|
+
4. No missing features or incomplete implementations
|
|
270
|
+
|
|
271
|
+
Verdict: APPROVED (all requirements met) or REJECTED (with specific gaps)"
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
// Security Review
|
|
275
|
+
Task(
|
|
276
|
+
subagent_type="oh-my-claudecode:security-reviewer",
|
|
277
|
+
model="opus",
|
|
278
|
+
prompt="SECURITY REVIEW
|
|
279
|
+
|
|
280
|
+
Check the implementation for:
|
|
281
|
+
1. OWASP Top 10 vulnerabilities
|
|
282
|
+
2. Input validation and sanitization
|
|
283
|
+
3. Authentication/authorization issues
|
|
284
|
+
4. Sensitive data exposure
|
|
285
|
+
5. Injection vulnerabilities (SQL, command, XSS)
|
|
286
|
+
6. Hardcoded secrets or credentials
|
|
287
|
+
|
|
288
|
+
Verdict: APPROVED (no vulnerabilities) or REJECTED (with specific issues)"
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
// Code Quality Review
|
|
292
|
+
Task(
|
|
293
|
+
subagent_type="oh-my-claudecode:code-reviewer",
|
|
294
|
+
model="opus",
|
|
295
|
+
prompt="CODE QUALITY REVIEW
|
|
296
|
+
|
|
297
|
+
Review the implementation for:
|
|
298
|
+
1. Code organization and structure
|
|
299
|
+
2. Design patterns and best practices
|
|
300
|
+
3. Error handling completeness
|
|
301
|
+
4. Test coverage adequacy
|
|
302
|
+
5. Documentation and comments
|
|
303
|
+
6. Maintainability and readability
|
|
304
|
+
|
|
305
|
+
Verdict: APPROVED (high quality) or REJECTED (with specific issues)"
|
|
306
|
+
)
|
|
307
|
+
\`\`\`
|
|
308
|
+
|
|
309
|
+
### Verdict Aggregation
|
|
310
|
+
|
|
311
|
+
- **All APPROVED** → AUTOPILOT_COMPLETE
|
|
312
|
+
- **Any REJECTED** → Fix the issues and re-validate (max 3 rounds)
|
|
313
|
+
|
|
314
|
+
### Fix and Retry
|
|
315
|
+
|
|
316
|
+
If any reviewer rejects:
|
|
317
|
+
1. Collect all rejection reasons
|
|
318
|
+
2. Fix each issue identified
|
|
319
|
+
3. Re-run validation
|
|
320
|
+
|
|
321
|
+
When all approve: AUTOPILOT_COMPLETE
|
|
322
|
+
`;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Escape special characters for embedding in prompts
|
|
326
|
+
*/
|
|
327
|
+
function escapeForPrompt(text) {
|
|
328
|
+
return text
|
|
329
|
+
.replace(/\\/g, '\\\\')
|
|
330
|
+
.replace(/"/g, '\\"')
|
|
331
|
+
.replace(/`/g, '\\`')
|
|
332
|
+
.replace(/\$/g, '\\$');
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Get the prompt for the current phase
|
|
336
|
+
*/
|
|
337
|
+
export function getPhasePrompt(phase, context) {
|
|
338
|
+
switch (phase) {
|
|
339
|
+
case 'expansion':
|
|
340
|
+
return getExpansionPrompt(context.idea || '');
|
|
341
|
+
case 'planning':
|
|
342
|
+
return getDirectPlanningPrompt(context.specPath || '.omc/autopilot/spec.md');
|
|
343
|
+
case 'execution':
|
|
344
|
+
return getExecutionPrompt(context.planPath || '.omc/plans/autopilot-impl.md');
|
|
345
|
+
case 'qa':
|
|
346
|
+
return getQAPrompt();
|
|
347
|
+
case 'validation':
|
|
348
|
+
return getValidationPrompt(context.specPath || '.omc/autopilot/spec.md');
|
|
349
|
+
default:
|
|
350
|
+
return '';
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/hooks/autopilot/prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO;;;;sBAIa,IAAI;;;;;;;;uCAQa,eAAe,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;yCAsBnB,eAAe,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;CAqB7D,CAAC;AACF,CAAC;AAED;;;GA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C,OAAO,CAAC,QAAQ,IAAI,8BAA8B,CAAC,CAAC;QAChF,KAAK,IAAI;YACP,OAAO,WAAW,EAAE,CAAC;QACvB,KAAK,YAAY;YACf,OAAO,mBAAmB,CAAC,OAAO,CAAC,QAAQ,IAAI,wBAAwB,CAAC,CAAC;QAC3E;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot State Management
|
|
3
|
+
*
|
|
4
|
+
* Persistent state for the autopilot workflow across phases.
|
|
5
|
+
*/
|
|
6
|
+
import type { AutopilotState, AutopilotPhase, AutopilotConfig } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Ensure the autopilot directory exists
|
|
9
|
+
*/
|
|
10
|
+
export declare function ensureAutopilotDir(directory: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Read autopilot state from disk
|
|
13
|
+
*/
|
|
14
|
+
export declare function readAutopilotState(directory: string): AutopilotState | null;
|
|
15
|
+
/**
|
|
16
|
+
* Write autopilot state to disk
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeAutopilotState(directory: string, state: AutopilotState): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Clear autopilot state
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearAutopilotState(directory: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Check if autopilot is active
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAutopilotActive(directory: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Initialize a new autopilot session
|
|
29
|
+
*/
|
|
30
|
+
export declare function initAutopilot(directory: string, idea: string, sessionId?: string, config?: Partial<AutopilotConfig>): AutopilotState;
|
|
31
|
+
/**
|
|
32
|
+
* Transition to a new phase
|
|
33
|
+
*/
|
|
34
|
+
export declare function transitionPhase(directory: string, newPhase: AutopilotPhase): AutopilotState | null;
|
|
35
|
+
/**
|
|
36
|
+
* Increment the agent spawn counter
|
|
37
|
+
*/
|
|
38
|
+
export declare function incrementAgentCount(directory: string, count?: number): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Update expansion phase data
|
|
41
|
+
*/
|
|
42
|
+
export declare function updateExpansion(directory: string, updates: Partial<AutopilotState['expansion']>): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Update planning phase data
|
|
45
|
+
*/
|
|
46
|
+
export declare function updatePlanning(directory: string, updates: Partial<AutopilotState['planning']>): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Update execution phase data
|
|
49
|
+
*/
|
|
50
|
+
export declare function updateExecution(directory: string, updates: Partial<AutopilotState['execution']>): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Update QA phase data
|
|
53
|
+
*/
|
|
54
|
+
export declare function updateQA(directory: string, updates: Partial<AutopilotState['qa']>): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Update validation phase data
|
|
57
|
+
*/
|
|
58
|
+
export declare function updateValidation(directory: string, updates: Partial<AutopilotState['validation']>): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Get the spec file path
|
|
61
|
+
*/
|
|
62
|
+
export declare function getSpecPath(directory: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Get the plan file path
|
|
65
|
+
*/
|
|
66
|
+
export declare function getPlanPath(directory: string): string;
|
|
67
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/hooks/autopilot/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAwBlF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAa3E;AAED;;GAEG;AACH,wBAAgB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