oh-my-claude-sisyphus 1.10.0 → 1.11.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.
Files changed (91) hide show
  1. package/README.md +50 -10
  2. package/dist/agents/definitions.js +1 -1
  3. package/dist/agents/model-lists.d.ts +26 -0
  4. package/dist/agents/model-lists.d.ts.map +1 -0
  5. package/dist/agents/model-lists.js +62 -0
  6. package/dist/agents/model-lists.js.map +1 -0
  7. package/dist/agents/orchestrator-sisyphus.js +1 -1
  8. package/dist/auth/index.d.ts +10 -0
  9. package/dist/auth/index.d.ts.map +1 -0
  10. package/dist/auth/index.js +13 -0
  11. package/dist/auth/index.js.map +1 -0
  12. package/dist/auth/manager.d.ts +54 -0
  13. package/dist/auth/manager.d.ts.map +1 -0
  14. package/dist/auth/manager.js +248 -0
  15. package/dist/auth/manager.js.map +1 -0
  16. package/dist/auth/oauth-google.d.ts +47 -0
  17. package/dist/auth/oauth-google.d.ts.map +1 -0
  18. package/dist/auth/oauth-google.js +280 -0
  19. package/dist/auth/oauth-google.js.map +1 -0
  20. package/dist/auth/oauth-openai.d.ts +46 -0
  21. package/dist/auth/oauth-openai.d.ts.map +1 -0
  22. package/dist/auth/oauth-openai.js +264 -0
  23. package/dist/auth/oauth-openai.js.map +1 -0
  24. package/dist/auth/pkce.d.ts +14 -0
  25. package/dist/auth/pkce.d.ts.map +1 -0
  26. package/dist/auth/pkce.js +35 -0
  27. package/dist/auth/pkce.js.map +1 -0
  28. package/dist/auth/storage.d.ts +52 -0
  29. package/dist/auth/storage.d.ts.map +1 -0
  30. package/dist/auth/storage.js +230 -0
  31. package/dist/auth/storage.js.map +1 -0
  32. package/dist/auth/types.d.ts +76 -0
  33. package/dist/auth/types.d.ts.map +1 -0
  34. package/dist/auth/types.js +5 -0
  35. package/dist/auth/types.js.map +1 -0
  36. package/dist/cli/index.js +0 -0
  37. package/dist/features/auto-update.d.ts +20 -0
  38. package/dist/features/auto-update.d.ts.map +1 -1
  39. package/dist/features/auto-update.js +35 -0
  40. package/dist/features/auto-update.js.map +1 -1
  41. package/dist/features/builtin-skills/skills.js +2 -2
  42. package/dist/hooks/bridge.d.ts.map +1 -1
  43. package/dist/hooks/bridge.js +26 -1
  44. package/dist/hooks/bridge.js.map +1 -1
  45. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  46. package/dist/hooks/persistent-mode/index.js +126 -4
  47. package/dist/hooks/persistent-mode/index.js.map +1 -1
  48. package/dist/hooks/preemptive-compaction/index.js +2 -2
  49. package/dist/hooks/preemptive-compaction/index.js.map +1 -1
  50. package/dist/hooks/thinking-block-validator/index.d.ts +3 -34
  51. package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -1
  52. package/dist/hooks/thinking-block-validator/index.js +21 -70
  53. package/dist/hooks/thinking-block-validator/index.js.map +1 -1
  54. package/dist/installer/hooks.d.ts +2 -2
  55. package/dist/installer/hooks.d.ts.map +1 -1
  56. package/dist/installer/hooks.js +85 -2
  57. package/dist/installer/hooks.js.map +1 -1
  58. package/dist/installer/index.d.ts +2 -2
  59. package/dist/installer/index.d.ts.map +1 -1
  60. package/dist/installer/index.js +4 -84
  61. package/dist/installer/index.js.map +1 -1
  62. package/dist/providers/index.d.ts +8 -0
  63. package/dist/providers/index.d.ts.map +1 -0
  64. package/dist/providers/index.js +10 -0
  65. package/dist/providers/index.js.map +1 -0
  66. package/dist/providers/registry.d.ts +29 -0
  67. package/dist/providers/registry.d.ts.map +1 -0
  68. package/dist/providers/registry.js +162 -0
  69. package/dist/providers/registry.js.map +1 -0
  70. package/dist/providers/router.d.ts +40 -0
  71. package/dist/providers/router.d.ts.map +1 -0
  72. package/dist/providers/router.js +88 -0
  73. package/dist/providers/router.js.map +1 -0
  74. package/dist/providers/types.d.ts +92 -0
  75. package/dist/providers/types.d.ts.map +1 -0
  76. package/dist/providers/types.js +27 -0
  77. package/dist/providers/types.js.map +1 -0
  78. package/dist/tools/ast-tools.d.ts +3 -3
  79. package/dist/tools/ast-tools.d.ts.map +1 -1
  80. package/dist/tools/ast-tools.js +205 -104
  81. package/dist/tools/ast-tools.js.map +1 -1
  82. package/package.json +1 -1
  83. package/scripts/claude-sisyphus.sh +9 -0
  84. package/scripts/install.sh +156 -62
  85. package/scripts/keyword-detector.sh +71 -0
  86. package/scripts/persistent-mode.sh +300 -0
  87. package/scripts/post-tool-verifier.sh +196 -0
  88. package/scripts/pre-tool-enforcer.sh +76 -0
  89. package/scripts/sisyphus-aliases.sh +18 -0
  90. package/scripts/stop-continuation.sh +31 -0
  91. package/scripts/uninstall.sh +129 -5
