feat(hooks): add delegate-task-english-directive hook to enforce English for subagents

Appends bold uppercase English-only directive to explore, librarian,
oracle, and plan subagent prompts via tool.execute.before on the task tool.
This commit is contained in:
YeonGyu-Kim
2026-03-13 14:11:38 +09:00
parent 0303488906
commit f3de122147
6 changed files with 132 additions and 0 deletions
+7
View File
@@ -16,6 +16,7 @@ import {
createRalphLoopHook,
createEditErrorRecoveryHook,
createDelegateTaskRetryHook,
createDelegateTaskEnglishDirectiveHook,
createTaskResumeInfoHook,
createStartWorkHook,
createPrometheusMdOnlyHook,
@@ -60,6 +61,7 @@ export type SessionHooks = {
taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null
anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null
runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null
delegateTaskEnglishDirective: ReturnType<typeof createDelegateTaskEnglishDirectiveHook> | null
}
export function createSessionHooks(args: {
@@ -215,6 +217,10 @@ export function createSessionHooks(args: {
? safeHook("delegate-task-retry", () => createDelegateTaskRetryHook(ctx))
: null
const delegateTaskEnglishDirective = isHookEnabled("delegate-task-english-directive")
? safeHook("delegate-task-english-directive", () => createDelegateTaskEnglishDirectiveHook())
: null
const startWork = isHookEnabled("start-work")
? safeHook("start-work", () => createStartWorkHook(ctx))
: null
@@ -276,6 +282,7 @@ export function createSessionHooks(args: {
ralphLoop,
editErrorRecovery,
delegateTaskRetry,
delegateTaskEnglishDirective,
startWork,
prometheusMdOnly,
sisyphusJuniorNotepad,