oh-my-opencode 3.13.1 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +2 -2
- package/README.ko.md +2 -2
- package/README.md +16 -8
- package/README.ru.md +2 -2
- package/README.zh-cn.md +2 -2
- package/bin/oh-my-opencode.js +11 -0
- package/bin/platform.js +13 -13
- package/bin/platform.test.ts +15 -0
- package/dist/agents/atlas/agent.d.ts +1 -1
- package/dist/agents/atlas/default-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/default.d.ts +0 -9
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/gemini.d.ts +0 -9
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/gpt.d.ts +0 -9
- package/dist/agents/atlas/shared-prompt.d.ts +9 -0
- package/dist/agents/dynamic-agent-category-skills-guide.d.ts +2 -0
- package/dist/agents/dynamic-agent-core-sections.d.ts +10 -0
- package/dist/agents/dynamic-agent-policy-sections.d.ts +6 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +5 -35
- package/dist/agents/dynamic-agent-prompt-types.d.ts +20 -0
- package/dist/agents/dynamic-agent-tool-categorization.d.ts +3 -0
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +1 -1
- package/dist/agents/hephaestus/gpt.d.ts +1 -1
- package/dist/agents/momus.d.ts +2 -2
- package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
- package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/sisyphus/gpt-5-4.d.ts +14 -14
- package/dist/agents/sisyphus/index.d.ts +1 -1
- package/dist/agents/sisyphus.d.ts +1 -1
- package/dist/agents/types.d.ts +3 -1
- package/dist/cli/doctor/checks/model-resolution-types.d.ts +3 -0
- package/dist/cli/doctor/checks/model-resolution.d.ts +2 -1
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/index.js +42241 -390
- package/dist/cli/mcp-oauth/login.d.ts +6 -1
- package/dist/cli/refresh-model-capabilities.d.ts +15 -0
- package/dist/cli/run/event-state.d.ts +0 -2
- package/dist/cli/run/types.d.ts +0 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/agent-names.d.ts +2 -0
- package/dist/config/schema/agent-overrides.d.ts +675 -15
- package/dist/config/schema/background-task.d.ts +2 -0
- package/dist/config/schema/categories.d.ts +90 -2
- package/dist/config/schema/commands.d.ts +1 -0
- package/dist/config/schema/dynamic-context-pruning.d.ts +1 -1
- package/dist/config/schema/experimental.d.ts +2 -1
- package/dist/config/schema/fallback-models.d.ts +111 -1
- package/dist/config/schema/hooks.d.ts +3 -0
- package/dist/config/schema/model-capabilities.d.ts +8 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +696 -17
- package/dist/config/schema/sisyphus-agent.d.ts +1 -0
- package/dist/config/schema/tmux.d.ts +11 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +6 -0
- package/dist/create-runtime-tmux-config.d.ts +9 -0
- package/dist/features/background-agent/abort-with-timeout.d.ts +2 -0
- package/dist/features/background-agent/background-task-notification-template.d.ts +10 -4
- package/dist/features/background-agent/constants.d.ts +1 -0
- package/dist/features/background-agent/fallback-retry-handler.d.ts +1 -1
- package/dist/features/background-agent/manager.d.ts +10 -0
- package/dist/features/background-agent/process-cleanup.d.ts +1 -1
- package/dist/features/background-agent/session-existence.d.ts +3 -0
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +5 -10
- package/dist/features/builtin-commands/commands.d.ts +4 -1
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/skills/ai-slop-remover.d.ts +2 -0
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +1 -1
- package/dist/features/builtin-skills/skills/review-work.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +5 -0
- package/dist/features/claude-code-mcp-loader/index.d.ts +1 -0
- package/dist/features/claude-code-mcp-loader/scope-filter.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/types.d.ts +8 -4
- package/dist/features/claude-code-session-state/state.d.ts +2 -0
- package/dist/features/context-injector/collector.d.ts +1 -0
- package/dist/features/opencode-skill-loader/async-loader.d.ts +2 -2
- package/dist/features/opencode-skill-loader/loader.d.ts +2 -0
- package/dist/features/skill-mcp-manager/manager.d.ts +4 -1
- package/dist/features/skill-mcp-manager/oauth-handler.d.ts +5 -4
- package/dist/features/skill-mcp-manager/types.d.ts +7 -0
- package/dist/features/tmux-subagent/manager.d.ts +15 -13
- package/dist/features/tmux-subagent/polling-manager.d.ts +5 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +4 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/recovery-hook.d.ts +10 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/recovery-hook.test-support.d.ts +29 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/session-timeout-map.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/state.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +1 -0
- package/dist/hooks/atlas/subagent-session-id.d.ts +1 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +2 -2
- package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
- package/dist/hooks/auto-slash-command/hook.d.ts +1 -0
- package/dist/hooks/auto-update-checker/hook/background-update-check.d.ts +29 -1
- package/dist/hooks/auto-update-checker/hook/model-capabilities-status.d.ts +2 -0
- package/dist/hooks/auto-update-checker/types.d.ts +2 -0
- package/dist/hooks/bash-file-read-guard.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/claude-code-hooks-hook.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/config-loader.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/config.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/handlers/session-event-handler.d.ts +3 -1
- package/dist/hooks/claude-code-hooks/session-hook-state.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/transcript.d.ts +1 -3
- package/dist/hooks/comment-checker/hook.d.ts +1 -0
- package/dist/hooks/comment-checker/pending-calls.d.ts +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -1
- package/dist/hooks/legacy-plugin-toast/auto-migrate-runner.d.ts +2 -0
- package/dist/hooks/legacy-plugin-toast/auto-migrate.d.ts +7 -0
- package/dist/hooks/legacy-plugin-toast/hook.d.ts +18 -0
- package/dist/hooks/legacy-plugin-toast/index.d.ts +1 -0
- package/dist/hooks/legacy-plugin-toast/plugin-entry-migrator.d.ts +1 -0
- package/dist/hooks/model-fallback/chat-message-fallback-handler.d.ts +23 -0
- package/dist/hooks/model-fallback/hook.d.ts +5 -0
- package/dist/hooks/model-fallback/next-fallback.d.ts +6 -0
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +11 -0
- package/dist/hooks/rules-injector/constants.d.ts +1 -0
- package/dist/hooks/rules-injector/finder.d.ts +1 -1
- package/dist/hooks/rules-injector/hook.d.ts +2 -0
- package/dist/hooks/rules-injector/injector.d.ts +2 -0
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +9 -1
- package/dist/hooks/runtime-fallback/fallback-models.d.ts +12 -0
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +5 -1
- package/dist/hooks/start-work/context-info-builder.d.ts +12 -0
- package/dist/hooks/start-work/start-work-hook.d.ts +7 -0
- package/dist/hooks/start-work/worktree-block.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +2 -2
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +4 -0
- package/dist/hooks/todo-description-override/description.d.ts +1 -1
- package/dist/hooks/tool-pair-validator/hook.d.ts +28 -0
- package/dist/hooks/tool-pair-validator/index.d.ts +1 -0
- package/dist/hooks/write-existing-file-guard/hook.d.ts +12 -0
- package/dist/hooks/write-existing-file-guard/session-read-permissions.d.ts +3 -0
- package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +15 -0
- package/dist/index.js +112232 -65637
- package/dist/mcp/websearch.d.ts +2 -2
- package/dist/oh-my-opencode.schema.json +2034 -4
- package/dist/openclaw/dispatcher.d.ts +6 -0
- package/dist/plugin/chat-params.d.ts +1 -0
- package/dist/plugin/command-execute-before.d.ts +17 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
- package/dist/plugin/tool-registry.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugin-dispose.d.ts +3 -0
- package/dist/shared/agent-display-names.d.ts +8 -0
- package/dist/shared/archive-entry-validator.d.ts +6 -0
- package/dist/shared/background-output-consumption.d.ts +5 -0
- package/dist/shared/connected-providers-cache.d.ts +22 -6
- package/dist/shared/contains-path.d.ts +2 -0
- package/dist/shared/external-plugin-detector.d.ts +14 -0
- package/dist/shared/fallback-chain-from-models.d.ts +10 -1
- package/dist/shared/index.d.ts +10 -1
- package/dist/shared/is-abort-error.d.ts +1 -0
- package/dist/shared/json-file-cache-store.d.ts +16 -0
- package/dist/shared/jsonc-parser.d.ts +1 -0
- package/dist/shared/known-variants.d.ts +6 -0
- package/dist/shared/legacy-plugin-warning.d.ts +7 -0
- package/dist/shared/load-opencode-plugins.d.ts +1 -0
- package/dist/shared/log-legacy-plugin-startup-warning.d.ts +10 -0
- package/dist/shared/migrate-legacy-config-file.d.ts +1 -0
- package/dist/shared/migrate-legacy-plugin-entry.d.ts +1 -0
- package/dist/shared/model-capabilities/bundled-snapshot.d.ts +2 -0
- package/dist/shared/model-capabilities/get-model-capabilities.d.ts +2 -0
- package/dist/shared/model-capabilities/index.d.ts +3 -0
- package/dist/shared/model-capabilities/runtime-model-readers.d.ts +11 -0
- package/dist/shared/model-capabilities/types.d.ts +94 -0
- package/dist/shared/model-capabilities-cache.d.ts +20 -0
- package/dist/shared/model-capability-aliases.d.ts +21 -0
- package/dist/shared/model-capability-guardrails.d.ts +38 -0
- package/dist/shared/model-capability-heuristics.d.ts +10 -0
- package/dist/shared/model-requirements.d.ts +8 -0
- package/dist/shared/model-resolution-types.d.ts +13 -0
- package/dist/shared/model-resolver.d.ts +10 -3
- package/dist/shared/model-settings-compatibility.d.ts +40 -0
- package/dist/shared/model-suggestion-retry.d.ts +0 -9
- package/dist/shared/plugin-entry-migrator.d.ts +3 -0
- package/dist/shared/plugin-identity.d.ts +4 -3
- package/dist/shared/project-discovery-dirs.d.ts +4 -0
- package/dist/shared/session-category-registry.d.ts +0 -24
- package/dist/shared/session-cursor.d.ts +6 -0
- package/dist/shared/session-prompt-params-helpers.d.ts +12 -0
- package/dist/shared/session-prompt-params-state.d.ts +9 -0
- package/dist/shared/skill-path-resolver.d.ts +0 -8
- package/dist/shared/task-system-enabled.d.ts +6 -0
- package/dist/shared/tmux/tmux-utils/server-health.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils.d.ts +3 -1
- package/dist/shared/write-file-atomically.d.ts +1 -0
- package/dist/shared/zip-entry-listing/powershell-zip-entry-listing.d.ts +4 -0
- package/dist/shared/zip-entry-listing/python-zip-entry-listing.d.ts +3 -0
- package/dist/shared/zip-entry-listing/read-zip-symlink-target.d.ts +1 -0
- package/dist/shared/zip-entry-listing/tar-zip-entry-listing.d.ts +3 -0
- package/dist/shared/zip-entry-listing/zipinfo-zip-entry-listing.d.ts +4 -0
- package/dist/shared/zip-entry-listing.d.ts +4 -0
- package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
- package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -1
- package/dist/tools/delegate-task/anthropic-categories.d.ts +2 -0
- package/dist/tools/delegate-task/background-task.d.ts +2 -6
- package/dist/tools/delegate-task/builtin-categories.d.ts +4 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +7 -0
- package/dist/tools/delegate-task/category-resolver.d.ts +2 -5
- package/dist/tools/delegate-task/constants.d.ts +1 -12
- package/dist/tools/delegate-task/executor-types.d.ts +2 -1
- package/dist/tools/delegate-task/google-categories.d.ts +2 -0
- package/dist/tools/delegate-task/kimi-categories.d.ts +2 -0
- package/dist/tools/delegate-task/model-selection.d.ts +2 -0
- package/dist/tools/delegate-task/openai-categories.d.ts +2 -0
- package/dist/tools/delegate-task/prompt-builder.d.ts +1 -1
- package/dist/tools/delegate-task/subagent-resolver.d.ts +3 -6
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +4 -6
- package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
- package/dist/tools/delegate-task/sync-task.d.ts +2 -6
- package/dist/tools/delegate-task/types.d.ts +5 -6
- package/dist/tools/delegate-task/unstable-agent-task.d.ts +2 -6
- package/dist/tools/grep/cli.d.ts +3 -2
- package/dist/tools/grep/constants.d.ts +1 -2
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/look-at/constants.d.ts +1 -1
- package/dist/tools/lsp/infer-extension.d.ts +1 -0
- package/dist/tools/session-manager/file-storage.d.ts +8 -0
- package/dist/tools/session-manager/sdk-storage.d.ts +8 -0
- package/dist/tools/session-manager/sdk-unavailable.d.ts +1 -0
- package/dist/tools/session-manager/storage.d.ts +1 -1
- package/dist/tools/skill/description-formatter.d.ts +3 -0
- package/dist/tools/skill/mcp-capability-formatter.d.ts +3 -0
- package/dist/tools/skill/native-skills.d.ts +12 -0
- package/dist/tools/skill/scope-priority.d.ts +4 -0
- package/dist/tools/skill/skill-body.d.ts +2 -0
- package/dist/tools/skill/skill-matcher.d.ts +5 -0
- package/dist/tools/skill/types.d.ts +30 -2
- package/dist/tools/skill-mcp/tools.d.ts +1 -1
- package/package.json +16 -14
- package/postinstall.mjs +12 -0
- package/dist/hooks/openclaw.d.ts +0 -11
|
@@ -4,5 +4,6 @@ export declare const SisyphusAgentConfigSchema: z.ZodObject<{
|
|
|
4
4
|
default_builder_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
planner_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
replace_plan: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
tdd: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
7
8
|
}, z.core.$strip>;
|
|
8
9
|
export type SisyphusAgentConfig = z.infer<typeof SisyphusAgentConfigSchema>;
|
|
@@ -6,6 +6,11 @@ export declare const TmuxLayoutSchema: z.ZodEnum<{
|
|
|
6
6
|
"even-horizontal": "even-horizontal";
|
|
7
7
|
"even-vertical": "even-vertical";
|
|
8
8
|
}>;
|
|
9
|
+
export declare const TmuxIsolationSchema: z.ZodEnum<{
|
|
10
|
+
session: "session";
|
|
11
|
+
inline: "inline";
|
|
12
|
+
window: "window";
|
|
13
|
+
}>;
|
|
9
14
|
export declare const TmuxConfigSchema: z.ZodObject<{
|
|
10
15
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
11
16
|
layout: z.ZodDefault<z.ZodEnum<{
|
|
@@ -18,6 +23,12 @@ export declare const TmuxConfigSchema: z.ZodObject<{
|
|
|
18
23
|
main_pane_size: z.ZodDefault<z.ZodNumber>;
|
|
19
24
|
main_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
20
25
|
agent_pane_min_width: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
isolation: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
session: "session";
|
|
28
|
+
inline: "inline";
|
|
29
|
+
window: "window";
|
|
30
|
+
}>>;
|
|
21
31
|
}, z.core.$strip>;
|
|
22
32
|
export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
|
|
23
33
|
export type TmuxLayout = z.infer<typeof TmuxLayoutSchema>;
|
|
34
|
+
export type TmuxIsolation = z.infer<typeof TmuxIsolationSchema>;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./schema/fallback-models";
|
|
|
13
13
|
export * from "./schema/git-env-prefix";
|
|
14
14
|
export * from "./schema/git-master";
|
|
15
15
|
export * from "./schema/hooks";
|
|
16
|
+
export * from "./schema/model-capabilities";
|
|
16
17
|
export * from "./schema/notification";
|
|
17
18
|
export * from "./schema/oh-my-opencode-config";
|
|
18
19
|
export * from "./schema/ralph-loop";
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -9,9 +9,12 @@ type DisposableHook = {
|
|
|
9
9
|
dispose?: () => void;
|
|
10
10
|
} | null | undefined;
|
|
11
11
|
export type DisposableCreatedHooks = {
|
|
12
|
+
claudeCodeHooks?: DisposableHook;
|
|
13
|
+
commentChecker?: DisposableHook;
|
|
12
14
|
runtimeFallback?: DisposableHook;
|
|
13
15
|
todoContinuationEnforcer?: DisposableHook;
|
|
14
16
|
autoSlashCommand?: DisposableHook;
|
|
17
|
+
anthropicContextWindowLimitRecovery?: DisposableHook;
|
|
15
18
|
};
|
|
16
19
|
export declare function disposeCreatedHooks(hooks: DisposableCreatedHooks): void;
|
|
17
20
|
export declare function createHooks(args: {
|
|
@@ -38,6 +41,7 @@ export declare function createHooks(args: {
|
|
|
38
41
|
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
|
|
39
42
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
40
43
|
thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
|
|
44
|
+
toolPairValidator: ReturnType<typeof import("./hooks").createToolPairValidatorHook> | null;
|
|
41
45
|
commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
|
|
42
46
|
toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
|
|
43
47
|
directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
|
|
@@ -46,6 +50,7 @@ export declare function createHooks(args: {
|
|
|
46
50
|
rulesInjector: ReturnType<typeof import("./hooks").createRulesInjectorHook> | null;
|
|
47
51
|
tasksTodowriteDisabler: ReturnType<typeof import("./hooks").createTasksTodowriteDisablerHook> | null;
|
|
48
52
|
writeExistingFileGuard: ReturnType<typeof import("./hooks").createWriteExistingFileGuardHook> | null;
|
|
53
|
+
bashFileReadGuard: ReturnType<typeof import("./hooks").createBashFileReadGuardHook> | null;
|
|
49
54
|
hashlineReadEnhancer: ReturnType<typeof import("./hooks").createHashlineReadEnhancerHook> | null;
|
|
50
55
|
jsonErrorRecovery: ReturnType<typeof import("./hooks").createJsonErrorRecoveryHook> | null;
|
|
51
56
|
readImageResizer: ReturnType<typeof import("./hooks").createReadImageResizerHook> | null;
|
|
@@ -74,5 +79,6 @@ export declare function createHooks(args: {
|
|
|
74
79
|
taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook> | null;
|
|
75
80
|
anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
76
81
|
runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
|
|
82
|
+
legacyPluginToast: ReturnType<typeof import("./hooks").createLegacyPluginToastHook> | null;
|
|
77
83
|
};
|
|
78
84
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OhMyOpenCodeConfig, TmuxConfig } from "./config";
|
|
2
|
+
export declare function isTmuxIntegrationEnabled(pluginConfig: {
|
|
3
|
+
tmux?: {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
} | undefined;
|
|
6
|
+
}): boolean;
|
|
7
|
+
export declare function createRuntimeTmuxConfig(pluginConfig: {
|
|
8
|
+
tmux?: OhMyOpenCodeConfig["tmux"];
|
|
9
|
+
}): TmuxConfig;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED";
|
|
1
|
+
import type { BackgroundTaskStatus } from "./types";
|
|
2
|
+
export type BackgroundTaskNotificationStatus = "COMPLETED" | "CANCELLED" | "INTERRUPTED" | "ERROR";
|
|
3
|
+
export interface BackgroundTaskNotificationTask {
|
|
4
|
+
id: string;
|
|
5
|
+
description: string;
|
|
6
|
+
status: BackgroundTaskStatus;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
3
9
|
export declare function buildBackgroundTaskNotificationText(input: {
|
|
4
|
-
task:
|
|
10
|
+
task: BackgroundTaskNotificationTask;
|
|
5
11
|
duration: string;
|
|
6
12
|
statusText: BackgroundTaskNotificationStatus;
|
|
7
13
|
allComplete: boolean;
|
|
8
14
|
remainingCount: number;
|
|
9
|
-
completedTasks:
|
|
15
|
+
completedTasks: BackgroundTaskNotificationTask[];
|
|
10
16
|
}): string;
|
|
@@ -9,6 +9,7 @@ export declare const DEFAULT_MAX_TOOL_CALLS = 4000;
|
|
|
9
9
|
export declare const DEFAULT_CIRCUIT_BREAKER_CONSECUTIVE_THRESHOLD = 20;
|
|
10
10
|
export declare const DEFAULT_CIRCUIT_BREAKER_ENABLED = true;
|
|
11
11
|
export declare const MIN_RUNTIME_BEFORE_STALE_MS = 30000;
|
|
12
|
+
export declare const DEFAULT_SESSION_GONE_TIMEOUT_MS = 60000;
|
|
12
13
|
export declare const MIN_IDLE_TIME_MS = 5000;
|
|
13
14
|
export declare const POLLING_INTERVAL_MS = 3000;
|
|
14
15
|
export declare const TASK_CLEANUP_DELAY_MS: number;
|
|
@@ -41,6 +41,8 @@ export declare class BackgroundManager {
|
|
|
41
41
|
private completedTaskSummaries;
|
|
42
42
|
private idleDeferralTimers;
|
|
43
43
|
private notificationQueueByParent;
|
|
44
|
+
private observedOutputSessions;
|
|
45
|
+
private observedIncompleteTodosBySession;
|
|
44
46
|
private rootDescendantCounts;
|
|
45
47
|
private preStartDescendantReservations;
|
|
46
48
|
private enableParentSessionNotifications;
|
|
@@ -52,6 +54,7 @@ export declare class BackgroundManager {
|
|
|
52
54
|
onShutdown?: () => void | Promise<void>;
|
|
53
55
|
enableParentSessionNotifications?: boolean;
|
|
54
56
|
});
|
|
57
|
+
private abortSessionWithLogging;
|
|
55
58
|
assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
|
|
56
59
|
reserveSubagentSpawn(parentSessionID: string): Promise<{
|
|
57
60
|
spawnContext: SubagentSpawnContext;
|
|
@@ -87,7 +90,12 @@ export declare class BackgroundManager {
|
|
|
87
90
|
}): Promise<BackgroundTask>;
|
|
88
91
|
resume(input: ResumeInput): Promise<BackgroundTask>;
|
|
89
92
|
private checkSessionTodos;
|
|
93
|
+
private markSessionOutputObserved;
|
|
94
|
+
private clearSessionOutputObserved;
|
|
95
|
+
private clearSessionTodoObservation;
|
|
96
|
+
private hasOutputSignalFromPart;
|
|
90
97
|
handleEvent(event: Event): void;
|
|
98
|
+
private handleSessionErrorEvent;
|
|
91
99
|
private tryFallbackRetry;
|
|
92
100
|
markForNotification(task: BackgroundTask): void;
|
|
93
101
|
getPendingNotifications(sessionID: string): BackgroundTask[];
|
|
@@ -145,6 +153,8 @@ export declare class BackgroundManager {
|
|
|
145
153
|
private hasRunningTasks;
|
|
146
154
|
private pruneStaleTasksAndNotifications;
|
|
147
155
|
private checkAndInterruptStaleTasks;
|
|
156
|
+
private verifySessionExists;
|
|
157
|
+
private failCrashedTask;
|
|
148
158
|
private pollRunningTasks;
|
|
149
159
|
/**
|
|
150
160
|
* Shutdown the manager gracefully.
|
|
@@ -3,6 +3,6 @@ interface CleanupTarget {
|
|
|
3
3
|
}
|
|
4
4
|
export declare function registerManagerForCleanup(manager: CleanupTarget): void;
|
|
5
5
|
export declare function unregisterManagerForCleanup(manager: CleanupTarget): void;
|
|
6
|
-
/** @internal
|
|
6
|
+
/** @internal - test-only reset for module-level singleton state */
|
|
7
7
|
export declare function _resetForTesting(): void;
|
|
8
8
|
export {};
|
|
@@ -6,6 +6,7 @@ export declare function pruneStaleTasksAndNotifications(args: {
|
|
|
6
6
|
tasks: Map<string, BackgroundTask>;
|
|
7
7
|
notifications: Map<string, BackgroundTask[]>;
|
|
8
8
|
onTaskPruned: (taskId: string, task: BackgroundTask, errorMessage: string) => void;
|
|
9
|
+
taskTtlMs?: number;
|
|
9
10
|
}): void;
|
|
10
11
|
export type SessionStatusMap = Record<string, {
|
|
11
12
|
type: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
2
|
+
import type { DelegatedModelConfig } from "../../shared/model-resolution-types";
|
|
2
3
|
import type { SessionPermissionRule } from "../../shared/question-denied-session-permission";
|
|
3
4
|
export type BackgroundTaskStatus = "pending" | "running" | "completed" | "error" | "cancelled" | "interrupt";
|
|
4
5
|
export interface ToolCallWindow {
|
|
@@ -36,11 +37,7 @@ export interface BackgroundTask {
|
|
|
36
37
|
providerID: string;
|
|
37
38
|
modelID: string;
|
|
38
39
|
};
|
|
39
|
-
model?:
|
|
40
|
-
providerID: string;
|
|
41
|
-
modelID: string;
|
|
42
|
-
variant?: string;
|
|
43
|
-
};
|
|
40
|
+
model?: DelegatedModelConfig;
|
|
44
41
|
/** Fallback chain for runtime retry on model errors */
|
|
45
42
|
fallbackChain?: FallbackEntry[];
|
|
46
43
|
/** Number of fallback retry attempts made */
|
|
@@ -61,6 +58,8 @@ export interface BackgroundTask {
|
|
|
61
58
|
lastMsgCount?: number;
|
|
62
59
|
/** Number of consecutive polls with stable message count */
|
|
63
60
|
stablePolls?: number;
|
|
61
|
+
/** Number of consecutive polls where session was missing from status map */
|
|
62
|
+
consecutiveMissedPolls?: number;
|
|
64
63
|
}
|
|
65
64
|
export interface LaunchInput {
|
|
66
65
|
description: string;
|
|
@@ -74,11 +73,7 @@ export interface LaunchInput {
|
|
|
74
73
|
};
|
|
75
74
|
parentAgent?: string;
|
|
76
75
|
parentTools?: Record<string, boolean>;
|
|
77
|
-
model?:
|
|
78
|
-
providerID: string;
|
|
79
|
-
modelID: string;
|
|
80
|
-
variant?: string;
|
|
81
|
-
};
|
|
76
|
+
model?: DelegatedModelConfig;
|
|
82
77
|
/** Fallback chain for runtime retry on model errors */
|
|
83
78
|
fallbackChain?: FallbackEntry[];
|
|
84
79
|
isUnstableAgent?: boolean;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { BuiltinCommandName, BuiltinCommands } from "./types";
|
|
2
|
-
export
|
|
2
|
+
export interface LoadBuiltinCommandsOptions {
|
|
3
|
+
useRegisteredAgents?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function loadBuiltinCommands(disabledCommands?: BuiltinCommandName[], options?: LoadBuiltinCommandsOptions): BuiltinCommands;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HANDOFF_TEMPLATE = "# Handoff Command\n\n## Purpose\n\nUse /handoff when:\n- The current session context is getting too long and quality is degrading\n- You want to start fresh while preserving essential context from this session\n- The context window is approaching capacity\n\nThis creates a detailed context summary that can be used to continue work in a new session.\n\n---\n\n# PHASE 0: VALIDATE REQUEST\n\nBefore proceeding, confirm:\n- [ ] There is meaningful work or context in this session to preserve\n- [ ] The user wants to create a handoff summary (not just asking about it)\n\nIf the session is nearly empty or has no meaningful context, inform the user there is nothing substantial to hand off.\n\n---\n\n# PHASE 1: GATHER PROGRAMMATIC CONTEXT\n\nExecute these tools to gather concrete data:\n\n1. session_read({ session_id: \"$SESSION_ID\" })
|
|
1
|
+
export declare const HANDOFF_TEMPLATE = "# Handoff Command\n\n## Purpose\n\nUse /handoff when:\n- The current session context is getting too long and quality is degrading\n- You want to start fresh while preserving essential context from this session\n- The context window is approaching capacity\n\nThis creates a detailed context summary that can be used to continue work in a new session.\n\n---\n\n# PHASE 0: VALIDATE REQUEST\n\nBefore proceeding, confirm:\n- [ ] There is meaningful work or context in this session to preserve\n- [ ] The user wants to create a handoff summary (not just asking about it)\n\nIf the session is nearly empty or has no meaningful context, inform the user there is nothing substantial to hand off.\n\n---\n\n# PHASE 1: GATHER PROGRAMMATIC CONTEXT\n\nExecute these tools to gather concrete data:\n\n1. session_read({ session_id: \"$SESSION_ID\" }) - full session history\n2. todoread() - current task progress\n3. Bash({ command: \"git diff --stat HEAD~10..HEAD\" }) - recent file changes\n4. Bash({ command: \"git status --porcelain\" }) - uncommitted changes\n\nSuggested execution order:\n\n```\nsession_read({ session_id: \"$SESSION_ID\" })\ntodoread()\nBash({ command: \"git diff --stat HEAD~10..HEAD\" })\nBash({ command: \"git status --porcelain\" })\n```\n\nAnalyze the gathered outputs to understand:\n- What the user asked for (exact wording)\n- What work was completed\n- What tasks remain incomplete (include todo state)\n- What decisions were made\n- What files were modified or discussed (include git diff/stat + status)\n- What patterns, constraints, or preferences were established\n\n---\n\n# PHASE 2: EXTRACT CONTEXT\n\nWrite the context summary from first person perspective (\"I did...\", \"I told you...\").\n\nFocus on:\n- Capabilities and behavior, not file-by-file implementation details\n- What matters for continuing the work\n- Avoiding excessive implementation details (variable names, storage keys, constants) unless critical\n- USER REQUESTS (AS-IS) must be verbatim (do not paraphrase)\n- EXPLICIT CONSTRAINTS must be verbatim only (do not invent)\n\nQuestions to consider when extracting:\n- What did I just do or implement?\n- What instructions did I already give which are still relevant (e.g. follow patterns in the codebase)?\n- What files did I tell you are important or that I am working on?\n- Did I provide a plan or spec that should be included?\n- What did I already tell you that is important (libraries, patterns, constraints, preferences)?\n- What important technical details did I discover (APIs, methods, patterns)?\n- What caveats, limitations, or open questions did I find?\n\n---\n\n# PHASE 3: FORMAT OUTPUT\n\nGenerate a handoff summary using this exact format:\n\n```\nHANDOFF CONTEXT\n===============\n\nUSER REQUESTS (AS-IS)\n---------------------\n- [Exact verbatim user requests - NOT paraphrased]\n\nGOAL\n----\n[One sentence describing what should be done next]\n\nWORK COMPLETED\n--------------\n- [First person bullet points of what was done]\n- [Include specific file paths when relevant]\n- [Note key implementation decisions]\n\nCURRENT STATE\n-------------\n- [Current state of the codebase or task]\n- [Build/test status if applicable]\n- [Any environment or configuration state]\n\nPENDING TASKS\n-------------\n- [Tasks that were planned but not completed]\n- [Next logical steps to take]\n- [Any blockers or issues encountered]\n- [Include current todo state from todoread()]\n\nKEY FILES\n---------\n- [path/to/file1] - [brief role description]\n- [path/to/file2] - [brief role description]\n(Maximum 10 files, prioritized by importance)\n- (Include files from git diff/stat and git status)\n\nIMPORTANT DECISIONS\n-------------------\n- [Technical decisions that were made and why]\n- [Trade-offs that were considered]\n- [Patterns or conventions established]\n\nEXPLICIT CONSTRAINTS\n--------------------\n- [Verbatim constraints only - from user or existing AGENTS.md]\n- If none, write: None\n\nCONTEXT FOR CONTINUATION\n------------------------\n- [What the next session needs to know to continue]\n- [Warnings or gotchas to be aware of]\n- [References to documentation if relevant]\n```\n\nRules for the summary:\n- Plain text with bullets\n- No markdown headers with # (use the format above with dashes)\n- No bold, italic, or code fences within content\n- Use workspace-relative paths for files\n- Keep it focused - only include what matters for continuation\n- Pick an appropriate length based on complexity\n- USER REQUESTS (AS-IS) and EXPLICIT CONSTRAINTS must be verbatim only\n\n---\n\n# PHASE 4: PROVIDE INSTRUCTIONS\n\nAfter generating the summary, instruct the user:\n\n```\n---\n\nTO CONTINUE IN A NEW SESSION:\n\n1. Press 'n' in OpenCode TUI to open a new session, or run 'opencode' in a new terminal\n2. Paste the HANDOFF CONTEXT above as your first message\n3. Add your request: \"Continue from the handoff context above. [Your next task]\"\n\nThe new session will have all context needed to continue seamlessly.\n```\n\n---\n\n# IMPORTANT CONSTRAINTS\n\n- DO NOT attempt to programmatically create new sessions (no API available to agents)\n- DO provide a self-contained summary that works without access to this session\n- DO include workspace-relative file paths\n- DO NOT include sensitive information (API keys, credentials, secrets)\n- DO NOT exceed 10 files in the KEY FILES section\n- DO keep the GOAL section to a single sentence or short paragraph\n\n---\n\n# EXECUTE NOW\n\nBegin by gathering programmatic context, then synthesize the handoff summary.\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INIT_DEEP_TEMPLATE = "# /init-deep\n\nGenerate hierarchical AGENTS.md files. Root + complexity-scored subdirectories.\n\n## Usage\n\n```\n/init-deep # Update mode: modify existing + create new where warranted\n/init-deep --create-new # Read existing \u2192 remove all \u2192 regenerate from scratch\n/init-deep --max-depth=2 # Limit directory depth (default: 3)\n```\n\n---\n\n## Workflow (High-Level)\n\n1. **Discovery + Analysis** (concurrent)\n - Fire background explore agents immediately\n - Main session: bash structure + LSP codemap + read existing AGENTS.md\n2. **Score & Decide** - Determine AGENTS.md locations from merged findings\n3. **Generate** - Root first, then subdirs in parallel\n4. **Review** - Deduplicate, trim, validate\n\n<critical>\n**TodoWrite ALL phases. Mark in_progress \u2192 completed in real-time.**\n```\nTodoWrite([\n { id: \"discovery\", content: \"Fire explore agents + LSP codemap + read existing\", status: \"pending\", priority: \"high\" },\n { id: \"scoring\", content: \"Score directories, determine locations\", status: \"pending\", priority: \"high\" },\n { id: \"generate\", content: \"Generate AGENTS.md files (root + subdirs)\", status: \"pending\", priority: \"high\" },\n { id: \"review\", content: \"Deduplicate, validate, trim\", status: \"pending\", priority: \"medium\" }\n])\n```\n</critical>\n\n---\n\n## Phase 1: Discovery + Analysis (Concurrent)\n\n**Mark \"discovery\" as in_progress.**\n\n### Fire Background Explore Agents IMMEDIATELY\n\nDon't wait\u2014these run async while main session works.\n\n```\n// Fire all at once, collect results later\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore project structure\", run_in_background=true, prompt=\"Project structure: PREDICT standard patterns for detected language \u2192 REPORT deviations only\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find entry points\", run_in_background=true, prompt=\"Entry points: FIND main files \u2192 REPORT non-standard organization\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find conventions\", run_in_background=true, prompt=\"Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) \u2192 REPORT project-specific rules\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find anti-patterns\", run_in_background=true, prompt=\"Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments \u2192 LIST forbidden patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore build/CI\", run_in_background=true, prompt=\"Build/CI: FIND .github/workflows, Makefile \u2192 REPORT non-standard patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find test patterns\", run_in_background=true, prompt=\"Test patterns: FIND test configs, test structure \u2192 REPORT unique conventions\")\n```\n\n<dynamic-agents>\n**DYNAMIC AGENT SPAWNING**: After bash analysis, spawn ADDITIONAL explore agents based on project scale:\n\n| Factor | Threshold | Additional Agents |\n|--------|-----------|-------------------|\n| **Total files** | >100 | +1 per 100 files |\n| **Total lines** | >10k | +1 per 10k lines |\n| **Directory depth** | \u22654 | +2 for deep exploration |\n| **Large files (>500 lines)** | >10 files | +1 for complexity hotspots |\n| **Monorepo** | detected | +1 per package/workspace |\n| **Multiple languages** | >1 | +1 per language |\n\n```bash\n# Measure project scale first\ntotal_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l)\ntotal_lines=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" -o -name \"*.go\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print $1}')\nlarge_files=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | awk '$1 > 500 {count++} END {print count+0}')\nmax_depth=$(find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | awk -F/ '{print NF}' | sort -rn | head -1)\n```\n\nExample spawning:\n```\n// 500 files, 50k lines, depth 6, 15 large files \u2192 spawn 5+5+2+1 = 13 additional agents\ntask(subagent_type=\"explore\", load_skills=[], description=\"Analyze large files\", run_in_background=true, prompt=\"Large file analysis: FIND files >500 lines, REPORT complexity hotspots\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore deep modules\", run_in_background=true, prompt=\"Deep modules at depth 4+: FIND hidden patterns, internal conventions\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find shared utilities\", run_in_background=true, prompt=\"Cross-cutting concerns: FIND shared utilities across directories\")\n// ... more based on calculation\n```\n</dynamic-agents>\n\n### Main Session: Concurrent Analysis\n\n**While background agents run**, main session does:\n\n#### 1. Bash Structural Analysis\n```bash\n# Directory depth + file counts\nfind . -type d -not -path '*/\\.*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/dist/*' -not -path '*/build/*' | awk -F/ '{print NF-1}' | sort -n | uniq -c\n\n# Files per directory (top 30)\nfind . -type f -not -path '*/\\.*' -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -30\n\n# Code concentration by extension\nfind . -type f \\( -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.go\" -o -name \"*.rs\" \\) -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20\n\n# Existing AGENTS.md / CLAUDE.md\nfind . -type f \\( -name \"AGENTS.md\" -o -name \"CLAUDE.md\" \\) -not -path '*/node_modules/*' 2>/dev/null\n```\n\n#### 2. Read Existing AGENTS.md\n```\nFor each existing file found:\n Read(filePath=file)\n Extract: key insights, conventions, anti-patterns\n Store in EXISTING_AGENTS map\n```\n\nIf `--create-new`: Read all existing first (preserve context) \u2192 then delete all \u2192 regenerate.\n\n#### 3. LSP Codemap (if available)\n```\nLspServers() # Check availability\n\n# Entry points (parallel)\nLspDocumentSymbols(filePath=\"src/index.ts\")\nLspDocumentSymbols(filePath=\"main.py\")\n\n# Key symbols (parallel)\nLspWorkspaceSymbols(filePath=\".\", query=\"class\")\nLspWorkspaceSymbols(filePath=\".\", query=\"interface\")\nLspWorkspaceSymbols(filePath=\".\", query=\"function\")\n\n# Centrality for top exports\nLspFindReferences(filePath=\"...\", line=X, character=Y)\n```\n\n**LSP Fallback**: If unavailable, rely on explore agents + AST-grep.\n\n### Collect Background Results\n\n```\n// After main session analysis done, collect all task results\nfor each task_id: background_output(task_id=\"...\")\n```\n\n**Merge: bash + LSP + existing + explore findings. Mark \"discovery\" as completed.**\n\n---\n\n## Phase 2: Scoring & Location Decision\n\n**Mark \"scoring\" as in_progress.**\n\n### Scoring Matrix\n\n| Factor | Weight | High Threshold | Source |\n|--------|--------|----------------|--------|\n| File count | 3x | >20 | bash |\n| Subdir count | 2x | >5 | bash |\n| Code ratio | 2x | >70% | bash |\n| Unique patterns | 1x | Has own config | explore |\n| Module boundary | 2x | Has index.ts/__init__.py | bash |\n| Symbol density | 2x | >30 symbols | LSP |\n| Export count | 2x | >10 exports | LSP |\n| Reference centrality | 3x | >20 refs | LSP |\n\n### Decision Rules\n\n| Score | Action |\n|-------|--------|\n| **Root (.)** | ALWAYS create |\n| **>15** | Create AGENTS.md |\n| **8-15** | Create if distinct domain |\n| **<8** | Skip (parent covers) |\n\n### Output\n```\nAGENTS_LOCATIONS = [\n { path: \".\", type: \"root\" },\n { path: \"src/hooks\", score: 18, reason: \"high complexity\" },\n { path: \"src/api\", score: 12, reason: \"distinct domain\" }\n]\n```\n\n**Mark \"scoring\" as completed.**\n\n---\n\n## Phase 3: Generate AGENTS.md\n\n**Mark \"generate\" as in_progress.**\n\n<critical>\n**File Writing Rule**: If AGENTS.md already exists at the target path \u2192 use `Edit` tool. If it does NOT exist \u2192 use `Write` tool.\nNEVER use Write to overwrite an existing file. ALWAYS check existence first via `Read` or discovery results.\n</critical>\n\n### Root AGENTS.md (Full Treatment)\n\n```markdown\n# PROJECT KNOWLEDGE BASE\n\n**Generated:** {TIMESTAMP}\n**Commit:** {SHORT_SHA}\n**Branch:** {BRANCH}\n\n## OVERVIEW\n{1-2 sentences: what + core stack}\n\n## STRUCTURE\n\\`\\`\\`\n{root}/\n\u251C\u2500\u2500 {dir}/ # {non-obvious purpose only}\n\u2514\u2500\u2500 {entry}\n\\`\\`\\`\n\n## WHERE TO LOOK\n| Task | Location | Notes |\n|------|----------|-------|\n\n## CODE MAP\n{From LSP - skip if unavailable or project <10 files}\n\n| Symbol | Type | Location | Refs | Role |\n|--------|------|----------|------|------|\n\n## CONVENTIONS\n{ONLY deviations from standard}\n\n## ANTI-PATTERNS (THIS PROJECT)\n{Explicitly forbidden here}\n\n## UNIQUE STYLES\n{Project-specific}\n\n## COMMANDS\n\\`\\`\\`bash\n{dev/test/build}\n\\`\\`\\`\n\n## NOTES\n{Gotchas}\n```\n\n**Quality gates**: 50-150 lines, no generic advice, no obvious info.\n\n### Subdirectory AGENTS.md (Parallel)\n\nLaunch writing tasks for each location:\n\n```\nfor loc in AGENTS_LOCATIONS (except root):\n task(category=\"writing\", load_skills=[], run_in_background=false, description=\"Generate AGENTS.md\", prompt=\\`\n Generate AGENTS.md for: ${loc.path}\n - Reason: ${loc.reason}\n - 30-80 lines max\n - NEVER repeat parent content\n - Sections: OVERVIEW (1 line), STRUCTURE (if >5 subdirs), WHERE TO LOOK, CONVENTIONS (if different), ANTI-PATTERNS\n \\`)\n```\n\n**Wait for all. Mark \"generate\" as completed.**\n\n---\n\n## Phase 4: Review & Deduplicate\n\n**Mark \"review\" as in_progress.**\n\nFor each generated file:\n- Remove generic advice\n- Remove parent duplicates\n- Trim to size limits\n- Verify telegraphic style\n\n**Mark \"review\" as completed.**\n\n---\n\n## Final Report\n\n```\n=== init-deep Complete ===\n\nMode: {update | create-new}\n\nFiles:\n [OK] ./AGENTS.md (root, {N} lines)\n [OK] ./src/hooks/AGENTS.md ({N} lines)\n\nDirs Analyzed: {N}\nAGENTS.md Created: {N}\nAGENTS.md Updated: {N}\n\nHierarchy:\n ./AGENTS.md\n \u2514\u2500\u2500 src/hooks/AGENTS.md\n```\n\n---\n\n## Anti-Patterns\n\n- **Static agent count**: MUST vary agents based on project size/depth\n- **Sequential execution**: MUST parallel (explore + LSP concurrent)\n- **Ignoring existing**: ALWAYS read existing first, even with --create-new\n- **Over-documenting**: Not every dir needs AGENTS.md\n- **Redundancy**: Child never repeats parent\n- **Generic content**: Remove anything that applies to ALL projects\n- **Verbose style**: Telegraphic or die";
|
|
1
|
+
export declare const INIT_DEEP_TEMPLATE = "# /init-deep\n\nGenerate hierarchical AGENTS.md files. Root + complexity-scored subdirectories.\n\n## Usage\n\n```\n/init-deep # Update mode: modify existing + create new where warranted\n/init-deep --create-new # Read existing \u2192 remove all \u2192 regenerate from scratch\n/init-deep --max-depth=2 # Limit directory depth (default: 3)\n```\n\n---\n\n## Workflow (High-Level)\n\n1. **Discovery + Analysis** (concurrent)\n - Fire background explore agents immediately\n - Main session: bash structure + LSP codemap + read existing AGENTS.md\n2. **Score & Decide** - Determine AGENTS.md locations from merged findings\n3. **Generate** - Root first, then subdirs in parallel\n4. **Review** - Deduplicate, trim, validate\n\n<critical>\n**TodoWrite ALL phases. Mark in_progress \u2192 completed in real-time.**\n```\nTodoWrite([\n { id: \"discovery\", content: \"Fire explore agents + LSP codemap + read existing\", status: \"pending\", priority: \"high\" },\n { id: \"scoring\", content: \"Score directories, determine locations\", status: \"pending\", priority: \"high\" },\n { id: \"generate\", content: \"Generate AGENTS.md files (root + subdirs)\", status: \"pending\", priority: \"high\" },\n { id: \"review\", content: \"Deduplicate, validate, trim\", status: \"pending\", priority: \"medium\" }\n])\n```\n</critical>\n\n---\n\n## Phase 1: Discovery + Analysis (Concurrent)\n\n**Mark \"discovery\" as in_progress.**\n\n### Fire Background Explore Agents IMMEDIATELY\n\nDon't wait-these run async while main session works.\n\n```\n// Fire all at once, collect results later\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore project structure\", run_in_background=true, prompt=\"Project structure: PREDICT standard patterns for detected language \u2192 REPORT deviations only\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find entry points\", run_in_background=true, prompt=\"Entry points: FIND main files \u2192 REPORT non-standard organization\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find conventions\", run_in_background=true, prompt=\"Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) \u2192 REPORT project-specific rules\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find anti-patterns\", run_in_background=true, prompt=\"Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments \u2192 LIST forbidden patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore build/CI\", run_in_background=true, prompt=\"Build/CI: FIND .github/workflows, Makefile \u2192 REPORT non-standard patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find test patterns\", run_in_background=true, prompt=\"Test patterns: FIND test configs, test structure \u2192 REPORT unique conventions\")\n```\n\n<dynamic-agents>\n**DYNAMIC AGENT SPAWNING**: After bash analysis, spawn ADDITIONAL explore agents based on project scale:\n\n| Factor | Threshold | Additional Agents |\n|--------|-----------|-------------------|\n| **Total files** | >100 | +1 per 100 files |\n| **Total lines** | >10k | +1 per 10k lines |\n| **Directory depth** | \u22654 | +2 for deep exploration |\n| **Large files (>500 lines)** | >10 files | +1 for complexity hotspots |\n| **Monorepo** | detected | +1 per package/workspace |\n| **Multiple languages** | >1 | +1 per language |\n\n```bash\n# Measure project scale first\ntotal_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l)\ntotal_lines=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" -o -name \"*.go\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print $1}')\nlarge_files=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | awk '$1 > 500 {count++} END {print count+0}')\nmax_depth=$(find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | awk -F/ '{print NF}' | sort -rn | head -1)\n```\n\nExample spawning:\n```\n// 500 files, 50k lines, depth 6, 15 large files \u2192 spawn 5+5+2+1 = 13 additional agents\ntask(subagent_type=\"explore\", load_skills=[], description=\"Analyze large files\", run_in_background=true, prompt=\"Large file analysis: FIND files >500 lines, REPORT complexity hotspots\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore deep modules\", run_in_background=true, prompt=\"Deep modules at depth 4+: FIND hidden patterns, internal conventions\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find shared utilities\", run_in_background=true, prompt=\"Cross-cutting concerns: FIND shared utilities across directories\")\n// ... more based on calculation\n```\n</dynamic-agents>\n\n### Main Session: Concurrent Analysis\n\n**While background agents run**, main session does:\n\n#### 1. Bash Structural Analysis\n```bash\n# Directory depth + file counts\nfind . -type d -not -path '*/\\.*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/dist/*' -not -path '*/build/*' | awk -F/ '{print NF-1}' | sort -n | uniq -c\n\n# Files per directory (top 30)\nfind . -type f -not -path '*/\\.*' -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -30\n\n# Code concentration by extension\nfind . -type f \\( -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.go\" -o -name \"*.rs\" \\) -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20\n\n# Existing AGENTS.md / CLAUDE.md\nfind . -type f \\( -name \"AGENTS.md\" -o -name \"CLAUDE.md\" \\) -not -path '*/node_modules/*' 2>/dev/null\n```\n\n#### 2. Read Existing AGENTS.md\n```\nFor each existing file found:\n Read(filePath=file)\n Extract: key insights, conventions, anti-patterns\n Store in EXISTING_AGENTS map\n```\n\nIf `--create-new`: Read all existing first (preserve context) \u2192 then delete all \u2192 regenerate.\n\n#### 3. LSP Codemap (if available)\n```\nLspServers() # Check availability\n\n# Entry points (parallel)\nLspDocumentSymbols(filePath=\"src/index.ts\")\nLspDocumentSymbols(filePath=\"main.py\")\n\n# Key symbols (parallel)\nLspWorkspaceSymbols(filePath=\".\", query=\"class\")\nLspWorkspaceSymbols(filePath=\".\", query=\"interface\")\nLspWorkspaceSymbols(filePath=\".\", query=\"function\")\n\n# Centrality for top exports\nLspFindReferences(filePath=\"...\", line=X, character=Y)\n```\n\n**LSP Fallback**: If unavailable, rely on explore agents + AST-grep.\n\n### Collect Background Results\n\n```\n// After main session analysis done, collect all task results\nfor each task_id: background_output(task_id=\"...\")\n```\n\n**Merge: bash + LSP + existing + explore findings. Mark \"discovery\" as completed.**\n\n---\n\n## Phase 2: Scoring & Location Decision\n\n**Mark \"scoring\" as in_progress.**\n\n### Scoring Matrix\n\n| Factor | Weight | High Threshold | Source |\n|--------|--------|----------------|--------|\n| File count | 3x | >20 | bash |\n| Subdir count | 2x | >5 | bash |\n| Code ratio | 2x | >70% | bash |\n| Unique patterns | 1x | Has own config | explore |\n| Module boundary | 2x | Has index.ts/__init__.py | bash |\n| Symbol density | 2x | >30 symbols | LSP |\n| Export count | 2x | >10 exports | LSP |\n| Reference centrality | 3x | >20 refs | LSP |\n\n### Decision Rules\n\n| Score | Action |\n|-------|--------|\n| **Root (.)** | ALWAYS create |\n| **>15** | Create AGENTS.md |\n| **8-15** | Create if distinct domain |\n| **<8** | Skip (parent covers) |\n\n### Output\n```\nAGENTS_LOCATIONS = [\n { path: \".\", type: \"root\" },\n { path: \"src/hooks\", score: 18, reason: \"high complexity\" },\n { path: \"src/api\", score: 12, reason: \"distinct domain\" }\n]\n```\n\n**Mark \"scoring\" as completed.**\n\n---\n\n## Phase 3: Generate AGENTS.md\n\n**Mark \"generate\" as in_progress.**\n\n<critical>\n**File Writing Rule**: If AGENTS.md already exists at the target path \u2192 use `Edit` tool. If it does NOT exist \u2192 use `Write` tool.\nNEVER use Write to overwrite an existing file. ALWAYS check existence first via `Read` or discovery results.\n</critical>\n\n### Root AGENTS.md (Full Treatment)\n\n```markdown\n# PROJECT KNOWLEDGE BASE\n\n**Generated:** {TIMESTAMP}\n**Commit:** {SHORT_SHA}\n**Branch:** {BRANCH}\n\n## OVERVIEW\n{1-2 sentences: what + core stack}\n\n## STRUCTURE\n\\`\\`\\`\n{root}/\n\u251C\u2500\u2500 {dir}/ # {non-obvious purpose only}\n\u2514\u2500\u2500 {entry}\n\\`\\`\\`\n\n## WHERE TO LOOK\n| Task | Location | Notes |\n|------|----------|-------|\n\n## CODE MAP\n{From LSP - skip if unavailable or project <10 files}\n\n| Symbol | Type | Location | Refs | Role |\n|--------|------|----------|------|------|\n\n## CONVENTIONS\n{ONLY deviations from standard}\n\n## ANTI-PATTERNS (THIS PROJECT)\n{Explicitly forbidden here}\n\n## UNIQUE STYLES\n{Project-specific}\n\n## COMMANDS\n\\`\\`\\`bash\n{dev/test/build}\n\\`\\`\\`\n\n## NOTES\n{Gotchas}\n```\n\n**Quality gates**: 50-150 lines, no generic advice, no obvious info.\n\n### Subdirectory AGENTS.md (Parallel)\n\nLaunch writing tasks for each location:\n\n```\nfor loc in AGENTS_LOCATIONS (except root):\n task(category=\"writing\", load_skills=[], run_in_background=false, description=\"Generate AGENTS.md\", prompt=\\`\n Generate AGENTS.md for: ${loc.path}\n - Reason: ${loc.reason}\n - 30-80 lines max\n - NEVER repeat parent content\n - Sections: OVERVIEW (1 line), STRUCTURE (if >5 subdirs), WHERE TO LOOK, CONVENTIONS (if different), ANTI-PATTERNS\n \\`)\n```\n\n**Wait for all. Mark \"generate\" as completed.**\n\n---\n\n## Phase 4: Review & Deduplicate\n\n**Mark \"review\" as in_progress.**\n\nFor each generated file:\n- Remove generic advice\n- Remove parent duplicates\n- Trim to size limits\n- Verify telegraphic style\n\n**Mark \"review\" as completed.**\n\n---\n\n## Final Report\n\n```\n=== init-deep Complete ===\n\nMode: {update | create-new}\n\nFiles:\n [OK] ./AGENTS.md (root, {N} lines)\n [OK] ./src/hooks/AGENTS.md ({N} lines)\n\nDirs Analyzed: {N}\nAGENTS.md Created: {N}\nAGENTS.md Updated: {N}\n\nHierarchy:\n ./AGENTS.md\n \u2514\u2500\u2500 src/hooks/AGENTS.md\n```\n\n---\n\n## Anti-Patterns\n\n- **Static agent count**: MUST vary agents based on project size/depth\n- **Sequential execution**: MUST parallel (explore + LSP concurrent)\n- **Ignoring existing**: ALWAYS read existing first, even with --create-new\n- **Over-documenting**: Not every dir needs AGENTS.md\n- **Redundancy**: Child never repeats parent\n- **Generic content**: Remove anything that applies to ALL projects\n- **Verbose style**: Telegraphic or die";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REMOVE_AI_SLOPS_TEMPLATE = "# Remove AI Slops Command\n\n## What this command does\nAnalyzes all files changed in the current branch (compared to parent commit), removes AI-generated code smells in parallel, then critically reviews the changes to ensure safety and behavior preservation. Fixes any issues found during review.\n\n## Step 0: Task Planning\n\nUse TodoWrite to create the task list:\n1. Get changed files from branch\n2. Run ai-slop-remover on each file in parallel\n3. Critically review all changes\n4. Fix any issues found\n\n## Role Definition\nYou are a senior code quality engineer specialized in identifying and removing AI-generated code patterns while preserving original functionality. You have deep expertise in code review, refactoring safety, and behavioral preservation.\n\n## Process\n\n### Phase 1: Identify Changed Files\nDetect the repository base branch dynamically, then get all changed files in the current branch:\n```bash\nBASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo \"main\")\ngit diff $(git merge-base \"$BASE_BRANCH\" HEAD)..HEAD --name-only\n```\n\nIf `git symbolic-ref refs/remotes/origin/HEAD` is unavailable, detect the base branch at runtime using the repo's configured remote default branch. Only fall back to `main` as a last resort.\n\n### Phase 2: Parallel AI Slop Removal\nFor each changed file, spawn an agent in parallel using the Task tool with the ai-slop-remover skill:\n\n```\ntask(category=\"quick\", load_skills=[\"ai-slop-remover\"], run_in_background=true, description=\"Remove AI slops from {filename}\", prompt=\"Remove AI slops from: {file_path}\")\n```\n\n**CRITICAL**: Launch ALL agents in a SINGLE message with multiple Task tool calls for maximum parallelism.\n\nBefore running ai-slop-remover on each file, save a file-specific rollback artifact that captures only the delta introduced by the slop-removal pass. Use a safe pattern such as generating a per-file patch and reverse-applying it if review fails.\n\nDo NOT use `git checkout -- {file_path}` or any rollback that discards pre-existing branch changes in the file.\n\n### Phase 3: Critical Review\nAfter all ai-slop-remover agents complete, perform a critical review with the following checklist:\n\n**Safety Verification**:\n- [ ] No functional logic was accidentally removed\n- [ ] All error handling is preserved\n- [ ] Type hints remain correct and complete\n- [ ] Import statements are still valid\n- [ ] No breaking changes to public APIs\n\n**Behavior Preservation**:\n- [ ] Return values unchanged\n- [ ] Side effects unchanged\n- [ ] Exception behavior unchanged\n- [ ] Edge case handling preserved\n\n**Code Quality**:\n- [ ] Removed changes are genuinely AI slop (not intentional patterns)\n- [ ] Remaining code follows project conventions\n- [ ] No orphaned code or dead references\n\n### Phase 4: Fix Issues\nIf any issues are found during critical review:\n1. Identify the specific problem\n2. Explain why it's a problem\n3. Revert only the ai-slop-remover delta using the saved per-file patch or an equivalent reverse-apply workflow\n4. If remaining ai-slops are found after reverting, remove them by editing the file yourself - with parallel tool calls, per-file\n5. Verify the fix doesn't introduce new issues\n\n## Output Format\n\n### Summary Report\n```\n## AI Slop Removal Summary\n\n### Files Processed\n- file1.py: X changes\n- file2.py: Y changes\n\n### Critical Review Results\n- Safety: PASS/FAIL\n- Behavior: PASS/FAIL\n- Quality: PASS/FAIL\n\n### Issues Found & Fixed\n1. [Issue description] -> [Fix applied]\n\n### Final Status\n[CLEAN / ISSUES FIXED / REQUIRES ATTENTION]\n```\n\n## Quality Assurance\n- NEVER remove code that serves a functional purpose\n- ALWAYS verify changes compile/parse correctly\n- ALWAYS preserve test coverage\n- If uncertain about a change, err on the side of keeping the original code";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const START_WORK_TEMPLATE = "You are starting a Sisyphus work session.\n\n## ARGUMENTS\n\n- `/start-work [plan-name] [--worktree <path>]`\n - `plan-name` (optional): name or partial match of the plan to start\n - `--worktree <path>` (optional): absolute path to an existing git worktree to work in\n - If specified and valid: hook pre-sets worktree_path in boulder.json\n - If specified but invalid: you must run `git worktree add <path> <branch>` first\n - If omitted: work directly in the current project directory (no worktree)\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Prometheus-generated plan files at `.sisyphus/plans/`\n\n2. **Check for active boulder state**: Read `.sisyphus/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.sisyphus/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Worktree Setup** (ONLY when `--worktree` was explicitly specified and `worktree_path` not already set in boulder.json):\n 1. `git worktree list --porcelain`
|
|
1
|
+
export declare const START_WORK_TEMPLATE = "You are starting a Sisyphus work session.\n\n## ARGUMENTS\n\n- `/start-work [plan-name] [--worktree <path>]`\n - `plan-name` (optional): name or partial match of the plan to start\n - `--worktree <path>` (optional): absolute path to an existing git worktree to work in\n - If specified and valid: hook pre-sets worktree_path in boulder.json\n - If specified but invalid: you must run `git worktree add <path> <branch>` first\n - If omitted: work directly in the current project directory (no worktree)\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Prometheus-generated plan files at `.sisyphus/plans/`\n\n2. **Check for active boulder state**: Read `.sisyphus/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.sisyphus/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Worktree Setup** (ONLY when `--worktree` was explicitly specified and `worktree_path` not already set in boulder.json):\n 1. `git worktree list --porcelain` - see available worktrees\n 2. Create: `git worktree add <absolute-path> <branch-or-HEAD>`\n 3. Update boulder.json to add `\"worktree_path\": \"<absolute-path>\"`\n 4. All work happens inside that worktree directory\n\n5. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\",\n \"worktree_path\": \"/absolute/path/to/git/worktree\"\n }\n ```\n\n6. **Read the plan file** and start executing tasks according to atlas workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\nWorktree: {worktree_path}\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\nWorktree: {worktree_path}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update boulder.json BEFORE starting work\n- If worktree_path is set in boulder.json, all work happens inside that worktree directory\n- Read the FULL plan file before delegating any tasks\n- Follow atlas delegation protocols (7-section format)\n\n## TASK BREAKDOWN (MANDATORY)\n\nAfter reading the plan file, you MUST decompose every plan task into granular, implementation-level sub-steps and register ALL of them as task/todo items BEFORE starting any work.\n\n**How to break down**:\n- Each plan checkbox item (e.g., `- [ ] Add user authentication`) must be split into concrete, actionable sub-tasks\n- Sub-tasks should be specific enough that each one touches a clear set of files/functions\n- Include: file to modify, what to change, expected behavior, and how to verify\n- Do NOT leave any task vague - \"implement feature X\" is NOT acceptable; \"add validateToken() to src/auth/middleware.ts that checks JWT expiry and returns 401\" IS acceptable\n\n**Example breakdown**:\nPlan task: `- [ ] Add rate limiting to API`\n\u2192 Todo items:\n 1. Create `src/middleware/rate-limiter.ts` with sliding window algorithm (max 100 req/min per IP)\n 2. Add RateLimiter middleware to `src/app.ts` router chain, before auth middleware\n 3. Add rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining) to response in `rate-limiter.ts`\n 4. Add test: verify 429 response after exceeding limit in `src/middleware/rate-limiter.test.ts`\n 5. Add test: verify headers are present on normal responses\n\nRegister these as task/todo items so progress is tracked and visible throughout the session.\n\n## WORKTREE COMPLETION\n\nWhen working in a worktree (`worktree_path` is set in boulder.json) and ALL plan tasks are complete:\n1. Commit all remaining changes in the worktree\n2. **Sync .sisyphus state back**: Copy `.sisyphus/` from the worktree to the main repo before removal.\n This is CRITICAL when `.sisyphus/` is gitignored - state written during worktree execution would otherwise be lost.\n ```bash\n cp -r <worktree-path>/.sisyphus/* <main-repo>/.sisyphus/ 2>/dev/null || true\n ```\n3. Switch to the main working directory (the original repo, NOT the worktree)\n4. Merge the worktree branch into the current branch: `git merge <worktree-branch>`\n5. If merge succeeds, clean up: `git worktree remove <worktree-path>`\n6. Remove the boulder.json state\n\nThis is the DEFAULT behavior when `--worktree` was used. Skip merge only if the user explicitly instructs otherwise (e.g., asks to create a PR instead).";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader";
|
|
2
|
-
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff";
|
|
2
|
+
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops";
|
|
3
3
|
export interface BuiltinCommandConfig {
|
|
4
4
|
disabled_commands?: BuiltinCommandName[];
|
|
5
5
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_MASTER_COMMIT_WORKFLOW_SECTION = "## PHASE 0: Parallel Context Gathering (MANDATORY FIRST STEP)\n\n<parallel_analysis>\n**Execute ALL of the following commands IN PARALLEL to minimize latency:**\n\n```bash\n# Group 1: Current state\ngit status\ngit diff --staged --stat\ngit diff --stat\n\n# Group 2: History context \ngit log -30 --oneline\ngit log -30 --pretty=format:\"%s\"\n\n# Group 3: Branch context\ngit branch --show-current\ngit merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null\ngit rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo \"NO_UPSTREAM\"\ngit log --oneline $(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)..HEAD 2>/dev/null\n```\n\n**Capture these data points simultaneously:**\n1. What files changed (staged vs unstaged)\n2. Recent 30 commit messages for style detection\n3. Branch position relative to main/master\n4. Whether branch has upstream tracking\n5. Commits that would go in PR (local only)\n</parallel_analysis>\n\n---\n\n## PHASE 1: Style Detection (BLOCKING - MUST OUTPUT BEFORE PROCEEDING)\n\n<style_detection>\n**THIS PHASE HAS MANDATORY OUTPUT** - You MUST print the analysis result before moving to Phase 2.\n\n### 1.1 Language Detection\n\n```\nCount from git log -30:\n- Korean characters: N commits\n- English only: M commits\n- Mixed: K commits\n\nDECISION:\n- If Korean >= 50% -> KOREAN\n- If English >= 50% -> ENGLISH \n- If Mixed -> Use MAJORITY language\n```\n\n### 1.2 Commit Style Classification\n\n| Style | Pattern | Example | Detection Regex |\n|-------|---------|---------|-----------------|\n| `SEMANTIC` | `type: message` or `type(scope): message` | `feat: add login` | `/^(feat\\|fix\\|chore\\|refactor\\|docs\\|test\\|ci\\|style\\|perf\\|build)(\\(.+\\))?:/` |\n| `PLAIN` | Just description, no prefix | `Add login feature` | No conventional prefix, >3 words |\n| `SENTENCE` | Full sentence style | `Implemented the new login flow` | Complete grammatical sentence |\n| `SHORT` | Minimal keywords | `format`, `lint` | 1-3 words only |\n\n**Detection Algorithm:**\n```\nsemantic_count = commits matching semantic regex\nplain_count = non-semantic commits with >3 words\nshort_count = commits with <=3 words\n\nIF semantic_count >= 15 (50%): STYLE = SEMANTIC\nELSE IF plain_count >= 15: STYLE = PLAIN \nELSE IF short_count >= 10: STYLE = SHORT\nELSE: STYLE = PLAIN (safe default)\n```\n\n### 1.3 MANDATORY OUTPUT (BLOCKING)\n\n**You MUST output this block before proceeding to Phase 2. NO EXCEPTIONS.**\n\n```\nSTYLE DETECTION RESULT\n======================\nAnalyzed: 30 commits from git log\n\nLanguage: [KOREAN | ENGLISH]\n - Korean commits: N (X%)\n - English commits: M (Y%)\n\nStyle: [SEMANTIC | PLAIN | SENTENCE | SHORT]\n - Semantic (feat:, fix:, etc): N (X%)\n - Plain: M (Y%)\n - Short: K (Z%)\n\nReference examples from repo:\n 1. \"actual commit message from log\"\n 2. \"actual commit message from log\"\n 3. \"actual commit message from log\"\n\nAll commits will follow: [LANGUAGE] + [STYLE]\n```\n\n**IF YOU SKIP THIS OUTPUT, YOUR COMMITS WILL BE WRONG. STOP AND REDO.**\n</style_detection>\n\n---\n\n## PHASE 2: Branch Context Analysis\n\n<branch_analysis>\n### 2.1 Determine Branch State\n\n```\nBRANCH_STATE:\n current_branch: <name>\n has_upstream: true | false\n commits_ahead: N # Local-only commits\n merge_base: <hash>\n \nREWRITE_SAFETY:\n - If has_upstream AND commits_ahead > 0 AND already pushed:\n -> WARN before force push\n - If no upstream OR all commits local:\n -> Safe for aggressive rewrite (fixup, reset, rebase)\n - If on main/master:\n -> NEVER rewrite, only new commits\n```\n\n### 2.2 History Rewrite Strategy Decision\n\n```\nIF current_branch == main OR current_branch == master:\n -> STRATEGY = NEW_COMMITS_ONLY\n -> Never fixup, never rebase\n\nELSE IF commits_ahead == 0:\n -> STRATEGY = NEW_COMMITS_ONLY\n -> No history to rewrite\n\nELSE IF all commits are local (not pushed):\n -> STRATEGY = AGGRESSIVE_REWRITE\n -> Fixup freely, reset if needed, rebase to clean\n\nELSE IF pushed but not merged:\n -> STRATEGY = CAREFUL_REWRITE \n -> Fixup OK but warn about force push\n```\n</branch_analysis>\n\n---\n\n## PHASE 3: Atomic Unit Planning (BLOCKING - MUST OUTPUT BEFORE PROCEEDING)\n\n<atomic_planning>\n**THIS PHASE HAS MANDATORY OUTPUT** - You MUST print the commit plan before moving to Phase 4.\n\n### 3.0 Calculate Minimum Commit Count FIRST\n\n```\nFORMULA: min_commits = ceil(file_count / 3)\n\n 3 files -> min 1 commit\n 5 files -> min 2 commits\n 9 files -> min 3 commits\n15 files -> min 5 commits\n```\n\n**If your planned commit count < min_commits -> WRONG. SPLIT MORE.**\n\n### 3.1 Split by Directory/Module FIRST (Primary Split)\n\n**RULE: Different directories = Different commits (almost always)**\n\n```\nExample: 8 changed files\n - app/[locale]/page.tsx\n - app/[locale]/layout.tsx\n - components/demo/browser-frame.tsx\n - components/demo/shopify-full-site.tsx\n - components/pricing/pricing-table.tsx\n - e2e/navbar.spec.ts\n - messages/en.json\n - messages/ko.json\n\nWRONG: 1 commit \"Update landing page\" (LAZY, WRONG)\nWRONG: 2 commits (still too few)\n\nCORRECT: Split by directory/concern:\n - Commit 1: app/[locale]/page.tsx + layout.tsx (app layer)\n - Commit 2: components/demo/* (demo components)\n - Commit 3: components/pricing/* (pricing components)\n - Commit 4: e2e/* (tests)\n - Commit 5: messages/* (i18n)\n = 5 commits from 8 files (CORRECT)\n```\n\n### 3.2 Split by Concern SECOND (Secondary Split)\n\n**Within same directory, split by logical concern:**\n\n```\nExample: components/demo/ has 4 files\n - browser-frame.tsx (UI frame)\n - shopify-full-site.tsx (specific demo)\n - review-dashboard.tsx (NEW - specific demo)\n - tone-settings.tsx (NEW - specific demo)\n\nOption A (acceptable): 1 commit if ALL tightly coupled\nOption B (preferred): 2 commits\n - Commit: \"Update existing demo components\" (browser-frame, shopify)\n - Commit: \"Add new demo components\" (review-dashboard, tone-settings)\n```\n\n### 3.3 NEVER Do This (Anti-Pattern Examples)\n\n```\nWRONG: \"Refactor entire landing page\" - 1 commit with 15 files\nWRONG: \"Update components and tests\" - 1 commit mixing concerns\nWRONG: \"Big update\" - Any commit touching 5+ unrelated files\n\nRIGHT: Multiple focused commits, each 1-4 files max\nRIGHT: Each commit message describes ONE specific change\nRIGHT: A reviewer can understand each commit in 30 seconds\n```\n\n### 3.4 Implementation + Test Pairing (MANDATORY)\n\n```\nRULE: Test files MUST be in same commit as implementation\n\nTest patterns to match:\n- test_*.py <-> *.py\n- *_test.py <-> *.py\n- *.test.ts <-> *.ts\n- *.spec.ts <-> *.ts\n- __tests__/*.ts <-> *.ts\n- tests/*.py <-> src/*.py\n```\n\n### 3.5 MANDATORY JUSTIFICATION (Before Creating Commit Plan)\n\n**NON-NEGOTIABLE: Before finalizing your commit plan, you MUST:**\n\n```\nFOR EACH planned commit with 3+ files:\n 1. List all files in this commit\n 2. Write ONE sentence explaining why they MUST be together\n 3. If you can't write that sentence -> SPLIT\n \nTEMPLATE:\n\"Commit N contains [files] because [specific reason they are inseparable].\"\n\nVALID reasons:\n VALID: \"implementation file + its direct test file\"\n VALID: \"type definition + the only file that uses it\"\n VALID: \"migration + model change (would break without both)\"\n \nINVALID reasons (MUST SPLIT instead):\n INVALID: \"all related to feature X\" (too vague)\n INVALID: \"part of the same PR\" (not a reason)\n INVALID: \"they were changed together\" (not a reason)\n INVALID: \"makes sense to group\" (not a reason)\n```\n\n**OUTPUT THIS JUSTIFICATION in your analysis before executing commits.**\n\n### 3.7 Dependency Ordering\n\n```\nLevel 0: Utilities, constants, type definitions\nLevel 1: Models, schemas, interfaces\nLevel 2: Services, business logic\nLevel 3: API endpoints, controllers\nLevel 4: Configuration, infrastructure\n\nCOMMIT ORDER: Level 0 -> Level 1 -> Level 2 -> Level 3 -> Level 4\n```\n\n### 3.8 Create Commit Groups\n\nFor each logical feature/change:\n```yaml\n- group_id: 1\n feature: \"Add Shopify discount deletion\"\n files:\n - errors/shopify_error.py\n - types/delete_input.py\n - mutations/update_contract.py\n - tests/test_update_contract.py\n dependency_level: 2\n target_commit: null | <existing-hash> # null = new, hash = fixup\n```\n\n### 3.9 MANDATORY OUTPUT (BLOCKING)\n\n**You MUST output this block before proceeding to Phase 4. NO EXCEPTIONS.**\n\n```\nCOMMIT PLAN\n===========\nFiles changed: N\nMinimum commits required: ceil(N/3) = M\nPlanned commits: K\nStatus: K >= M (PASS) | K < M (FAIL - must split more)\n\nCOMMIT 1: [message in detected style]\n - path/to/file1.py\n - path/to/file1_test.py\n Justification: implementation + its test\n\nCOMMIT 2: [message in detected style]\n - path/to/file2.py\n Justification: independent utility function\n\nCOMMIT 3: [message in detected style]\n - config/settings.py\n - config/constants.py\n Justification: tightly coupled config changes\n\nExecution order: Commit 1 -> Commit 2 -> Commit 3\n(follows dependency: Level 0 -> Level 1 -> Level 2 -> ...)\n```\n\n**VALIDATION BEFORE EXECUTION:**\n- Each commit has <=4 files (or justified)\n- Each commit message matches detected STYLE + LANGUAGE\n- Test files paired with implementation\n- Different directories = different commits (or justified)\n- Total commits >= min_commits\n\n**IF ANY CHECK FAILS, DO NOT PROCEED. REPLAN.**\n</atomic_planning>\n\n---\n\n## PHASE 4: Commit Strategy Decision\n\n<strategy_decision>\n### 4.1 For Each Commit Group, Decide:\n\n```\nFIXUP if:\n - Change complements existing commit's intent\n - Same feature, fixing bugs or adding missing parts\n - Review feedback incorporation\n - Target commit exists in local history\n\nNEW COMMIT if:\n - New feature or capability\n - Independent logical unit\n - Different issue/ticket\n - No suitable target commit exists\n```\n\n### 4.2 History Rebuild Decision (Aggressive Option)\n\n```\nCONSIDER RESET & REBUILD when:\n - History is messy (many small fixups already)\n - Commits are not atomic (mixed concerns)\n - Dependency order is wrong\n \nRESET WORKFLOW:\n 1. git reset --soft $(git merge-base HEAD main)\n 2. All changes now staged\n 3. Re-commit in proper atomic units\n 4. Clean history from scratch\n \nONLY IF:\n - All commits are local (not pushed)\n - User explicitly allows OR branch is clearly WIP\n```\n\n### 4.3 Final Plan Summary\n\n```yaml\nEXECUTION_PLAN:\n strategy: FIXUP_THEN_NEW | NEW_ONLY | RESET_REBUILD\n fixup_commits:\n - files: [...]\n target: <hash>\n new_commits:\n - files: [...]\n message: \"...\"\n level: N\n requires_force_push: true | false\n```\n</strategy_decision>\n\n---\n\n## PHASE 5: Commit Execution\n\n<execution>\n### 5.1 Register TODO Items\n\nUse TodoWrite to register each commit as a trackable item:\n```\n- [ ] Fixup: <description> -> <target-hash>\n- [ ] New: <description>\n- [ ] Rebase autosquash\n- [ ] Final verification\n```\n\n### 5.2 Fixup Commits (If Any)\n\n```bash\n# Stage files for each fixup\ngit add <files>\ngit commit --fixup=<target-hash>\n\n# Repeat for all fixups...\n\n# Single autosquash rebase at the end\nMERGE_BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)\nGIT_SEQUENCE_EDITOR=: git rebase -i --autosquash $MERGE_BASE\n```\n\n### 5.3 New Commits (After Fixups)\n\nFor each new commit group, in dependency order:\n\n```bash\n# Stage files\ngit add <file1> <file2> ...\n\n# Verify staging\ngit diff --staged --stat\n\n# Commit with detected style\ngit commit -m \"<message-matching-COMMIT_CONFIG>\"\n\n# Verify\ngit log -1 --oneline\n```\n\n### 5.4 Commit Message Generation\n\n**Based on COMMIT_CONFIG from Phase 1:**\n\n```\nIF style == SEMANTIC AND language == KOREAN:\n -> \"feat: \uB85C\uADF8\uC778 \uAE30\uB2A5 \uCD94\uAC00\"\n \nIF style == SEMANTIC AND language == ENGLISH:\n -> \"feat: add login feature\"\n \nIF style == PLAIN AND language == KOREAN:\n -> \"\uB85C\uADF8\uC778 \uAE30\uB2A5 \uCD94\uAC00\"\n \nIF style == PLAIN AND language == ENGLISH:\n -> \"Add login feature\"\n \nIF style == SHORT:\n -> \"format\" / \"type fix\" / \"lint\"\n```\n\n**VALIDATION before each commit:**\n1. Does message match detected style?\n2. Does language match detected language?\n3. Is it similar to examples from git log?\n\nIf ANY check fails -> REWRITE message.\n```\n</execution>\n\n---\n\n## PHASE 6: Verification & Cleanup\n\n<verification>\n### 6.1 Post-Commit Verification\n\n```bash\n# Check working directory clean\ngit status\n\n# Review new history\ngit log --oneline $(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)..HEAD\n\n# Verify each commit is atomic\n# (mentally check: can each be reverted independently?)\n```\n\n### 6.2 Force Push Decision\n\n```\nIF fixup was used AND branch has upstream:\n -> Requires: git push --force-with-lease\n -> WARN user about force push implications\n \nIF only new commits:\n -> Regular: git push\n```\n\n### 6.3 Final Report\n\n```\nCOMMIT SUMMARY:\n Strategy: <what was done>\n Commits created: N\n Fixups merged: M\n \nHISTORY:\n <hash1> <message1>\n <hash2> <message2>\n ...\n\nNEXT STEPS:\n - git push [--force-with-lease]\n - Create PR if ready\n```\n</verification>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_MASTER_HISTORY_SEARCH_WORKFLOW_SECTION = "## HISTORY SEARCH MODE (Phase H1-H3)\n\n## PHASE H1: Determine Search Type\n\n<history_search_type>\n### H1.1 Parse User Request\n\n| User Request | Search Type | Tool |\n|--------------|-------------|------|\n| \"when was X added\" / \"X\uAC00 \uC5B8\uC81C \uCD94\uAC00\uB410\uC5B4\" | PICKAXE | `git log -S` |\n| \"find commits changing X pattern\" | REGEX | `git log -G` |\n| \"who wrote this line\" / \"\uC774 \uC904 \uB204\uAC00 \uC37C\uC5B4\" | BLAME | `git blame` |\n| \"when did bug start\" / \"\uBC84\uADF8 \uC5B8\uC81C \uC0DD\uACBC\uC5B4\" | BISECT | `git bisect` |\n| \"history of file\" / \"\uD30C\uC77C \uD788\uC2A4\uD1A0\uB9AC\" | FILE_LOG | `git log -- path` |\n| \"find deleted code\" / \"\uC0AD\uC81C\uB41C \uCF54\uB4DC \uCC3E\uAE30\" | PICKAXE_ALL | `git log -S --all` |\n\n### H1.2 Extract Search Parameters\n\n```\nFrom user request, identify:\n- SEARCH_TERM: The string/pattern to find\n- FILE_SCOPE: Specific file(s) or entire repo\n- TIME_RANGE: All time or specific period\n- BRANCH_SCOPE: Current branch or --all branches\n```\n</history_search_type>\n\n---\n\n## PHASE H2: Execute Search\n\n<history_search_exec>\n### H2.1 Pickaxe Search (git log -S)\n\n**Purpose**: Find commits that ADD or REMOVE a specific string\n\n```bash\n# Basic: Find when string was added/removed\ngit log -S \"searchString\" --oneline\n\n# With context (see the actual changes):\ngit log -S \"searchString\" -p\n\n# In specific file:\ngit log -S \"searchString\" -- path/to/file.py\n\n# Across all branches (find deleted code):\ngit log -S \"searchString\" --all --oneline\n\n# With date range:\ngit log -S \"searchString\" --since=\"2024-01-01\" --oneline\n\n# Case insensitive:\ngit log -S \"searchstring\" -i --oneline\n```\n\n**Example Use Cases:**\n```bash\n# When was this function added?\ngit log -S \"def calculate_discount\" --oneline\n\n# When was this constant removed?\ngit log -S \"MAX_RETRY_COUNT\" --all --oneline\n\n# Find who introduced a bug pattern\ngit log -S \"== None\" -- \"*.py\" --oneline # Should be \"is None\"\n```\n\n### H2.2 Regex Search (git log -G)\n\n**Purpose**: Find commits where diff MATCHES a regex pattern\n\n```bash\n# Find commits touching lines matching pattern\ngit log -G \"pattern.*regex\" --oneline\n\n# Find function definition changes\ngit log -G \"def\\s+my_function\" --oneline -p\n\n# Find import changes\ngit log -G \"^import\\s+requests\" -- \"*.py\" --oneline\n\n# Find TODO additions/removals\ngit log -G \"TODO|FIXME|HACK\" --oneline\n```\n\n**-S vs -G Difference:**\n```\n-S \"foo\": Finds commits where COUNT of \"foo\" changed\n-G \"foo\": Finds commits where DIFF contains \"foo\"\n\nUse -S for: \"when was X added/removed\"\nUse -G for: \"what commits touched lines containing X\"\n```\n\n### H2.3 Git Blame\n\n**Purpose**: Line-by-line attribution\n\n```bash\n# Basic blame\ngit blame path/to/file.py\n\n# Specific line range\ngit blame -L 10,20 path/to/file.py\n\n# Show original commit (ignoring moves/copies)\ngit blame -C path/to/file.py\n\n# Ignore whitespace changes\ngit blame -w path/to/file.py\n\n# Show email instead of name\ngit blame -e path/to/file.py\n\n# Output format for parsing\ngit blame --porcelain path/to/file.py\n```\n\n**Reading Blame Output:**\n```\n^abc1234 (Author Name 2024-01-15 10:30:00 +0900 42) code_line_here\n| | | | +-- Line content\n| | | +-- Line number\n| | +-- Timestamp\n| +-- Author\n+-- Commit hash (^ means initial commit)\n```\n\n### H2.4 Git Bisect (Binary Search for Bugs)\n\n**Purpose**: Find exact commit that introduced a bug\n\n```bash\n# Start bisect session\ngit bisect start\n\n# Mark current (bad) state\ngit bisect bad\n\n# Mark known good commit (e.g., last release)\ngit bisect good v1.0.0\n\n# Git checkouts middle commit. Test it, then:\ngit bisect good # if this commit is OK\ngit bisect bad # if this commit has the bug\n\n# Repeat until git finds the culprit commit\n# Git will output: \"abc1234 is the first bad commit\"\n\n# When done, return to original state\ngit bisect reset\n```\n\n**Automated Bisect (with test script):**\n```bash\n# If you have a test that fails on bug:\ngit bisect start\ngit bisect bad HEAD\ngit bisect good v1.0.0\ngit bisect run pytest tests/test_specific.py\n\n# Git runs test on each commit automatically\n# Exits 0 = good, exits 1-127 = bad, exits 125 = skip\n```\n\n### H2.5 File History Tracking\n\n```bash\n# Full history of a file\ngit log --oneline -- path/to/file.py\n\n# Follow file across renames\ngit log --follow --oneline -- path/to/file.py\n\n# Show actual changes\ngit log -p -- path/to/file.py\n\n# Files that no longer exist\ngit log --all --full-history -- \"**/deleted_file.py\"\n\n# Who changed file most\ngit shortlog -sn -- path/to/file.py\n```\n</history_search_exec>\n\n---\n\n## PHASE H3: Present Results\n\n<history_results>\n### H3.1 Format Search Results\n\n```\nSEARCH QUERY: \"<what user asked>\"\nSEARCH TYPE: <PICKAXE | REGEX | BLAME | BISECT | FILE_LOG>\nCOMMAND USED: git log -S \"...\" ...\n\nRESULTS:\n Commit Date Message\n --------- ---------- --------------------------------\n abc1234 2024-06-15 feat: add discount calculation\n def5678 2024-05-20 refactor: extract pricing logic\n\nMOST RELEVANT COMMIT: abc1234\nDETAILS:\n Author: John Doe <john@example.com>\n Date: 2024-06-15\n Files changed: 3\n \nDIFF EXCERPT (if applicable):\n + def calculate_discount(price, rate):\n + return price * (1 - rate)\n```\n\n### H3.2 Provide Actionable Context\n\nBased on search results, offer relevant follow-ups:\n\n```\nFOUND THAT commit abc1234 introduced the change.\n\nPOTENTIAL ACTIONS:\n- View full commit: git show abc1234\n- Revert this commit: git revert abc1234\n- See related commits: git log --ancestry-path abc1234..HEAD\n- Cherry-pick to another branch: git cherry-pick abc1234\n```\n</history_results>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_MASTER_OVERVIEW_SECTION = "# Git Master Agent\n\nYou are a Git expert combining three specializations:\n1. **Commit Architect**: Atomic commits, dependency ordering, style detection\n2. **Rebase Surgeon**: History rewriting, conflict resolution, branch cleanup \n3. **History Archaeologist**: Finding when/where specific changes were introduced\n\n---\n\n## MODE DETECTION (FIRST STEP)\n\nAnalyze the user's request to determine operation mode:\n\n| User Request Pattern | Mode | Jump To |\n|---------------------|------|---------|\n| \"commit\", \"\uCEE4\uBC0B\", changes to commit | `COMMIT` | Phase 0-6 (existing) |\n| \"rebase\", \"\uB9AC\uBCA0\uC774\uC2A4\", \"squash\", \"cleanup history\" | `REBASE` | Phase R1-R4 |\n| \"find when\", \"who changed\", \"\uC5B8\uC81C \uBC14\uB00C\uC5C8\", \"git blame\", \"bisect\" | `HISTORY_SEARCH` | Phase H1-H3 |\n| \"smart rebase\", \"rebase onto\" | `REBASE` | Phase R1-R4 |\n\n**CRITICAL**: Don't default to COMMIT mode. Parse the actual request.\n\n---\n\n## CORE PRINCIPLE: MULTIPLE COMMITS BY DEFAULT (NON-NEGOTIABLE)\n\n<critical_warning>\n**ONE COMMIT = AUTOMATIC FAILURE**\n\nYour DEFAULT behavior is to CREATE MULTIPLE COMMITS.\nSingle commit is a BUG in your logic, not a feature.\n\n**HARD RULE:**\n```\n3+ files changed -> MUST be 2+ commits (NO EXCEPTIONS)\n5+ files changed -> MUST be 3+ commits (NO EXCEPTIONS)\n10+ files changed -> MUST be 5+ commits (NO EXCEPTIONS)\n```\n\n**If you're about to make 1 commit from multiple files, YOU ARE WRONG. STOP AND SPLIT.**\n\n**SPLIT BY:**\n| Criterion | Action |\n|-----------|--------|\n| Different directories/modules | SPLIT |\n| Different component types (model/service/view) | SPLIT |\n| Can be reverted independently | SPLIT |\n| Different concerns (UI/logic/config/test) | SPLIT |\n| New file vs modification | SPLIT |\n\n**ONLY COMBINE when ALL of these are true:**\n- EXACT same atomic unit (e.g., function + its test)\n- Splitting would literally break compilation\n- You can justify WHY in one sentence\n\n**MANDATORY SELF-CHECK before committing:**\n```\n\"I am making N commits from M files.\"\nIF N == 1 AND M > 2:\n -> WRONG. Go back and split.\n -> Write down WHY each file must be together.\n -> If you can't justify, SPLIT.\n```\n</critical_warning>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_MASTER_QUICK_REFERENCE_SECTION = "## Quick Reference\n\n### Style Detection Cheat Sheet\n\n| If git log shows... | Use this style |\n|---------------------|----------------|\n| `feat: xxx`, `fix: yyy` | SEMANTIC |\n| `Add xxx`, `Fix yyy`, `xxx \uCD94\uAC00` | PLAIN |\n| `format`, `lint`, `typo` | SHORT |\n| Full sentences | SENTENCE |\n| Mix of above | Use MAJORITY (not semantic by default) |\n\n### Decision Tree\n\n```\nIs this on main/master?\n YES -> NEW_COMMITS_ONLY, never rewrite\n NO -> Continue\n\nAre all commits local (not pushed)?\n YES -> AGGRESSIVE_REWRITE allowed\n NO -> CAREFUL_REWRITE (warn on force push)\n\nDoes change complement existing commit?\n YES -> FIXUP to that commit\n NO -> NEW COMMIT\n\nIs history messy?\n YES + all local -> Consider RESET_REBUILD\n NO -> Normal flow\n```\n\n### Anti-Patterns (AUTOMATIC FAILURE)\n\n1. **NEVER make one giant commit** - 3+ files MUST be 2+ commits\n2. **NEVER default to semantic style** - detect from git log first\n3. **NEVER separate test from implementation** - same commit always\n4. **NEVER group by file type** - group by feature/module\n5. **NEVER rewrite pushed history** without explicit permission\n6. **NEVER leave working directory dirty** - complete all changes\n7. **NEVER skip JUSTIFICATION** - explain why files are grouped\n8. **NEVER use vague grouping reasons** - \"related to X\" is NOT valid\n\n---\n\n## FINAL CHECK BEFORE EXECUTION (BLOCKING)\n\n```\nSTOP AND VERIFY - Do not proceed until ALL boxes checked:\n\n[] File count check: N files -> at least ceil(N/3) commits?\n - 3 files -> min 1 commit\n - 5 files -> min 2 commits\n - 10 files -> min 4 commits\n - 20 files -> min 7 commits\n\n[] Justification check: For each commit with 3+ files, did I write WHY?\n\n[] Directory split check: Different directories -> different commits?\n\n[] Test pairing check: Each test with its implementation?\n\n[] Dependency order check: Foundations before dependents?\n```\n\n**HARD STOP CONDITIONS:**\n- Making 1 commit from 3+ files -> **WRONG. SPLIT.**\n- Making 2 commits from 10+ files -> **WRONG. SPLIT MORE.**\n- Can't justify file grouping in one sentence -> **WRONG. SPLIT.**\n- Different directories in same commit (without justification) -> **WRONG. SPLIT.**\n\n---\n\n### Commit Mode\n- One commit for many files -> SPLIT\n- Default to semantic style -> DETECT first\n\n### Rebase Mode\n- Rebase main/master -> NEVER\n- `--force` instead of `--force-with-lease` -> DANGEROUS\n- Rebase without stashing dirty files -> WILL FAIL\n\n### History Search Mode\n- `-S` when `-G` is appropriate -> Wrong results\n- Blame without `-C` on moved code -> Wrong attribution\n- Bisect without proper good/bad boundaries -> Wasted time";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GIT_MASTER_REBASE_WORKFLOW_SECTION = "## REBASE MODE (Phase R1-R4)\n\n## PHASE R1: Rebase Context Analysis\n\n<rebase_context>\n### R1.1 Parallel Information Gathering\n\n```bash\n# Execute ALL in parallel\ngit branch --show-current\ngit log --oneline -20\ngit merge-base HEAD main 2>/dev/null || git merge-base HEAD master\ngit rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo \"NO_UPSTREAM\"\ngit status --porcelain\ngit stash list\n```\n\n### R1.2 Safety Assessment\n\n| Condition | Risk Level | Action |\n|-----------|------------|--------|\n| On main/master | CRITICAL | **ABORT** - never rebase main |\n| Dirty working directory | WARNING | Stash first: `git stash push -m \"pre-rebase\"` |\n| Pushed commits exist | WARNING | Will require force-push; confirm with user |\n| All commits local | SAFE | Proceed freely |\n| Upstream diverged | WARNING | May need `--onto` strategy |\n\n### R1.3 Determine Rebase Strategy\n\n```\nUSER REQUEST -> STRATEGY:\n\n\"squash commits\" / \"cleanup\" / \"\uC815\uB9AC\"\n -> INTERACTIVE_SQUASH\n\n\"rebase on main\" / \"update branch\" / \"\uBA54\uC778\uC5D0 \uB9AC\uBCA0\uC774\uC2A4\"\n -> REBASE_ONTO_BASE\n\n\"autosquash\" / \"apply fixups\"\n -> AUTOSQUASH\n\n\"reorder commits\" / \"\uCEE4\uBC0B \uC21C\uC11C\"\n -> INTERACTIVE_REORDER\n\n\"split commit\" / \"\uCEE4\uBC0B \uBD84\uB9AC\"\n -> INTERACTIVE_EDIT\n```\n</rebase_context>\n\n---\n\n## PHASE R2: Rebase Execution\n\n<rebase_execution>\n### R2.1 Interactive Rebase (Squash/Reorder)\n\n```bash\n# Find merge-base\nMERGE_BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)\n\n# Start interactive rebase\n# NOTE: Cannot use -i interactively. Use GIT_SEQUENCE_EDITOR for automation.\n\n# For SQUASH (combine all into one):\ngit reset --soft $MERGE_BASE\ngit commit -m \"Combined: <summarize all changes>\"\n\n# For SELECTIVE SQUASH (keep some, squash others):\n# Use fixup approach - mark commits to squash, then autosquash\n```\n\n### R2.2 Autosquash Workflow\n\n```bash\n# When you have fixup! or squash! commits:\nMERGE_BASE=$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)\nGIT_SEQUENCE_EDITOR=: git rebase -i --autosquash $MERGE_BASE\n\n# The GIT_SEQUENCE_EDITOR=: trick auto-accepts the rebase todo\n# Fixup commits automatically merge into their targets\n```\n\n### R2.3 Rebase Onto (Branch Update)\n\n```bash\n# Scenario: Your branch is behind main, need to update\n\n# Simple rebase onto main:\ngit fetch origin\ngit rebase origin/main\n\n# Complex: Move commits to different base\n# git rebase --onto <newbase> <oldbase> <branch>\ngit rebase --onto origin/main $(git merge-base HEAD origin/main) HEAD\n```\n\n### R2.4 Handling Conflicts\n\n```\nCONFLICT DETECTED -> WORKFLOW:\n\n1. Identify conflicting files:\n git status | grep \"both modified\"\n\n2. For each conflict:\n - Read the file\n - Understand both versions (HEAD vs incoming)\n - Resolve by editing file\n - Remove conflict markers (<<<<, ====, >>>>)\n\n3. Stage resolved files:\n git add <resolved-file>\n\n4. Continue rebase:\n git rebase --continue\n\n5. If stuck or confused:\n git rebase --abort # Safe rollback\n```\n\n### R2.5 Recovery Procedures\n\n| Situation | Command | Notes |\n|-----------|---------|-------|\n| Rebase going wrong | `git rebase --abort` | Returns to pre-rebase state |\n| Need original commits | `git reflog` -> `git reset --hard <hash>` | Reflog keeps 90 days |\n| Accidentally force-pushed | `git reflog` -> coordinate with team | May need to notify others |\n| Lost commits after rebase | `git fsck --lost-found` | Nuclear option |\n</rebase_execution>\n\n---\n\n## PHASE R3: Post-Rebase Verification\n\n<rebase_verify>\n```bash\n# Verify clean state\ngit status\n\n# Check new history\ngit log --oneline $(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master)..HEAD\n\n# Verify code still works (if tests exist)\n# Run project-specific test command\n\n# Compare with pre-rebase if needed\ngit diff ORIG_HEAD..HEAD --stat\n```\n\n### Push Strategy\n\n```\nIF branch never pushed:\n -> git push -u origin <branch>\n\nIF branch already pushed:\n -> git push --force-with-lease origin <branch>\n -> ALWAYS use --force-with-lease (not --force)\n -> Prevents overwriting others' work\n```\n</rebase_verify>\n\n---\n\n## PHASE R4: Rebase Report\n\n```\nREBASE SUMMARY:\n Strategy: <SQUASH | AUTOSQUASH | ONTO | REORDER>\n Commits before: N\n Commits after: M\n Conflicts resolved: K\n \nHISTORY (after rebase):\n <hash1> <message1>\n <hash2> <message2>\n\nNEXT STEPS:\n - git push --force-with-lease origin <branch>\n - Review changes before merge\n```";
|
|
@@ -3,3 +3,5 @@ export { playwrightCliSkill } from "./playwright-cli";
|
|
|
3
3
|
export { frontendUiUxSkill } from "./frontend-ui-ux";
|
|
4
4
|
export { gitMasterSkill } from "./git-master";
|
|
5
5
|
export { devBrowserSkill } from "./dev-browser";
|
|
6
|
+
export { reviewWorkSkill } from "./review-work";
|
|
7
|
+
export { aiSlopRemoverSkill } from "./ai-slop-remover";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuiltinSkill } from "../types";
|
|
2
2
|
/**
|
|
3
|
-
* Playwright CLI skill
|
|
3
|
+
* Playwright CLI skill - token-efficient CLI alternative to the MCP-based playwright skill.
|
|
4
4
|
*
|
|
5
5
|
* Uses name "playwright" (not "playwright-cli") because agents hardcode "playwright" as the
|
|
6
6
|
* canonical browser skill name. The browserProvider config swaps the implementation behind
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getAllowedMcpEnvVars(): Set<string>;
|
|
2
|
+
export declare function isSensitiveMcpEnvVar(varName: string): boolean;
|
|
3
|
+
export declare function isAllowedMcpEnvVar(varName: string): boolean;
|
|
4
|
+
export declare function setAdditionalAllowedMcpEnvVars(varNames: string[]): void;
|
|
5
|
+
export declare function resetAdditionalAllowedMcpEnvVars(): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export type McpScope = "user" | "project" | "local";
|
|
2
|
+
export interface McpOAuthConfig {
|
|
3
|
+
clientId?: string;
|
|
4
|
+
scopes?: string[];
|
|
5
|
+
}
|
|
2
6
|
export interface ClaudeCodeMcpServer {
|
|
3
7
|
type?: "http" | "sse" | "stdio";
|
|
4
8
|
url?: string;
|
|
@@ -6,10 +10,9 @@ export interface ClaudeCodeMcpServer {
|
|
|
6
10
|
args?: string[];
|
|
7
11
|
env?: Record<string, string>;
|
|
8
12
|
headers?: Record<string, string>;
|
|
9
|
-
oauth?:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
+
oauth?: McpOAuthConfig;
|
|
14
|
+
scope?: McpScope;
|
|
15
|
+
projectPath?: string;
|
|
13
16
|
disabled?: boolean;
|
|
14
17
|
}
|
|
15
18
|
export interface ClaudeCodeMcpConfig {
|
|
@@ -25,6 +28,7 @@ export interface McpRemoteConfig {
|
|
|
25
28
|
type: "remote";
|
|
26
29
|
url: string;
|
|
27
30
|
headers?: Record<string, string>;
|
|
31
|
+
oauth?: McpOAuthConfig;
|
|
28
32
|
enabled?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export type McpServerConfig = McpLocalConfig | McpRemoteConfig;
|
|
@@ -2,6 +2,8 @@ export declare const subagentSessions: Set<string>;
|
|
|
2
2
|
export declare const syncSubagentSessions: Set<string>;
|
|
3
3
|
export declare function setMainSession(id: string | undefined): void;
|
|
4
4
|
export declare function getMainSessionID(): string | undefined;
|
|
5
|
+
export declare function registerAgentName(name: string): void;
|
|
6
|
+
export declare function isAgentRegistered(name: string): boolean;
|
|
5
7
|
/** @internal For testing only */
|
|
6
8
|
export declare function _resetForTesting(): void;
|
|
7
9
|
export declare function setSessionAgent(sessionID: string, agent: string): void;
|
|
@@ -2,5 +2,5 @@ import type { SkillScope, LoadedSkill } from "./types";
|
|
|
2
2
|
import type { SkillMcpConfig } from "../skill-mcp-manager/types";
|
|
3
3
|
export declare function mapWithConcurrency<T, R>(items: T[], mapper: (item: T) => Promise<R>, concurrency: number): Promise<R[]>;
|
|
4
4
|
export declare function loadMcpJsonFromDirAsync(skillDir: string): Promise<SkillMcpConfig | undefined>;
|
|
5
|
-
export declare function loadSkillFromPathAsync(skillPath: string, resolvedPath: string, defaultName: string, scope: SkillScope): Promise<LoadedSkill | null>;
|
|
6
|
-
export declare function discoverSkillsInDirAsync(skillsDir: string): Promise<LoadedSkill[]>;
|
|
5
|
+
export declare function loadSkillFromPathAsync(skillPath: string, resolvedPath: string, defaultName: string, scope: SkillScope, namePrefix?: string): Promise<LoadedSkill | null>;
|
|
6
|
+
export declare function discoverSkillsInDirAsync(skillsDir: string, scope?: SkillScope, namePrefix?: string, depth?: number, maxDepth?: number): Promise<LoadedSkill[]>;
|
|
@@ -4,6 +4,8 @@ export declare function loadUserSkills(): Promise<Record<string, CommandDefiniti
|
|
|
4
4
|
export declare function loadProjectSkills(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
5
5
|
export declare function loadOpencodeGlobalSkills(): Promise<Record<string, CommandDefinition>>;
|
|
6
6
|
export declare function loadOpencodeProjectSkills(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
7
|
+
export declare function loadProjectAgentsSkills(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
8
|
+
export declare function loadGlobalAgentsSkills(): Promise<Record<string, CommandDefinition>>;
|
|
7
9
|
export interface DiscoverSkillsOptions {
|
|
8
10
|
includeClaudeCodePaths?: boolean;
|
|
9
11
|
directory?: string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import type { Prompt, Resource, Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
3
3
|
import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
|
4
|
-
import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
4
|
+
import type { OAuthProviderFactory, SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
5
5
|
export declare class SkillMcpManager {
|
|
6
6
|
private readonly state;
|
|
7
|
+
constructor(options?: {
|
|
8
|
+
createOAuthProvider?: OAuthProviderFactory;
|
|
9
|
+
});
|
|
7
10
|
private getClientKey;
|
|
8
11
|
getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
|
|
9
12
|
disconnectSession(sessionID: string): Promise<void>;
|