Skip to content

feat: Planner Agent — auto-expand short prompts into full product specs #898

@ryaneggz

Description

@ryaneggz

Summary

Introduce a Planner Agent pre-execution phase to Orchestra's assistant pipeline. When enabled via PlannerConfig on an Assistant, the planner intercepts the first message in a thread, expands the user's short prompt (1-4 sentences) into a structured product specification, and optionally pauses for human-in-the-loop approval before the generator begins work.

This follows Anthropic's harness research showing that a high-level planning phase dramatically improves the ambition and coherence of generated output.

Key Capabilities

  • PlannerConfig on the Assistant schema (toggleable enabled, auto_approve, model override, scope_level)
  • Planner runs as a pre-phase before the generator on the first message of a thread
  • Expands short prompts into structured product specs (Overview, Features, User Stories, Tech Stack, Design Direction)
  • Persists plan as /PLAN.md in StateBackend for the generator to reference throughout execution
  • Optional HITL approval — pause for user review before generator proceeds
  • Planner prompted to be ambitious about scope and identify AI feature opportunities

Spec

Full spec: .claude/specs/planner-agent.md

Implementation Plan

Detailed plan: .claude/plans/planner-agent.md

Phases

  1. Schema & Data LayerPlannerConfig model, Assistant schema extension, Alembic migration
  2. Planner System Prompt — High-level expansion prompt at backend/src/static/prompts/md/planner.md
  3. Pre-Execution Phase — LLMController integration, HITL interrupt, StateBackend persistence
  4. Frontend Display — Collapsible PlanPanel, approval UI, status indicators
  5. Tests & Example — Unit + integration tests, example notebook

File Changes

File Change
backend/src/schemas/entities/planner.py New — PlannerConfig model
backend/src/schemas/entities/llm.py Modify — add planner field to Assistant
backend/src/controllers/llm.py Modify — pre-execution planner phase
backend/src/static/prompts/md/planner.md New — planner system prompt
backend/migrations/versions/xxx_add_planner.py New — Alembic migration
frontend/src/components/chat/PlanPanel.tsx New — plan display component
examples/agents/planner_example.ipynb New — example notebook

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestharness-designHarness design feature set (v0.9-v0.10)phase-1Phase 1: Core infrastructure (parallel)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions