Skip to content

Single-source flows: ~/.pi/agent/pi-flow.json via /pi-flow:setup - #10

Merged
maikeffi merged 1 commit into
mainfrom
pi-flow-single-source
Jun 14, 2026
Merged

Single-source flows: ~/.pi/agent/pi-flow.json via /pi-flow:setup#10
maikeffi merged 1 commit into
mainfrom
pi-flow-single-source

Conversation

@maikeffi

Copy link
Copy Markdown
Contributor

Follow-up to #9, driven by real first-run UX feedback: built-in flows were invisible (they lived in code and were merged at runtime), and user flows squatted a pi-flow key in pi's shared settings.json. Two textures for one concept.

This makes flows single-source: every flow — starter or custom — lives in one file the user owns, ~/.pi/agent/pi-flow.json (alongside pi's own models.json/settings.json).

Changes

  • resolveFlows no longer merges built-ins; flows come solely from pi-flow.json. BUILTIN_FLOWS remains as seed content only.
  • /pi-flow:setup writes the three starter flows into pi-flow.json on demand (opt-in; never rewrites an existing file).
  • /pi-flow:help prints the flow schema, replacing /pi-flow:show.
  • Reader moved off the settings.json pi-flow key onto the dedicated file.
  • Empty-state messaging points users to /pi-flow:setup.
  • ADR-0001, CONTEXT.md, and README updated to match.

Trade explicitly accepted

A seeded built-in is the user's frozen copy — a future package improvement to it won't reach an existing pi-flow.json. For a small, stable set of starter flows, that's the right call (recorded in ADR-0001).

Tests

56 passing (vitest run), through the existing pure-function and fake-ExtensionAPI seams.

Context: #1 (PRD), #9 (merged v2). No issues to close.

🤖 Generated with Claude Code

…ow:setup

Flows now come solely from a dedicated ~/.pi/agent/pi-flow.json file the user owns; built-ins are no longer merged at runtime. /pi-flow:setup seeds the three starter flows into that file on demand (and never rewrites it after); /pi-flow:help prints the flow schema, replacing /pi-flow:show. Reading moves off the settings.json pi-flow key onto the dedicated file.

Updates ADR-0001, CONTEXT.md, and README to match. 56 tests passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maikeffi
maikeffi merged commit e8e28e6 into main Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant