Context
After the native plan mode refactor (PR #30), workflow_orchestrator.md grew to 1000+ lines by absorbing the task-planner skill's planning logic. While functional, this creates maintainability concerns.
Proposal
Incrementally move deterministic logic out of the prompt and into code/dynamic loading:
Phase 1: team_mode_score calculation → hook
- The 8-factor scoring table is deterministic logic better suited as a Python hook
- A PreToolUse or PostToolUse hook could calculate the score and inject the result
- Removes ~50 lines of scoring instructions from the prompt
Phase 2: Agent selection keywords → dynamic from agent files
- Agent keyword table is currently hardcoded in the prompt
- Could be dynamically loaded from agent YAML frontmatter at planning time
- Keeps agent definitions as single source of truth
- Removes ~30 lines from the prompt
Phase 3: Evaluate contextual injection
- Investigate whether planning instructions can be injected on-demand (e.g., when EnterPlanMode is detected)
- Current constraint: SessionStart hook fires once, no mid-conversation injection mechanism
- May require Claude Code platform support for event-based prompt injection
Non-goals
- Full file split into many small files (coordination overhead outweighs benefits)
- Moving LLM reasoning guidance into code (decomposition rules, atomicity validation are inherently prompt-based)
References
Context
After the native plan mode refactor (PR #30),
workflow_orchestrator.mdgrew to 1000+ lines by absorbing the task-planner skill's planning logic. While functional, this creates maintainability concerns.Proposal
Incrementally move deterministic logic out of the prompt and into code/dynamic loading:
Phase 1: team_mode_score calculation → hook
Phase 2: Agent selection keywords → dynamic from agent files
Phase 3: Evaluate contextual injection
Non-goals
References
system-prompts/workflow_orchestrator.md(Planning Instructions section, lines 376+)