flow-cc 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.0] - 2026-02-15
9
+
10
+ ### Changed
11
+ - Session files are now branch-scoped: `.claude/memory/session-{branch}.md` — multiple terminals no longer overwrite each other
12
+ - PRD resolution now matches current git branch against PRD `**Branch:**` headers (STATE.md "Active PRD" is fallback)
13
+ - `/flow:status` shows all active sessions across branches when multiple exist
14
+ - Removed STATE.md project mismatch warning from `/flow:go` — PRD picker is authoritative
15
+
16
+ ### Fixed
17
+ - Two terminals on different branches no longer corrupt each other's session state
18
+ - PRD resolution no longer depends on STATE.md singleton — correct PRD found per-branch
19
+ - `/flow:go` no longer warns falsely when STATE.md was updated by another terminal
20
+
8
21
  ## [0.8.3] - 2026-02-15
9
22
 
10
23
  ### Fixed
package/README.md CHANGED
@@ -86,7 +86,7 @@ Spec any project at any time. Execute the current one while planning ahead.
86
86
 
87
87
  - `/flow:spec` writes PRDs to `.planning/prds/{slug}.md` — one file per project
88
88
  - `/flow:spec Payments` targets a specific future project without changing your current position
89
- - STATE.md tracks the **Active PRD** field so `/flow:go` always knows which spec to execute
89
+ - PRD resolution matches the current git branch against each PRD's `**Branch:**` header STATE.md "Active PRD" is fallback
90
90
  - Smart resolution: user argument > STATE.md > slug derivation > legacy fallback
91
91
  - Existing `PRD.md` at root? Still works — legacy files are consumed transparently and migrated on archive
92
92
 
@@ -129,7 +129,7 @@ your-project/
129
129
  ├── CLAUDE.md # Execution rules + learned rules
130
130
  ├── .claude/
131
131
  │ └── memory/
132
- │ └── session.md # Per-developer session state (gitignored)
132
+ │ └── session-{branch}.md # Per-branch session state (gitignored)
133
133
  ├── .planning/
134
134
  │ ├── STATE.md # Project-level GPS — shared across developers
135
135
  │ ├── ROADMAP.md # Project milestones and progress tracking
@@ -187,10 +187,10 @@ Hard caps prevent context bloat. Total worst-case: ~30 lines of lessons context
187
187
 
188
188
  Flow supports multiple developers on the same repo without conflicts:
189
189
 
190
- - **`session.md`**Per-developer session state, stored in `.claude/memory/session.md` (gitignored). Each developer has their own session GPS that never conflicts.
190
+ - **Branch-scoped sessions** Each branch gets its own session file at `.claude/memory/session-{branch-slug}.md` (gitignored). Multiple terminals on different branches never conflict. Same-branch conflicts are prevented by Linear assignment (one dev per issue/branch).
191
+ - **Branch-based PRD resolution** — Skills match the current git branch against each PRD's `**Branch:**` header to find the active PRD. STATE.md "Active PRD" is fallback.
192
+ - **Cross-developer awareness** — `/flow:status` shows all active sessions across branches. `/flow:go` warns if another developer was recently active on the same branch.
191
193
  - **`STATE.md`** — Shared project-level state in `.planning/STATE.md`. Updated at project boundaries only (not every session), so conflicts are rare.
192
- - **Developer identity** — `/flow:spec` and `/flow:go` track who is working on what. PRDs can be assigned to specific developers (advisory, not blocking).
193
- - **Template provided** — `session.md.template` scaffolds the per-developer file on first use.
194
194
 
195
195
  ---
196
196
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.3
1
+ 0.9.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-cc",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Structured workflow system for Claude Code — spec interviews, agent-team execution, session handoffs, compounding knowledge",
5
5
  "author": "Troy Hoffman",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@ You are executing the `/flow:done` skill. This finalizes the current session by
18
18
 
19
19
  Read in parallel:
20
20
  - `.planning/STATE.md`, `.planning/ROADMAP.md`, `tasks/lessons.md`, `CLAUDE.md`
21
- - Active PRD from `.planning/prds/` (resolve via STATE.md "Active PRD" field, or legacy root `PRD.md`)
22
- - `.claude/memory/session.md` (if exists)
21
+ - Active PRD: (1) `git branch --show-current` (2) read first 10 lines of each `.planning/prds/*.md` for `**Branch:**` header (3) match current branch → active PRD (4) no match: fall back to STATE.md "Active PRD" (5) still none: check legacy root `PRD.md` (6) nothing: no active PRD
22
+ - `.claude/memory/session-{branch-slug}.md` (if exists). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
23
23
 
24
24
  Also run:
25
25
  - `git log --oneline -20` — commits this session
@@ -62,7 +62,7 @@ Check ROADMAP.md progress and commits to determine if a project completed this s
62
62
 
63
63
  ### 2.5. Write session.md (Every Session)
64
64
 
65
- Always runs. Create `.claude/memory/` if needed. Write `.claude/memory/session.md`:
65
+ Always runs. Create `.claude/memory/` if needed. Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`. Write `.claude/memory/session-{branch-slug}.md`:
66
66
 
67
67
  ```
