Skip to content

Incrementally decompose monolithic workflow_orchestrator.md #31

Description

@barkain

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions