feat(keyword-detector): add team mode keyword detection
Detects user invocations of team-mode work across English and Korean
('team mode', '팀 모드', '팀으로') and injects a concise English directive
instructing the LLM to orchestrate via team_* tools (team_create ->
team_task_create + team_send_message), forbidding delegate_task
substitution and fallbacks.
The Korean variants use a Hangul-syllable negative lookbehind (가-힣) so
that '스팀으로 게임 켜줘' does not falsely match '팀으로' and '스팀모드' does
not falsely match '팀모드'.
Follows the existing folder pattern (mode/default.ts + mode/index.ts)
shared by ultrawork/, search/, and analyze/. The hook orchestration in
hook.ts handles the new keyword type generically through the shared
KEYWORD_DETECTORS array, so existing guards (non-OMO agent skip,
non-main session filter, system-reminder strip, code-block strip) all
apply automatically.
Adds 7 regression tests covering English/Korean trigger forms, the
Hangul-prefix false-positive guard, the bare-'team' negative case, and
non-main-session filtering.
This commit is contained in:
@@ -4,9 +4,11 @@ export const INLINE_CODE_PATTERN = /`[^`]+`/g
|
||||
export { isPlannerAgent, isNonOmoAgent, getUltraworkMessage } from "./ultrawork"
|
||||
export { SEARCH_PATTERN, SEARCH_MESSAGE } from "./search"
|
||||
export { ANALYZE_PATTERN, ANALYZE_MESSAGE } from "./analyze"
|
||||
export { TEAM_PATTERN, TEAM_MESSAGE } from "./team"
|
||||
|
||||
import { getUltraworkMessage } from "./ultrawork"
|
||||
import { SEARCH_PATTERN, SEARCH_MESSAGE } from "./search"
|
||||
import { TEAM_PATTERN, TEAM_MESSAGE } from "./team"
|
||||
|
||||
export type KeywordDetector = {
|
||||
pattern: RegExp
|
||||
@@ -41,4 +43,8 @@ SYNTHESIZE findings before proceeding.
|
||||
MANDATORY delegate_task params: ALWAYS include load_skills and run_in_background when calling delegate_task. Evaluate available skills before dispatch - pass task-appropriate skills when relevant, pass [] ONLY when no skill matches the task domain.
|
||||
Example: delegate_task(subagent_type="explore", prompt="...", run_in_background=true, load_skills=[])`,
|
||||
},
|
||||
{
|
||||
pattern: TEAM_PATTERN,
|
||||
message: TEAM_MESSAGE,
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user