Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 36b86d6

Browse files
z23ccclaude
andcommitted
fix(pipeline): five quality gaps — domain skills, brainstorm→plan, planSync, investigation, memory (v0.1.36)
1. Worker domain skills: expand from frontend-only to all 6 domains with per-domain focus table and fallback guidelines 2. Brainstorm→Plan: make requirements doc consumption mandatory with traceability (MUST read, MUST reference in epic spec) 3. planSync: update docs to reflect default-enabled state (was documented as disabled but default config already had enabled:true) 4. Worker Phase 3 (Investigation): include in S/M task sequences — all tasks need context before coding, not just L tasks 5. Memory system: change default from false to true so cross-epic knowledge accumulates automatically Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2e02b8a commit 36b86d6

6 files changed

Lines changed: 46 additions & 32 deletions

File tree

agents/worker.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,23 @@ Parse the spec carefully. Identify:
247247
- **Domain** (from task JSON `domain` field): if set (frontend/backend/architecture/testing/docs/ops), focus your approach accordingly — e.g., backend tasks prioritize API/DB, frontend tasks prioritize UI/UX
248248

249249
**Domain-specific skill loading:**
250-
If task domain is `frontend`, you MUST Read the skill file and follow it:
250+
Based on the task `domain` field, you MUST Read and follow the corresponding skill file. This is a quality gate — not optional.
251+
252+
| Domain | Skill file to load | Focus |
253+
|--------|-------------------|-------|
254+
| `frontend` | `skills/flow-code-frontend-ui/SKILL.md` | Component architecture, design system, accessibility, AI aesthetic avoidance |
255+
| `backend` | Apply `flow-code-api-design` patterns (if skill exists) | API design, DB queries, error handling, input validation |
256+
| `testing` | Apply `flow-code-debug` patterns | Test coverage, edge cases, regression guards |
257+
| `docs` | Follow project's doc conventions | Accuracy, completeness, cross-references |
258+
| `architecture` | Apply `flow-code-api-design` patterns | Module boundaries, dependency direction, interface stability |
259+
| `ops` | Focus on idempotency, rollback safety, monitoring | CI/CD, infra, deploy scripts |
260+
251261
```bash
252-
# Load frontend UI engineering skill (component architecture, design system, accessibility, AI aesthetic avoidance)
253-
cat "${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}/skills/flow-code-frontend-ui/SKILL.md"
262+
# Example: load frontend skill
263+
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}"
264+
cat "$PLUGIN_ROOT/skills/flow-code-frontend-ui/SKILL.md"
254265
```
255-
Apply all phases from the skill during implementation. This is not optional — it is a quality gate.
266+
If the skill file does not exist for a domain, apply the domain focus guidelines from the table above.
256267

257268
**Baseline check:**
258269
```bash
@@ -277,7 +288,7 @@ Save `GIT_BASELINE_REV` — you'll use it in Phase 10 to generate workspace chan
277288
<!-- section:core -->
278289
## Phase 3: Pre-implementation Investigation
279290

280-
**If the task spec contains `## Investigation targets` with content, execute this phase. Otherwise skip to Phase 4/5.**
291+
**Always execute this phase** — even S/M tasks need context before coding. If the task spec contains `## Investigation targets`, follow them. If not, do a lightweight scan: read the files listed in `**Files:**` and check for 2-3 related patterns via Grep. Skip only if the task is a trivial one-line config change with no dependencies.
281292

282293
### Step 0: RP-powered deep context (if RP_CONTEXT != none)
283294

bin/flowctl

16 Bytes
Binary file not shown.

codex/skills/flow-code-plan/steps.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ elif ls .flow/specs/*-requirements.md 1>/dev/null 2>&1; then
6363
fi
6464
```
6565

66-
**If a brainstorm requirements doc exists**, read it and use as enriched context:
67-
- Extract `## Problem`, `## Requirements`, `## Constraints`, `## Non-Goals` sections
68-
- Use `## Chosen Approach` to guide scout research direction
66+
**If a brainstorm requirements doc exists**, you MUST read it and use as enriched context (this is NOT optional — brainstorm output is a first-class input to planning):
67+
- Extract `## Problem`, `## Requirements`, `## Constraints`, `## Non-Goals` sections — these override any guesses
68+
- Use `## Chosen Approach` to guide scout research direction and as the primary approach (do not re-derive from scratch)
6969
- Use `## Evidence` file references as starting points for repo-scout
70-
- Use `## Open Questions` as specific research targets for scouts
70+
- Use `## Open Questions` as specific research targets for scouts — each MUST be resolved or explicitly carried as a gap
7171
- Pass `## Self-Interview Trace` (if present) as additional context for deep RP analysis
72+
- Reference the requirements doc in the epic spec: `**Source:** .flow/specs/<slug>-requirements.md`
7273

73-
This means `/flow-code:brainstorm``/flow-code:plan` flows seamlessly: brainstorm output directly enriches plan research instead of being orphaned.
74+
This means `/flow-code:brainstorm``/flow-code:plan` flows seamlessly: brainstorm output directly enriches plan research instead of being orphaned. The plan MUST be traceable back to the requirements doc.
7475

7576
**If no brainstorm doc exists**, proceed normally — Step 2 does its own mini clarity check.
7677

codex/skills/flow-code-work/phases.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Check if plan-sync should run:
392392
$FLOWCTL config get planSync.enabled --json
393393
```
394394

395-
Skip unless planSync.enabled is explicitly `true` (null/false/missing = skip).
395+
Plan-sync is **enabled by default** (default config: `planSync.enabled: true`). Skip only if explicitly set to `false`.
396396

397397
Get remaining tasks (todo status = not started yet):
398398

@@ -429,11 +429,11 @@ CROSS_EPIC: $CROSS_EPIC
429429
Follow your phases in plan-sync.md exactly.
430430
```
431431

432-
**Cross-epic sync** (disabled by default): When `planSync.crossEpic` is `true`, plan-sync also checks other open epics for stale references to the completed task's APIs. Enable via:
432+
**Cross-epic sync** (enabled by default): When `planSync.crossEpic` is `true`, plan-sync also checks other open epics for stale references to the completed task's APIs. Disable via:
433433
```bash
434-
$FLOWCTL config set planSync.crossEpic true
434+
$FLOWCTL config set planSync.crossEpic false
435435
```
436-
Use for multi-epic projects where epics share APIs. Disable for single-epic work (default) to save tokens.
436+
Disable for single-epic work to save tokens. Keep enabled (default) for multi-epic projects where epics share APIs.
437437

438438
Plan-sync returns a summary. **Check the result before advancing:**
439439

flowctl/crates/flowctl-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flowctl-cli"
3-
version = "0.1.35"
3+
version = "0.1.36"
44
description = "CLI entry point for flowctl"
55
edition.workspace = true
66
rust-version.workspace = true

flowctl/crates/flowctl-cli/src/commands/workflow/phase.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,17 @@ const PHASE_DEFS: &[PhaseDef] = &[
8181
const CANONICAL_ORDER: &[&str] = &["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
8282

8383
/// Default phase sequence (Worktree + Teams, always includes Phase 1).
84+
/// Phase 3 (investigation) now included by default — even S/M tasks need context.
8485
/// Phase 9 is inserted before 10 when `outputs.enabled` is true (default).
85-
const PHASE_SEQ_DEFAULT: &[&str] = &["1", "2", "5", "6", "7", "10", "11", "12"];
86-
const PHASE_SEQ_TDD: &[&str] = &["1", "2", "4", "5", "6", "7", "10", "11", "12"];
87-
const PHASE_SEQ_REVIEW: &[&str] = &["1", "2", "5", "6", "7", "8", "10", "11", "12"];
86+
const PHASE_SEQ_DEFAULT: &[&str] = &["1", "2", "3", "5", "6", "7", "10", "11", "12"];
87+
const PHASE_SEQ_TDD: &[&str] = &["1", "2", "3", "4", "5", "6", "7", "10", "11", "12"];
88+
const PHASE_SEQ_REVIEW: &[&str] = &["1", "2", "3", "5", "6", "7", "8", "10", "11", "12"];
8889

8990
/// Size-based phase sequences.
90-
/// S: fast path — skip investigation, outputs, memory. Keep guard (phase 6).
91-
const PHASE_SEQ_SMALL: &[&str] = &["1", "2", "5", "6", "7", "10", "12"];
92-
/// L: thorough path — all 11 defined phases (adds investigation, TDD, review, outputs, memory).
93-
const PHASE_SEQ_LARGE: &[&str] = &["1", "2", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
91+
/// S: fast path — includes lightweight investigation (phase 3), skips outputs/memory.
92+
const PHASE_SEQ_SMALL: &[&str] = &["1", "2", "3", "5", "6", "7", "10", "12"];
93+
/// L: thorough path — all 11 defined phases (adds TDD, review, outputs, memory).
94+
const PHASE_SEQ_LARGE: &[&str] = &["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
9495

9596
fn get_phase_def(phase_id: &str) -> Option<&'static PhaseDef> {
9697
PHASE_DEFS.iter().find(|p| p.id == phase_id)
@@ -99,9 +100,9 @@ fn get_phase_def(phase_id: &str) -> Option<&'static PhaseDef> {
99100
/// Build the phase sequence based on mode flags and task size.
100101
///
101102
/// Size controls the base sequence:
102-
/// - S (small): fast path — 7 phases, skips investigation/outputs/memory
103-
/// - M (medium, default): standard 8-phase sequence
104-
/// - L (large): thorough — all 11 defined phases
103+
/// - S (small): fast path — 8 phases, includes investigation, skips outputs/memory
104+
/// - M (medium, default): standard 9-phase sequence with investigation
105+
/// - L (large): thorough — all 12 defined phases
105106
///
106107
/// Additional flags (--tdd, --review) merge extra phases into the base.
107108
/// Config overrides (outputs.enabled, memory.enabled) apply on top.
@@ -143,7 +144,7 @@ fn build_phase_sequence(tdd: bool, review: bool, size: TaskSize) -> Vec<&'static
143144
if read_config_bool("outputs.enabled", true) {
144145
phases.insert("9");
145146
}
146-
if read_config_bool("memory.enabled", false) {
147+
if read_config_bool("memory.enabled", true) {
147148
phases.insert("11");
148149
}
149150

@@ -358,8 +359,8 @@ mod tests {
358359
#[test]
359360
fn test_build_sequence_size_s() {
360361
let seq = build_phase_sequence(false, false, TaskSize::Small);
361-
// S base always includes these core phases
362-
for p in &["1", "2", "5", "6", "7", "10", "12"] {
362+
// S base includes investigation (phase 3) since all tasks need context
363+
for p in &["1", "2", "3", "5", "6", "7", "10", "12"] {
363364
assert!(seq.contains(p), "S sequence missing phase {p}");
364365
}
365366
// S should NOT include TDD or review without flags
@@ -370,8 +371,8 @@ mod tests {
370371
#[test]
371372
fn test_build_sequence_size_l() {
372373
let seq = build_phase_sequence(false, false, TaskSize::Large);
373-
// L base includes TDD, review, outputs — all non-conditional phases
374-
for p in &["1", "2", "4", "5", "6", "7", "8", "10", "12"] {
374+
// L base includes TDD, review, outputs, investigation — all non-conditional phases
375+
for p in &["1", "2", "3", "4", "5", "6", "7", "8", "10", "12"] {
375376
assert!(seq.contains(p), "L sequence missing phase {p}");
376377
}
377378
// L is strictly a superset of S
@@ -385,15 +386,16 @@ mod tests {
385386
fn test_size_s_with_tdd() {
386387
let seq = build_phase_sequence(true, false, TaskSize::Small);
387388
assert!(seq.contains(&"4"), "S+TDD should include phase 4");
389+
assert!(seq.contains(&"3"), "S+TDD should include investigation");
388390
assert!(seq.contains(&"5"));
389391
assert!(seq.contains(&"6"));
390392
}
391393

392394
#[test]
393395
fn test_backward_compat_no_size() {
394396
let seq = build_phase_sequence(false, false, TaskSize::Medium);
395-
// Medium always includes the default core phases
396-
for p in &["1", "2", "5", "6", "7", "10", "12"] {
397+
// Medium always includes investigation + core phases
398+
for p in &["1", "2", "3", "5", "6", "7", "10", "12"] {
397399
assert!(seq.contains(p), "M sequence missing phase {p}");
398400
}
399401
// No TDD, no review

0 commit comments

Comments
 (0)