oh-my-opencode 4.3.1 → 4.5.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/.agents/command/get-unpublished-changes.md +148 -0
- package/.agents/command/omomomo.md +37 -0
- package/.agents/command/publish.md +376 -0
- package/.agents/command/remove-deadcode.md +221 -0
- package/.agents/command/security-research.md +16 -0
- package/.agents/skills/get-unpublished-changes/SKILL.md +24 -0
- package/.agents/skills/github-triage/SKILL.md +587 -0
- package/.agents/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.agents/skills/hyperplan/SKILL.md +450 -0
- package/.agents/skills/omomomo/SKILL.md +36 -0
- package/.agents/skills/pre-publish-review/SKILL.md +407 -0
- package/.agents/skills/publish/SKILL.md +428 -0
- package/.agents/skills/remove-deadcode/SKILL.md +216 -0
- package/.agents/skills/security-research/SKILL.md +204 -0
- package/.agents/skills/work-with-pr/SKILL.md +360 -0
- package/.agents/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.agents/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/.opencode/command/get-unpublished-changes.md +148 -0
- package/.opencode/command/omomomo.md +37 -0
- package/.opencode/command/publish.md +376 -0
- package/.opencode/command/remove-deadcode.md +221 -0
- package/.opencode/command/security-research.md +16 -0
- package/.opencode/skills/github-triage/SKILL.md +587 -0
- package/.opencode/skills/github-triage/scripts/gh_fetch.py +398 -0
- package/.opencode/skills/hyperplan/SKILL.md +450 -0
- package/.opencode/skills/pre-publish-review/SKILL.md +407 -0
- package/.opencode/skills/work-with-pr/SKILL.md +360 -0
- package/.opencode/skills/work-with-pr-workspace/evals/evals.json +76 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.json +138 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/benchmark.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/eval_metadata.json +57 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/code-changes.md +454 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/execution-plan.md +136 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/pr-description.md +47 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/outputs/verification-strategy.md +163 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/grading.json +15 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/code-changes.md +615 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/execution-plan.md +99 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/pr-description.md +50 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/outputs/verification-strategy.md +111 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-1/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/eval_metadata.json +37 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/code-changes.md +205 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/execution-plan.md +78 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/outputs/verification-strategy.md +87 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/grading.json +11 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/code-changes.md +334 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/execution-plan.md +86 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/pr-description.md +23 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/outputs/verification-strategy.md +119 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-2/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/code-changes.md +221 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/execution-plan.md +104 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/pr-description.md +41 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/outputs/verification-strategy.md +84 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/code-changes.md +342 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/execution-plan.md +131 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/pr-description.md +39 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/outputs/verification-strategy.md +128 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-3/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/code-changes.md +143 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/execution-plan.md +82 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/outputs/verification-strategy.md +69 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/code-changes.md +252 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/execution-plan.md +83 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/pr-description.md +33 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/outputs/verification-strategy.md +101 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-4/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/eval_metadata.json +32 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/code-changes.md +387 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +112 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/pr-description.md +51 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/verification-strategy.md +75 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/grading.json +10 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/code-changes.md +529 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/execution-plan.md +127 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/pr-description.md +42 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/outputs/verification-strategy.md +120 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/without_skill/timing.json +1 -0
- package/.opencode/skills/work-with-pr-workspace/iteration-1/review.html +1326 -0
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/dist/agents/atlas/agent.d.ts +6 -6
- package/dist/agents/prometheus/gemini.d.ts +0 -11
- package/dist/agents/prometheus/gpt.d.ts +0 -10
- package/dist/agents/prometheus/system-prompt.d.ts +2 -20
- package/dist/agents/types.d.ts +1 -16
- package/dist/cli/index.js +60 -20
- package/dist/config/schema/agent-names.d.ts +3 -3
- package/dist/config/schema/agent-overrides.d.ts +208 -208
- package/dist/config/schema/categories.d.ts +28 -28
- package/dist/config/schema/fallback-models.d.ts +20 -20
- package/dist/config/schema/oh-my-opencode-config.d.ts +208 -208
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +19 -0
- package/dist/features/background-agent/parent-wake-notifier.d.ts +8 -19
- package/dist/help/schema/acp.d.ts +95 -0
- package/dist/help/schema/doctor.d.ts +147 -0
- package/dist/help/schema/sandbox.d.ts +74 -0
- package/dist/help/schema/status.d.ts +139 -0
- package/dist/hooks/keyword-detector/analyze/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/hyperplan/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/search/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/team/default.d.ts +2 -7
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -9
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -16
- package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +1 -10
- package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +1 -5
- package/dist/hooks/ralph-loop/no-progress-turn-detector.d.ts +7 -0
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +1 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +1 -0
- package/dist/hooks/tool-pair-validator/hook.d.ts +6 -1
- package/dist/index.js +51976 -50299
- package/dist/plugin-handlers/provider-config-handler.d.ts +1 -0
- package/dist/shared/migration/model-versions.d.ts +6 -0
- package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -0
- package/dist/shared/prompt-async-gate/types.d.ts +4 -3
- package/package.json +19 -13
- package/dist/agents/atlas/default-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/default.d.ts +0 -2
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gemini.d.ts +0 -2
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/gpt.d.ts +0 -2
- package/dist/agents/atlas/kimi-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/kimi.d.ts +0 -2
- package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +0 -6
- package/dist/agents/atlas/opus-4-7.d.ts +0 -2
- package/dist/agents/atlas/shared-prompt.d.ts +0 -9
- package/dist/agents/prometheus/behavioral-summary.d.ts +0 -6
- package/dist/agents/prometheus/high-accuracy-mode.d.ts +0 -6
- package/dist/agents/prometheus/identity-constraints.d.ts +0 -7
- package/dist/agents/prometheus/interview-mode.d.ts +0 -7
- package/dist/agents/prometheus/plan-generation.d.ts +0 -7
- package/dist/agents/prometheus/plan-template.d.ts +0 -7
- package/dist/agents/prometheus/spec-driven-mode.d.ts +0 -7
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# Code Changes
|
|
2
|
+
|
|
3
|
+
## 1. NEW: `src/tools/delegate-task/default-categories.ts`
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import type { CategoryConfig } from "../../config/schema"
|
|
7
|
+
|
|
8
|
+
export const DEFAULT_CATEGORIES: Record<string, CategoryConfig> = {
|
|
9
|
+
"visual-engineering": { model: "google/gemini-3.1-pro", variant: "high" },
|
|
10
|
+
ultrabrain: { model: "openai/gpt-5.4", variant: "xhigh" },
|
|
11
|
+
deep: { model: "openai/gpt-5.3-codex", variant: "medium" },
|
|
12
|
+
artistry: { model: "google/gemini-3.1-pro", variant: "high" },
|
|
13
|
+
quick: { model: "anthropic/claude-haiku-4-5" },
|
|
14
|
+
"unspecified-low": { model: "anthropic/claude-sonnet-4-6" },
|
|
15
|
+
"unspecified-high": { model: "anthropic/claude-opus-4-6", variant: "max" },
|
|
16
|
+
writing: { model: "kimi-for-coding/k2p5" },
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 2. NEW: `src/tools/delegate-task/category-descriptions.ts`
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
export const CATEGORY_DESCRIPTIONS: Record<string, string> = {
|
|
24
|
+
"visual-engineering": "Frontend, UI/UX, design, styling, animation",
|
|
25
|
+
ultrabrain: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
|
|
26
|
+
deep: "Goal-oriented autonomous problem-solving. Thorough research before action. For hairy problems requiring deep understanding.",
|
|
27
|
+
artistry: "Complex problem-solving with unconventional, creative approaches - beyond standard patterns",
|
|
28
|
+
quick: "Trivial tasks - single file changes, typo fixes, simple modifications",
|
|
29
|
+
"unspecified-low": "Tasks that don't fit other categories, low effort required",
|
|
30
|
+
"unspecified-high": "Tasks that don't fit other categories, high effort required",
|
|
31
|
+
writing: "Documentation, prose, technical writing",
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 3. NEW: `src/tools/delegate-task/category-prompt-appends.ts`
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
export const VISUAL_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
39
|
+
You are working on VISUAL/UI tasks.
|
|
40
|
+
...
|
|
41
|
+
</Category_Context>`
|
|
42
|
+
|
|
43
|
+
export const ULTRABRAIN_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
44
|
+
You are working on DEEP LOGICAL REASONING / COMPLEX ARCHITECTURE tasks.
|
|
45
|
+
...
|
|
46
|
+
</Category_Context>`
|
|
47
|
+
|
|
48
|
+
export const ARTISTRY_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
49
|
+
You are working on HIGHLY CREATIVE / ARTISTIC tasks.
|
|
50
|
+
...
|
|
51
|
+
</Category_Context>`
|
|
52
|
+
|
|
53
|
+
export const QUICK_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
54
|
+
You are working on SMALL / QUICK tasks.
|
|
55
|
+
...
|
|
56
|
+
</Caller_Warning>`
|
|
57
|
+
|
|
58
|
+
export const UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
59
|
+
You are working on tasks that don't fit specific categories but require moderate effort.
|
|
60
|
+
...
|
|
61
|
+
</Caller_Warning>`
|
|
62
|
+
|
|
63
|
+
export const UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
64
|
+
You are working on tasks that don't fit specific categories but require substantial effort.
|
|
65
|
+
...
|
|
66
|
+
</Category_Context>`
|
|
67
|
+
|
|
68
|
+
export const WRITING_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
69
|
+
You are working on WRITING / PROSE tasks.
|
|
70
|
+
...
|
|
71
|
+
</Category_Context>`
|
|
72
|
+
|
|
73
|
+
export const DEEP_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
74
|
+
You are working on GOAL-ORIENTED AUTONOMOUS tasks.
|
|
75
|
+
...
|
|
76
|
+
</Category_Context>`
|
|
77
|
+
|
|
78
|
+
export const CATEGORY_PROMPT_APPENDS: Record<string, string> = {
|
|
79
|
+
"visual-engineering": VISUAL_CATEGORY_PROMPT_APPEND,
|
|
80
|
+
ultrabrain: ULTRABRAIN_CATEGORY_PROMPT_APPEND,
|
|
81
|
+
deep: DEEP_CATEGORY_PROMPT_APPEND,
|
|
82
|
+
artistry: ARTISTRY_CATEGORY_PROMPT_APPEND,
|
|
83
|
+
quick: QUICK_CATEGORY_PROMPT_APPEND,
|
|
84
|
+
"unspecified-low": UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND,
|
|
85
|
+
"unspecified-high": UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND,
|
|
86
|
+
writing: WRITING_CATEGORY_PROMPT_APPEND,
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
> Note: Each `*_CATEGORY_PROMPT_APPEND` contains the full template string from the original. Abbreviated with `...` here for readability. The actual code would contain the complete unmodified prompt text.
|
|
91
|
+
|
|
92
|
+
## 4. NEW: `src/tools/delegate-task/plan-agent-prompt.ts`
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import type {
|
|
96
|
+
AvailableCategory,
|
|
97
|
+
AvailableSkill,
|
|
98
|
+
} from "../../agents/dynamic-agent-prompt-builder"
|
|
99
|
+
import { truncateDescription } from "../../shared/truncate-description"
|
|
100
|
+
|
|
101
|
+
export const PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS = `<system>
|
|
102
|
+
BEFORE you begin planning, you MUST first understand the user's request deeply.
|
|
103
|
+
...
|
|
104
|
+
</CRITICAL_REQUIREMENT_DEPENDENCY_PARALLEL_EXECUTION_CATEGORY_SKILLS>
|
|
105
|
+
|
|
106
|
+
<FINAL_OUTPUT_FOR_CALLER>
|
|
107
|
+
...
|
|
108
|
+
</FINAL_OUTPUT_FOR_CALLER>
|
|
109
|
+
|
|
110
|
+
`
|
|
111
|
+
|
|
112
|
+
export const PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS = `### REQUIRED OUTPUT FORMAT
|
|
113
|
+
...
|
|
114
|
+
`
|
|
115
|
+
|
|
116
|
+
function renderPlanAgentCategoryRows(categories: AvailableCategory[]): string[] {
|
|
117
|
+
const sorted = [...categories].sort((a, b) => a.name.localeCompare(b.name))
|
|
118
|
+
return sorted.map((category) => {
|
|
119
|
+
const bestFor = category.description || category.name
|
|
120
|
+
const model = category.model || ""
|
|
121
|
+
return `| \`${category.name}\` | ${bestFor} | ${model} |`
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function renderPlanAgentSkillRows(skills: AvailableSkill[]): string[] {
|
|
126
|
+
const sorted = [...skills].sort((a, b) => a.name.localeCompare(b.name))
|
|
127
|
+
return sorted.map((skill) => {
|
|
128
|
+
const domain = truncateDescription(skill.description).trim() || skill.name
|
|
129
|
+
return `| \`${skill.name}\` | ${domain} |`
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function buildPlanAgentSkillsSection(
|
|
134
|
+
categories: AvailableCategory[] = [],
|
|
135
|
+
skills: AvailableSkill[] = []
|
|
136
|
+
): string {
|
|
137
|
+
const categoryRows = renderPlanAgentCategoryRows(categories)
|
|
138
|
+
const skillRows = renderPlanAgentSkillRows(skills)
|
|
139
|
+
|
|
140
|
+
return `### AVAILABLE CATEGORIES
|
|
141
|
+
|
|
142
|
+
| Category | Best For | Model |
|
|
143
|
+
|----------|----------|-------|
|
|
144
|
+
${categoryRows.join("\n")}
|
|
145
|
+
|
|
146
|
+
### AVAILABLE SKILLS (ALWAYS EVALUATE ALL)
|
|
147
|
+
|
|
148
|
+
Skills inject specialized expertise into the delegated agent.
|
|
149
|
+
YOU MUST evaluate EVERY skill and justify inclusions/omissions.
|
|
150
|
+
|
|
151
|
+
| Skill | Domain |
|
|
152
|
+
|-------|--------|
|
|
153
|
+
${skillRows.join("\n")}`
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function buildPlanAgentSystemPrepend(
|
|
157
|
+
categories: AvailableCategory[] = [],
|
|
158
|
+
skills: AvailableSkill[] = []
|
|
159
|
+
): string {
|
|
160
|
+
return [
|
|
161
|
+
PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS,
|
|
162
|
+
buildPlanAgentSkillsSection(categories, skills),
|
|
163
|
+
PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS,
|
|
164
|
+
].join("\n\n")
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
> Note: Template strings abbreviated with `...`. Full unmodified content in the actual file.
|
|
169
|
+
|
|
170
|
+
## 5. NEW: `src/tools/delegate-task/plan-agent-identity.ts`
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
/**
|
|
174
|
+
* List of agent names that should be treated as plan agents (receive plan system prompt).
|
|
175
|
+
* Case-insensitive matching is used.
|
|
176
|
+
*/
|
|
177
|
+
export const PLAN_AGENT_NAMES = ["plan"]
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Check if the given agent name is a plan agent (receives plan system prompt).
|
|
181
|
+
*/
|
|
182
|
+
export function isPlanAgent(agentName: string | undefined): boolean {
|
|
183
|
+
if (!agentName) return false
|
|
184
|
+
const lowerName = agentName.toLowerCase().trim()
|
|
185
|
+
return PLAN_AGENT_NAMES.some(name => lowerName === name || lowerName.includes(name))
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Plan family: plan + prometheus. Shares mutual delegation blocking and task tool permission.
|
|
190
|
+
* Does NOT share system prompt (only isPlanAgent controls that).
|
|
191
|
+
*/
|
|
192
|
+
export const PLAN_FAMILY_NAMES = ["plan", "prometheus"]
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Check if the given agent belongs to the plan family (blocking + task permission).
|
|
196
|
+
*/
|
|
197
|
+
export function isPlanFamily(category: string): boolean
|
|
198
|
+
export function isPlanFamily(category: string | undefined): boolean
|
|
199
|
+
export function isPlanFamily(category: string | undefined): boolean {
|
|
200
|
+
if (!category) return false
|
|
201
|
+
const lowerCategory = category.toLowerCase().trim()
|
|
202
|
+
return PLAN_FAMILY_NAMES.some(
|
|
203
|
+
(name) => lowerCategory === name || lowerCategory.includes(name)
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## 6. MODIFIED: `src/tools/delegate-task/constants.ts` (barrel re-export)
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
export { DEFAULT_CATEGORIES } from "./default-categories"
|
|
212
|
+
export { CATEGORY_DESCRIPTIONS } from "./category-descriptions"
|
|
213
|
+
export {
|
|
214
|
+
VISUAL_CATEGORY_PROMPT_APPEND,
|
|
215
|
+
ULTRABRAIN_CATEGORY_PROMPT_APPEND,
|
|
216
|
+
ARTISTRY_CATEGORY_PROMPT_APPEND,
|
|
217
|
+
QUICK_CATEGORY_PROMPT_APPEND,
|
|
218
|
+
UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND,
|
|
219
|
+
UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND,
|
|
220
|
+
WRITING_CATEGORY_PROMPT_APPEND,
|
|
221
|
+
DEEP_CATEGORY_PROMPT_APPEND,
|
|
222
|
+
CATEGORY_PROMPT_APPENDS,
|
|
223
|
+
} from "./category-prompt-appends"
|
|
224
|
+
export {
|
|
225
|
+
PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS,
|
|
226
|
+
PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS,
|
|
227
|
+
buildPlanAgentSkillsSection,
|
|
228
|
+
buildPlanAgentSystemPrepend,
|
|
229
|
+
} from "./plan-agent-prompt"
|
|
230
|
+
export {
|
|
231
|
+
PLAN_AGENT_NAMES,
|
|
232
|
+
isPlanAgent,
|
|
233
|
+
PLAN_FAMILY_NAMES,
|
|
234
|
+
isPlanFamily,
|
|
235
|
+
} from "./plan-agent-identity"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## 7. NEW: `src/shared/category-model-requirements.ts`
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import type { ModelRequirement } from "./model-requirements"
|
|
242
|
+
|
|
243
|
+
export const CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
|
|
244
|
+
"visual-engineering": {
|
|
245
|
+
fallbackChain: [
|
|
246
|
+
{
|
|
247
|
+
providers: ["google", "github-copilot", "opencode"],
|
|
248
|
+
model: "gemini-3.1-pro",
|
|
249
|
+
variant: "high",
|
|
250
|
+
},
|
|
251
|
+
{ providers: ["zai-coding-plan", "opencode"], model: "glm-5" },
|
|
252
|
+
{
|
|
253
|
+
providers: ["anthropic", "github-copilot", "opencode"],
|
|
254
|
+
model: "claude-opus-4-6",
|
|
255
|
+
variant: "max",
|
|
256
|
+
},
|
|
257
|
+
{ providers: ["opencode-go"], model: "glm-5" },
|
|
258
|
+
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
ultrabrain: {
|
|
262
|
+
fallbackChain: [
|
|
263
|
+
// ... full content from original
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
deep: {
|
|
267
|
+
fallbackChain: [
|
|
268
|
+
// ... full content from original
|
|
269
|
+
],
|
|
270
|
+
requiresModel: "gpt-5.3-codex",
|
|
271
|
+
},
|
|
272
|
+
artistry: {
|
|
273
|
+
fallbackChain: [
|
|
274
|
+
// ... full content from original
|
|
275
|
+
],
|
|
276
|
+
requiresModel: "gemini-3.1-pro",
|
|
277
|
+
},
|
|
278
|
+
quick: {
|
|
279
|
+
fallbackChain: [
|
|
280
|
+
// ... full content from original
|
|
281
|
+
],
|
|
282
|
+
},
|
|
283
|
+
"unspecified-low": {
|
|
284
|
+
fallbackChain: [
|
|
285
|
+
// ... full content from original
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
"unspecified-high": {
|
|
289
|
+
fallbackChain: [
|
|
290
|
+
// ... full content from original
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
writing: {
|
|
294
|
+
fallbackChain: [
|
|
295
|
+
// ... full content from original
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
> Note: Each category's `fallbackChain` contains the exact same entries as the original `model-requirements.ts`. Abbreviated here.
|
|
302
|
+
|
|
303
|
+
## 8. MODIFIED: `src/shared/model-requirements.ts`
|
|
304
|
+
|
|
305
|
+
**Remove** `CATEGORY_MODEL_REQUIREMENTS` from the file body. **Add** re-export at the end:
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
export type FallbackEntry = {
|
|
309
|
+
providers: string[];
|
|
310
|
+
model: string;
|
|
311
|
+
variant?: string;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export type ModelRequirement = {
|
|
315
|
+
fallbackChain: FallbackEntry[];
|
|
316
|
+
variant?: string;
|
|
317
|
+
requiresModel?: string;
|
|
318
|
+
requiresAnyModel?: boolean;
|
|
319
|
+
requiresProvider?: string[];
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
|
|
323
|
+
// ... unchanged, full agent entries stay here
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export { CATEGORY_MODEL_REQUIREMENTS } from "./category-model-requirements"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Summary of Changes
|
|
330
|
+
|
|
331
|
+
| File | Lines Before | Lines After | Action |
|
|
332
|
+
|------|-------------|-------------|--------|
|
|
333
|
+
| `constants.ts` | 654 | ~25 | Rewrite as barrel re-export |
|
|
334
|
+
| `default-categories.ts` | - | ~15 | **NEW** |
|
|
335
|
+
| `category-descriptions.ts` | - | ~12 | **NEW** |
|
|
336
|
+
| `category-prompt-appends.ts` | - | ~280 | **NEW** (mostly exempt prompt text) |
|
|
337
|
+
| `plan-agent-prompt.ts` | - | ~270 | **NEW** (mostly exempt prompt text) |
|
|
338
|
+
| `plan-agent-identity.ts` | - | ~35 | **NEW** |
|
|
339
|
+
| `model-requirements.ts` | 311 | ~165 | Remove CATEGORY_MODEL_REQUIREMENTS |
|
|
340
|
+
| `category-model-requirements.ts` | - | ~150 | **NEW** |
|
|
341
|
+
|
|
342
|
+
**Zero consumer files modified.** Backward compatibility maintained through barrel re-exports.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Execution Plan: Refactor constants.ts
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
|
|
5
|
+
`src/tools/delegate-task/constants.ts` is **654 lines** with 6 distinct responsibilities. Violates the 200 LOC modular-code-enforcement rule. `CATEGORY_MODEL_REQUIREMENTS` is actually in `src/shared/model-requirements.ts` (311 lines, also violating 200 LOC), not in `constants.ts`.
|
|
6
|
+
|
|
7
|
+
## Pre-Flight Analysis
|
|
8
|
+
|
|
9
|
+
### Current `constants.ts` responsibilities:
|
|
10
|
+
1. **Category prompt appends** (8 template strings, ~274 LOC prompt text)
|
|
11
|
+
2. **DEFAULT_CATEGORIES** (Record<string, CategoryConfig>, ~10 LOC)
|
|
12
|
+
3. **CATEGORY_PROMPT_APPENDS** (map of category->prompt, ~10 LOC)
|
|
13
|
+
4. **CATEGORY_DESCRIPTIONS** (map of category->description, ~10 LOC)
|
|
14
|
+
5. **Plan agent prompts** (2 template strings + 4 builder functions, ~250 LOC prompt text)
|
|
15
|
+
6. **Plan agent identity utils** (`isPlanAgent`, `isPlanFamily`, ~30 LOC)
|
|
16
|
+
|
|
17
|
+
### Current `model-requirements.ts` responsibilities:
|
|
18
|
+
1. Types (`FallbackEntry`, `ModelRequirement`)
|
|
19
|
+
2. `AGENT_MODEL_REQUIREMENTS` (~146 LOC)
|
|
20
|
+
3. `CATEGORY_MODEL_REQUIREMENTS` (~148 LOC)
|
|
21
|
+
|
|
22
|
+
### Import dependency map for `constants.ts`:
|
|
23
|
+
|
|
24
|
+
**Internal consumers (within delegate-task/):**
|
|
25
|
+
| File | Imports |
|
|
26
|
+
|------|---------|
|
|
27
|
+
| `categories.ts` | `DEFAULT_CATEGORIES`, `CATEGORY_PROMPT_APPENDS` |
|
|
28
|
+
| `tools.ts` | `CATEGORY_DESCRIPTIONS` |
|
|
29
|
+
| `tools.test.ts` | `DEFAULT_CATEGORIES`, `CATEGORY_PROMPT_APPENDS`, `CATEGORY_DESCRIPTIONS`, `isPlanAgent`, `PLAN_AGENT_NAMES`, `isPlanFamily`, `PLAN_FAMILY_NAMES` |
|
|
30
|
+
| `prompt-builder.ts` | `buildPlanAgentSystemPrepend`, `isPlanAgent` |
|
|
31
|
+
| `subagent-resolver.ts` | `isPlanFamily` |
|
|
32
|
+
| `sync-continuation.ts` | `isPlanFamily` |
|
|
33
|
+
| `sync-prompt-sender.ts` | `isPlanFamily` |
|
|
34
|
+
| `index.ts` | `export * from "./constants"` (barrel) |
|
|
35
|
+
|
|
36
|
+
**External consumers (import from `"../../tools/delegate-task/constants"`):**
|
|
37
|
+
| File | Imports |
|
|
38
|
+
|------|---------|
|
|
39
|
+
| `agents/atlas/prompt-section-builder.ts` | `CATEGORY_DESCRIPTIONS` |
|
|
40
|
+
| `agents/builtin-agents.ts` | `CATEGORY_DESCRIPTIONS` |
|
|
41
|
+
| `plugin/available-categories.ts` | `CATEGORY_DESCRIPTIONS` |
|
|
42
|
+
| `plugin-handlers/category-config-resolver.ts` | `DEFAULT_CATEGORIES` |
|
|
43
|
+
| `shared/merge-categories.ts` | `DEFAULT_CATEGORIES` |
|
|
44
|
+
| `shared/merge-categories.test.ts` | `DEFAULT_CATEGORIES` |
|
|
45
|
+
|
|
46
|
+
**External consumers of `CATEGORY_MODEL_REQUIREMENTS`:**
|
|
47
|
+
| File | Import path |
|
|
48
|
+
|------|-------------|
|
|
49
|
+
| `tools/delegate-task/categories.ts` | `../../shared/model-requirements` |
|
|
50
|
+
|
|
51
|
+
## Step-by-Step Execution
|
|
52
|
+
|
|
53
|
+
### Step 1: Create branch
|
|
54
|
+
```bash
|
|
55
|
+
git checkout -b refactor/split-category-constants dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Step 2: Split `constants.ts` into 5 focused files
|
|
59
|
+
|
|
60
|
+
#### 2a. Create `default-categories.ts`
|
|
61
|
+
- Move `DEFAULT_CATEGORIES` record
|
|
62
|
+
- Import `CategoryConfig` type from config schema
|
|
63
|
+
- ~15 LOC
|
|
64
|
+
|
|
65
|
+
#### 2b. Create `category-descriptions.ts`
|
|
66
|
+
- Move `CATEGORY_DESCRIPTIONS` record
|
|
67
|
+
- No dependencies
|
|
68
|
+
- ~12 LOC
|
|
69
|
+
|
|
70
|
+
#### 2c. Create `category-prompt-appends.ts`
|
|
71
|
+
- Move all 8 `*_CATEGORY_PROMPT_APPEND` template string constants
|
|
72
|
+
- Move `CATEGORY_PROMPT_APPENDS` mapping record
|
|
73
|
+
- No dependencies (all self-contained template strings)
|
|
74
|
+
- ~280 LOC (mostly prompt text, exempt from 200 LOC per modular-code-enforcement)
|
|
75
|
+
|
|
76
|
+
#### 2d. Create `plan-agent-prompt.ts`
|
|
77
|
+
- Move `PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS`
|
|
78
|
+
- Move `PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS`
|
|
79
|
+
- Move `renderPlanAgentCategoryRows()`, `renderPlanAgentSkillRows()`
|
|
80
|
+
- Move `buildPlanAgentSkillsSection()`, `buildPlanAgentSystemPrepend()`
|
|
81
|
+
- Imports: `AvailableCategory`, `AvailableSkill` from agents, `truncateDescription` from shared
|
|
82
|
+
- ~270 LOC (mostly prompt text, exempt)
|
|
83
|
+
|
|
84
|
+
#### 2e. Create `plan-agent-identity.ts`
|
|
85
|
+
- Move `PLAN_AGENT_NAMES`, `isPlanAgent()`
|
|
86
|
+
- Move `PLAN_FAMILY_NAMES`, `isPlanFamily()`
|
|
87
|
+
- No dependencies
|
|
88
|
+
- ~35 LOC
|
|
89
|
+
|
|
90
|
+
### Step 3: Convert `constants.ts` to barrel re-export file
|
|
91
|
+
Replace entire contents with re-exports from the 5 new files. This maintains 100% backward compatibility for all existing importers.
|
|
92
|
+
|
|
93
|
+
### Step 4: Split `model-requirements.ts`
|
|
94
|
+
|
|
95
|
+
#### 4a. Create `src/shared/category-model-requirements.ts`
|
|
96
|
+
- Move `CATEGORY_MODEL_REQUIREMENTS` record
|
|
97
|
+
- Import `ModelRequirement` type from `./model-requirements`
|
|
98
|
+
- ~150 LOC
|
|
99
|
+
|
|
100
|
+
#### 4b. Update `model-requirements.ts`
|
|
101
|
+
- Remove `CATEGORY_MODEL_REQUIREMENTS`
|
|
102
|
+
- Add re-export: `export { CATEGORY_MODEL_REQUIREMENTS } from "./category-model-requirements"`
|
|
103
|
+
- Keep types (`FallbackEntry`, `ModelRequirement`) and `AGENT_MODEL_REQUIREMENTS`
|
|
104
|
+
- ~165 LOC (now under 200)
|
|
105
|
+
|
|
106
|
+
### Step 5: Verify no import breakage
|
|
107
|
+
- Run `bun run typecheck` to confirm all imports resolve
|
|
108
|
+
- Run `bun test` to confirm no behavioral regressions
|
|
109
|
+
- Run `bun run build` to confirm build succeeds
|
|
110
|
+
|
|
111
|
+
### Step 6: Verify LSP diagnostics clean
|
|
112
|
+
- Check `lsp_diagnostics` on all new and modified files
|
|
113
|
+
|
|
114
|
+
### Step 7: Commit and create PR
|
|
115
|
+
- Single atomic commit: `refactor: split delegate-task constants and category model requirements into focused modules`
|
|
116
|
+
- Create PR with description
|
|
117
|
+
|
|
118
|
+
## Files Modified
|
|
119
|
+
|
|
120
|
+
| File | Action |
|
|
121
|
+
|------|--------|
|
|
122
|
+
| `src/tools/delegate-task/constants.ts` | Rewrite as barrel re-export |
|
|
123
|
+
| `src/tools/delegate-task/default-categories.ts` | **NEW** |
|
|
124
|
+
| `src/tools/delegate-task/category-descriptions.ts` | **NEW** |
|
|
125
|
+
| `src/tools/delegate-task/category-prompt-appends.ts` | **NEW** |
|
|
126
|
+
| `src/tools/delegate-task/plan-agent-prompt.ts` | **NEW** |
|
|
127
|
+
| `src/tools/delegate-task/plan-agent-identity.ts` | **NEW** |
|
|
128
|
+
| `src/shared/model-requirements.ts` | Remove CATEGORY_MODEL_REQUIREMENTS, add re-export |
|
|
129
|
+
| `src/shared/category-model-requirements.ts` | **NEW** |
|
|
130
|
+
|
|
131
|
+
**Zero changes to any consumer files.** All existing imports work via barrel re-exports.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
- Split `src/tools/delegate-task/constants.ts` (654 LOC, 6 responsibilities) into 5 focused modules: `default-categories.ts`, `category-descriptions.ts`, `category-prompt-appends.ts`, `plan-agent-prompt.ts`, `plan-agent-identity.ts`
|
|
4
|
+
- Extract `CATEGORY_MODEL_REQUIREMENTS` from `src/shared/model-requirements.ts` (311 LOC) into `category-model-requirements.ts`, bringing both files under the 200 LOC limit
|
|
5
|
+
- Convert original files to barrel re-exports for 100% backward compatibility (zero consumer changes)
|
|
6
|
+
|
|
7
|
+
## Motivation
|
|
8
|
+
|
|
9
|
+
Both files violate the project's 200 LOC modular-code-enforcement rule. `constants.ts` mixed 6 unrelated responsibilities (category configs, prompt templates, plan agent builders, identity utils). `model-requirements.ts` mixed agent and category model requirements.
|
|
10
|
+
|
|
11
|
+
## Changes
|
|
12
|
+
|
|
13
|
+
### `src/tools/delegate-task/`
|
|
14
|
+
| New File | Responsibility |
|
|
15
|
+
|----------|---------------|
|
|
16
|
+
| `default-categories.ts` | `DEFAULT_CATEGORIES` record |
|
|
17
|
+
| `category-descriptions.ts` | `CATEGORY_DESCRIPTIONS` record |
|
|
18
|
+
| `category-prompt-appends.ts` | 8 prompt template constants + `CATEGORY_PROMPT_APPENDS` map |
|
|
19
|
+
| `plan-agent-prompt.ts` | Plan agent system prompts + builder functions |
|
|
20
|
+
| `plan-agent-identity.ts` | `isPlanAgent`, `isPlanFamily` + name lists |
|
|
21
|
+
|
|
22
|
+
`constants.ts` is now a barrel re-export file (~25 LOC).
|
|
23
|
+
|
|
24
|
+
### `src/shared/`
|
|
25
|
+
| New File | Responsibility |
|
|
26
|
+
|----------|---------------|
|
|
27
|
+
| `category-model-requirements.ts` | `CATEGORY_MODEL_REQUIREMENTS` record |
|
|
28
|
+
|
|
29
|
+
`model-requirements.ts` retains types + `AGENT_MODEL_REQUIREMENTS` and re-exports `CATEGORY_MODEL_REQUIREMENTS`.
|
|
30
|
+
|
|
31
|
+
## Backward Compatibility
|
|
32
|
+
|
|
33
|
+
All existing import paths (`from "./constants"`, `from "../../tools/delegate-task/constants"`, `from "../../shared/model-requirements"`) continue to work unchanged. Zero consumer files modified.
|
|
34
|
+
|
|
35
|
+
## Testing
|
|
36
|
+
|
|
37
|
+
- `bun run typecheck` passes
|
|
38
|
+
- `bun test` passes (existing `tools.test.ts` validates all re-exported symbols)
|
|
39
|
+
- `bun run build` succeeds
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Verification Strategy
|
|
2
|
+
|
|
3
|
+
## 1. Type Safety
|
|
4
|
+
|
|
5
|
+
### 1a. LSP diagnostics on all new files
|
|
6
|
+
```
|
|
7
|
+
lsp_diagnostics("src/tools/delegate-task/default-categories.ts")
|
|
8
|
+
lsp_diagnostics("src/tools/delegate-task/category-descriptions.ts")
|
|
9
|
+
lsp_diagnostics("src/tools/delegate-task/category-prompt-appends.ts")
|
|
10
|
+
lsp_diagnostics("src/tools/delegate-task/plan-agent-prompt.ts")
|
|
11
|
+
lsp_diagnostics("src/tools/delegate-task/plan-agent-identity.ts")
|
|
12
|
+
lsp_diagnostics("src/shared/category-model-requirements.ts")
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 1b. LSP diagnostics on modified files
|
|
16
|
+
```
|
|
17
|
+
lsp_diagnostics("src/tools/delegate-task/constants.ts")
|
|
18
|
+
lsp_diagnostics("src/shared/model-requirements.ts")
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 1c. Full typecheck
|
|
22
|
+
```bash
|
|
23
|
+
bun run typecheck
|
|
24
|
+
```
|
|
25
|
+
Expected: 0 errors. This confirms all 14 consumer files (8 internal + 6 external) resolve their imports correctly through the barrel re-exports.
|
|
26
|
+
|
|
27
|
+
## 2. Behavioral Regression
|
|
28
|
+
|
|
29
|
+
### 2a. Existing test suite
|
|
30
|
+
```bash
|
|
31
|
+
bun test src/tools/delegate-task/tools.test.ts
|
|
32
|
+
```
|
|
33
|
+
This test file imports `DEFAULT_CATEGORIES`, `CATEGORY_PROMPT_APPENDS`, `CATEGORY_DESCRIPTIONS`, `isPlanAgent`, `PLAN_AGENT_NAMES`, `isPlanFamily`, `PLAN_FAMILY_NAMES` from `./constants`. If the barrel re-export is correct, all these tests pass unchanged.
|
|
34
|
+
|
|
35
|
+
### 2b. Category resolver tests
|
|
36
|
+
```bash
|
|
37
|
+
bun test src/tools/delegate-task/category-resolver.test.ts
|
|
38
|
+
```
|
|
39
|
+
This exercises `resolveCategoryConfig()` which imports `DEFAULT_CATEGORIES` and `CATEGORY_PROMPT_APPENDS` from `./constants` and `CATEGORY_MODEL_REQUIREMENTS` from `../../shared/model-requirements`.
|
|
40
|
+
|
|
41
|
+
### 2c. Model selection tests
|
|
42
|
+
```bash
|
|
43
|
+
bun test src/tools/delegate-task/model-selection.test.ts
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2d. Merge categories tests
|
|
47
|
+
```bash
|
|
48
|
+
bun test src/shared/merge-categories.test.ts
|
|
49
|
+
```
|
|
50
|
+
Imports `DEFAULT_CATEGORIES` from `../tools/delegate-task/constants` (external path).
|
|
51
|
+
|
|
52
|
+
### 2e. Full test suite
|
|
53
|
+
```bash
|
|
54
|
+
bun test
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 3. Build Verification
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bun run build
|
|
61
|
+
```
|
|
62
|
+
Confirms ESM bundle + declarations emit correctly with the new file structure.
|
|
63
|
+
|
|
64
|
+
## 4. Export Completeness Verification
|
|
65
|
+
|
|
66
|
+
### 4a. Verify `constants.ts` re-exports match original exports
|
|
67
|
+
Cross-check that every symbol previously exported from `constants.ts` is still exported. The original file exported these symbols:
|
|
68
|
+
- `VISUAL_CATEGORY_PROMPT_APPEND`
|
|
69
|
+
- `ULTRABRAIN_CATEGORY_PROMPT_APPEND`
|
|
70
|
+
- `ARTISTRY_CATEGORY_PROMPT_APPEND`
|
|
71
|
+
- `QUICK_CATEGORY_PROMPT_APPEND`
|
|
72
|
+
- `UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND`
|
|
73
|
+
- `UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND`
|
|
74
|
+
- `WRITING_CATEGORY_PROMPT_APPEND`
|
|
75
|
+
- `DEEP_CATEGORY_PROMPT_APPEND`
|
|
76
|
+
- `DEFAULT_CATEGORIES`
|
|
77
|
+
- `CATEGORY_PROMPT_APPENDS`
|
|
78
|
+
- `CATEGORY_DESCRIPTIONS`
|
|
79
|
+
- `PLAN_AGENT_SYSTEM_PREPEND_STATIC_BEFORE_SKILLS`
|
|
80
|
+
- `PLAN_AGENT_SYSTEM_PREPEND_STATIC_AFTER_SKILLS`
|
|
81
|
+
- `buildPlanAgentSkillsSection`
|
|
82
|
+
- `buildPlanAgentSystemPrepend`
|
|
83
|
+
- `PLAN_AGENT_NAMES`
|
|
84
|
+
- `isPlanAgent`
|
|
85
|
+
- `PLAN_FAMILY_NAMES`
|
|
86
|
+
- `isPlanFamily`
|
|
87
|
+
|
|
88
|
+
All 19 must be re-exported from the barrel.
|
|
89
|
+
|
|
90
|
+
### 4b. Verify `model-requirements.ts` re-exports match original exports
|
|
91
|
+
Original exports: `FallbackEntry`, `ModelRequirement`, `AGENT_MODEL_REQUIREMENTS`, `CATEGORY_MODEL_REQUIREMENTS`. All 4 must still be available.
|
|
92
|
+
|
|
93
|
+
## 5. LOC Compliance Check
|
|
94
|
+
|
|
95
|
+
Verify each new file is under 200 LOC (excluding prompt template text per modular-code-enforcement rule):
|
|
96
|
+
|
|
97
|
+
| File | Expected Total LOC | Non-prompt LOC | Compliant? |
|
|
98
|
+
|------|-------------------|----------------|------------|
|
|
99
|
+
| `default-categories.ts` | ~15 | ~15 | Yes |
|
|
100
|
+
| `category-descriptions.ts` | ~12 | ~12 | Yes |
|
|
101
|
+
| `category-prompt-appends.ts` | ~280 | ~15 | Yes (prompt exempt) |
|
|
102
|
+
| `plan-agent-prompt.ts` | ~270 | ~40 | Yes (prompt exempt) |
|
|
103
|
+
| `plan-agent-identity.ts` | ~35 | ~35 | Yes |
|
|
104
|
+
| `category-model-requirements.ts` | ~150 | ~150 | Yes |
|
|
105
|
+
| `model-requirements.ts` (after) | ~165 | ~165 | Yes |
|
|
106
|
+
| `constants.ts` (after) | ~25 | ~25 | Yes |
|
|
107
|
+
|
|
108
|
+
## 6. Consumer Impact Matrix
|
|
109
|
+
|
|
110
|
+
Verify zero consumer files need changes:
|
|
111
|
+
|
|
112
|
+
| Consumer File | Import Path | Should Still Work? |
|
|
113
|
+
|--------------|-------------|-------------------|
|
|
114
|
+
| `delegate-task/categories.ts` | `./constants` | Yes (barrel) |
|
|
115
|
+
| `delegate-task/tools.ts` | `./constants` | Yes (barrel) |
|
|
116
|
+
| `delegate-task/tools.test.ts` | `./constants` | Yes (barrel) |
|
|
117
|
+
| `delegate-task/prompt-builder.ts` | `./constants` | Yes (barrel) |
|
|
118
|
+
| `delegate-task/subagent-resolver.ts` | `./constants` | Yes (barrel) |
|
|
119
|
+
| `delegate-task/sync-continuation.ts` | `./constants` | Yes (barrel) |
|
|
120
|
+
| `delegate-task/sync-prompt-sender.ts` | `./constants` | Yes (barrel) |
|
|
121
|
+
| `delegate-task/index.ts` | `./constants` | Yes (barrel) |
|
|
122
|
+
| `agents/atlas/prompt-section-builder.ts` | `../../tools/delegate-task/constants` | Yes (barrel) |
|
|
123
|
+
| `agents/builtin-agents.ts` | `../tools/delegate-task/constants` | Yes (barrel) |
|
|
124
|
+
| `plugin/available-categories.ts` | `../tools/delegate-task/constants` | Yes (barrel) |
|
|
125
|
+
| `plugin-handlers/category-config-resolver.ts` | `../tools/delegate-task/constants` | Yes (barrel) |
|
|
126
|
+
| `shared/merge-categories.ts` | `../tools/delegate-task/constants` | Yes (barrel) |
|
|
127
|
+
| `shared/merge-categories.test.ts` | `../tools/delegate-task/constants` | Yes (barrel) |
|
|
128
|
+
| `delegate-task/categories.ts` | `../../shared/model-requirements` | Yes (re-export) |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"total_tokens": null, "duration_ms": 229000, "total_duration_seconds": 229}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eval_id": 4,
|
|
3
|
+
"eval_name": "new-mcp-arxiv-casual",
|
|
4
|
+
"prompt": "implement issue #100 - we need to add a new built-in MCP for arxiv paper search. just the basic search endpoint, nothing fancy. pr it",
|
|
5
|
+
"assertions": [
|
|
6
|
+
{
|
|
7
|
+
"id": "worktree-isolation",
|
|
8
|
+
"text": "Plan uses git worktree in a sibling directory",
|
|
9
|
+
"type": "manual"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "follows-mcp-pattern",
|
|
13
|
+
"text": "New MCP follows existing pattern from src/mcp/ (websearch, context7, grep_app)",
|
|
14
|
+
"type": "manual"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "three-gates",
|
|
18
|
+
"text": "Verification loop includes all 3 gates",
|
|
19
|
+
"type": "manual"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "pr-targets-dev",
|
|
23
|
+
"text": "PR targets dev branch",
|
|
24
|
+
"type": "manual"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "local-validation",
|
|
28
|
+
"text": "Runs local checks before pushing",
|
|
29
|
+
"type": "manual"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"run_id": "eval-4-with_skill",
|
|
3
|
+
"expectations": [
|
|
4
|
+
{"text": "Plan uses git worktree in a sibling directory", "passed": true, "evidence": "../omo-wt/feat/arxiv-mcp"},
|
|
5
|
+
{"text": "New MCP follows existing pattern from src/mcp/", "passed": true, "evidence": "Follows context7.ts and grep-app.ts static export pattern"},
|
|
6
|
+
{"text": "Verification loop includes all 3 gates", "passed": true, "evidence": "Gate A (CI), Gate B (review-work 5 agents), Gate C (Cubic)"},
|
|
7
|
+
{"text": "PR targets dev branch", "passed": true, "evidence": "--base dev"},
|
|
8
|
+
{"text": "Runs local checks before pushing", "passed": true, "evidence": "bun run typecheck, bun test src/mcp/, bun run build"}
|
|
9
|
+
]
|
|
10
|
+
}
|