@@ -25,10 +25,17 @@ if ! command -v claude &> /dev/null; then
25
25
  echo -e "${YELLOW}Warning: 'claude' command not found. Please install Claude Code first:${NC}"
26
26
  echo " curl -fsSL https://claude.ai/install.sh | bash"
27
27
  echo ""
28
- read -p "Continue anyway? (y/N) " -n 1 -r
29
- echo
30
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
31
- exit 1
28
+ # Check if running interactively (stdin is a terminal)
29
+ if [ -t 0 ]; then
30
+ read -p "Continue anyway? (y/N) " -n 1 -r
31
+ echo
32
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
33
+ exit 1
34
+ fi
35
+ else
36
+ # Non-interactive mode (piped from curl) - continue with installation
37
+ echo -e "${YELLOW}Non-interactive mode detected. Continuing installation...${NC}"
38
+ echo -e "${YELLOW}You can install Claude Code later with: curl -fsSL https://claude.ai/install.sh | bash${NC}"
32
39
  fi
33
40
  else
34
41
  echo -e "${GREEN}✓ Claude Code found${NC}"
@@ -275,53 +282,6 @@ Guidelines:
275
282
  - Identify dependencies and prerequisites
276
283
  AGENT_EOF
277
284
 
278
- # Orchestrator-Sisyphus Agent (Todo Coordinator)
279
- cat > "$CLAUDE_CONFIG_DIR/agents/orchestrator-sisyphus.md" << 'AGENT_EOF'
280
- ---
281
- name: orchestrator-sisyphus
282
- description: Master coordinator for todo lists. Reads requirements and delegates to specialist agents.
283
- tools: Read, Grep, Glob, Task, TodoWrite
284
- model: sonnet
285
- ---
286
-
287
- You are Orchestrator-Sisyphus, the master coordinator for complex multi-step tasks.
288
-
289
- Your responsibilities:
290
- 1. **Todo Management**: Break down complex tasks into atomic, trackable todos
291
- 2. **Delegation**: Route tasks to appropriate specialist agents
292
- 3. **Progress Tracking**: Monitor completion and handle blockers
293
- 4. **Verification**: Ensure all tasks are truly complete before finishing
294
-
295
- Delegation Routing:
296
- - Visual/UI tasks → frontend-engineer
297
- - Complex analysis → oracle
298
- - Documentation → document-writer
299
- - Quick searches → explore
300
- - Research → librarian
301
- - Image analysis → multimodal-looker
302
- - Plan review → momus
303
- - Pre-planning → metis
304
-
305
- Verification Protocol:
306
- 1. Check file existence for any created files
307
- 2. Run tests if applicable
308
- 3. Type check if TypeScript
309
- 4. Code review for quality
310
- 5. Verify acceptance criteria are met
311
-
312
- Persistent State:
313
- - Use `.sisyphus/notepads/` to track learnings and prevent repeated mistakes
314
- - Record blockers and their resolutions
315
- - Document decisions made during execution
316
-
317
- Guidelines:
318
- - Break tasks into atomic units (one clear action each)
319
- - Mark todos in_progress before starting, completed when done
320
- - Never mark a task complete without verification
321
- - Delegate to specialists rather than doing everything yourself
322
- - Report progress after each significant step
323
- AGENT_EOF
324
-
325
285
  # Sisyphus-Junior Agent (Focused Executor)
