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

Commit 720cb33

Browse files
z23ccclaude
andcommitted
feat(skills): add 5 engineering skills + wire into worker pipeline (v0.1.38)
New skills: - flow-code-security: OWASP Top 10, three-tier boundary (Always/Ask/Never), secrets management, input validation, file upload safety - flow-code-code-review: five-axis review (correctness/readability/architecture/ security/performance), severity labels (Critical→FYI), change sizing - flow-code-incremental: vertical slicing, Implement→Test→Verify→Commit cycle, scope discipline, Save Point Pattern, rollback-friendly commits - flow-code-tdd: Red-Green-Refactor cycle, Prove-It Pattern for bugs, test pyramid (80/15/5), DAMP over DRY, mock guidance - flow-code-simplify: Chesterton's Fence, 18 simplification patterns, behavior preservation, dead code removal + /flow-code:simplify command Pipeline integration: - Worker Phase 4: references flow-code-tdd skill + Prove-It Pattern - Worker Phase 5: references flow-code-incremental for vertical slicing - Worker Phase 6: upgraded to five-axis self-review from flow-code-code-review - Worker domain table: all domains load incremental + code-review skills; backend/architecture/ops load security skill; testing loads tdd skill - Existing flow-code-api-design already complete (kept as-is) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 576238d commit 720cb33

9 files changed

Lines changed: 1132 additions & 15 deletions

File tree

agents/worker.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -251,21 +251,28 @@ Parse the spec carefully. Identify:
251251
**Domain-specific skill loading:**
252252
Based on the task `domain` field, you MUST Read and follow the corresponding skill file. This is a quality gate — not optional.
253253

254-
| Domain | Skill file to load | Focus |
255-
|--------|-------------------|-------|
256-
| `frontend` | `skills/flow-code-frontend-ui/SKILL.md` | Component architecture, design system, accessibility, AI aesthetic avoidance |
257-
| `backend` | Apply `flow-code-api-design` patterns (if skill exists) | API design, DB queries, error handling, input validation |
258-
| `testing` | Apply `flow-code-debug` patterns | Test coverage, edge cases, regression guards |
254+
| Domain | Skill files to load | Focus |
255+
|--------|---------------------|-------|
256+
| `frontend` | `flow-code-frontend-ui` | Component architecture, design system, accessibility, AI aesthetic avoidance |
257+
| `backend` | `flow-code-api-design` + `flow-code-security` | API design, DB queries, input validation, OWASP prevention |
258+
| `testing` | `flow-code-tdd` + `flow-code-debug` | TDD Red-Green-Refactor, Prove-It Pattern, test pyramid |
259259
| `docs` | Follow project's doc conventions | Accuracy, completeness, cross-references |
260-
| `architecture` | Apply `flow-code-api-design` patterns | Module boundaries, dependency direction, interface stability |
261-
| `ops` | Focus on idempotency, rollback safety, monitoring | CI/CD, infra, deploy scripts |
260+
| `architecture` | `flow-code-api-design` + `flow-code-security` | Module boundaries, dependency direction, contract-first |
261+
| `ops` | `flow-code-security` | Idempotency, rollback safety, secrets management, monitoring |
262+
263+
**All domains additionally load:**
264+
- `flow-code-incremental` — vertical slicing, scope discipline, Implement→Test→Verify→Commit cycle
265+
- `flow-code-code-review` — five-axis self-review in Phase 6
262266

263267
```bash
264-
# Example: load frontend skill
268+
# Load domain skills (read each that exists)
265269
PLUGIN_ROOT="${DROID_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT}}"
270+
cat "$PLUGIN_ROOT/skills/flow-code-incremental/SKILL.md"
271+
cat "$PLUGIN_ROOT/skills/flow-code-code-review/SKILL.md"
272+
# Then load domain-specific skills per table above, e.g.:
266273
cat "$PLUGIN_ROOT/skills/flow-code-frontend-ui/SKILL.md"
267274
```
268-
If the skill file does not exist for a domain, apply the domain focus guidelines from the table above.
275+
If a skill file does not exist, skip it and apply the focus guidelines from the table above.
269276

