2.5 KiB
2.5 KiB
Plan: Per-task model override via MCP + cheapest-model prompt guidance
Spec: docs/superpowers/specs/2026-06-09-per-task-model-override-design.md
TDD, one focused commit per task. Build with -c Release per project; run
ClaudeDo.Worker.Tests (and Data.Tests if touched).
Task 1 — ModelRegistry: cost ordering + alias validation
- Add
ByCostAscending = ["haiku","sonnet","opus"]. - Add
string? NormalizeAlias(string? model): trim; null/blank → null; case-insensitive match againstAliases→ canonical lowercase; else throwArgumentException($"Unknown model '{model}'. Allowed: {join(Aliases)}."). - Tests (Data.Tests): "sonnet"/"OPUS"/" haiku " → normalized; ""/null/" " → null; "gpt4" → throws.
Task 2 — CreateChildAsync accepts model
TaskRepository.CreateChildAsync: addstring? model = null(before the trailingCancellationToken ct = default); setchild.Model = ModelRegistry.NormalizeAlias(model).- Update the two existing callers to compile (named pass-through added in Tasks 3–4; keep default null here).
Task 3 — Planning + improvement MCP tools forward model
PlanningMcpService.CreateChildTask: addstring? modelparam aftercommitType; pass toCreateChildAsync. Extend[Description]to document the model arg (haiku/sonnet/opus; cheapest capable).TaskRunMcpService.SuggestImprovement: addstring? modelparam afterdescription; pass toCreateChildAsync. Extend[Description].- Tests: each tool persists the model; invalid value throws.
Task 4 — External AddTask forwards model
ExternalMcpService.AddTask: addstring? model = nullparam (before the trailingCancellationToken);entity.Model = ModelRegistry.NormalizeAlias(model). Extend[Description].- Test: AddTask persists model; invalid value rejected.
Task 5 — Prompt guidance
PromptFiles.PlanningSystemDefault: add a short paragraph — assign each subtask the cheapest model that does it well, with ordering haiku < sonnet < opus and the heuristic; pass it asCreateChildTask(model=...).PromptFiles.SystemDefaultOut-of-scope section: when filing viaSuggestImprovement, pass the cheapest capablemodel.PromptFiles.ImprovementChildDefault: one-line minimality reminder.- No test (static prompt text); verify build only.
Task 6 — Verify
- Build App + Worker
-c Release; run Worker.Tests + Data.Tests. - Update
ClaudeDo.Worker/CLAUDE.md(ConfigMcpTools/creation-tool notes) andClaudeDo.Data/CLAUDE.md(ModelRegistry) if needed.