"Phase 1: Start — begin a new feature. Creates a worktree, upgrades dependencies, opens a PR, creates .flow-states/<branch>.json, and configures the workspace. Usage: /flow:flow-start <feature name words>"
Install
npx skillscat add benkruger/flow/flow-start Install via the SkillsCat registry.
FLOW Start — Phase 1: Start
Usage
/flow:flow-start invoice pdf export
/flow:flow-start --auto invoice pdf export
/flow:flow-start --manual invoice pdf exportArguments become the feature name (flags are not included in the name). Words are joined with hyphens:
- Branch:
invoice-pdf-export - Worktree:
.worktrees/invoice-pdf-export - PR title:
Invoice Pdf Export
Branch names are capped at 32 characters. If the hyphenated name exceeds 32 characters, truncate at the last whole word (hyphen boundary) that fits. Strip any trailing hyphen.
Do NOT proceed if the feature name is missing. Ask the user: "What is the feature name? e.g. /flow:flow-start invoice pdf export"Mode Resolution
- If
--autowas passed → continue=auto - If
--manualwas passed → continue=manual - Otherwise, read
.flow.jsonfrom the project root. Useskills.flow-start.continue. - If
.flow.jsonhas noskillskey → use built-in default: continue=manual
Announce
At the very start, output the following banner in your response (not via Bash) inside a fenced code block:
```
============================================
FLOW v0.19.0 — Phase 1: Start — STARTING
============================================
```Logging
After every Bash command in Steps 5–8, log it to .flow-states/<branch>.log. Step 4 handles its own logging internally.
Run the command directly — do not append any suffix:
COMMANDThen Read .flow-states/<branch>.log (empty string if it does not
exist yet) and Write it back with this line appended:
YYYY-MM-DDTHH:MM:SSZ [Phase 1] Step X — desc (exit EC)Use the feature name as <branch> — it matches the branch name.
Steps
Step 1 — Version gate
Run the version check before anything else:
exec ${CLAUDE_PLUGIN_ROOT}/bin/flow init-checkParse the JSON output. If "status": "error", tell the user to run /flow:flow-init and stop. Do not proceed to any further steps.
After init-check passes, check for a newer release:
exec ${CLAUDE_PLUGIN_ROOT}/bin/flow upgrade-checkParse the JSON output:
"status": "current"— proceed silently"status": "unknown"— proceed silently (best-effort check)"status": "upgrade_available"— show this notice, then continue:
```
╔══════════════════════════════════════════════╗
║ FLOW update available: v{installed} → v{latest}
║
║ To upgrade:
║ 1. claude plugin marketplace update
║ flow-marketplace
║ 2. Start a new Claude Code session
║ 3. Run /flow:flow-init
╚══════════════════════════════════════════════╝
```Step 2 — Check for existing feature
Use the Glob tool to check for existing state files matching .flow-states/*.json.
If any files are found, list their names (the branch names from the filenames).
If any files are found and continue=auto, print a warning and proceed automatically.
If any files are found and continue=manual, use AskUserQuestion:
Do NOT proceed past Step 2 until the existing feature check is complete. If existing features are found and the user chooses Cancel, stop here."An active FLOW feature already exists. What would you like to do?"
- Start a new feature anyway — proceed
- Cancel — stop here
Step 3 — Verify main is green
Run bin/flow ci on main before creating any resources:
bin/flow ciIf it fails, stop immediately:
"
bin/flow ciis failing on main. Please fix CI before starting a new feature."
Do not create a worktree, PR, or state file. Exit the skill entirely.
Step 4 — Set up workspace
Run the consolidated setup script:
exec ${CLAUDE_PLUGIN_ROOT}/bin/flow start-setup "<feature-name>"The script performs these operations in a single process:
git pull origin maingit worktree add .worktrees/<branch> -b <branch>git commit --allow-empty+git push -u origin+gh pr create- Create
.flow-states/<branch>.json(initial state, all 8 phases)
The script logs each operation to .flow-states/<branch>.log internally.
On success — stdout is JSON:
{"status": "ok", "worktree": ".worktrees/<branch>", "pr_url": "...", "pr_number": 123, "feature": "...", "branch": "..."}Parse the JSON. Then cd into the worktree:
cd .worktrees/<branch>The Bash tool persists working directory between calls, so all subsequent
commands run inside the worktree automatically. Do NOT repeat cd .worktrees/
in later steps — it would look for a nested .worktrees/ that doesn't exist.
On failure — stdout is error JSON, details on stderr:
{"status": "error", "step": "git_pull", "message": "..."}If the script returns an error, read the stderr output for details, report
the failure to the user, and stop.
Read the framework field from the state file (.flow-states/<branch>.json)
and follow only the matching section below. Do not announce the framework —
just follow the matching section silently.
If Rails
Step 5 — Upgrade gems
bundle update --allStep 6 — Post-upgrade bin/flow ci
bin/flow ci- Passes — continue to Step 8
- Fails — launch the CI fix sub-agent (see Step 7). Pass the full
bin/flow cioutput. After the sub-agent returns:- Fixed — continue to Step 8 (Gemfile.lock + fixes committed together)
- Not fixed — stop and report to the user what is failing
Step 7 — CI fix sub-agent
When bin/flow ci fails in Step 6, launch a sub-agent to diagnose
and fix the failures. Use the Task tool:
subagent_type:"general-purpose"model:"sonnet"description:"Fix bin/flow ci failures"
Provide these instructions (fill in the worktree path and bin/flow ci output):
You are fixing CI failures in a Rails worktree.
Worktree:<worktree path>
cd into the worktree before running any commands.The
bin/flow cioutput:
<paste the full bin/flow ci output>Tool rules: Use Glob and Read tools for all file and directory
operations. Use Grep for searching code. Only use Bash for commands
explicitly listed in these instructions (bin/flow ci, bin/rails test,
rubocop -A, rubocop). Never usecd <path> && git— if you need git
info, usegit -C <worktree_path>. Never use Bash for any other
purpose — no find, ls, cat, wc, test -f, stat, or running project
tooling not listed here.Fix the failures in this order:
- RuboCop violations — ALWAYS run
rubocop -Afirst. This
auto-corrects most violations. Then runbin/flow ci. If violations
remain, fix the code manually to satisfy the cop.- Test failures — read the failing test and the code it tests.
Understand the root cause. Fix the code, not the test (unless the
test itself is wrong). Runbin/rails test <file>to verify,
thenbin/flow cifor a full check.- Coverage gaps — read
test/coverage/uncovered.txtto see exactly
which lines are uncovered. Write the missing test, thenbin/flow ciNever modify
.rubocop.ymlor any RuboCop configuration.
Fix the code, never the rules. Do not add exclusions or disable cops.Max 3 attempts. After each fix, run
bin/flow ci. If green, report what
was fixed and stop. If still failing after 3 attempts, report exactly
what is failing and what was tried.Return:
- Status: fixed / not_fixed
- What was wrong
- What was changed (files modified)
Wait for the sub-agent to return.
Do NOT proceed past Step 6 until `bin/flow ci` is green.Step 8 — Commit and push
Use /flow:flow-commit to review and commit the changes (Gemfile.lock + any gem fixes).
Rails report additions
Include in the Done report:
- Which gems were upgraded (
git diff Gemfile.locksummary) - Confirmation
bin/flow ciis green
If Python
No additional setup needed — Step 3 already verified bin/flow ci on main,
and Python has no dependency upgrade step. Proceed silently to Done —
do not announce the framework or explain why steps were skipped.
Done — Update state and complete phase
Complete the phase:
bin/flow phase-transition --phase flow-start --action completeParse the JSON output. If "status": "error", report the error and stop.
Use the formatted_time field in the COMPLETE banner below. Do not print
the timing calculation.
Output the following banner in your response (not via Bash) inside a fenced code block:
```
============================================
FLOW v0.19.0 — Phase 1: Start — COMPLETE (<formatted_time>)
============================================
```Invoke the flow:flow-status skill to show the current state.
If continue=auto, skip the transition question and invoke flow:flow-plan directly.
If continue=manual, use AskUserQuestion:
"Phase 1: Start is complete. Ready to begin Phase 2: Plan?"
- Yes, start Phase 2 now
- Not yet
- I have a correction or learning to capture
If "I have a correction or learning to capture":
- Ask the user what they want to capture
- Invoke
/flow:flow-notewith their message - Re-ask with only "Yes, start Phase 2 now" and "Not yet"
If Yes — invoke the flow:flow-plan skill using the Skill tool.
If Not yet — output the following banner in your response (not via Bash) inside a fenced code block:
```
============================================
FLOW — Paused
Run /flow:flow-continue when ready to continue.
============================================
```Then report:
- Worktree location
- PR link
- Any additional report items from the framework section above
Hard Rules
- Do not narrate internal operations to the user — no "The framework is Python", no "Proceeding to phase completion", no "No additional setup steps are needed". Just do the work silently and show results
- Never use Bash to print banners — output them as text in your response
- Never use Bash for file reads — use Glob, Read, and Grep tools instead of ls, cat, head, tail, find, or grep
- Never use
cd <path> && git— usegit -C <path>for git commands in other directories - Never cd before running
bin/flow— it detects the project root internally