326
286
  cat > "$CLAUDE_CONFIG_DIR/agents/sisyphus-junior.md" << 'AGENT_EOF'
327
287
  ---
@@ -435,7 +395,7 @@ Guidelines:
435
395
  - Interview until you have enough information to plan
436
396
  AGENT_EOF
437
397
 
438
- echo -e "${GREEN}✓ Installed 11 agent definitions${NC}"
398
+ echo -e "${GREEN}✓ Installed 10 agent definitions${NC}"
439
399
 
440
400
  echo -e "${BLUE}[4/5]${NC} Installing slash commands..."
441
401
 
@@ -1036,6 +996,46 @@ echo -e "${GREEN}✓ Installed 3 skills${NC}"
1036
996
  echo -e "${BLUE}[6/8]${NC} Installing hook scripts..."
1037
997
  mkdir -p "$CLAUDE_CONFIG_DIR/hooks"
1038
998
 
999
+ # Ask user about silent auto-update preference (opt-in for security)
1000
+ CONFIG_FILE="$CLAUDE_CONFIG_DIR/.sisyphus-config.json"
1001
+ ENABLE_SILENT_UPDATE="false"
1002
+
1003
+ echo ""
1004
+ echo -e "${YELLOW}Silent Auto-Update Configuration${NC}"
1005
+ echo " Sisyphus can automatically check for and install updates in the background."
1006
+ echo " This runs without user interaction when you start Claude Code."
1007
+ echo ""
1008
+ echo -e "${YELLOW}Security Note:${NC} Silent updates download and execute code from GitHub."
1009
+ echo " You can always manually update using /update command instead."
1010
+ echo ""
1011
+
1012
+ if [ -t 0 ]; then
1013
+ read -p "Enable silent auto-updates? (y/N) " -n 1 -r
1014
+ echo
1015
+
1016
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
1017
+ ENABLE_SILENT_UPDATE="true"
1018
+ echo -e "${GREEN}✓ Silent auto-updates enabled${NC}"
1019
+ else
1020
+ ENABLE_SILENT_UPDATE="false"
1021
+ echo -e "${GREEN}✓ Silent auto-updates disabled (use /update to update manually)${NC}"
1022
+ fi
1023
+ else
1024
+ ENABLE_SILENT_UPDATE="false"
1025
+ echo -e "${GREEN}✓ Silent auto-updates disabled (non-interactive mode, use /update to update manually)${NC}"
1026
+ fi
1027
+
1028
+ # Save configuration
1029
+ cat > "$CONFIG_FILE" << CONFIG_EOF
1030
+ {
1031
+ "silentAutoUpdate": $ENABLE_SILENT_UPDATE,
1032
+ "configuredAt": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
1033
+ "configVersion": 1
1034
+ }
1035
+ CONFIG_EOF
1036
+ echo -e "${GREEN}✓ Saved configuration to $CONFIG_FILE${NC}"
1037
+ echo ""
1038
+
1039
1039
  # Keyword detector hook - detects ultrawork/ultrathink/search/analyze keywords
1040
1040
  cat > "$CLAUDE_CONFIG_DIR/hooks/keyword-detector.sh" << 'HOOK_EOF'
1041
1041
  #!/bin/bash
@@ -1058,9 +1058,10 @@ if command -v jq &> /dev/null; then
1058
1058
  ' 2>/dev/null)
1059
1059
  fi
1060
1060
 
1061
- # Fallback: simple grep extraction if jq fails
1061
+ # Fallback: portable extraction if jq fails (works on macOS and Linux)
1062
1062
  if [ -z "$PROMPT" ] || [ "$PROMPT" = "null" ]; then
1063
- PROMPT=$(echo "$INPUT" | grep -oP '"(prompt|content|text)"\s*:\s*"\K[^"]+' | head -1)
1063
+ # Use sed for portable JSON value extraction (no grep -P which is GNU-only)
1064
+ PROMPT=$(echo "$INPUT" | sed -n 's/.*"\(prompt\|content\|text\)"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\2/p' | head -1)
1064
1065
  fi
1065
1066
 
1066
1067
  # Exit if no prompt found
@@ -1150,12 +1151,14 @@ exit 0
1150
1151
  HOOK_EOF
1151
1152
  chmod +x "$CLAUDE_CONFIG_DIR/hooks/stop-continuation.sh"
1152
1153
 
1153
- # Silent auto-update hook - checks and applies updates without user awareness
1154
+ # Silent auto-update hook - checks and applies updates only if enabled
1154
1155
  cat > "$CLAUDE_CONFIG_DIR/hooks/silent-auto-update.sh" << 'HOOK_EOF'
1155
1156
  #!/bin/bash
1156
1157
  # Sisyphus Silent Auto-Update Hook
1157
- # Runs completely in the background to check for and apply updates
1158
- # without any user notification or interruption.
1158
+ # Runs completely in the background to check for and apply updates.
1159
+ #
1160
+ # SECURITY: This hook only runs if the user has explicitly enabled
1161
+ # silent auto-updates in ~/.claude/.sisyphus-config.json
1159
1162
  #
1160
1163
  # This hook is designed to be called on UserPromptSubmit events
1161
1164
  # but runs asynchronously so it doesn't block the user experience.
@@ -1167,6 +1170,7 @@ INPUT=$(cat)
1167
1170
  # The actual update check happens in the background
1168
1171
  (
1169
1172
  # Configuration
1173
+ CONFIG_FILE="$HOME/.claude/.sisyphus-config.json"
1170
1174
  VERSION_FILE="$HOME/.claude/.sisyphus-version.json"
1171
1175
  STATE_FILE="$HOME/.claude/.sisyphus-silent-update.json"
1172
1176
  LOG_FILE="$HOME/.claude/.sisyphus-update.log"
@@ -1178,6 +1182,61 @@ INPUT=$(cat)
1178
1182
  echo "[$(date -Iseconds)] $1" >> "$LOG_FILE" 2>/dev/null
1179
1183
  }
1180
1184
 