270277
**Baseline check:**
271278
```bash
@@ -361,7 +368,7 @@ END
361368

362369
**Skip this phase if TDD_MODE is not `true`.**
363370

364-
Before implementing the feature, write failing tests first:
371+
Follow the `flow-code-tdd` skill for the full TDD methodology. Core cycle:
365372

366373
1. **Red** — Write test(s) that cover the acceptance criteria. Run them to confirm they FAIL:
367374
```bash
@@ -374,12 +381,16 @@ Before implementing the feature, write failing tests first:
374381

375382
3. **Refactor** — After tests pass, clean up without changing behavior. Run tests again to confirm still green.
376383

384+
**For bug fixes**: always use the Prove-It Pattern — write a test that demonstrates the bug, confirm it fails, then fix.
385+
377386
The key constraint: **no implementation code before a failing test exists**. This ensures every change is test-driven.
378387
<!-- /section:tdd -->
379388

380389
<!-- section:core -->
381390
## Phase 5: Implement
382391

392+
Follow the `flow-code-incremental` skill: build in vertical slices (Implement→Test→Verify→Commit per slice). Each slice leaves the system working. Scope discipline: only touch what the task spec requires.
393+
383394
**First, capture base commit for scoped review:**
384395
```bash
385396
BASE_COMMIT=$(git rev-parse HEAD)
@@ -529,17 +540,23 @@ Continue until guard passes. There is no retry limit — this is not a retry loo
529540
530541
**Teams mode constraint:** When `TEAM_MODE=true`, only fix files in `OWNED_FILES`. If the failure is caused by a file you don't own, request access via `flowctl approval create --kind file_access` + `approval show --wait` (or fallback `Need file access:` SendMessage), then wait for a resolution. If access is rejected or times out, note the issue in your completion summary.
531542

532-
### Step 2: Review your own diff
543+
### Step 2: Five-axis self-review
544+
545+
Follow the `flow-code-code-review` skill. Review your own diff across all five axes:
546+
533547
```bash
534548
git diff
535549
```
536550

537-
Scan your changes for obvious issues:
551+
**Axis 1 — Correctness:** Does it match the spec? Edge cases handled?
552+
**Axis 2 — Readability:** Clear names? Functions <40 lines? No dead code?
553+
**Axis 3 — Architecture:** Follows project patterns? Module boundaries respected?
554+
**Axis 4 — Security:** Input validated? Queries parameterized? No secrets in code?
555+
**Axis 5 — Performance:** No N+1 queries? No unbounded fetches? No main-thread blocking?
538556

557+
Also check:
539558
- No commented-out code or debug prints left behind
540559
- No hardcoded values that should be constants/config
541-
- Naming is consistent with existing codebase patterns
542-
- New functions handle error cases, not just happy path
543560
- No duplicate logic — reuse existing utilities
544561

545562
If you find issues, fix them and re-run `<FLOWCTL> guard` to verify.

bin/flowctl

-16 Bytes
Binary file not shown.

commands/flow-code/simplify.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: flow-code:simplify
3+
description: "Reduce code complexity while preserving exact behavior"
4+
argument-hint: "[file or directory to simplify]"
5+
---
6+
7+
# IMPORTANT: This command MUST invoke the skill `flow-code-simplify`
8+
9+
The ONLY purpose of this command is to call the `flow-code-simplify` skill. You MUST use that skill now.
10+
11+
**User request:** $ARGUMENTS
12+
13+
Pass the user request to the skill. The skill handles all code simplification logic.

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.37"
3+
version = "0.1.38"
44
description = "CLI entry point for flowctl"
55
edition.workspace = true
66
rust-version.workspace = true
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
---
2+
name: flow-code-code-review
3+
description: "Use when reviewing code changes — self-review in Worker Phase 6, impl-review, or PR review. Applies five-axis scoring with severity labels."
4+
tier: 2
5+
user-invocable: true
6+
---
7+
<!-- SKILL_TAGS: review,quality,correctness,security -->
8+
9+
# Five-Axis Code Review
10+
11+
> **Startup:** Follow [Startup Sequence](../_shared/preamble.md) before proceeding.
12+
13+
## flowctl Setup
14+
15+
```bash
16+
FLOWCTL="$HOME/.flow/bin/flowctl"
17+
```
18+
19+
## Overview
20+
21+
Structured code review across five orthogonal axes. Every finding gets a severity label. Every review ends with a clear verdict. This replaces ad-hoc "looks good" reviews with systematic quality gates.
22+
23+
## When to Use
24+
25+
- Worker Phase 6 (self-review before commit)
26+
- Implementation review (impl-review phase)
27+
- PR review before merge
28+
- Manual code review requests
29+
30+
**When NOT to use:**
31+
- Plan review (that checks spec alignment, not code quality)
32+
- Architecture design review (use flow-code-api-design instead)
33+
34+
## The Five Axes
35+
36+
Review every diff across these five dimensions. Each axis is independent — a change can score well on correctness but poorly on security.
37+
38+
### Axis 1: Correctness
39+
40+
- Does the code do what the spec says?
41+
- Are edge cases handled? (null, empty, boundary values, overflow)
42+
- Are errors caught and handled appropriately?
43+
- Do tests cover the actual behavior, not just happy path?
44+
- Are race conditions possible under concurrent access?
45+
46+
### Axis 2: Readability & Simplicity
47+
48+
- Can a new team member understand this code without explanation?
49+
- Are names clear and specific? (`processData``validateUserInput`)
50+
- Is the logic straightforward or unnecessarily clever?
51+
- Are functions under 40 lines? Files under 300 lines?
52+
- Is there dead code, commented-out code, or TODOs that should be tickets?
53+
54+
### Axis 3: Architecture
55+
56+
- Does the change follow existing project patterns?
57+
- Are module boundaries respected? (no cross-layer imports)
58+
- Is the abstraction level appropriate? (not too deep, not too shallow)
59+
- Would this change make future modifications harder?
60+
- Are dependencies flowing in the right direction?
61+
62+
### Axis 4: Security
63+
64+
- Is all user input validated at the boundary?
65+
- Are queries parameterized?
66+
- Are auth and authorization checks present where needed?
67+
- Are secrets, tokens, or PII protected?
68+
- See `flow-code-security` skill for full checklist.
69+
70+
### Axis 5: Performance
71+
72+
- Are there N+1 query patterns?
73+
- Are there unbounded loops or data fetches?
74+
- Could this block the main thread or event loop?
75+
- Are expensive operations cached where appropriate?
76+
- Are there unnecessary re-renders (React) or recomputations?
77+
78+
## Severity Labels
79+
80+
Every finding MUST have a severity label:
81+
82+
| Label | Meaning | Action Required |
83+
|-------|---------|-----------------|
84+
| **Critical** | Blocks merge. Bug, security hole, data loss risk. | Must fix before proceeding. |
85+
| **Important** | Should fix. Correctness concern or significant quality issue. | Fix unless strong justification. |
86+
| **Suggestion** | Consider this. Improvement opportunity. | Author decides. |
87+
| **Nit** | Minor style or naming preference. | Author may ignore. |
88+
| **FYI** | Informational. No action needed. | For awareness only. |
89+
90+
## Change Sizing
91+
92+
| Lines Changed | Rating | Action |
93+
|---------------|--------|--------|
94+
| ~100 | Good | Easy to review thoroughly |
95+
| ~300 | Acceptable | Review in one sitting |
96+
| ~500 | Large | Consider splitting |
97+
| ~1000+ | Too large | Split into smaller changes |
98+
99+
If a diff exceeds 500 lines, flag it: "This change is large (~N lines). Consider splitting into focused commits."
100+
101+
## Review Process
102+
103+
### Step 1: Understand Context
104+
105+
Before looking at code:
106+
- Read the task spec / PR description
107+
- Understand WHAT should have changed and WHY
108+
- Check which files are expected to change
109+
110+
### Step 2: Review Tests First
111+
112+
- Do tests exist for the change?
113+
- Do they test behavior, not implementation?
114+
- Are edge cases covered?
115+
- Would the tests catch a regression if someone reverted the key logic?
116+
117+
### Step 3: Review Implementation
118+
119+
Walk through the diff with all five axes active:
120+
- Read file-by-file in dependency order (utilities → services → handlers → tests)
121+
- For each file, check all five axes
122+
- Note findings with severity labels
123+
124+
### Step 4: Categorize Findings
125+
126+
Group findings by severity:
127+
```
128+
## Critical (must fix)
129+
- [Correctness] Missing null check on user.email (line 42) — NPE in production
130+
- [Security] SQL built with template literal (line 89) — injection risk
131+
132+
## Important (should fix)
133+
- [Architecture] Direct DB access from handler — should go through service layer
134+
- [Performance] Fetching all users to count them — use COUNT query
135+
136+
## Suggestions
137+
- [Readability] Rename `processData` to `validateOrderInput` for clarity
138+
- [Readability] Extract lines 120-145 into a named function
139+
140+
## Nits
141+
- [Readability] Inconsistent spacing in object literal (line 67)
142+
```
143+
144+
### Step 5: Verdict
145+
146+
| Verdict | Criteria |
147+
|---------|----------|
148+
| **SHIP** | Zero Critical, zero Important, all Suggestions are minor |
149+
| **NEEDS_WORK** | Has Critical or Important findings that need fixes |
150+
| **MAJOR_RETHINK** | Fundamental approach is wrong — need to redesign |
151+
152+
## Multi-Model Review Pattern
153+
154+
For highest quality, use cross-model review:
155+
1. Model A (Claude) writes the code
156+
2. Model B (Codex/different model) reviews independently
157+
3. Model A addresses findings
158+
4. Human approves final result
159+
160+
This catches blind spots that same-model review misses.
161+
162+
## Dead Code Hygiene
163+
164+
During review, flag:
165+
- Commented-out code blocks (delete or create a ticket)
166+
- Unused imports, variables, functions
167+
- Feature flags for features that shipped months ago
168+
- `TODO` comments older than 30 days without tickets
169+
170+
## Common Rationalizations
171+
172+
| Rationalization | Reality |
173+
|---|---|
174+
| "It works, so it's fine" | Working code can still have security holes, performance issues, and maintenance debt. |
175+
| "We'll clean it up later" | Later never comes. Fix it now or create a tracked ticket. |
176+
| "It's just a nit" | Accumulated nits become a maintenance burden. Fix the pattern, not individual instances. |
177+
| "The tests pass" | Tests only catch what they test for. Review the untested paths. |
178+
| "I don't have context on this area" | Say so. Ask questions. Don't rubber-stamp code you don't understand. |
179+
180+
## Red Flags
181+
182+
- No tests added for new behavior
183+
- Error handling that swallows exceptions silently
184+
- Magic numbers or strings without constants
185+
- Functions with more than 4 parameters
186+
- Deeply nested conditionals (3+ levels)
187+
- Mixed concerns in a single commit (feature + refactor + config change)
188+
- TODOs without ticket references
189+
- Changes to generated files
190+
191+
## Verification
192+
193+
After completing a review:
194+
195+
- [ ] All five axes evaluated (correctness, readability, architecture, security, performance)
196+
- [ ] Every finding has a severity label
197+
- [ ] Critical/Important findings have specific fix guidance
198+
- [ ] Clear SHIP / NEEDS_WORK / MAJOR_RETHINK verdict given
199+
- [ ] Change size noted if >500 lines
200+
- [ ] Tests reviewed before implementation
201+
- [ ] No rubber-stamping — every approval reflects genuine review

0 commit comments

Comments
 (0)