68
68
  # Session State
@@ -103,9 +103,9 @@ Always runs. Create `.claude/memory/` if needed. Write `.claude/memory/session.m
103
103
 
104
104
  ### 5. Commit Doc Updates
105
105
 
106
- **Normal session:** Only stage `tasks/lessons.md` if changed. Skip STATE.md/ROADMAP.md. Never stage `.claude/memory/session.md` (gitignored). If no shared doc changes, print "No shared doc changes to commit." Otherwise: `docs: session-end updates — [brief summary]`
106
+ **Normal session:** Only stage `tasks/lessons.md` if changed. Skip STATE.md/ROADMAP.md. Never stage files in `.claude/memory/` (all gitignored). If no shared doc changes, print "No shared doc changes to commit." Otherwise: `docs: session-end updates — [brief summary]`
107
107
 
108
- **Project boundary session:** Stage STATE.md, ROADMAP.md, lessons.md, archived files. Never stage session.md. Commit: `docs: session-end updates — [brief summary]`
108
+ **Project boundary session:** Stage STATE.md, ROADMAP.md, lessons.md, archived files. Never stage files in `.claude/memory/` (all gitignored). Commit: `docs: session-end updates — [brief summary]`
109
109
 
110
110
  Do NOT push unless user asks.
111
111
 
package/skills/flow-go.md CHANGED
@@ -14,7 +14,7 @@ You are executing the `/flow:go` skill. This reads the PRD, identifies the next
14
14
 
15
15
  ## Step 1 — Orient
16
16
 
17
- Read in parallel: `.planning/STATE.md`, `.planning/ROADMAP.md`, `tasks/lessons.md`, `CLAUDE.md`, `.claude/memory/session.md` (if exists).
17
+ Read in parallel: `.planning/STATE.md`, `.planning/ROADMAP.md`, `tasks/lessons.md`, `CLAUDE.md`, `.claude/memory/session-{branch-slug}.md` (if exists). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
18
18
 
19
19
  Run `git config user.name` to get developer identity.
20
20
 
@@ -28,7 +28,7 @@ The user must always select which PRD to execute.
28
28
 
29
29
  3. **No PRDs found** — "No PRDs found in `.planning/prds/`. Run `/flow:spec` first." Stop.
30
30
 
31
- **After selection:** Read chosen PRD. If its project doesn't match STATE.md current project, warn: "PRD project doesn't match current project. Verify you're executing the right spec."
31
+ **After selection:** Read the chosen PRD fully.
32
32
 
33
33
  **Assignment check:** Check milestone's `**Assigned To:**` against `git config user.name`. If different, print advisory warning. Do NOT block execution.
34
34
 
@@ -41,7 +41,8 @@ If any fail, stop and tell the user:
41
41
  1. **PRD selected?** If no PRDs found, stop.
42
42
  2. **Milestone detailed enough?** Must have wave structure, file lists, verification commands. If missing: "PRD milestone too vague. Add wave structure + file lists, or run `/flow:spec`."
43
43
  3. **Branch check:** Verify correct feature branch (from PRD header). Warn if wrong.
44
- 4. **All done?** If no pending milestones: "All milestones complete! Run `/flow:done` to wrap up."
44
+ 4. **Session overlap check:** If `session-{branch-slug}.md` exists, read its `**Developer:**` field. If it names a different developer than `git config user.name`, print advisory: "[Developer] was last active on this branch ([date]). Check Linear assignment before proceeding." Non-blocking — do not stop execution.
45
+ 5. **All done?** If no pending milestones: "All milestones complete! Run `/flow:done` to wrap up."
45
46
 
46
47
  ## Step 2.5 — Linear Status: In Progress
47
48
 
@@ -132,7 +133,7 @@ Atomic commit for this milestone. Stage only files from this milestone's agents.
132
133
 
133
134
  ## Step 6 — Update Docs
134
135
 
135
- **Session state (ALWAYS):** Write `.claude/memory/session.md` (create dir if needed):
136
+ **Session state (ALWAYS):** Write `.claude/memory/session-{branch-slug}.md` (create dir if needed). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
136
137
  `Date | Developer | Branch | Working On: Milestone N: [Name] from [PRD] | Status: complete — [what was built] | Next: [Milestone N+1 or /flow:done] | Blockers: [any or None]`
137
138
 
138
139
  **ROADMAP.md (ALWAYS):** Mark milestone as "Complete ([date])"
@@ -145,6 +145,8 @@ Subsections: New Database Tables, New API Endpoints, New Files to Create (groupe
145
145
  (Continue Milestone 2, etc.)
146
146
  ```
147
147
 
148
+ > The `**Branch:**` field is the primary key for PRD resolution. Downstream skills match the current git branch against this field to find the active PRD.
149
+
148
150
  ## Phase 4 — Post-PRD Updates
149
151
 
150
152
  After writing the PRD:
@@ -16,10 +16,11 @@ Read ALL in parallel:
16
16
  - `.planning/STATE.md`
17
17
  - `.planning/ROADMAP.md`
18
18
  - List `.planning/prds/` for all PRD files (or legacy root `PRD.md`)
