feat: integrate PhaseFlow as a native spec-driven workflow (v0.3.0) - #1
Merged
Conversation
Port of PhaseFlow's on-disk workflow model into Go: .planning/ layout, ROADMAP.md phase/plan parser with decimal-phase ordering, progress computation, in-place checkbox mutation, and config.json load/save that preserves unmodeled upstream keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Vendor PhaseFlow's phase commands, subagent definitions, and workflow templates (MIT, (c) 2025 Lex Christopherson) into internal/phaseflow/assets and embed them via go:embed. Adds a frontmatter-aware loader exposing Command/AgentPrompt/Template lookups so the engine can seed gophermind's agent with the upstream prompts without an external install. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Engine drives the loop over the state model: Init scaffolds .planning/ (config/ROADMAP/STATE/PROJECT), Status renders progress and the current phase, Next resolves the next incomplete phase. Agentic steps (roadmap, plan, execute, verify, milestone) build a state-seeded prompt from the embedded upstream command asset for gophermind's agent to run. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
State commands (init/status/next/commands) run locally; loop steps (roadmap/plan/execute/verify/milestone) build a state-seeded prompt that runs through the standard agent path. Adds `phase` to completion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
/phase init|status|next|commands print to the transcript; loop steps (roadmap/plan/execute/verify/milestone) send a state-seeded prompt to the agent. Guards arg parsing and updates /help. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a PhaseFlow section to the README, an Unreleased CHANGELOG entry, and upstream attribution in CREDITS for the vendored MIT assets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Any embedded PhaseFlow command (map-codebase, code-review, ship, …), not just the five core loop steps, now runs agentically by name via BuildCommandPrompt, from both `phase <cmd>` and `/phase <cmd>`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Convert PhaseFlow's deterministic SDK logic (state.cjs position/progress sync, milestone.cjs archiving) from prompt-driven agent work into native Go: - SyncState recomputes STATE.md's Current Position/progress from the roadmap - CompletePlan marks a plan done, auto-ticks a finished phase, and syncs state - ArchiveMilestone snapshots the shipped roadmap and appends a stat-bearing entry to .planning/MILESTONES.md, gated on all phases being complete Wired as `phase done|sync|archive` (CLI) and `/phase done|sync|archive` (TUI). These run locally with no tokens and cannot drift from the checkboxes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… code Rework comments across the package to say why: the in-place ROADMAP edit rationale, the friendly-verb→upstream-filename mapping, why state is injected into step prompts, and the scope of the tiny frontmatter reader. Correct the setCheckbox and parseAsset comments to match actual behavior, and inline the redundant stateBar helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add PROJECT.md (committed project overrides: build/test commands, repo conventions, PhaseFlow notes). Gitignore CONTEXT.md and .claude-resume as machine/session-specific local state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…, privacy) - SECURITY: validate milestone version before interpolating into a filename, rejecting path separators and '..' so `phase archive` cannot write outside .planning/milestones/ (with a traversal regression test) - reliability: propagate MarkPhase failure in CompletePlan instead of swallowing it, so an unticked phase after all plans done is no longer silent - privacy: drop the absolute local path from PROJECT.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…iption setCheckbox replaced the first marker *type* found anywhere on the line, so a plan/phase whose description text contained a '[ ]'/'[x]' token had its description corrupted instead of its checkbox. Select the leftmost marker occurrence — the list item's own checkbox always precedes its text. Adds a regression test with markers embedded in a plan description. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates PhaseFlow (MIT, © 2025 Lex Christopherson) into gophermind as a first-class native subsystem,
internal/phaseflow— the spec-driven loop Roadmap → Phases → Plan → Execute → Verify → Milestone, with state persisted under.planning/(interchangeable with upstream's on-disk model).What's included
internal/phaseflow/assets/viago:embed(attribution inCREDITS.md+assets/LICENSE.upstream).gophermind phase <cmd>(CLI) and/phase <cmd>(TUI). The full embedded command surface is runnable by name.phase done,phase sync,phase archive.Review & quality
Three rounds of adversarial review (haiku subagents). Findings fixed with regression tests:
ArchiveMilestone(version interpolated into a filename) — now validated.setCheckboxflipped a marker inside the description instead of the leftmost checkbox — now leftmost-only.MarkPhaseerror inCompletePlan— now propagated.PROJECT.md— removed.Round 3: no remaining bugs.
go build ./...,go vet ./...,gofmt, and fullgo test ./...all green.make snapshotvalidates the cross-platform release pipeline (darwin/linux/windows, deb/rpm/apk, SBOMs, Homebrew/scoop/winget).Targets v0.3.0 (see CHANGELOG).
🤖 Generated with Claude Code