1185
+ # Check if silent auto-update is enabled in configuration
1186
+ is_enabled() {
1187
+ if [ ! -f "$CONFIG_FILE" ]; then
1188
+ # No config file = not explicitly enabled = disabled for security
1189
+ return 1
1190
+ fi
1191
+
1192
+ # Check silentAutoUpdate setting
1193
+ local enabled=""
1194
+ if command -v jq &> /dev/null; then
1195
+ enabled=$(jq -r '.silentAutoUpdate // false' "$CONFIG_FILE" 2>/dev/null)
1196
+ else
1197
+ # Fallback: simple grep
1198
+ enabled=$(grep -o '"silentAutoUpdate"[[:space:]]*:[[:space:]]*true' "$CONFIG_FILE" 2>/dev/null)
1199
+ if [ -n "$enabled" ]; then
1200
+ enabled="true"
1201
+ else
1202
+ enabled="false"
1203
+ fi
1204
+ fi
1205
+
1206
+ [ "$enabled" = "true" ]
1207
+ }
1208
+
1209
+ # Exit early if silent auto-update is disabled
1210
+ if ! is_enabled; then
1211
+ log "Silent auto-update is disabled (run installer to enable, or use /update)"
1212
+ exit 0
1213
+ fi
1214
+
1215
+ # Portable function to convert ISO date to epoch (works on Linux and macOS)
1216
+ iso_to_epoch() {
1217
+ local iso_date="$1"
1218
+ local epoch=""
1219
+
1220
+ # Try GNU date first (Linux)
1221
+ epoch=$(date -d "$iso_date" +%s 2>/dev/null)
1222
+ if [ $? -eq 0 ] && [ -n "$epoch" ]; then
1223
+ echo "$epoch"
1224
+ return 0
1225
+ fi
1226
+
1227
+ # Try BSD/macOS date (need to strip timezone suffix and reformat)
1228
+ # ISO format: 2024-01-15T10:30:00+00:00 or 2024-01-15T10:30:00Z
1229
+ local clean_date=$(echo "$iso_date" | sed 's/[+-][0-9][0-9]:[0-9][0-9]$//' | sed 's/Z$//' | sed 's/T/ /')
1230
+ epoch=$(date -j -f "%Y-%m-%d %H:%M:%S" "$clean_date" +%s 2>/dev/null)
1231
+ if [ $? -eq 0 ] && [ -n "$epoch" ]; then
1232
+ echo "$epoch"
1233
+ return 0
1234
+ fi
1235
+
1236
+ # Fallback: return 0 (will trigger update check)
1237
+ echo "0"
1238
+ }
1239
+
1181
1240
  # Check if we should check for updates (rate limiting)
1182
1241
  should_check() {
1183
1242
  if [ ! -f "$VERSION_FILE" ]; then
@@ -1193,8 +1252,8 @@ INPUT=$(cat)
1193
1252
  return 0 # No last check time - should check
1194
1253
  fi
1195
1254
 
1196
- # Calculate hours since last check
1197
- local last_check_epoch=$(date -d "$last_check" +%s 2>/dev/null || echo 0)
1255
+ # Calculate hours since last check (using portable iso_to_epoch)
1256
+ local last_check_epoch=$(iso_to_epoch "$last_check")
1198
1257
  local now_epoch=$(date +%s)
1199
1258
  local diff_hours=$(( (now_epoch - last_check_epoch) / 3600 ))
1200
1259
 
@@ -1273,6 +1332,35 @@ EOF
1273
1332
  fi
1274
1333
  }
1275
1334
 
1335
+ # Lock file management for concurrent install protection
1336
+ LOCK_FILE="$HOME/.claude/.sisyphus-update.lock"
1337
+ LOCK_TIMEOUT=300 # 5 minutes - stale lock threshold
1338
+
1339
+ acquire_lock() {
1340
+ # Check if lock exists and is stale
1341
+ if [ -f "$LOCK_FILE" ]; then
1342
+ local lock_time=$(cat "$LOCK_FILE" 2>/dev/null)
1343
+ local now=$(date +%s)
1344
+ local lock_age=$((now - lock_time))
1345
+
1346
+ if [ "$lock_age" -lt "$LOCK_TIMEOUT" ]; then
1347
+ log "Another update is in progress (lock age: ${lock_age}s)"
1348
+ return 1 # Lock is held by another process
1349
+ else
1350
+ log "Removing stale lock (age: ${lock_age}s)"
1351
+ rm -f "$LOCK_FILE"
1352
+ fi
1353
+ fi
1354
+
1355
+ # Create lock file with current timestamp
1356
+ echo "$(date +%s)" > "$LOCK_FILE"
1357
+ return 0
1358
+ }
1359
+
1360
+ release_lock() {
1361
+ rm -f "$LOCK_FILE" 2>/dev/null
1362
+ }
1363
+
1276
1364
  # Main logic
