oh-my-claude-sisyphus 3.7.16 → 3.8.2
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/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +8 -6
- package/agents/AGENTS.md +8 -8
- package/agents/architect.md +32 -0
- package/agents/build-fixer.md +35 -0
- package/agents/code-reviewer.md +51 -0
- package/agents/executor-high.md +49 -0
- package/agents/explore-high.md +39 -0
- package/agents/explore-medium.md +33 -0
- package/dist/__tests__/hooks/learner/bridge.test.js +13 -7
- package/dist/__tests__/hooks/learner/bridge.test.js.map +1 -1
- package/dist/__tests__/hooks.test.js +306 -67
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +31 -15
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/hooks/bridge.js +3 -3
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/clear-suggestions/constants.d.ts +54 -0
- package/dist/hooks/clear-suggestions/constants.d.ts.map +1 -0
- package/dist/hooks/clear-suggestions/constants.js +102 -0
- package/dist/hooks/clear-suggestions/constants.js.map +1 -0
- package/dist/hooks/clear-suggestions/index.d.ts +61 -0
- package/dist/hooks/clear-suggestions/index.d.ts.map +1 -0
- package/dist/hooks/clear-suggestions/index.js +276 -0
- package/dist/hooks/clear-suggestions/index.js.map +1 -0
- package/dist/hooks/clear-suggestions/triggers.d.ts +65 -0
- package/dist/hooks/clear-suggestions/triggers.d.ts.map +1 -0
- package/dist/hooks/clear-suggestions/triggers.js +222 -0
- package/dist/hooks/clear-suggestions/triggers.js.map +1 -0
- package/dist/hooks/clear-suggestions/types.d.ts +92 -0
- package/dist/hooks/clear-suggestions/types.d.ts.map +1 -0
- package/dist/hooks/clear-suggestions/types.js +9 -0
- package/dist/hooks/clear-suggestions/types.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +51 -51
- package/dist/hooks/keyword-detector/__tests__/index.test.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 +18 -5
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/docs/CLAUDE.md +104 -0
- package/package.json +1 -1
- package/scripts/keyword-detector.mjs +176 -84
- package/scripts/post-tool-verifier.mjs +42 -3
- package/scripts/pre-tool-enforcer.mjs +4 -1
- package/scripts/session-start.mjs +7 -1
- package/scripts/skill-injector.mjs +4 -1
- package/templates/hooks/keyword-detector.sh +197 -31
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# OMC Keyword Detector Hook
|
|
3
|
-
# Detects
|
|
4
|
-
#
|
|
2
|
+
# OMC Keyword Detector Hook (Bash)
|
|
3
|
+
# Detects magic keywords and invokes skill tools
|
|
4
|
+
# Linux/macOS compatible
|
|
5
|
+
#
|
|
6
|
+
# Supported keywords (in priority order):
|
|
7
|
+
# 1. cancel: Stop active modes
|
|
8
|
+
# 2. ralph: Persistence mode until task completion
|
|
9
|
+
# 3. autopilot: Full autonomous execution
|
|
10
|
+
# 4. ultrapilot: Parallel autopilot
|
|
11
|
+
# 5. ultrawork/ulw: Maximum parallel execution
|
|
12
|
+
# 6. ecomode/eco: Token-efficient execution
|
|
13
|
+
# 7. swarm: N coordinated agents
|
|
14
|
+
# 8. pipeline: Sequential agent chaining
|
|
15
|
+
# 9. ralplan: Iterative planning with consensus
|
|
16
|
+
# 10. plan: Planning interview mode
|
|
17
|
+
# 11. tdd: Test-driven development
|
|
18
|
+
# 12. research: Research orchestration
|
|
19
|
+
# 13. ultrathink/think: Extended reasoning
|
|
20
|
+
# 14. deepsearch: Codebase search (restricted patterns)
|
|
21
|
+
# 15. analyze: Analysis mode (restricted patterns)
|
|
5
22
|
|
|
6
23
|
# Read stdin (JSON input from Claude Code)
|
|
7
24
|
INPUT=$(cat)
|
|
@@ -45,58 +62,207 @@ PROMPT_NO_CODE=$(echo "$PROMPT" | sed 's/```[^`]*```//g' | sed 's/`[^`]*`//g')
|
|
|
45
62
|
# Convert to lowercase for case-insensitive matching
|
|
46
63
|
PROMPT_LOWER=$(echo "$PROMPT_NO_CODE" | tr '[:upper:]' '[:lower:]')
|
|
47
64
|
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
# Create a skill invocation message that tells Claude to use the Skill tool
|
|
66
|
+
create_skill_invocation() {
|
|
67
|
+
local skill_name="$1"
|
|
68
|
+
local original_prompt="$2"
|
|
69
|
+
local args="$3"
|
|
70
|
+
|
|
71
|
+
local args_section=""
|
|
72
|
+
if [ -n "$args" ]; then
|
|
73
|
+
args_section="\\nArguments: $args"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
local skill_upper=$(echo "$skill_name" | tr '[:lower:]' '[:upper:]')
|
|
77
|
+
|
|
78
|
+
cat << EOF
|
|
79
|
+
[MAGIC KEYWORD: ${skill_upper}]
|
|
80
|
+
|
|
81
|
+
You MUST invoke the skill using the Skill tool:
|
|
82
|
+
|
|
83
|
+
Skill: oh-my-claudecode:${skill_name}${args_section}
|
|
84
|
+
|
|
85
|
+
User request:
|
|
86
|
+
${original_prompt}
|
|
87
|
+
|
|
88
|
+
IMPORTANT: Invoke the skill IMMEDIATELY. Do not proceed without loading the skill instructions.
|
|
89
|
+
EOF
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Clear state files for cancel operation
|
|
93
|
+
clear_state_files() {
|
|
94
|
+
local directory="$1"
|
|
95
|
+
local modes=("ralph" "autopilot" "ultrapilot" "ultrawork" "ecomode" "swarm" "pipeline")
|
|
96
|
+
|
|
97
|
+
for mode in "${modes[@]}"; do
|
|
98
|
+
rm -f "$directory/.omc/state/${mode}-state.json" 2>/dev/null
|
|
99
|
+
rm -f "$HOME/.omc/state/${mode}-state.json" 2>/dev/null
|
|
100
|
+
done
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# Activate state for a mode
|
|
104
|
+
activate_state() {
|
|
105
|
+
local directory="$1"
|
|
106
|
+
local prompt="$2"
|
|
107
|
+
local state_name="$3"
|
|
108
|
+
|
|
109
|
+
# Create directories
|
|
110
|
+
mkdir -p "$directory/.omc/state" 2>/dev/null
|
|
52
111
|
mkdir -p "$HOME/.omc/state" 2>/dev/null
|
|
53
112
|
|
|
54
113
|
# Escape prompt for JSON
|
|
55
|
-
|
|
114
|
+
local prompt_escaped=$(echo "$prompt" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | tr '\n' ' ')
|
|
115
|
+
local timestamp=$(date -Iseconds 2>/dev/null || date +%Y-%m-%dT%H:%M:%S%z)
|
|
56
116
|
|
|
57
|
-
|
|
117
|
+
local state_json="{
|
|
58
118
|
\"active\": true,
|
|
59
|
-
\"started_at\": \"$
|
|
60
|
-
\"original_prompt\": \"$
|
|
119
|
+
\"started_at\": \"$timestamp\",
|
|
120
|
+
\"original_prompt\": \"$prompt_escaped\",
|
|
61
121
|
\"reinforcement_count\": 0,
|
|
62
|
-
\"last_checked_at\": \"$
|
|
122
|
+
\"last_checked_at\": \"$timestamp\"
|
|
63
123
|
}"
|
|
64
124
|
|
|
65
125
|
# Write state to both local and global locations
|
|
66
|
-
echo "$
|
|
67
|
-
echo "$
|
|
126
|
+
echo "$state_json" > "$directory/.omc/state/${state_name}-state.json" 2>/dev/null
|
|
127
|
+
echo "$state_json" > "$HOME/.omc/state/${state_name}-state.json" 2>/dev/null
|
|
128
|
+
}
|
|
68
129
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
130
|
+
# Output JSON with skill invocation message
|
|
131
|
+
output_skill() {
|
|
132
|
+
local skill_name="$1"
|
|
133
|
+
local prompt="$2"
|
|
134
|
+
local args="$3"
|
|
135
|
+
|
|
136
|
+
local message=$(create_skill_invocation "$skill_name" "$prompt" "$args")
|
|
137
|
+
# Escape for JSON: backslashes, quotes, and newlines
|
|
138
|
+
local escaped_message=$(echo "$message" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | awk '{printf "%s\\n", $0}' | sed 's/\\n$//')
|
|
139
|
+
|
|
140
|
+
echo "{\"continue\": true, \"message\": \"$escaped_message\"}"
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
# Priority 1: Cancel (BEFORE other modes - clears states)
|
|
144
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(stop|cancel|abort)\b'; then
|
|
145
|
+
clear_state_files "$DIRECTORY"
|
|
146
|
+
output_skill "cancel" "$PROMPT"
|
|
73
147
|
exit 0
|
|
74
148
|
fi
|
|
75
149
|
|
|
76
|
-
#
|
|
77
|
-
if echo "$PROMPT_LOWER" | grep -qE '\b(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
150
|
+
# Priority 2: Ralph keywords
|
|
151
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(ralph|don'\''t stop|must complete|until done)\b'; then
|
|
152
|
+
activate_state "$DIRECTORY" "$PROMPT" "ralph"
|
|
153
|
+
activate_state "$DIRECTORY" "$PROMPT" "ultrawork"
|
|
154
|
+
output_skill "ralph" "$PROMPT"
|
|
81
155
|
exit 0
|
|
82
156
|
fi
|
|
83
157
|
|
|
84
|
-
#
|
|
85
|
-
if echo "$PROMPT_LOWER" | grep -qE '\b(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
158
|
+
# Priority 3: Autopilot keywords
|
|
159
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(autopilot|auto pilot|auto-pilot|autonomous|full auto|fullsend)\b' || \
|
|
160
|
+
echo "$PROMPT_LOWER" | grep -qE '\bbuild\s+me\s+' || \
|
|
161
|
+
echo "$PROMPT_LOWER" | grep -qE '\bcreate\s+me\s+' || \
|
|
162
|
+
echo "$PROMPT_LOWER" | grep -qE '\bmake\s+me\s+' || \
|
|
163
|
+
echo "$PROMPT_LOWER" | grep -qE '\bi\s+want\s+a\s+' || \
|
|
164
|
+
echo "$PROMPT_LOWER" | grep -qE '\bi\s+want\s+an\s+' || \
|
|
165
|
+
echo "$PROMPT_LOWER" | grep -qE '\bhandle\s+it\s+all\b' || \
|
|
166
|
+
echo "$PROMPT_LOWER" | grep -qE '\bend\s+to\s+end\b' || \
|
|
167
|
+
echo "$PROMPT_LOWER" | grep -qE '\be2e\s+this\b'; then
|
|
168
|
+
activate_state "$DIRECTORY" "$PROMPT" "autopilot"
|
|
169
|
+
output_skill "autopilot" "$PROMPT"
|
|
170
|
+
exit 0
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
# Priority 4: Ultrapilot
|
|
174
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(ultrapilot|ultra-pilot)\b' || \
|
|
175
|
+
echo "$PROMPT_LOWER" | grep -qE '\bparallel\s+build\b' || \
|
|
176
|
+
echo "$PROMPT_LOWER" | grep -qE '\bswarm\s+build\b'; then
|
|
177
|
+
activate_state "$DIRECTORY" "$PROMPT" "ultrapilot"
|
|
178
|
+
output_skill "ultrapilot" "$PROMPT"
|
|
179
|
+
exit 0
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
# Priority 5: Ultrawork keywords
|
|
183
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(ultrawork|ulw|uw)\b'; then
|
|
184
|
+
activate_state "$DIRECTORY" "$PROMPT" "ultrawork"
|
|
185
|
+
output_skill "ultrawork" "$PROMPT"
|
|
89
186
|
exit 0
|
|
90
187
|
fi
|
|
91
188
|
|
|
92
|
-
#
|
|
93
|
-
if echo "$PROMPT_LOWER" | grep -qE '\b(
|
|
189
|
+
# Priority 6: Ecomode keywords
|
|
190
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(eco|ecomode|eco-mode|efficient|save-tokens|budget)\b'; then
|
|
191
|
+
activate_state "$DIRECTORY" "$PROMPT" "ecomode"
|
|
192
|
+
output_skill "ecomode" "$PROMPT"
|
|
193
|
+
exit 0
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# Priority 7: Swarm - parse N from "swarm N agents"
|
|
197
|
+
SWARM_MATCH=$(echo "$PROMPT_LOWER" | grep -oE '\bswarm\s+[0-9]+\s+agents?\b' | grep -oE '[0-9]+')
|
|
198
|
+
if [ -n "$SWARM_MATCH" ]; then
|
|
199
|
+
output_skill "swarm" "$PROMPT" "$SWARM_MATCH"
|
|
200
|
+
exit 0
|
|
201
|
+
fi
|
|
202
|
+
if echo "$PROMPT_LOWER" | grep -qE '\bcoordinated\s+agents\b'; then
|
|
203
|
+
output_skill "swarm" "$PROMPT" "3"
|
|
204
|
+
exit 0
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
# Priority 8: Pipeline
|
|
208
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(pipeline)\b' || \
|
|
209
|
+
echo "$PROMPT_LOWER" | grep -qE '\bchain\s+agents\b'; then
|
|
210
|
+
output_skill "pipeline" "$PROMPT"
|
|
211
|
+
exit 0
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
# Priority 9: Ralplan keyword (before plan to avoid false match)
|
|
215
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(ralplan)\b'; then
|
|
216
|
+
output_skill "ralplan" "$PROMPT"
|
|
217
|
+
exit 0
|
|
218
|
+
fi
|
|
219
|
+
|
|
220
|
+
# Priority 10: Plan keywords
|
|
221
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(plan this|plan the)\b'; then
|
|
222
|
+
output_skill "plan" "$PROMPT"
|
|
223
|
+
exit 0
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
# Priority 11: TDD
|
|
227
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(tdd)\b' || \
|
|
228
|
+
echo "$PROMPT_LOWER" | grep -qE '\btest\s+first\b' || \
|
|
229
|
+
echo "$PROMPT_LOWER" | grep -qE '\bred\s+green\b'; then
|
|
230
|
+
output_skill "tdd" "$PROMPT"
|
|
231
|
+
exit 0
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
# Priority 12: Research
|
|
235
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(research)\b' || \
|
|
236
|
+
echo "$PROMPT_LOWER" | grep -qE '\banalyze\s+data\b' || \
|
|
237
|
+
echo "$PROMPT_LOWER" | grep -qE '\bstatistics\b'; then
|
|
238
|
+
output_skill "research" "$PROMPT"
|
|
239
|
+
exit 0
|
|
240
|
+
fi
|
|
241
|
+
|
|
242
|
+
# Priority 13: Ultrathink/think keywords (keep inline message)
|
|
243
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(ultrathink|think hard|think deeply)\b'; then
|
|
94
244
|
cat << 'EOF'
|
|
95
|
-
{"continue": true, "message": "<
|
|
245
|
+
{"continue": true, "message": "<think-mode>\n\n**ULTRATHINK MODE ENABLED** - Extended reasoning activated.\n\nYou are now in deep thinking mode. Take your time to:\n1. Thoroughly analyze the problem from multiple angles\n2. Consider edge cases and potential issues\n3. Think through the implications of each approach\n4. Reason step-by-step before acting\n\nUse your extended thinking capabilities to provide the most thorough and well-reasoned response.\n\n</think-mode>\n\n---\n"}
|
|
96
246
|
EOF
|
|
97
247
|
exit 0
|
|
98
248
|
fi
|
|
99
249
|
|
|
250
|
+
# Priority 14: Deepsearch (RESTRICTED patterns)
|
|
251
|
+
if echo "$PROMPT_LOWER" | grep -qE '\b(deepsearch)\b' || \
|
|
252
|
+
echo "$PROMPT_LOWER" | grep -qE '\bsearch\s+(the\s+)?(codebase|code|files|project)\b' || \
|
|
253
|
+
echo "$PROMPT_LOWER" | grep -qE '\bfind\s+(in\s+)?(codebase|code|all\s+files)\b'; then
|
|
254
|
+
output_skill "deepsearch" "$PROMPT"
|
|
255
|
+
exit 0
|
|
256
|
+
fi
|
|
257
|
+
|
|
258
|
+
# Priority 15: Analyze (RESTRICTED patterns)
|
|
259
|
+
if echo "$PROMPT_LOWER" | grep -qE '\bdeep\s*analyze\b' || \
|
|
260
|
+
echo "$PROMPT_LOWER" | grep -qE '\binvestigate\s+(the|this|why)\b' || \
|
|
261
|
+
echo "$PROMPT_LOWER" | grep -qE '\bdebug\s+(the|this|why)\b'; then
|
|
262
|
+
output_skill "analyze" "$PROMPT"
|
|
263
|
+
exit 0
|
|
264
|
+
fi
|
|
265
|
+
|
|
100
266
|
# No keywords detected - continue without modification
|
|
101
267
|
echo '{"continue": true}'
|
|
102
268
|
exit 0
|