claudecode-omc 4.8.2 → 4.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +3 -3
- package/README.de.md +60 -0
- package/README.es.md +60 -0
- package/README.fr.md +60 -0
- package/README.it.md +60 -0
- package/README.ja.md +60 -0
- package/README.ko.md +60 -0
- package/README.md +101 -16
- package/README.pt.md +60 -0
- package/README.ru.md +60 -0
- package/README.tr.md +60 -0
- package/README.vi.md +60 -0
- package/README.zh.md +60 -0
- package/agents/code-reviewer.md +107 -6
- package/agents/critic.md +212 -42
- package/agents/debugger.md +52 -4
- package/agents/document-specialist.md +39 -60
- package/agents/executor.md +29 -9
- package/agents/explore.md +3 -1
- package/agents/security-reviewer.md +57 -0
- package/agents/test-engineer.md +21 -0
- package/agents/verifier.md +2 -0
- package/agents/writer.md +2 -0
- package/bridge/cli.cjs +7402 -3580
- package/bridge/mcp-server.cjs +558 -43
- package/bridge/runtime-cli.cjs +3034 -1801
- package/bridge/team-bridge.cjs +25 -1
- package/bridge/team-mcp.cjs +257 -88
- package/bridge/team.js +5226 -413
- package/dist/__tests__/agent-boundary-guidance.test.d.ts +2 -0
- package/dist/__tests__/agent-boundary-guidance.test.d.ts.map +1 -0
- package/dist/__tests__/agent-boundary-guidance.test.js +48 -0
- package/dist/__tests__/agent-boundary-guidance.test.js.map +1 -0
- package/dist/__tests__/agent-registry.test.js +48 -11
- package/dist/__tests__/agent-registry.test.js.map +1 -1
- package/dist/__tests__/auto-slash-aliases.test.js +25 -0
- package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
- package/dist/__tests__/bedrock-model-routing.test.d.ts +21 -0
- package/dist/__tests__/bedrock-model-routing.test.d.ts.map +1 -0
- package/dist/__tests__/bedrock-model-routing.test.js +397 -0
- package/dist/__tests__/bedrock-model-routing.test.js.map +1 -0
- package/dist/__tests__/cleanup-validation.test.js +7 -3
- package/dist/__tests__/cleanup-validation.test.js.map +1 -1
- package/dist/__tests__/cli-win32-warning.test.js +15 -2
- package/dist/__tests__/cli-win32-warning.test.js.map +1 -1
- package/dist/__tests__/consolidation-contracts.test.js +27 -3
- package/dist/__tests__/consolidation-contracts.test.js.map +1 -1
- package/dist/__tests__/context-guard-stop.test.d.ts +2 -0
- package/dist/__tests__/context-guard-stop.test.d.ts.map +1 -0
- package/dist/__tests__/context-guard-stop.test.js +58 -0
- package/dist/__tests__/context-guard-stop.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcer.test.js +76 -11
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +62 -1
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hooks.test.js +165 -4
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/hud/defaults.test.js +4 -0
- package/dist/__tests__/hud/defaults.test.js.map +1 -1
- package/dist/__tests__/hud/limits-error.test.js +2 -4
- package/dist/__tests__/hud/limits-error.test.js.map +1 -1
- package/dist/__tests__/hud/mission-board-state.test.d.ts +2 -0
- package/dist/__tests__/hud/mission-board-state.test.d.ts.map +1 -0
- package/dist/__tests__/hud/mission-board-state.test.js +170 -0
- package/dist/__tests__/hud/mission-board-state.test.js.map +1 -0
- package/dist/__tests__/hud/mission-board.test.d.ts +2 -0
- package/dist/__tests__/hud/mission-board.test.d.ts.map +1 -0
- package/dist/__tests__/hud/mission-board.test.js +143 -0
- package/dist/__tests__/hud/mission-board.test.js.map +1 -0
- package/dist/__tests__/hud/rate-limits-error.test.js +13 -0
- package/dist/__tests__/hud/rate-limits-error.test.js.map +1 -1
- package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts +8 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.d.ts.map +1 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js +145 -0
- package/dist/__tests__/hud/render-rate-limits-priority.test.js.map +1 -0
- package/dist/__tests__/hud/render.test.js +22 -0
- package/dist/__tests__/hud/render.test.js.map +1 -1
- package/dist/__tests__/hud/stale-indicator.test.d.ts +9 -0
- package/dist/__tests__/hud/stale-indicator.test.d.ts.map +1 -0
- package/dist/__tests__/hud/stale-indicator.test.js +81 -0
- package/dist/__tests__/hud/stale-indicator.test.js.map +1 -0
- package/dist/__tests__/hud/state.test.js +30 -0
- package/dist/__tests__/hud/state.test.js.map +1 -1
- package/dist/__tests__/hud/usage-api-lock.test.d.ts +2 -0
- package/dist/__tests__/hud/usage-api-lock.test.d.ts.map +1 -0
- package/dist/__tests__/hud/usage-api-lock.test.js +245 -0
- package/dist/__tests__/hud/usage-api-lock.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api-stale.test.d.ts +9 -0
- package/dist/__tests__/hud/usage-api-stale.test.d.ts.map +1 -0
- package/dist/__tests__/hud/usage-api-stale.test.js +297 -0
- package/dist/__tests__/hud/usage-api-stale.test.js.map +1 -0
- package/dist/__tests__/hud/usage-api.test.js +223 -0
- package/dist/__tests__/hud/usage-api.test.js.map +1 -1
- package/dist/__tests__/hud/watch-mode-init.test.d.ts +2 -0
- package/dist/__tests__/hud/watch-mode-init.test.d.ts.map +1 -0
- package/dist/__tests__/hud/watch-mode-init.test.js +133 -0
- package/dist/__tests__/hud/watch-mode-init.test.js.map +1 -0
- package/dist/__tests__/hud-agents.test.js +12 -10
- package/dist/__tests__/hud-agents.test.js.map +1 -1
- package/dist/__tests__/hud-build-guidance.test.js +6 -2
- package/dist/__tests__/hud-build-guidance.test.js.map +1 -1
- package/dist/__tests__/hud-marketplace-resolution.test.d.ts +2 -0
- package/dist/__tests__/hud-marketplace-resolution.test.d.ts.map +1 -0
- package/dist/__tests__/hud-marketplace-resolution.test.js +53 -0
- package/dist/__tests__/hud-marketplace-resolution.test.js.map +1 -0
- package/dist/__tests__/installer-hud-skip.test.js +12 -0
- package/dist/__tests__/installer-hud-skip.test.js.map +1 -1
- package/dist/__tests__/installer-plugin-agents.test.d.ts +2 -0
- package/dist/__tests__/installer-plugin-agents.test.d.ts.map +1 -0
- package/dist/__tests__/installer-plugin-agents.test.js +111 -0
- package/dist/__tests__/installer-plugin-agents.test.js.map +1 -0
- package/dist/__tests__/installer-version-guard.test.d.ts +2 -0
- package/dist/__tests__/installer-version-guard.test.d.ts.map +1 -0
- package/dist/__tests__/installer-version-guard.test.js +75 -0
- package/dist/__tests__/installer-version-guard.test.js.map +1 -0
- package/dist/__tests__/installer.test.js +58 -4
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/omc-tools-server.test.js +8 -5
- package/dist/__tests__/omc-tools-server.test.js.map +1 -1
- package/dist/__tests__/pre-tool-enforcer.test.js +38 -0
- package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
- package/dist/__tests__/prompt-injection.test.js +3 -3
- package/dist/__tests__/prompt-injection.test.js.map +1 -1
- package/dist/__tests__/ralph-prd-mandatory.test.js +53 -2
- package/dist/__tests__/ralph-prd-mandatory.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js +42 -0
- package/dist/__tests__/rate-limit-wait/rate-limit-monitor.test.js.map +1 -1
- package/dist/__tests__/rate-limit-wait/tmux-detector.test.js +1 -1
- package/dist/__tests__/session-history-search.test.d.ts +2 -0
- package/dist/__tests__/session-history-search.test.d.ts.map +1 -0
- package/dist/__tests__/session-history-search.test.js +115 -0
- package/dist/__tests__/session-history-search.test.js.map +1 -0
- package/dist/__tests__/session-start-script-context.test.d.ts +2 -0
- package/dist/__tests__/session-start-script-context.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-script-context.test.js +49 -0
- package/dist/__tests__/session-start-script-context.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +81 -24
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/__tests__/standalone-server.test.js +8 -4
- package/dist/__tests__/standalone-server.test.js.map +1 -1
- package/dist/__tests__/tier0-docs-consistency.test.js +10 -2
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +5 -15
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +48 -49
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/document-specialist.d.ts +1 -1
- package/dist/agents/document-specialist.d.ts.map +1 -1
- package/dist/agents/document-specialist.js +46 -21
- package/dist/agents/document-specialist.js.map +1 -1
- package/dist/agents/explore.d.ts.map +1 -1
- package/dist/agents/explore.js +3 -2
- package/dist/agents/explore.js.map +1 -1
- package/dist/agents/index.d.ts +2 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +3 -6
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/cli/__tests__/ask.test.js +255 -8
- package/dist/cli/__tests__/ask.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search-help.test.js +13 -0
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
- package/dist/cli/__tests__/session-search.test.d.ts +2 -0
- package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
- package/dist/cli/__tests__/session-search.test.js +72 -0
- package/dist/cli/__tests__/session-search.test.js.map +1 -0
- package/dist/cli/__tests__/team-help.test.js +1 -1
- package/dist/cli/__tests__/team-help.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +256 -4
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/__tests__/team.test.js +52 -2
- package/dist/cli/commands/__tests__/team.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +15 -1
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/session-search.d.ts +18 -0
- package/dist/cli/commands/session-search.d.ts.map +1 -0
- package/dist/cli/commands/session-search.js +47 -0
- package/dist/cli/commands/session-search.js.map +1 -0
- package/dist/cli/commands/team.d.ts +11 -0
- package/dist/cli/commands/team.d.ts.map +1 -1
- package/dist/cli/commands/team.js +94 -24
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +12 -1
- package/dist/cli/commands/wait.js.map +1 -1
- package/dist/cli/index.js +70 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +100 -214
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/win32-warning.d.ts +2 -1
- package/dist/cli/win32-warning.d.ts.map +1 -1
- package/dist/cli/win32-warning.js +20 -6
- package/dist/cli/win32-warning.js.map +1 -1
- package/dist/config/__tests__/loader.test.d.ts +2 -0
- package/dist/config/__tests__/loader.test.d.ts.map +1 -0
- package/dist/config/__tests__/loader.test.js +145 -0
- package/dist/config/__tests__/loader.test.js.map +1 -0
- package/dist/config/__tests__/models.test.d.ts +2 -0
- package/dist/config/__tests__/models.test.d.ts.map +1 -0
- package/dist/config/__tests__/models.test.js +147 -0
- package/dist/config/__tests__/models.test.js.map +1 -0
- package/dist/config/__tests__/test-helpers.d.ts +3 -0
- package/dist/config/__tests__/test-helpers.d.ts.map +1 -0
- package/dist/config/__tests__/test-helpers.js +19 -0
- package/dist/config/__tests__/test-helpers.js.map +1 -0
- package/dist/config/loader.d.ts +3 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +140 -126
- package/dist/config/loader.js.map +1 -1
- package/dist/config/models.d.ts +29 -10
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +96 -10
- package/dist/config/models.js.map +1 -1
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +8 -1
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/builtin-skills/types.d.ts +3 -0
- package/dist/features/builtin-skills/types.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.d.ts +5 -12
- package/dist/features/delegation-enforcer.d.ts.map +1 -1
- package/dist/features/delegation-enforcer.js +48 -54
- package/dist/features/delegation-enforcer.js.map +1 -1
- package/dist/features/delegation-routing/__tests__/resolver.test.js +4 -3
- package/dist/features/delegation-routing/__tests__/resolver.test.js.map +1 -1
- package/dist/features/delegation-routing/types.d.ts.map +1 -1
- package/dist/features/delegation-routing/types.js +7 -4
- package/dist/features/delegation-routing/types.js.map +1 -1
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +2 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/rate-limit-wait/daemon.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/daemon.js +8 -5
- package/dist/features/rate-limit-wait/daemon.js.map +1 -1
- package/dist/features/rate-limit-wait/index.d.ts +1 -1
- package/dist/features/rate-limit-wait/index.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/index.js +1 -1
- package/dist/features/rate-limit-wait/index.js.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts +9 -0
- package/dist/features/rate-limit-wait/rate-limit-monitor.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/rate-limit-monitor.js +38 -0
- package/dist/features/rate-limit-wait/rate-limit-monitor.js.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts +2 -1
- package/dist/features/rate-limit-wait/tmux-detector.d.ts.map +1 -1
- package/dist/features/rate-limit-wait/tmux-detector.js +8 -9
- package/dist/features/rate-limit-wait/tmux-detector.js.map +1 -1
- package/dist/features/rate-limit-wait/types.d.ts +11 -0
- package/dist/features/rate-limit-wait/types.d.ts.map +1 -1
- package/dist/features/session-history-search/index.d.ts +6 -0
- package/dist/features/session-history-search/index.d.ts.map +1 -0
- package/dist/features/session-history-search/index.js +480 -0
- package/dist/features/session-history-search/index.js.map +1 -0
- package/dist/features/session-history-search/types.d.ts +36 -0
- package/dist/features/session-history-search/types.d.ts.map +1 -0
- package/dist/features/session-history-search/types.js +2 -0
- package/dist/features/session-history-search/types.js.map +1 -0
- package/dist/hooks/__tests__/background-process-guard.test.js +101 -5
- package/dist/hooks/__tests__/background-process-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-openclaw.test.js +16 -5
- package/dist/hooks/__tests__/bridge-openclaw.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge-routing.test.js +48 -1
- package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
- package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/executor.js +9 -1
- package/dist/hooks/auto-slash-command/executor.js.map +1 -1
- package/dist/hooks/auto-slash-command/types.d.ts +2 -0
- package/dist/hooks/auto-slash-command/types.d.ts.map +1 -1
- package/dist/hooks/auto-slash-command/types.js +0 -7
- package/dist/hooks/auto-slash-command/types.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -3
- package/dist/hooks/autopilot/prompts.js +1 -1
- package/dist/hooks/bridge-normalize.d.ts.map +1 -1
- package/dist/hooks/bridge-normalize.js +2 -0
- package/dist/hooks/bridge-normalize.js.map +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +248 -39
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/keyword-detector/__tests__/index.test.js +41 -0
- 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 +3 -1
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/permission-handler/index.d.ts +8 -0
- package/dist/hooks/permission-handler/index.d.ts.map +1 -1
- package/dist/hooks/permission-handler/index.js +76 -0
- package/dist/hooks/permission-handler/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js +90 -0
- package/dist/hooks/persistent-mode/__tests__/ralph-verification-flow.test.js.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts +2 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +535 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +296 -21
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +156 -0
- package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/integration.test.js +27 -2
- package/dist/hooks/project-memory/__tests__/integration.test.js.map +1 -1
- package/dist/hooks/project-memory/__tests__/storage.test.js +37 -0
- package/dist/hooks/project-memory/__tests__/storage.test.js.map +1 -1
- package/dist/hooks/project-memory/storage.d.ts +1 -1
- package/dist/hooks/project-memory/storage.d.ts.map +1 -1
- package/dist/hooks/project-memory/storage.js +5 -4
- package/dist/hooks/project-memory/storage.js.map +1 -1
- package/dist/hooks/ralph/index.d.ts +1 -1
- package/dist/hooks/ralph/index.d.ts.map +1 -1
- package/dist/hooks/ralph/index.js +1 -1
- package/dist/hooks/ralph/index.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +18 -0
- package/dist/hooks/ralph/loop.d.ts.map +1 -1
- package/dist/hooks/ralph/loop.js +31 -0
- package/dist/hooks/ralph/loop.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +4 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +56 -21
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
- package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
- package/dist/hooks/recovery/__tests__/storage.test.js +65 -0
- package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
- package/dist/hooks/recovery/storage.d.ts +5 -1
- package/dist/hooks/recovery/storage.d.ts.map +1 -1
- package/dist/hooks/recovery/storage.js +7 -29
- package/dist/hooks/recovery/storage.js.map +1 -1
- package/dist/hooks/recovery/types.d.ts +1 -1
- package/dist/hooks/recovery/types.d.ts.map +1 -1
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js +140 -0
- package/dist/hooks/session-end/__tests__/duplicate-notifications.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts +2 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.d.ts.map +1 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js +122 -0
- package/dist/hooks/session-end/__tests__/mode-state-cleanup.test.js.map +1 -0
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js +38 -12
- package/dist/hooks/session-end/__tests__/openclaw-session-end.test.js.map +1 -1
- package/dist/hooks/session-end/callbacks.d.ts +4 -1
- package/dist/hooks/session-end/callbacks.d.ts.map +1 -1
- package/dist/hooks/session-end/callbacks.js +5 -4
- package/dist/hooks/session-end/callbacks.js.map +1 -1
- package/dist/hooks/session-end/index.d.ts.map +1 -1
- package/dist/hooks/session-end/index.js +162 -36
- package/dist/hooks/session-end/index.js.map +1 -1
- package/dist/hooks/skill-state/__tests__/skill-state.test.js +35 -33
- package/dist/hooks/skill-state/__tests__/skill-state.test.js.map +1 -1
- package/dist/hooks/skill-state/index.d.ts +3 -3
- package/dist/hooks/skill-state/index.d.ts.map +1 -1
- package/dist/hooks/skill-state/index.js +7 -11
- package/dist/hooks/skill-state/index.js.map +1 -1
- package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
- package/dist/hooks/subagent-tracker/index.js +22 -0
- package/dist/hooks/subagent-tracker/index.js.map +1 -1
- package/dist/hooks/think-mode/__tests__/index.test.js +20 -20
- package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -1
- package/dist/hooks/think-mode/switcher.d.ts.map +1 -1
- package/dist/hooks/think-mode/switcher.js +13 -10
- package/dist/hooks/think-mode/switcher.js.map +1 -1
- package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts +2 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.d.ts.map +1 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.js +56 -0
- package/dist/hooks/thinking-block-validator/__tests__/index.test.js.map +1 -0
- package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -1
- package/dist/hooks/thinking-block-validator/index.js +7 -6
- package/dist/hooks/thinking-block-validator/index.js.map +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +6 -0
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +14 -5
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hud/elements/agents.d.ts.map +1 -1
- package/dist/hud/elements/agents.js +8 -14
- package/dist/hud/elements/agents.js.map +1 -1
- 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 +3 -3
- package/dist/hud/elements/limits.d.ts.map +1 -1
- package/dist/hud/elements/limits.js +26 -18
- package/dist/hud/elements/limits.js.map +1 -1
- package/dist/hud/elements/mission-board.d.ts +2 -0
- package/dist/hud/elements/mission-board.d.ts.map +1 -0
- package/dist/hud/elements/mission-board.js +2 -0
- package/dist/hud/elements/mission-board.js.map +1 -0
- package/dist/hud/index.d.ts +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +10 -2
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/mission-board.d.ts +75 -0
- package/dist/hud/mission-board.d.ts.map +1 -0
- package/dist/hud/mission-board.js +420 -0
- package/dist/hud/mission-board.js.map +1 -0
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +16 -8
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +13 -0
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +11 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js +10 -0
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +207 -106
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/installer/__tests__/claude-md-merge.test.js +53 -9
- package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.d.ts +2 -0
- package/dist/installer/__tests__/hook-templates.test.d.ts.map +1 -0
- package/dist/installer/__tests__/hook-templates.test.js +76 -0
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -0
- package/dist/installer/hooks.d.ts +15 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +51 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +25 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +273 -64
- package/dist/installer/index.js.map +1 -1
- package/dist/lib/mode-names.d.ts.map +1 -1
- package/dist/lib/mode-names.js +2 -0
- package/dist/lib/mode-names.js.map +1 -1
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js +30 -3
- package/dist/mcp/__tests__/team-server-artifact-convergence.test.js.map +1 -1
- package/dist/mcp/__tests__/team-server-deprecation.test.js +2 -0
- package/dist/mcp/__tests__/team-server-deprecation.test.js.map +1 -1
- package/dist/mcp/team-job-convergence.d.ts.map +1 -1
- package/dist/mcp/team-job-convergence.js +12 -3
- package/dist/mcp/team-job-convergence.js.map +1 -1
- package/dist/mcp/team-server.d.ts.map +1 -1
- package/dist/mcp/team-server.js +18 -4
- package/dist/mcp/team-server.js.map +1 -1
- package/dist/notifications/__tests__/config-merge.test.js +36 -1
- package/dist/notifications/__tests__/config-merge.test.js.map +1 -1
- package/dist/notifications/__tests__/formatter.test.js +13 -5
- package/dist/notifications/__tests__/formatter.test.js.map +1 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.js +27 -1
- package/dist/notifications/__tests__/notify-registry-integration.test.js.map +1 -1
- package/dist/notifications/__tests__/verbosity.test.js +33 -1
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
- package/dist/notifications/config.d.ts +7 -0
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +18 -0
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/formatter.d.ts +2 -2
- package/dist/notifications/formatter.d.ts.map +1 -1
- package/dist/notifications/formatter.js +7 -6
- package/dist/notifications/formatter.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +5 -3
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/template-engine.js +1 -1
- package/dist/notifications/template-engine.js.map +1 -1
- package/dist/notifications/types.d.ts +4 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +26 -0
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/__tests__/index.test.js +42 -0
- package/dist/openclaw/__tests__/index.test.js.map +1 -1
- package/dist/openclaw/__tests__/signal.test.d.ts +2 -0
- package/dist/openclaw/__tests__/signal.test.d.ts.map +1 -0
- package/dist/openclaw/__tests__/signal.test.js +69 -0
- package/dist/openclaw/__tests__/signal.test.js.map +1 -0
- package/dist/openclaw/dispatcher.d.ts +5 -1
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +13 -2
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/openclaw/index.d.ts +2 -1
- package/dist/openclaw/index.d.ts.map +1 -1
- package/dist/openclaw/index.js +29 -15
- package/dist/openclaw/index.js.map +1 -1
- package/dist/openclaw/signal.d.ts +3 -0
- package/dist/openclaw/signal.d.ts.map +1 -0
- package/dist/openclaw/signal.js +215 -0
- package/dist/openclaw/signal.js.map +1 -0
- package/dist/openclaw/types.d.ts +35 -0
- package/dist/openclaw/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +2 -12
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +41 -11
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js +78 -0
- package/dist/team/__tests__/api-interop.cwd-resolution.test.js.map +1 -0
- package/dist/team/__tests__/api-interop.dispatch.test.d.ts +2 -0
- package/dist/team/__tests__/api-interop.dispatch.test.d.ts.map +1 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js +125 -0
- package/dist/team/__tests__/api-interop.dispatch.test.js.map +1 -0
- package/dist/team/__tests__/cli-detection.test.d.ts +2 -0
- package/dist/team/__tests__/cli-detection.test.d.ts.map +1 -0
- package/dist/team/__tests__/cli-detection.test.js +36 -0
- package/dist/team/__tests__/cli-detection.test.js.map +1 -0
- package/dist/team/__tests__/model-contract.test.js +79 -2
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/runtime-done-recovery.test.js +1 -0
- package/dist/team/__tests__/runtime-done-recovery.test.js.map +1 -1
- package/dist/team/__tests__/runtime-prompt-mode.test.js +84 -8
- package/dist/team/__tests__/runtime-prompt-mode.test.js.map +1 -1
- package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.js +237 -0
- package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js +103 -0
- package/dist/team/__tests__/runtime-v2.monitor.test.js.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts +2 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.d.ts.map +1 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js +49 -0
- package/dist/team/__tests__/runtime-v2.shutdown.test.js.map +1 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js +3 -0
- package/dist/team/__tests__/runtime-watchdog-retry.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.create-team.test.js +29 -12
- package/dist/team/__tests__/tmux-session.create-team.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js +6 -0
- package/dist/team/__tests__/tmux-session.kill-team-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +9 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +32 -3
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +153 -2
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/cli-detection.d.ts.map +1 -1
- package/dist/team/cli-detection.js +6 -2
- package/dist/team/cli-detection.js.map +1 -1
- package/dist/team/idle-nudge.js +1 -1
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/mcp-team-bridge.d.ts.map +1 -1
- package/dist/team/mcp-team-bridge.js +2 -1
- package/dist/team/mcp-team-bridge.js.map +1 -1
- package/dist/team/model-contract.d.ts +1 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +35 -4
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +10 -7
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime-v2.d.ts +4 -0
- package/dist/team/runtime-v2.d.ts.map +1 -1
- package/dist/team/runtime-v2.js +231 -59
- package/dist/team/runtime-v2.js.map +1 -1
- package/dist/team/runtime.d.ts +6 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +39 -14
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/tmux-session.d.ts +20 -11
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +108 -51
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/types.d.ts +1 -0
- package/dist/team/types.d.ts.map +1 -1
- package/dist/team/types.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +2 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +46 -12
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/tools/__tests__/memory-tools.test.js +29 -1
- package/dist/tools/__tests__/memory-tools.test.js.map +1 -1
- package/dist/tools/lsp/client.d.ts +11 -0
- package/dist/tools/lsp/client.d.ts.map +1 -1
- package/dist/tools/lsp/client.js +46 -0
- package/dist/tools/lsp/client.js.map +1 -1
- package/dist/tools/session-history-tools.d.ts +23 -0
- package/dist/tools/session-history-tools.d.ts.map +1 -0
- package/dist/tools/session-history-tools.js +41 -0
- package/dist/tools/session-history-tools.js.map +1 -0
- package/dist/tools/trace-tools.d.ts +9 -0
- package/dist/tools/trace-tools.d.ts.map +1 -1
- package/dist/tools/trace-tools.js +2 -1
- package/dist/tools/trace-tools.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +5 -0
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +22 -0
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/skill-pipeline.d.ts +9 -0
- package/dist/utils/skill-pipeline.d.ts.map +1 -0
- package/dist/utils/skill-pipeline.js +97 -0
- package/dist/utils/skill-pipeline.js.map +1 -0
- package/docs/AGENTS.md +1 -1
- package/docs/ANALYTICS-SYSTEM.md +23 -132
- package/docs/CLAUDE.md +40 -139
- package/docs/MIGRATION.md +4 -4
- package/docs/OPENCLAW-ROUTING.md +102 -0
- package/docs/PERFORMANCE-MONITORING.md +30 -55
- package/docs/REFERENCE.md +62 -35
- package/docs/TIERED_AGENTS_V2.md +3 -2
- package/docs/design/SKILL_AUDIT_1445.md +75 -0
- package/docs/ko/MIGRATION.md +2 -2
- package/docs/ko/REFERENCE.md +14 -22
- package/docs/partials/agent-tiers.md +11 -15
- package/docs/partials/features.md +2 -2
- package/docs/partials/mode-selection-guide.md +2 -2
- package/docs/shared/agent-tiers.md +11 -15
- package/docs/shared/features.md +2 -2
- package/docs/shared/mode-selection-guide.md +2 -2
- package/package.json +4 -1
- package/scripts/code-simplifier.mjs +1 -1
- package/scripts/context-guard-stop.mjs +26 -10
- package/scripts/keyword-detector.mjs +99 -39
- package/scripts/persistent-mode.cjs +295 -34
- package/scripts/persistent-mode.mjs +79 -21
- package/scripts/plugin-setup.mjs +10 -1
- package/scripts/post-tool-verifier.mjs +57 -3
- package/scripts/pre-tool-enforcer.mjs +207 -2
- package/scripts/run-provider-advisor.js +30 -3
- package/scripts/session-start.mjs +3 -3
- package/scripts/setup-claude-md.sh +159 -0
- package/scripts/setup-progress.sh +123 -0
- package/scripts/sync-metadata.ts +11 -1
- package/skills/AGENTS.md +13 -17
- package/skills/ai-slop-cleaner/SKILL.md +130 -0
- package/skills/analyze/SKILL.md +28 -73
- package/skills/ask/SKILL.md +51 -0
- package/skills/bdd-generator/SKILL.md +60 -0
- package/skills/ccg/SKILL.md +6 -6
- package/skills/deep-interview/SKILL.md +4 -0
- package/skills/e2e/SKILL.md +55 -0
- package/skills/electron-driver/SKILL.md +51 -0
- package/skills/electron-driver/scripts/driver-template.js +46 -0
- package/skills/multi-model-research/SKILL.md +51 -0
- package/skills/omc-doctor/SKILL.md +2 -2
- package/skills/omc-setup/SKILL.md +75 -1206
- package/skills/omc-setup/phases/01-install-claude-md.md +76 -0
- package/skills/omc-setup/phases/02-configure.md +211 -0
- package/skills/omc-setup/phases/03-integrations.md +192 -0
- package/skills/omc-setup/phases/04-welcome.md +192 -0
- package/skills/omc-teams/SKILL.md +35 -2
- package/skills/plan/SKILL.md +3 -0
- package/skills/planning-with-files/SKILL.md +49 -0
- package/skills/planning-with-files/examples.md +17 -0
- package/skills/planning-with-files/reference.md +21 -0
- package/skills/planning-with-files/scripts/check-complete.ps1 +28 -0
- package/skills/planning-with-files/scripts/check-complete.sh +31 -0
- package/skills/planning-with-files/scripts/init-session.ps1 +31 -0
- package/skills/planning-with-files/scripts/init-session.sh +36 -0
- package/skills/planning-with-files/scripts/session-catchup.py +66 -0
- package/skills/planning-with-files/templates/findings.md +24 -0
- package/skills/planning-with-files/templates/progress.md +38 -0
- package/skills/planning-with-files/templates/task_plan.md +53 -0
- package/skills/ralph/SKILL.md +16 -10
- package/skills/release/SKILL.md +4 -0
- package/skills/setup/SKILL.md +40 -0
- package/skills/start-dev/SKILL.md +45 -0
- package/skills/tdd-generator/SKILL.md +51 -0
- package/skills/team/SKILL.md +6 -6
- package/skills/test-coverage/SKILL.md +40 -0
- package/skills/test-gen/SKILL.md +70 -0
- package/templates/hooks/code-simplifier.mjs +1 -1
- package/templates/hooks/keyword-detector.mjs +100 -32
- package/templates/hooks/persistent-mode.mjs +43 -4
- package/templates/hooks/pre-tool-use.mjs +115 -1
- package/templates/hooks/session-start.mjs +1 -1
- package/agents/build-fixer.md +0 -90
- package/agents/deep-executor.md +0 -112
- package/agents/harsh-critic.md +0 -254
- package/agents/quality-reviewer.md +0 -151
- package/skills/ask-codex/SKILL.md +0 -47
- package/skills/ask-gemini/SKILL.md +0 -47
- package/skills/build-fix/SKILL.md +0 -123
- package/skills/code-review/SKILL.md +0 -573
- package/skills/configure-openclaw/SKILL.md +0 -383
- package/skills/learn-about-omc/SKILL.md +0 -37
- package/skills/note/SKILL.md +0 -62
- package/skills/omc-help/SKILL.md +0 -192
- package/skills/ralph-init/SKILL.md +0 -40
- package/skills/security-review/SKILL.md +0 -282
- package/skills/tdd/SKILL.md +0 -104
- package/skills/test-gen/skill.md +0 -531
- package/skills/trace/SKILL.md +0 -33
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-generator
|
|
3
|
+
description: Test-driven workflow for unit, component, and E2E testing. Enforces Red-Green-Refactor and generates the right test type for changed code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Generator
|
|
7
|
+
|
|
8
|
+
Use this skill to drive implementation through tests first.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Detect target type:
|
|
13
|
+
- Pure logic -> unit tests
|
|
14
|
+
- UI behavior -> component/integration tests
|
|
15
|
+
- User journeys -> E2E tests
|
|
16
|
+
2. RED:
|
|
17
|
+
- Write failing test first
|
|
18
|
+
3. GREEN:
|
|
19
|
+
- Implement minimal code to pass
|
|
20
|
+
4. REFACTOR:
|
|
21
|
+
- Improve structure while keeping tests green
|
|
22
|
+
5. Add regression cases for discovered bugs and edges.
|
|
23
|
+
|
|
24
|
+
## Recommended Stack
|
|
25
|
+
|
|
26
|
+
- Unit/component: Vitest + Testing Library
|
|
27
|
+
- E2E: Playwright
|
|
28
|
+
|
|
29
|
+
## E2E Agent Option
|
|
30
|
+
|
|
31
|
+
For large journey suites, you can run Playwright test agents:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx playwright test --init-agents
|
|
35
|
+
npx playwright test --agent=planner
|
|
36
|
+
npx playwright test --agent=generator
|
|
37
|
+
npx playwright test --agent=healer --repeat
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quality Rules
|
|
41
|
+
|
|
42
|
+
- Test behavior, not private implementation details.
|
|
43
|
+
- Prefer semantic queries (`getByRole`, `getByLabelText`) for UI tests.
|
|
44
|
+
- Keep one assertion intent per test case.
|
|
45
|
+
- Add explicit edge cases and failure-path coverage.
|
|
46
|
+
|
|
47
|
+
## References
|
|
48
|
+
|
|
49
|
+
- Playwright best practices: https://playwright.dev/docs/best-practices
|
|
50
|
+
- Vitest guide: https://vitest.dev/guide/
|
|
51
|
+
|
package/skills/team/SKILL.md
CHANGED
|
@@ -21,7 +21,7 @@ The `swarm` compatibility alias was removed in #1131.
|
|
|
21
21
|
### Parameters
|
|
22
22
|
|
|
23
23
|
- **N** - Number of teammate agents (1-20). Optional; defaults to auto-sizing based on task decomposition.
|
|
24
|
-
- **agent-type** - OMC agent to spawn for the `team-exec` stage (e.g., executor,
|
|
24
|
+
- **agent-type** - OMC agent to spawn for the `team-exec` stage (e.g., executor, debugger, designer, codex, gemini). Optional; defaults to stage-aware routing. Use `codex` to spawn Codex CLI workers or `gemini` for Gemini CLI workers (requires respective CLIs installed). See Stage Agent Routing below.
|
|
25
25
|
- **task** - High-level task to decompose and distribute among teammates
|
|
26
26
|
- **ralph** - Optional modifier. When present, wraps the team pipeline in Ralph's persistence loop (retry on failure, architect verification before completion). See Team + Ralph Composition below.
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ The `swarm` compatibility alias was removed in #1131.
|
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
/team 5:executor "fix all TypeScript errors across the project"
|
|
32
|
-
/team 3:
|
|
32
|
+
/team 3:debugger "fix build errors in src/"
|
|
33
33
|
/team 4:designer "implement responsive layouts for all page components"
|
|
34
34
|
/team "refactor the auth module with security review"
|
|
35
35
|
/team ralph "build a complete REST API for user management"
|
|
@@ -102,9 +102,9 @@ Each pipeline stage uses **specialized agents** -- not just executors. The lead
|
|
|
102
102
|
|-------|----------------|-----------------|-------------------|
|
|
103
103
|
| **team-plan** | `explore` (haiku), `planner` (opus) | `analyst` (opus), `architect` (opus) | Use `analyst` for unclear requirements. Use `architect` for systems with complex boundaries. |
|
|
104
104
|
| **team-prd** | `analyst` (opus) | `critic` (opus) | Use `critic` to challenge scope. |
|
|
105
|
-
| **team-exec** | `executor` (sonnet) | `
|
|
106
|
-
| **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus)
|
|
107
|
-
| **team-fix** | `executor` (sonnet) | `
|
|
105
|
+
| **team-exec** | `executor` (sonnet) | `executor` (opus), `debugger` (sonnet), `designer` (sonnet), `writer` (haiku), `test-engineer` (sonnet) | Match agent to subtask type. Use `executor` (model=opus) for complex autonomous work, `designer` for UI, `debugger` for compilation issues, `writer` for docs, `test-engineer` for test creation. |
|
|
106
|
+
| **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus) | Always run `verifier`. Add `security-reviewer` for auth/crypto changes. Add `code-reviewer` for >20 files or architectural changes. `code-reviewer` also covers style/formatting checks. |
|
|
107
|
+
| **team-fix** | `executor` (sonnet) | `debugger` (sonnet), `executor` (opus) | Use `debugger` for type/build errors and regression isolation. Use `executor` (model=opus) for complex multi-file fixes. |
|
|
108
108
|
|
|
109
109
|
**Routing rules:**
|
|
110
110
|
|
|
@@ -134,7 +134,7 @@ Each pipeline stage uses **specialized agents** -- not just executors. The lead
|
|
|
134
134
|
- Exit (fail): fix tasks are generated and control moves to `team-fix`.
|
|
135
135
|
- **team-fix**
|
|
136
136
|
- Entry: verification found defects/regressions/incomplete criteria.
|
|
137
|
-
- Agents: `executor`/`
|
|
137
|
+
- Agents: `executor`/`debugger` depending on defect type.
|
|
138
138
|
- Exit: fixes are complete and flow returns to `team-exec` then `team-verify`.
|
|
139
139
|
|
|
140
140
|
### Verify/Fix Loop and Stop Conditions
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-coverage
|
|
3
|
+
description: Analyze coverage, prioritize untested risk hotspots, generate missing tests, and verify threshold improvements.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test Coverage
|
|
7
|
+
|
|
8
|
+
Use this skill to close meaningful coverage gaps, not just raise percentages.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Run coverage:
|
|
13
|
+
- `pnpm test --coverage` or `npx vitest run --coverage`
|
|
14
|
+
2. Parse summary and rank low-coverage files by risk:
|
|
15
|
+
- Business-critical logic
|
|
16
|
+
- Error handling paths
|
|
17
|
+
- Security-sensitive branches
|
|
18
|
+
3. Generate targeted tests:
|
|
19
|
+
- Unit for pure functions
|
|
20
|
+
- Integration for service/API boundaries
|
|
21
|
+
- E2E for critical user journeys
|
|
22
|
+
4. Re-run coverage and report before/after delta.
|
|
23
|
+
|
|
24
|
+
## Coverage Rules
|
|
25
|
+
|
|
26
|
+
- Use thresholds per project policy; default target can start at 80%.
|
|
27
|
+
- Cover meaningful branches and failure modes, not only statements.
|
|
28
|
+
- Exclude generated/build/vendor files explicitly.
|
|
29
|
+
- Enable all-file analysis when feasible to avoid hidden zero-coverage files.
|
|
30
|
+
|
|
31
|
+
## Vitest Guidance
|
|
32
|
+
|
|
33
|
+
- Default provider is V8; use Istanbul if project requires instrumentation parity.
|
|
34
|
+
- Configure `coverage.include`, `coverage.exclude`, and `coverage.thresholds`.
|
|
35
|
+
|
|
36
|
+
## References
|
|
37
|
+
|
|
38
|
+
- Vitest coverage guide: https://vitest.dev/guide/coverage.html
|
|
39
|
+
- Vitest coverage config: https://vitest.dev/config/#coverage
|
|
40
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-gen
|
|
3
|
+
description: Post-change intelligent test generation workflow that detects stack, analyzes changed files, and produces acceptance plus regression tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test Generation Workflow
|
|
7
|
+
|
|
8
|
+
Use this skill after code changes to generate the right tests quickly.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### Phase 1: Detect context
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
omc test detect-stack
|
|
16
|
+
omc test changed
|
|
17
|
+
omc test analyze path/to/file
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Prefer `omc test changed` when the goal is to cover the current diff.
|
|
21
|
+
|
|
22
|
+
### Phase 2: Generate testing pack
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
omc test gen path/to/file
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Expected artifacts:
|
|
29
|
+
|
|
30
|
+
- test plan
|
|
31
|
+
- acceptance checklist
|
|
32
|
+
- regression checklist
|
|
33
|
+
|
|
34
|
+
### Phase 3: Write or update tests
|
|
35
|
+
|
|
36
|
+
Choose test depth by risk:
|
|
37
|
+
|
|
38
|
+
- Pure logic -> unit tests
|
|
39
|
+
- UI behavior -> component/integration tests
|
|
40
|
+
- Async I/O or cross-boundary behavior -> integration tests
|
|
41
|
+
- Critical user flows -> E2E tests
|
|
42
|
+
|
|
43
|
+
### Phase 4: Verify
|
|
44
|
+
|
|
45
|
+
Run the smallest targeted test command first, then broaden if needed.
|
|
46
|
+
|
|
47
|
+
If higher orchestration is needed, combine with:
|
|
48
|
+
|
|
49
|
+
- `/oh-my-claudecode:tdd-generator`
|
|
50
|
+
- `/oh-my-claudecode:test-coverage`
|
|
51
|
+
- `/oh-my-claudecode:ultraqa`
|
|
52
|
+
|
|
53
|
+
## Rules
|
|
54
|
+
|
|
55
|
+
- Do not stop at happy-path-only coverage.
|
|
56
|
+
- Add regression assertions for risk signals.
|
|
57
|
+
- Avoid implementation-detail-only tests.
|
|
58
|
+
- If no safe automated test can be added, provide a concrete manual regression checklist.
|
|
59
|
+
|
|
60
|
+
## Output
|
|
61
|
+
|
|
62
|
+
Always report:
|
|
63
|
+
|
|
64
|
+
1. analyzed target files
|
|
65
|
+
2. generated/updated test files
|
|
66
|
+
3. acceptance items covered
|
|
67
|
+
4. regression items covered
|
|
68
|
+
5. commands executed
|
|
69
|
+
6. remaining gaps
|
|
70
|
+
|
|
@@ -136,7 +136,7 @@ async function main() {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
process.stdout.write(
|
|
139
|
-
JSON.stringify({ decision: 'block', reason: buildMessage(files) }) + '\n',
|
|
139
|
+
JSON.stringify({ continue: false, decision: 'block', reason: buildMessage(files) }) + '\n',
|
|
140
140
|
);
|
|
141
141
|
} catch (error) {
|
|
142
142
|
try {
|
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
* 1. cancelomc/stopomc: Stop active modes
|
|
10
10
|
* 2. ralph: Persistence mode until task completion
|
|
11
11
|
* 3. autopilot: Full autonomous execution
|
|
12
|
-
* 4. team:
|
|
12
|
+
* 4. team: Explicit-only via /team (not auto-triggered)
|
|
13
13
|
* 5. ultrawork/ulw: Maximum parallel execution
|
|
14
|
-
* 6.
|
|
14
|
+
* 6. ccg: Claude-Codex-Gemini tri-model orchestration
|
|
15
15
|
* 7. ralplan: Iterative planning with consensus
|
|
16
|
-
* 8.
|
|
17
|
-
* 9.
|
|
18
|
-
* 10.
|
|
19
|
-
* 11.
|
|
20
|
-
* 12.
|
|
21
|
-
* 13.
|
|
16
|
+
* 8. deep interview: Socratic interview workflow
|
|
17
|
+
* 9. ai-slop-cleaner: Cleanup/deslop anti-slop workflow
|
|
18
|
+
* 10. tdd: Test-driven development
|
|
19
|
+
* 11. code review: Comprehensive review mode
|
|
20
|
+
* 12. security review: Security-focused review mode
|
|
21
|
+
* 13. ultrathink: Extended reasoning
|
|
22
|
+
* 14. deepsearch: Codebase search (restricted patterns)
|
|
23
|
+
* 15. analyze: Analysis mode (restricted patterns)
|
|
22
24
|
*/
|
|
23
25
|
|
|
24
26
|
import { writeFileSync, mkdirSync, existsSync, unlinkSync, readFileSync } from 'fs';
|
|
@@ -49,6 +51,40 @@ Use your extended thinking capabilities to provide the most thorough and well-re
|
|
|
49
51
|
---
|
|
50
52
|
`;
|
|
51
53
|
|
|
54
|
+
const ANALYZE_MESSAGE = `<analyze-mode>
|
|
55
|
+
ANALYSIS MODE. Gather context before diving deep:
|
|
56
|
+
- Search relevant code paths first
|
|
57
|
+
- Compare working vs broken behavior
|
|
58
|
+
- Synthesize findings before proposing changes
|
|
59
|
+
</analyze-mode>
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
const TDD_MESSAGE = `<tdd-mode>
|
|
65
|
+
[TDD MODE ACTIVATED]
|
|
66
|
+
Write or update tests first when practical, confirm they fail for the right reason, then implement the minimal fix and re-run verification.
|
|
67
|
+
</tdd-mode>
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
const CODE_REVIEW_MESSAGE = `<code-review-mode>
|
|
73
|
+
[CODE REVIEW MODE ACTIVATED]
|
|
74
|
+
Perform a comprehensive code review of the relevant changes or target area. Focus on correctness, maintainability, edge cases, regressions, and test adequacy before recommending changes.
|
|
75
|
+
</code-review-mode>
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
const SECURITY_REVIEW_MESSAGE = `<security-review-mode>
|
|
81
|
+
[SECURITY REVIEW MODE ACTIVATED]
|
|
82
|
+
Perform a focused security review of the relevant changes or target area. Check trust boundaries, auth/authz, data exposure, input validation, command/file access, secrets handling, and escalation risks before recommending changes.
|
|
83
|
+
</security-review-mode>
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
`;
|
|
87
|
+
|
|
52
88
|
// Extract prompt from various JSON structures
|
|
53
89
|
function extractPrompt(input) {
|
|
54
90
|
try {
|
|
@@ -69,6 +105,15 @@ function extractPrompt(input) {
|
|
|
69
105
|
}
|
|
70
106
|
|
|
71
107
|
// Sanitize text to prevent false positives from code blocks, XML tags, URLs, and file paths
|
|
108
|
+
const ANTI_SLOP_EXPLICIT_PATTERN = /\b(ai[\s-]?slop|anti[\s-]?slop|deslop|de[\s-]?slop)\b/i;
|
|
109
|
+
const ANTI_SLOP_ACTION_PATTERN = /\b(clean(?:\s*up)?|cleanup|refactor|simplify|dedupe|de-duplicate|prune)\b/i;
|
|
110
|
+
const ANTI_SLOP_SMELL_PATTERN = /\b(slop|duplicate(?:d|s)?|duplication|dead\s+code|unused\s+code|over[\s-]?abstract(?:ion|ed)?|wrapper\s+layers?|boundary\s+violations?|needless\s+abstractions?|unnecessary\s+abstractions?|ai[\s-]?generated|generated\s+code|tech\s+debt)\b/i;
|
|
111
|
+
|
|
112
|
+
function isAntiSlopCleanupRequest(text) {
|
|
113
|
+
return ANTI_SLOP_EXPLICIT_PATTERN.test(text) ||
|
|
114
|
+
(ANTI_SLOP_ACTION_PATTERN.test(text) && ANTI_SLOP_SMELL_PATTERN.test(text));
|
|
115
|
+
}
|
|
116
|
+
|
|
72
117
|
function sanitizeForKeywordDetection(text) {
|
|
73
118
|
return text
|
|
74
119
|
// 1. Strip XML-style tag blocks: <tag-name ...>...</tag-name> (multi-line, greedy on tag name)
|
|
@@ -229,8 +274,8 @@ function resolveConflicts(matches) {
|
|
|
229
274
|
// Team keyword detection removed — team is now explicit-only via /team skill.
|
|
230
275
|
|
|
231
276
|
// Sort by priority order
|
|
232
|
-
const priorityOrder = ['cancel','ralph','autopilot','ultrawork',
|
|
233
|
-
'
|
|
277
|
+
const priorityOrder = ['cancel','ralph','autopilot','ultrawork',
|
|
278
|
+
'ccg','ralplan','deep-interview','ai-slop-cleaner','tdd','code-review','security-review','ultrathink','deepsearch','analyze'];
|
|
234
279
|
resolved.sort((a, b) => priorityOrder.indexOf(a.name) - priorityOrder.indexOf(b.name));
|
|
235
280
|
|
|
236
281
|
return resolved;
|
|
@@ -337,10 +382,6 @@ async function main() {
|
|
|
337
382
|
matches.push({ name: 'ultrawork', args: '' });
|
|
338
383
|
}
|
|
339
384
|
|
|
340
|
-
// Pipeline keywords
|
|
341
|
-
if (/\bagent\s+pipeline\b/i.test(cleanPrompt) || /\bchain\s+agents\b/i.test(cleanPrompt)) {
|
|
342
|
-
matches.push({ name: 'pipeline', args: '' });
|
|
343
|
-
}
|
|
344
385
|
|
|
345
386
|
// CCG keywords (Claude-Codex-Gemini tri-model orchestration)
|
|
346
387
|
if (/\b(ccg|claude-codex-gemini)\b/i.test(cleanPrompt)) {
|
|
@@ -352,12 +393,33 @@ async function main() {
|
|
|
352
393
|
matches.push({ name: 'ralplan', args: '' });
|
|
353
394
|
}
|
|
354
395
|
|
|
396
|
+
// Deep interview keywords
|
|
397
|
+
if (/\b(deep[\s-]interview|ouroboros)\b/i.test(cleanPrompt)) {
|
|
398
|
+
matches.push({ name: 'deep-interview', args: '' });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// AI slop cleanup keywords
|
|
402
|
+
if (isAntiSlopCleanupRequest(cleanPrompt)) {
|
|
403
|
+
matches.push({ name: 'ai-slop-cleaner', args: '' });
|
|
404
|
+
}
|
|
405
|
+
|
|
355
406
|
// TDD keywords
|
|
356
407
|
if (/\b(tdd)\b/i.test(cleanPrompt) ||
|
|
357
|
-
/\btest\s+first\b/i.test(cleanPrompt)
|
|
408
|
+
/\btest\s+first\b/i.test(cleanPrompt) ||
|
|
409
|
+
/\bred\s+green\b/i.test(cleanPrompt)) {
|
|
358
410
|
matches.push({ name: 'tdd', args: '' });
|
|
359
411
|
}
|
|
360
412
|
|
|
413
|
+
// Code review keywords
|
|
414
|
+
if (/\b(code\s+review|review\s+code)\b/i.test(cleanPrompt)) {
|
|
415
|
+
matches.push({ name: 'code-review', args: '' });
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Security review keywords
|
|
419
|
+
if (/\b(security\s+review|review\s+security)\b/i.test(cleanPrompt)) {
|
|
420
|
+
matches.push({ name: 'security-review', args: '' });
|
|
421
|
+
}
|
|
422
|
+
|
|
361
423
|
// Ultrathink keywords
|
|
362
424
|
if (/\b(ultrathink)\b/i.test(cleanPrompt)) {
|
|
363
425
|
matches.push({ name: 'ultrathink', args: '' });
|
|
@@ -396,7 +458,7 @@ async function main() {
|
|
|
396
458
|
|
|
397
459
|
// Handle cancel specially - clear states and emit
|
|
398
460
|
if (resolved.length > 0 && resolved[0].name === 'cancel') {
|
|
399
|
-
clearStateFiles(directory, ['ralph', 'autopilot', 'ultrawork'
|
|
461
|
+
clearStateFiles(directory, ['ralph', 'autopilot', 'ultrawork']);
|
|
400
462
|
console.log(JSON.stringify(createHookOutput(createSkillInvocation('cancel', prompt))));
|
|
401
463
|
return;
|
|
402
464
|
}
|
|
@@ -415,27 +477,33 @@ async function main() {
|
|
|
415
477
|
activateState(directory, prompt, 'ultrawork', sessionId);
|
|
416
478
|
}
|
|
417
479
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
480
|
+
const additionalContextParts = [];
|
|
481
|
+
for (const [keywordName, message] of [
|
|
482
|
+
['ultrathink', ULTRATHINK_MESSAGE],
|
|
483
|
+
['analyze', ANALYZE_MESSAGE],
|
|
484
|
+
['tdd', TDD_MESSAGE],
|
|
485
|
+
['code-review', CODE_REVIEW_MESSAGE],
|
|
486
|
+
['security-review', SECURITY_REVIEW_MESSAGE],
|
|
487
|
+
]) {
|
|
488
|
+
const index = resolved.findIndex(m => m.name === keywordName);
|
|
489
|
+
if (index !== -1) {
|
|
490
|
+
resolved.splice(index, 1);
|
|
491
|
+
additionalContextParts.push(message);
|
|
428
492
|
}
|
|
493
|
+
}
|
|
429
494
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
console.log(JSON.stringify(createHookOutput(ULTRATHINK_MESSAGE + skillMessage)));
|
|
495
|
+
if (resolved.length === 0 && additionalContextParts.length > 0) {
|
|
496
|
+
console.log(JSON.stringify(createHookOutput(additionalContextParts.join(''))));
|
|
433
497
|
return;
|
|
434
498
|
}
|
|
435
499
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
500
|
+
if (resolved.length > 0) {
|
|
501
|
+
additionalContextParts.push(createMultiSkillInvocation(resolved, prompt));
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (additionalContextParts.length > 0) {
|
|
505
|
+
console.log(JSON.stringify(createHookOutput(additionalContextParts.join(''))));
|
|
506
|
+
return;
|
|
439
507
|
}
|
|
440
508
|
} catch (error) {
|
|
441
509
|
// On any error, allow continuation
|
|
@@ -132,6 +132,29 @@ Do NOT skip this step. Do NOT move on without fixing the error.
|
|
|
132
132
|
* from causing the stop hook to malfunction in new sessions.
|
|
133
133
|
*/
|
|
134
134
|
const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
135
|
+
const TEAM_TERMINAL_PHASES = new Set([
|
|
136
|
+
"completed",
|
|
137
|
+
"complete",
|
|
138
|
+
"failed",
|
|
139
|
+
"cancelled",
|
|
140
|
+
"canceled",
|
|
141
|
+
"aborted",
|
|
142
|
+
"terminated",
|
|
143
|
+
"done",
|
|
144
|
+
]);
|
|
145
|
+
const TEAM_ACTIVE_PHASES = new Set([
|
|
146
|
+
"team-plan",
|
|
147
|
+
"team-prd",
|
|
148
|
+
"team-exec",
|
|
149
|
+
"team-verify",
|
|
150
|
+
"team-fix",
|
|
151
|
+
"planning",
|
|
152
|
+
"executing",
|
|
153
|
+
"verify",
|
|
154
|
+
"verification",
|
|
155
|
+
"fix",
|
|
156
|
+
"fixing",
|
|
157
|
+
]);
|
|
135
158
|
|
|
136
159
|
/**
|
|
137
160
|
* Check if a state is stale based on its timestamps.
|
|
@@ -153,6 +176,23 @@ function isStaleState(state) {
|
|
|
153
176
|
return age > STALE_STATE_THRESHOLD_MS;
|
|
154
177
|
}
|
|
155
178
|
|
|
179
|
+
function normalizeTeamPhase(state) {
|
|
180
|
+
if (!state || typeof state !== "object") return null;
|
|
181
|
+
|
|
182
|
+
const rawPhase = state.current_phase ?? state.phase ?? state.stage;
|
|
183
|
+
if (typeof rawPhase !== "string") return null;
|
|
184
|
+
|
|
185
|
+
const phase = rawPhase.trim().toLowerCase();
|
|
186
|
+
if (!phase || TEAM_TERMINAL_PHASES.has(phase)) return null;
|
|
187
|
+
return TEAM_ACTIVE_PHASES.has(phase) ? phase : null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function getSafeReinforcementCount(value) {
|
|
191
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0
|
|
192
|
+
? Math.floor(value)
|
|
193
|
+
: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
156
196
|
/**
|
|
157
197
|
* Check if a skill active state is stale based on its per-skill TTL.
|
|
158
198
|
* Unlike mode states (which use the global 2-hour threshold), skill states
|
|
@@ -803,10 +843,9 @@ async function main() {
|
|
|
803
843
|
? team.state.session_id === sessionId
|
|
804
844
|
: !team.state.session_id || team.state.session_id === sessionId;
|
|
805
845
|
if (sessionMatches) {
|
|
806
|
-
const phase = team.state
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
const newCount = (team.state.reinforcement_count || 0) + 1;
|
|
846
|
+
const phase = normalizeTeamPhase(team.state);
|
|
847
|
+
if (phase) {
|
|
848
|
+
const newCount = getSafeReinforcementCount(team.state.reinforcement_count) + 1;
|
|
810
849
|
if (newCount <= 20) {
|
|
811
850
|
const toolError = readLastToolError(stateDir);
|
|
812
851
|
const errorGuidance = getToolErrorRetryGuidance(toolError);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* OMC Pre-Tool-Use Hook (Node.js)
|
|
4
|
-
* Enforces delegation by warning when orchestrator attempts direct source file edits
|
|
4
|
+
* Enforces delegation by warning when orchestrator attempts direct source file edits.
|
|
5
|
+
* Also activates skill-active state for Stop hook protection (issue #1033).
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import * as path from 'path';
|
|
8
9
|
import { dirname } from 'path';
|
|
10
|
+
import { existsSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
9
11
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
10
12
|
|
|
11
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -14,6 +16,105 @@ const __dirname = dirname(__filename);
|
|
|
14
16
|
// Dynamic import for the shared stdin module
|
|
15
17
|
const { readStdin } = await import(pathToFileURL(path.join(__dirname, 'lib', 'stdin.mjs')).href);
|
|
16
18
|
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Skill Active State (issue #1033)
|
|
21
|
+
// Writes skill-active-state.json so the persistent-mode Stop hook can prevent
|
|
22
|
+
// premature session termination while a skill is executing.
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Skill protection levels: none/light/medium/heavy.
|
|
27
|
+
* - 'none': Already has dedicated mode state (ralph, autopilot) or instant/read-only
|
|
28
|
+
* - 'light': Quick agent shortcuts (3 reinforcements, 5 min TTL)
|
|
29
|
+
* - 'medium': Review/planning skills that run multiple agents (5 reinforcements, 15 min TTL)
|
|
30
|
+
* - 'heavy': Long-running skills (10 reinforcements, 30 min TTL)
|
|
31
|
+
*/
|
|
32
|
+
const PROTECTION_CONFIGS = {
|
|
33
|
+
none: { maxReinforcements: 0, staleTtlMs: 0 },
|
|
34
|
+
light: { maxReinforcements: 3, staleTtlMs: 5 * 60 * 1000 },
|
|
35
|
+
medium: { maxReinforcements: 5, staleTtlMs: 15 * 60 * 1000 },
|
|
36
|
+
heavy: { maxReinforcements: 10, staleTtlMs: 30 * 60 * 1000 },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const SKILL_PROTECTION = {
|
|
40
|
+
// Already have mode state → no protection needed
|
|
41
|
+
autopilot: 'none', ralph: 'none', ultrawork: 'none', team: 'none',
|
|
42
|
+
'omc-teams': 'none', ultraqa: 'none', cancel: 'none',
|
|
43
|
+
// Instant / read-only → no protection needed
|
|
44
|
+
trace: 'none', hud: 'none', 'omc-doctor': 'none', 'omc-help': 'none',
|
|
45
|
+
'learn-about-omc': 'none', note: 'none',
|
|
46
|
+
// Light protection (3 reinforcements)
|
|
47
|
+
tdd: 'light', 'build-fix': 'light', analyze: 'light', skill: 'light',
|
|
48
|
+
'configure-notifications': 'light',
|
|
49
|
+
// Medium protection (5 reinforcements)
|
|
50
|
+
'code-review': 'medium', 'security-review': 'medium', plan: 'medium',
|
|
51
|
+
ralplan: 'medium', review: 'medium', 'external-context': 'medium',
|
|
52
|
+
sciomc: 'medium', learner: 'medium', 'omc-setup': 'medium',
|
|
53
|
+
'mcp-setup': 'medium', 'project-session-manager': 'medium',
|
|
54
|
+
'writer-memory': 'medium', 'ralph-init': 'medium', ccg: 'medium',
|
|
55
|
+
// Heavy protection (10 reinforcements)
|
|
56
|
+
deepinit: 'heavy',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function getSkillProtection(skillName) {
|
|
60
|
+
const normalized = (skillName || '').toLowerCase().replace(/^oh-my-claudecode:/, '');
|
|
61
|
+
return SKILL_PROTECTION[normalized] || 'light';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function getInvokedSkillName(toolInput) {
|
|
65
|
+
if (!toolInput || typeof toolInput !== 'object') return null;
|
|
66
|
+
const rawSkill = toolInput.skill || toolInput.skill_name || toolInput.skillName || toolInput.command || null;
|
|
67
|
+
if (typeof rawSkill !== 'string' || !rawSkill.trim()) return null;
|
|
68
|
+
const normalized = rawSkill.trim();
|
|
69
|
+
return normalized.includes(':') ? normalized.split(':').at(-1).toLowerCase() : normalized.toLowerCase();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const SESSION_ID_ALLOWLIST = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/;
|
|
73
|
+
|
|
74
|
+
function writeSkillActiveState(directory, skillName, sessionId) {
|
|
75
|
+
const protection = getSkillProtection(skillName);
|
|
76
|
+
if (protection === 'none') return;
|
|
77
|
+
|
|
78
|
+
const config = PROTECTION_CONFIGS[protection];
|
|
79
|
+
const now = new Date().toISOString();
|
|
80
|
+
const normalized = (skillName || '').toLowerCase().replace(/^oh-my-claudecode:/, '');
|
|
81
|
+
|
|
82
|
+
const state = {
|
|
83
|
+
active: true,
|
|
84
|
+
skill_name: normalized,
|
|
85
|
+
session_id: sessionId || undefined,
|
|
86
|
+
started_at: now,
|
|
87
|
+
last_checked_at: now,
|
|
88
|
+
reinforcement_count: 0,
|
|
89
|
+
max_reinforcements: config.maxReinforcements,
|
|
90
|
+
stale_ttl_ms: config.staleTtlMs,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const stateDir = path.join(directory, '.omc', 'state');
|
|
94
|
+
|
|
95
|
+
// Write to session-scoped path when sessionId is available (must match persistent-mode.mjs reads)
|
|
96
|
+
const safeSessionId = sessionId && SESSION_ID_ALLOWLIST.test(sessionId) ? sessionId : '';
|
|
97
|
+
const targetDir = safeSessionId
|
|
98
|
+
? path.join(stateDir, 'sessions', safeSessionId)
|
|
99
|
+
: stateDir;
|
|
100
|
+
const targetPath = path.join(targetDir, 'skill-active-state.json');
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
if (!existsSync(targetDir)) {
|
|
104
|
+
mkdirSync(targetDir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
const tmpPath = targetPath + '.tmp';
|
|
107
|
+
writeFileSync(tmpPath, JSON.stringify(state, null, 2), { mode: 0o600 });
|
|
108
|
+
renameSync(tmpPath, targetPath);
|
|
109
|
+
} catch {
|
|
110
|
+
// Best-effort; don't fail the hook
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
// Delegation enforcement
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
|
|
17
118
|
// Allowed path patterns (no warning)
|
|
18
119
|
// Paths are normalized to forward slashes before matching
|
|
19
120
|
const ALLOWED_PATH_PATTERNS = [
|
|
@@ -193,6 +294,19 @@ async function main() {
|
|
|
193
294
|
return;
|
|
194
295
|
}
|
|
195
296
|
|
|
297
|
+
// Activate skill state when Skill tool is invoked (issue #1033)
|
|
298
|
+
// Writes skill-active-state.json so the persistent-mode Stop hook can
|
|
299
|
+
// prevent premature session termination while a skill is executing.
|
|
300
|
+
if (toolName === 'Skill' || toolName === 'skill') {
|
|
301
|
+
const directory = data.cwd || data.directory || process.cwd();
|
|
302
|
+
const sessionId = data.sessionId || data.session_id || data.sessionid || '';
|
|
303
|
+
const toolInput = data.tool_input || data.toolInput || {};
|
|
304
|
+
const skillName = getInvokedSkillName(toolInput);
|
|
305
|
+
if (skillName) {
|
|
306
|
+
writeSkillActiveState(directory, skillName, sessionId);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
196
310
|
// Only check Edit and Write tools
|
|
197
311
|
if (!['Edit', 'Write', 'edit', 'write'].includes(toolName)) {
|
|
198
312
|
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
@@ -200,7 +200,7 @@ async function main() {
|
|
|
200
200
|
for (let i = 1; i <= 4; i++) {
|
|
201
201
|
const candidate = join(__dirname, ...Array(i).fill('..'), 'package.json');
|
|
202
202
|
const pkg = readJsonFile(candidate);
|
|
203
|
-
if (pkg?.name === 'claudecode-omc' && pkg?.version) {
|
|
203
|
+
if ((pkg?.name === 'claudecode-omc' || pkg?.name === 'oh-my-claude-sisyphus' || pkg?.name === 'oh-my-claudecode') && pkg?.version) {
|
|
204
204
|
currentVersion = pkg.version;
|
|
205
205
|
break;
|
|
206
206
|
}
|