1277
1365
  main() {
1278
1366
  # Check rate limiting
@@ -1280,6 +1368,14 @@ EOF
1280
1368
  exit 0
1281
1369
  fi
1282
1370
 
1371
+ # Acquire lock to prevent concurrent installations
1372
+ if ! acquire_lock; then
1373
+ exit 0 # Another instance is updating, skip
1374
+ fi
1375
+
1376
+ # Ensure lock is released on exit
1377
+ trap release_lock EXIT
1378
+
1283
1379
  log "Starting silent update check..."
1284
1380
 
1285
1381
  local current_version=$(get_current_version)
@@ -1545,7 +1641,6 @@ Use the Task tool to delegate to specialized agents:
1545
1641
  | `multimodal-looker` | Sonnet | Visual analysis | Screenshots, diagrams |
1546
1642
  | `momus` | Opus | Plan review | Critical evaluation of plans |
1547
1643
  | `metis` | Opus | Pre-planning | Hidden requirements, risk analysis |
1548
- | `orchestrator-sisyphus` | Sonnet | Todo coordination | Complex multi-step task management |
1549
1644
  | `sisyphus-junior` | Sonnet | Focused execution | Direct task implementation |
1550
1645
  | `prometheus` | Opus | Strategic planning | Creating comprehensive work plans |
1551
1646
 
@@ -1638,7 +1733,7 @@ else
1638
1733
  fi
1639
1734
 
1640
1735
  # Save version metadata for auto-update system
1641
- VERSION="1.8.0"
1736
+ VERSION="1.10.3"
1642
1737
  VERSION_FILE="$CLAUDE_CONFIG_DIR/.sisyphus-version.json"
1643
1738
 
1644
1739
  cat > "$VERSION_FILE" << VERSION_EOF
@@ -1679,7 +1774,6 @@ echo " document-writer - Technical writing (Haiku)"
1679
1774
  echo " multimodal-looker - Visual analysis (Sonnet)"
1680
1775
  echo " momus - Plan review (Opus)"
1681
1776
  echo " metis - Pre-planning analysis (Opus)"
1682
- echo " orchestrator-sisyphus - Todo coordination (Sonnet)"
1683
1777
  echo " sisyphus-junior - Focused execution (Sonnet)"
1684
1778
  echo " prometheus - Strategic planning (Opus)"
1685
1779
  echo ""
@@ -0,0 +1,71 @@
1
+ #!/bin/bash
2
+ # Sisyphus Keyword Detector Hook
3
+ # Detects ultrawork/ultrathink/search/analyze keywords and injects enhanced mode messages
4
+
5
+ # Read stdin (JSON input from Claude Code)
6
+ INPUT=$(cat)
7
+
8
+ # Extract the prompt text - try multiple JSON paths
9
+ PROMPT=""
10
+ if command -v jq &> /dev/null; then
11
+ PROMPT=$(echo "$INPUT" | jq -r '
12
+ if .prompt then .prompt
13
+ elif .message.content then .message.content
14
+ elif .parts then ([.parts[] | select(.type == "text") | .text] | join(" "))
15
+ else ""
16
+ end
17
+ ' 2>/dev/null)
18
+ fi
19
+
20
+ # Fallback: simple grep extraction if jq fails
21
+ if [ -z "$PROMPT" ] || [ "$PROMPT" = "null" ]; then
22
+ PROMPT=$(echo "$INPUT" | grep -oP '"(prompt|content|text)"\s*:\s*"\K[^"]+' | head -1)
23
+ fi
24
+
25
+ # Exit if no prompt found
26
+ if [ -z "$PROMPT" ]; then
27
+ echo '{"continue": true}'
28
+ exit 0
29
+ fi
30
+
31
+ # Remove code blocks before checking keywords
32
+ PROMPT_NO_CODE=$(echo "$PROMPT" | sed 's/```[^`]*```//g' | sed 's/`[^`]*`//g')
33
+
34
+ # Convert to lowercase
35
+ PROMPT_LOWER=$(echo "$PROMPT_NO_CODE" | tr '[:upper:]' '[:lower:]')
36
+
37
+ # Check for ultrawork keywords (highest priority)
38
+ if echo "$PROMPT_LOWER" | grep -qE '\b(ultrawork|ulw)\b'; then
39
+ cat << 'EOF'
40
+ {"continue": true, "message": "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## AGENT UTILIZATION PRINCIPLES\n- **Codebase Exploration**: Spawn exploration agents using BACKGROUND TASKS\n- **Documentation & References**: Use librarian-type agents via BACKGROUND TASKS\n- **Planning & Strategy**: NEVER plan yourself - spawn planning agent\n- **High-IQ Reasoning**: Use oracle for architecture decisions\n- **Frontend/UI Tasks**: Delegate to frontend-engineer\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY.\n- **PARALLEL**: Fire independent calls simultaneously - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use Task(run_in_background=true) for exploration (10+ concurrent).\n- **VERIFY**: Check ALL requirements met before done.\n- **DELEGATE**: Orchestrate specialized agents.\n\n## ZERO TOLERANCE\n- NO Scope Reduction - deliver FULL implementation\n- NO Partial Completion - finish 100%\n- NO Premature Stopping - ALL TODOs must be complete\n- NO TEST DELETION - fix code, not tests\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X.\n\n</ultrawork-mode>\n\n---\n"}
41
+ EOF
42
+ exit 0
43
+ fi
44
+
45
+ # Check for ultrathink/think keywords
46
+ if echo "$PROMPT_LOWER" | grep -qE '\b(ultrathink|think)\b'; then
47
+ cat << 'EOF'
48
+ {"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"}
49
+ EOF
50
+ exit 0
51
+ fi
52
+
53
+ # Check for search keywords
54
+ if echo "$PROMPT_LOWER" | grep -qE '\b(search|find|locate|lookup|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all'; then
55
+ cat << 'EOF'
56
+ {"continue": true, "message": "<search-mode>\nMAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:\n- explore agents (codebase patterns, file structures)\n- librarian agents (remote repos, official docs, GitHub examples)\nPlus direct tools: Grep, Glob\nNEVER stop at first result - be exhaustive.\n</search-mode>\n\n---\n"}
57
+ EOF
58
+ exit 0
59
+ fi
60
+
61
+ # Check for analyze keywords
62
+ if echo "$PROMPT_LOWER" | grep -qE '\b(analyze|analyse|investigate|examine|research|study|deep.?dive|inspect|audit|evaluate|assess|review|diagnose|scrutinize|dissect|debug|comprehend|interpret|breakdown|understand)\b|why\s+is|how\s+does|how\s+to'; then
63
+ cat << 'EOF'
64
+ {"continue": true, "message": "<analyze-mode>\nANALYSIS MODE. Gather context before diving deep:\n\nCONTEXT GATHERING (parallel):\n- 1-2 explore agents (codebase patterns, implementations)\n- 1-2 librarian agents (if external library involved)\n- Direct tools: Grep, Glob, LSP for targeted searches\n\nIF COMPLEX (architecture, multi-system, debugging after 2+ failures):\n- Consult oracle agent for strategic guidance\n\nSYNTHESIZE findings before proceeding.\n</analyze-mode>\n\n---\n"}
65
+ EOF
66
+ exit 0
67
+ fi
68
+
69
+ # No keywords detected
70
+ echo '{"continue": true}'
71
+ exit 0