Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hooks/hooks.json → Ralph workflow guards (active when FLOW_RALPH=1)
docs/ → Architecture docs, CI examples
```

**Skills**: 9 core + 22 extensions. See `docs/skills.md` for the full classification. Core workflow: `flow-code-run` (unified phase loop). Legacy individual skills (plan, plan-review, work, impl-review, epic-review) are deprecated but still functional as thin redirects.
**Skills**: See `docs/skills.md` for the full classification. Core workflow: `flow-code-run` (unified phase loop via `flowctl phase next/done`).
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this section positions /flow-code:run as the core workflow, later in CLAUDE.md there are still explicit legacy references to /flow-code:work (e.g. "/flow-code:run (or legacy /flow-code:work)" and resume guidance suggesting /flow-code:work <id>). If the PR goal is to remove deprecated references entirely, those later mentions should be updated to /flow-code:run too.

Copilot uses AI. Check for mistakes.

**Key invariant**: The `bin/flowctl` Rust binary is the single source of truth for `.flow/` state. Always invoke as:
```bash
Expand All @@ -28,14 +28,7 @@ $FLOWCTL <command>

## Primary Workflow

**Unified entry point** (preferred): `/flow-code:run "description"` — drives the entire pipeline (plan → plan-review → work → impl-review → close) via `flowctl phase next/done`. One command, zero manual phase transitions.

Individual phase commands (deprecated, still functional):
1. `/flow-code:plan "description"` → creates epic + tasks in `.flow/`
2. `/flow-code:plan-review` → Carmack-level review via RepoPrompt or Codex
3. `/flow-code:work <epic-id>` → executes tasks with Teams mode (auto-parallel with file locking)
4. `/flow-code:impl-review` → post-implementation review
5. `/flow-code:epic-review` → final review before closing
`/flow-code:run "description"` — drives the entire pipeline (plan → plan-review → work → impl-review → close) via `flowctl phase next/done`. One command, zero manual phase transitions.

Ralph (`/flow-code:ralph-init`) is the autonomous harness that runs this loop unattended.

Expand Down
2 changes: 1 addition & 1 deletion agents/worker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: worker
description: Task implementation worker. Spawned by flow-code-work to implement a single task with fresh context. Do not invoke directly - use /flow-code:work instead.
description: Task implementation worker. Spawned by flow-code-run during the work phase. Do not invoke directly - use /flow-code:run instead.
model: inherit
disallowedTools: Task
color: "#3B82F6"
Expand Down
49 changes: 21 additions & 28 deletions docs/CODEBASE_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ flow-code/
│ ├── setup.md, sync.md, uninstall.md
├── skills/ # 18 skill implementations
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory-structure snippet still claims there are 18 skill implementations, but the repository's skills/ directory currently contains more (e.g., flow-code-* extensions plus browser/). Please update the count and/or expand this list to match the actual directories (or regenerate this CODEBASE_MAP if it is meant to be auto-generated).

Suggested change
├── skills/ # 18 skill implementations
├── skills/ # Skill implementations (excerpt shown; repository currently contains additional entries)

Copilot uses AI. Check for mistakes.
│ ├── flow-code/ # Task CRUD via flowctl
│ ├── flow-code-plan/ # SKILL.md + steps.md + examples.md
│ ├── flow-code-work/ # SKILL.md + phases.md
│ ├── flow-code-run/ # Unified pipeline entry point (phase loop)
│ ├── flow-code-interview/ # SKILL.md + questions.md
│ ├── flow-code-prime/ # SKILL.md + workflow.md + pillars.md + remediation.md
│ ├── flow-code-impl-review/ # SKILL.md + workflow.md + flowctl-reference.md
│ ├── flow-code-plan-review/ # SKILL.md + workflow.md + flowctl-reference.md
│ ├── flow-code-epic-review/ # SKILL.md + workflow.md + flowctl-reference.md
│ ├── flow-code-ralph-init/ # SKILL.md + templates/ (ralph.sh, config.env, prompts)
│ ├── flow-code-auto-improve/ # SKILL.md + templates/ (auto-improve.sh, programs/)
│ ├── flow-code-map/ # SKILL.md + scripts/scan-codebase.py
Expand Down Expand Up @@ -246,24 +242,21 @@ sequenceDiagram
Interview->>flowctl: epic set-plan (refined spec)

Note over User,flowctl: Preferred: /flow-code:run fn-N (unified pipeline)
Note over User,flowctl: Legacy individual commands (deprecated, still functional):
User->>Plan: /flow-code:plan fn-N
Plan->>Scouts: 7 scouts in parallel
Scouts-->>Plan: patterns, docs, gaps, deps
Plan->>flowctl: epic create + task create (with deps)

User->>Work: /flow-code:work fn-N
loop Each ready task
Work->>flowctl: start task
Work->>Worker: spawn (fresh context)
Worker->>flowctl: show + cat (re-anchor)
Worker->>Worker: implement + test + commit
Worker->>Review: impl-review (if enabled)
Review-->>Worker: SHIP / NEEDS_WORK (fix loop)
Worker->>flowctl: done (summary + evidence)
User->>Run: /flow-code:run "description"
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Mermaid sequence diagram, the note says the preferred invocation is /flow-code:run fn-N, but the next line shows /flow-code:run "description" while subsequent flowctl calls assume an existing epic id fn-N. Please make these examples consistent (either demonstrate starting from a description or resuming an existing epic id).

