← Back to Articles & Artefacts
artefactseast

coaia-planning: Plan Decomposition to STCs

IAIP Research
260116-coaia-planning-concept-e3991fb4-dcf1-4e36-885c-3a5131564d6c

coaia-planning: Plan Decomposition to STCs

Emergence Context

From session e3991fb4-dcf1-4e36-885c-3a5131564d6c exploring Keeper Chronicles MCP integration.

The Pattern

``` coaia-narrative β†’ STC creation/management (MCP tools) coaia-visualizer β†’ STC viewing/editing (WebUI) coaia-planning β†’ Plan decomposition into STCs (Claude integration) ```

Core Function

Transform Claude plan files (.md) into structural tension chart JSONL compatible with coaia-narrative.

Input β†’ Output

``` Input: /home/mia/.claude/plans/<plan-name>.md Output: <project>-planning.jsonl (coaia-narrative format) Trace: Langfuse observation with plan→STC mapping ```

Mapping Rules

Plan ElementSTC ElementNotes
Episode/Phasestructural_tension_chart entityOne chart per major section
Goal/Objectivedesired_outcome entityExtract from headers/bullets
Current statecurrent_reality entityFramework's current evolution
Implementation stepsaction_step entitiesKey tasks with due dates
DependenciesRelations (advances_toward)Cross-chart connections

MCP Tool Candidates

```typescript // Core tools parse_claude_plan // Read .md plan, extract structure create_plan_stc // Generate STC from plan section list_plan_sections // Navigate plan structure sync_plan_to_charts // Update existing charts from plan changes

// Integration tools export_to_visualizer // Generate coaia-visualizer compatible output create_langfuse_trace // Document plan→STC transformation ```

miette Integration

Replaces manual work in miette_claude_plan_perspective_claude.sh:

  1. Current: Script parses plan, creates temp prompt, launches Claude agent
  2. With coaia-planning: Direct MCP calls to decompose plan

Architecture Sketch

``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Claude Session β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Claude Plan │───►│ coaia-planning β”‚ β”‚ β”‚ β”‚ (.md file) β”‚ β”‚ (MCP) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β–Ό β–Ό β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”β”‚ β”‚ β”‚coaia-narrativeβ”‚ β”‚ Langfuse β”‚ β”‚ Redis β”‚β”‚ β”‚ β”‚ (.jsonl) β”‚ β”‚ (traces) β”‚ β”‚(state) β”‚β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚ β”‚ β”‚ β”‚ β”‚ β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚coaia-visualizer β”‚ β”‚ β”‚ (WebUI) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ```

Next Steps

  1. Create coaia-planning package structure (mirror coaia-narrative)
  2. Implement plan parsing logic (markdown β†’ sections)
  3. Define STC generation rules
  4. Add Langfuse integration
  5. Test with proud-watching-sutton.md

Related Files

  • /src/coaia-narrative/index.ts - Reference implementation
  • /src/coaia-visualizer/lib/types.ts - Type definitions to extend
  • /src/miette/claude-plan-insights/miette_claude_plan_perspective_claude.sh - Manual workflow to formalize