19
- - Read the active PRD (from STATE.md "Active PRD" field) for milestone details
19
+ - Active PRD: (1) `git branch --show-current` (2) read first 10 lines of each `.planning/prds/*.md` for `**Branch:**` header (3) match current branch → active PRD (4) no match: fall back to STATE.md "Active PRD" (5) still none: check legacy root `PRD.md` (6) nothing: no active PRD
20
20
  - Count lessons in `tasks/lessons.md` (if exists)
21
- - `.claude/memory/session.md` (if exists)
21
+ - `.claude/memory/session-{branch-slug}.md` (if exists). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
22
22
  - Run `git config user.name` for developer identity
23
+ - List all `session-*.md` files in `.claude/memory/`. For each, read `**Date:**`, `**Developer:**`, `**Branch:**`, and `**Working On:**` fields.
23
24
 
24
25
  IF both STATE.md AND ROADMAP.md are missing:
25
26
  - Print: "No flow project found. Run `/flow:setup` to set up, or `/flow:task` for a quick standalone fix."
@@ -66,7 +67,7 @@ When suggesting /flow:spec, do NOT append a project name — the project picker
66
67
  ```
67
68
  Project: [name] ([X/Y] milestones complete)
68
69
  Developer: [git config user.name]
69
- Session: [session.md "Working On" field if exists, or "No active session"]
70
+ Session: [session-{branch-slug}.md "Working On" field if exists, or "No active session"]
70
71
  Last session: [date] — [what was built]
71
72
  Next: Milestone [N] — [name] ([short description])
72
73
  Lessons: [N]/10 active
@@ -76,10 +77,16 @@ PRDs:
76
77
  * {slug}.md (ready — future project)
77
78
  * PRD.md (legacy — at project root)
78
79
 
80
+ Sessions:
81
+ {branch} — {Developer}: {Working On} ({date})
82
+ {branch} — {Developer}: {Working On} ({date}, stale — branch deleted)
83
+
79
84
  [routing recommendations from Step 3]
80
85
  ```
81
86
 
82
- The PRDs section shows all PRD files found. Mark the one matching STATE.md "Active PRD" as "(active current project)". Mark others as "(ready future project)". Legacy root `PRD.md` shows as "(legacy — at project root)". Omit PRDs section if no PRD files exist.
87
+ Show Sessions section only if 2+ session files exist. Mark sessions as `stale` if their branch no longer exists locally (`git branch --list`).
88
+
89
+ The PRDs section shows all PRD files found. Mark the one whose `**Branch:**` header matches the current git branch as "(active — current project)". If no branch match, fall back to STATE.md "Active PRD". Mark others as "(ready — future project)". Legacy root `PRD.md` shows as "(legacy — at project root)". Omit PRDs section if no PRD files exist.
83
90
 
84
91
  Adapt the block based on available information. If STATE.md is missing, omit "Last session". If ROADMAP.md is missing, omit milestone counts and say "Run /flow:setup to set up tracking."
85
92
 
@@ -19,8 +19,8 @@ RULES:
19
19
 
20
20
  Read ALL in parallel (skip missing files gracefully):
21
21
  - `.planning/STATE.md`, `.planning/ROADMAP.md`, `CLAUDE.md`, `tasks/lessons.md`
22
- - Active PRD from `.planning/prds/` via STATE.md "Active PRD" field (or legacy root `PRD.md`)
23
- - `.claude/memory/session.md` (if exists)
22
+ - Active PRD: (1) `git branch --show-current` (2) read first 10 lines of each `.planning/prds/*.md` for `**Branch:**` header (3) match current branch → active PRD (4) no match: fall back to STATE.md "Active PRD" (5) still none: check legacy root `PRD.md` (6) nothing: no active PRD
23
+ - `.claude/memory/session-{branch-slug}.md` (if exists). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
24
24
 
25
25
  Run `git config user.name` for developer identity.
26
26
 
@@ -83,7 +83,7 @@ IF `.planning/STATE.md` exists, append to "What Was Built":
83
83
 
84
84
  RULES: Do NOT update ROADMAP.md, PRDs, or create `.planning/` if missing.
85
85
 
86
- **Session state:** Write `.claude/memory/session.md` (create dir if needed):
86
+ **Session state:** Write `.claude/memory/session-{branch-slug}.md` (create dir if needed). Branch slug: `git branch --show-current`, replace `/` with `-`, lowercase. Detached HEAD fallback: `session.md`.
87
87
  `# Session State` with Date, Developer, Branch, Working On (`/flow:task — [desc]`), Status, Next, Blockers fields.
88
88
 
89
89
  Lessons prompt via AskUserQuestion: "Any lessons worth capturing?" — "No" / "Yes, let me describe it" → capture to `tasks/lessons.md` as one-liner. Skip if lessons.md doesn't exist. If at 10, promote most battle-tested to `CLAUDE.md ## Learned Rules` first.
@@ -1,3 +1,4 @@
1
+ <!-- Filename: session-{branch-slug}.md — branch slug derived from git branch, / replaced with -, lowercased -->
1
2
  # Session State
2
3
 
3
4
  **Date:** {{DATE}}