Suggested change
User->>Run: /flow-code:run "description"
User->>Run: /flow-code:run fn-N

Copilot uses AI. Check for mistakes.
loop flowctl phase next/done
Run->>flowctl: phase next --epic fn-N --json
flowctl-->>Run: {phase, prompt, all_done}
alt phase = plan
Run->>Scouts: research scouts in parallel
Scouts-->>Run: patterns, docs, gaps
Run->>flowctl: epic plan + task create
else phase = work
Run->>Worker: spawn workers (Teams + worktree)
Worker->>flowctl: worker-phase next/done loop
Worker->>flowctl: done (summary + evidence)
end
Run->>flowctl: phase done --epic fn-N --phase X
end
Work->>Review: epic-review (completion gate)
Review-->>Work: SHIP
```

### Ralph Autonomous Loop
Expand All @@ -279,13 +272,13 @@ sequenceDiagram

alt status = plan
ralph.sh->>Claude: prompt_plan.md (new process)
Claude->>Claude: /flow-code:plan-review (deprecated, handled by run pipeline)
Claude->>Claude: /flow-code:run (plan phase)
else status = work
ralph.sh->>Claude: prompt_work.md (new process)
Claude->>Claude: /flow-code:work + impl-review (deprecated, handled by run pipeline)
Claude->>Claude: /flow-code:run (work phase)
else status = completion_review
ralph.sh->>Claude: prompt_completion.md (new process)
Claude->>Claude: /flow-code:epic-review (deprecated, handled by run pipeline)
Claude->>Claude: /flow-code:run (close phase)
end

Claude-->>ralph.sh: exit (verdict in log)
Expand Down Expand Up @@ -342,9 +335,9 @@ sequenceDiagram

**To add a new command**: Create `commands/flow-code/<name>.md` (thin stub) + `skills/flow-code-<name>/SKILL.md`
**To add a new agent**: Create `agents/<name>.md` with frontmatter (name, description, model, disallowedTools)
**To add a new scout to planning**: Add to the parallel scout list in `skills/flow-code-plan/steps.md` Step 1
**To add a new scout to planning**: Add to the scout dispatch in `skills/flow-code-run/SKILL.md` plan phase
**To add a new prime pillar**: Add criteria to `skills/flow-code-prime/pillars.md`, remediation to `remediation.md`
**To modify Ralph loop**: Edit `skills/flow-code-ralph-init/templates/ralph.sh` (canonical source)
**To modify auto-improve loop**: Edit `skills/flow-code-auto-improve/templates/auto-improve.sh`
**To add a review backend**: Add to impl-review, plan-review, and epic-review workflow.md files
**To change task state machine**: Modify `scripts/flowctl/commands/workflow.py` (state transitions) or `scripts/flowctl/core/state.py` (state storage)
**To add a review backend**: Add to `flowctl review-backend` and the review phase in `skills/flow-code-run/SKILL.md`
**To change task state machine**: Modify `flowctl/crates/flowctl-core/src/state_machine.rs`
12 changes: 3 additions & 9 deletions docs/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@

Skills are organized into **core** (essential workflow) and **extensions** (optional capabilities).

## Core Skills (9)
## Core Skills (4)

These skills form the primary plan-execute-review workflow. They ship with the plugin.
These skills form the primary workflow. They ship with the plugin.

| Skill | Command | Purpose |
|-------|---------|---------|
| `flow-code-run` | `/flow-code:run` | **Primary entry point** — unified phase loop (plan → review → work → close) |
| `flow-code` | `/flow-code` | Task/epic management entry point (list, create, status) |
| `flow-code-plan` | `/flow-code:plan` | Create structured build plans (deprecated — use `run`) |
| `flow-code-work` | `/flow-code:work` | Execute plans with Teams mode (deprecated — use `run`) |
| `flow-code-plan-review` | `/flow-code:plan-review` | Carmack-level plan review (deprecated — use `run`) |
| `flow-code-impl-review` | `/flow-code:impl-review` | Post-implementation code review (deprecated — use `run`) |
| `flow-code-epic-review` | `/flow-code:epic-review` | Final review before closing (deprecated — use `run`) |
| `flow-code-setup` | `/flow-code:setup` | Install flowctl CLI and configure project |
| `flow-code-map` | `/flow-code:map` | Generate codebase architecture maps |

Expand Down Expand Up @@ -67,5 +62,4 @@ For a new project:
2. `/flow-code:prime` — assess codebase readiness
3. `/flow-code:run "description"` — plan, review, execute, and close (all-in-one)

Legacy individual commands (deprecated, still functional):
3a. `/flow-code:plan "description"` → 4. `/flow-code:plan-review` → 5. `/flow-code:work <epic-id>` → 6. `/flow-code:impl-review` → 7. `/flow-code:epic-review`
That's it — `/flow-code:run` handles the full plan → review → work → review → close pipeline.