$npx -y skills add evanklem/evanflow --skill evanflow-iterateIterative self-review loop after implementing a plan. Re-read changed code with fresh eyes, fix issues found, re-run quality checks, repeat until clean. For UI work, includes visual verification (view the rendered page). Use after evanflow-executing-plans completes; on success, r
| 1 | # EvanFlow: Iterate |
| 2 | |
| 3 | |
| 4 | ## Vocabulary |
| 5 | |
| 6 | See `evanflow` meta-skill. Key terms: **deep modules**, **deletion test**, **vertical slice**. |
| 7 | |
| 8 | ## When to Use |
| 9 | |
| 10 | - After `evanflow-executing-plans` finishes all tasks |
| 11 | - After any non-trivial implementation |
| 12 | - When asked to "polish this" / "review this" / "make sure it's clean" |
| 13 | |
| 14 | **SKIP when:** the change is one line or trivially correct. |
| 15 | |
| 16 | ## The Loop |
| 17 | |
| 18 | Repeat until **stopping condition** met: |
| 19 | |
| 20 | ### 1. Run All Quality Checks |
| 21 | |
| 22 | Run the project's quality checks — exact commands are project-specific (see CLAUDE.md or the project's README). Typical examples across stacks: |
| 23 | |
| 24 | ```bash |
| 25 | # typecheck — one of: |
| 26 | tsc --noEmit # TypeScript |
| 27 | pnpm typecheck # if scripted |
| 28 | cargo check # Rust |
| 29 | go vet ./... # Go |
| 30 | |
| 31 | # lint — one of: |
| 32 | pnpm lint |
| 33 | eslint . |
| 34 | cargo clippy |
| 35 | ruff check . |
| 36 | |
| 37 | # test — one of: |
| 38 | pnpm test |
| 39 | pytest |
| 40 | cargo test |
| 41 | go test ./... |
| 42 | ``` |
| 43 | |
| 44 | If any check fails: fix and restart the loop. Don't proceed to step 2 with broken checks. |
| 45 | |
| 46 | ### 2. Re-Read the Diff With Fresh Eyes |
| 47 | |
| 48 | ```bash |
| 49 | git diff # working-tree changes |
| 50 | git diff HEAD~N..HEAD # if reviewing a series of past commits |
| 51 | ``` |
| 52 | |
| 53 | For each changed file, look critically for: |
| 54 | |
| 55 | - **Dead code** — leftover console.logs, commented-out blocks, unused imports/vars |
| 56 | - **Naming** — does the name match what the code does? (Ubiquitous language matters; see `evanflow-glossary`.) |
| 57 | - **Deletion test** — does each new module earn its existence? Could removing it improve the code? |
| 58 | - **Magic strings/numbers** — should be enums or constants per CLAUDE.md |
| 59 | - **Error handling** — boundary inputs validated? External calls wrapped? Loading/error/empty states in UI? |
| 60 | - **Type safety** — any `any`, `as`, `@ts-ignore`? Justified? |
| 61 | - **Security** — `authenticatedProcedure` where needed? Resource ownership re-derived from `ctx.user`? Per CLAUDE.md. |
| 62 | - **Test coverage** — does the new behavior have a test? Does the test verify behavior, not internals? |
| 63 | - **Test assertion correctness** — research shows 62% of LLM-generated assertions are wrong. For each assertion, would a one-character bug in the implementation still let it pass? If yes, the assertion is too weak. |
| 64 | - **Scope creep** — anything in the diff that wasn't in the plan? |
| 65 | - **Comments** — only WHY notes that explain non-obvious constraints. Delete WHAT comments. |
| 66 | |
| 67 | Fix what you find. Then restart from step 1. |
| 68 | |
| 69 | ### 2.5. Five Failure Modes Check |
| 70 | |
| 71 | Industry research identifies five predictable failure modes in agentic coding. After step 2's diff review, do an explicit pass against each: |
| 72 | |
| 73 | - **(a) Hallucinated actions** — did the implementation invent file paths, env vars, IDs, function names, library APIs, or other external values that aren't authoritatively confirmed? (Example: a `process.env.STRIPE_SECRET_KEY` reference when the actual var name is `STRIPE_SK`.) |
| 74 | - **(b) Scope creep** — does the diff touch files or behaviors not in the plan? Bundled refactors or stylistic changes that should be separate PRs? |
| 75 | - **(c) Cascading errors** — was a failure suppressed/caught/wrapped in a way that hides root cause from callers? Are there silent fallbacks that mask bugs (try/catch returning empty arrays, default values that paper over missing data)? |
| 76 | - **(d) Context loss** — does the diff contradict earlier decisions in the session, the plan, CLAUDE.md, or `CONTEXT.md`? Names, conventions, invariants? |
| 77 | - **(e) Tool misuse** — used the wrong tool (e.g., Bash for file reads, MCP server when CLI was simpler), or used a tool with wrong parameters (e.g., grep without proper escaping, Edit without reading first)? |
| 78 | |
| 79 | For each mode flagged, fix and restart from step 1. |
| 80 | |
| 81 | ### 3. (UI work only) Visual Verification |
| 82 | |
| 83 | If the diff touches frontend page or component files and the change has visible output: |
| 84 | |
| 85 | **Default approach (no Playwright needed):** |
| 86 | |
| 87 | ```bash |
| 88 | # Make sure your dev server is running first (e.g., pnpm dev, npm run dev, etc.) |
| 89 | chromium --headless --no-sandbox \ |
| 90 | --screenshot=/tmp/iter-$(date +%s).png \ |
| 91 | --window-size=1440,900 \ |
| 92 | http://localhost:<port>/<route> |
| 93 | ``` |
| 94 | |
| 95 | (If your project doesn't have `chromium`, substitute `google-chrome --headless` or `chrome --headless` with the same flags.) |
| 96 | |
| 97 | Then read the screenshot: |
| 98 | |
| 99 | ``` |
| 100 | Read /tmp/iter-*.png |
| 101 | ``` |
| 102 | |
| 103 | Check against: |
| 104 | - Any brainstorm mockup or design comp the project maintains |
| 105 | - The project's design system (colors, spacing, typography, component patterns documented in CLAUDE.md) |
| 106 | - Responsive behavior — also screenshot at `--window-size=390,844` (mobile) |
| 107 | |
| 108 | **If you need interaction** (click, fill, observe modal): use Playwright MCP. If MCP fails with "chrome not found", configure it to use your installed Ch |