@gobing-ai/spur 0.3.63 → 0.3.64

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.
Files changed (36) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/config/corpus-baseline.json +3326 -3886
  3. package/config/workflows/history-anatomy.yaml +2 -2
  4. package/package.json +9 -9
  5. package/plugins/sp/README.md +6 -3
  6. package/plugins/sp/agents/expert-spur.md +20 -4
  7. package/plugins/sp/commands/dev-find-issue.md +1 -1
  8. package/plugins/sp/commands/dev-gitmsg.md +12 -6
  9. package/plugins/sp/commands/dev-gtd.md +8 -19
  10. package/plugins/sp/commands/dev-idea.md +1 -1
  11. package/plugins/sp/commands/dev-plan.md +1 -1
  12. package/plugins/sp/commands/dev-run.md +2 -2
  13. package/plugins/sp/commands/dev-runall.md +2 -2
  14. package/plugins/sp/commands/dev-wrap.md +5 -6
  15. package/plugins/sp/commands/dev-wrapall.md +5 -7
  16. package/plugins/sp/plugin.json +1 -1
  17. package/plugins/sp/scripts/history-anatomy-cache.mjs +3 -2
  18. package/plugins/sp/scripts/history-anatomy-cache.ts +7 -2
  19. package/plugins/sp/skills/dogfood-testing/SKILL.md +14 -1
  20. package/plugins/sp/skills/history-anatomy/references/report-contract.md +8 -0
  21. package/plugins/sp/skills/next-router/SKILL.md +4 -4
  22. package/plugins/sp/skills/pr-reviewing/SKILL.md +2 -3
  23. package/plugins/sp/skills/redesign-web-ui/SKILL.md +184 -0
  24. package/plugins/sp/skills/redesign-web-ui/references/audit-checklist.md +121 -0
  25. package/plugins/sp/skills/redesign-web-ui/references/upgrade-techniques.md +66 -0
  26. package/plugins/sp/skills/spur-cli/references/agent.md +1 -1
  27. package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +5 -0
  28. package/plugins/sp/skills/spur-cli/references/workflows/operations.md +20 -5
  29. package/plugins/sp/skills/spur-cli/references/workflows/workflow-fit-and-tuning.md +230 -0
  30. package/plugins/sp/skills/spur-cli/references/workflows.md +26 -4
  31. package/plugins/sp/skills/spur-dev/references/cross-cutting.md +22 -30
  32. package/plugins/sp/skills/spur-dev/references/dev-operations.md +62 -20
  33. package/plugins/sp/skills/spur-dev/references/execution-workflow.md +1 -1
  34. package/plugins/sp/skills/spur-dev/references/flag-glossary.md +18 -8
  35. package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +7 -6
  36. package/spur.js +297 -214
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: redesign-web-ui
3
+ description: "Upgrade an existing website or app UI past generic AI defaults without rewriting the stack. Triggers: \"redesign this UI\", \"make it look premium\", \"generic AI design\", \"polish this page\", \"restyle the web app\"."
4
+ license: Apache-2.0
5
+ metadata:
6
+ author: spur
7
+ version: "1.0"
8
+ platforms: "claude-code,codex,openclaw,opencode,antigravity"
9
+ category: execution
10
+ interactions:
11
+ - pipeline
12
+ - reviewer
13
+ pipeline_steps:
14
+ - scan
15
+ - diagnose
16
+ - plan
17
+ - apply
18
+ - verify
19
+ operations:
20
+ - redesign
21
+ openclaw:
22
+ emoji: "🎨"
23
+ see_also:
24
+ - sp:code-implementation
25
+ - sp:code-review
26
+ - sp:source-driven-development
27
+ ---
28
+
29
+ # redesign-web-ui — existing-UI visual upgrade
30
+
31
+ This is a **technique** skill: it edits presentation. Specific product copy stays; placeholder copy
32
+ becomes real draft text. Information architecture, routing, and data behavior stay unless the
33
+ operator widens the scope.
34
+
35
+ ## When to use
36
+
37
+ - Redesign or restyle an existing page, app shell, or component set.
38
+ - Make an existing UI look premium / high-end rather than templated.
39
+ - Strip generic AI design fingerprints (Inter-only type, purple-blue gradients, three equal feature cards).
40
+ - Polish a page that feels unfinished (missing hover, focus, loading, empty, or error states).
41
+ - Restyle a web app in place without a framework migration.
42
+
43
+ ## When not to use
44
+
45
+ - **Greenfield visual identity with no existing UI** — there is nothing to upgrade; design from the brief.
46
+ - **IA or navigation restructure** — out of scope unless the operator asks.
47
+ - **Stack migration** — swapping CSS frameworks or component libraries.
48
+ - **Non-UI work** — APIs, CLI, schemas, backend.
49
+ - **Inventing legal or compliance surfaces** — privacy pages, terms, cookie banners. Link only
50
+ destinations the product already has.
51
+
52
+ ## Authority (read before changing tokens)
53
+
54
+ Resolve visual authority in this order. A lower layer never overrides a higher one. Cite the source
55
+ on every token change.
56
+
57
+ 1. **Repository-root `DESIGN.md`** — if it exists, it is the UI SSOT (palette, type, surfaces, motion,
58
+ density). Read it. Use its tokens by name.
59
+ 2. **Existing theme / CSS variables / Tailwind theme** — the live token file the app already compiles.
60
+ 3. **This skill's audit heuristics** — only for axes the two layers above leave free.
61
+
62
+ `docs/04_DESIGN.md` owns non-UI surfaces (commands, flags, DTOs). It is not this skill's authority.
63
+
64
+ Framework and CSS API facts (Tailwind v3 vs v4, styled-components APIs, browser features): verify
65
+ with source for the pinned version via `sp:source-driven-development`. Cross-check against docs
66
+ before changing config.
67
+
68
+ ## Pipeline
69
+
70
+ Run in order. Later steps consume the previous step's artifact. Stop after Diagnose when the
71
+ operator asked only for an audit.
72
+
73
+ ### Step 1 — Scan
74
+
75
+ Read the target UI and its styling entrypoints. Record, with evidence:
76
+
77
+ | Field | Evidence |
78
+ |---|---|
79
+ | Framework | manifest / entry file |
80
+ | Styling system | Tailwind v3/v4, CSS modules, vanilla, styled-components, … |
81
+ | Token source | `DESIGN.md`, CSS variables, `tailwind.config`, theme file |
82
+ | Scope | routes, layouts, and shared components that will render the change |
83
+
84
+ Done when every row has a path (or `none — proceed on heuristics`).
85
+
86
+ ### Step 2 — Diagnose
87
+
88
+ Walk [references/audit-checklist.md](references/audit-checklist.md). Emit a findings table. Every
89
+ row must cite `path:line`. No finding, no change. Cite the reference row you matched.
90
+
91
+ ```markdown
92
+ | ID | Pattern | Severity | Evidence | In-stack fix |
93
+ |----|---------|----------|----------|--------------|
94
+ | F1 | … | a11y \| fingerprint \| polish | `file:line` | … |
95
+ ```
96
+
97
+ Severity:
98
+
99
+ - **a11y** — focus, skip-link, alt, contrast, reduced-motion, keyboard path. Visible focus is required. Fix these.
100
+ - **fingerprint** — generic AI look that fights this product. Fix unless a higher authority specifies it.
101
+ - **polish** — optional quality. Apply when it does not fight the authority or the product type.
102
+
103
+ Done when every checklist category has been considered and every hit is a table row (or the
104
+ category is marked `none`).
105
+
106
+ ### Step 3 — Plan
107
+
108
+ Order the findings by the Fix Priority below. State the typefaces, palette, and one signature
109
+ choice, each cited to authority or to a subject-specific reason. Optional motion and layout
110
+ upgrades live in [references/upgrade-techniques.md](references/upgrade-techniques.md) — load that
111
+ file only when a finding needs a technique from it.
112
+
113
+ The plan should list every **a11y** and **fingerprint** finding. Always cite the token source.
114
+ Done when both are present.
115
+
116
+ ### Step 4 — Apply
117
+
118
+ Work in the existing styling system. Targeted upgrades, not a rewrite.
119
+
120
+ Fix Priority:
121
+
122
+ 1. Accessibility
123
+ 2. Token alignment to authority
124
+ 3. Typography and color fingerprints
125
+ 4. Hover, focus, active, loading, empty, error
126
+ 5. Layout, spacing, max-width
127
+ 6. Generic component cliches
128
+ 7. Motion that serves the product (and honors `prefers-reduced-motion`)
129
+
130
+ Before any new import, read the project's dependency manifest. Before editing Tailwind config,
131
+ validate the installed major version against its docs.
132
+
133
+ Done when every planned **a11y** and **fingerprint** row is reflected in the diff, or explicitly
134
+ deferred with a one-line reason.
135
+
136
+ ### Step 5 — Verify
137
+
138
+ Confirm with evidence, not assertion. See **Verification** below.
139
+
140
+ ## Hard constraints
141
+
142
+ - Keep the current framework and styling library.
143
+ - Preserve existing functionality; a visual change that breaks a flow is a failed run.
144
+ - Keep the diff reviewable — small, targeted edits over a greenfield restyle.
145
+ - Prefer the project's existing icon set, font loader, and image pipeline over new dependencies.
146
+ - Honor `prefers-reduced-motion` for every motion addition.
147
+
148
+ ## Common Rationalizations
149
+
150
+ | Rationalization | Reality |
151
+ |---|---|
152
+ | "I'll migrate to a nicer component library while I'm here." | Stack change is out of scope. Upgrade what is already compiled. |
153
+ | "DESIGN.md is just a mood board — I'll pick better colors." | Root `DESIGN.md` is authority. Cite its tokens; do not invent a parallel palette. |
154
+ | "A full rewrite is faster than patching these class names." | Rewrites drop states, a11y, and behavior. Patch in place; the audit is the map. |
155
+ | "I'll add stock photos / a new icon library for polish." | New assets and libraries are fingerprints of their own. Use the project's pipeline. |
156
+ | "Legal links and a cookie banner will make it feel finished." | Invented compliance UI is worse than omission. Link only destinations the product already has. |
157
+ | "A screenshot of the happy path is enough." | Verify behavior, shared routes, empty/error/focus, and both viewports when layout changed. |
158
+
159
+ ## Red Flags
160
+
161
+ - Diff introduces a second CSS framework or a new icon/font package without a dependency-file check.
162
+ - Palette or typeface that contradicts repository-root `DESIGN.md`.
163
+ - Finding with no `path:line` evidence.
164
+ - Custom scroll hijacking or inertia scroll on a product UI.
165
+ - Claimed "done" with no visual verification evidence (or no statement of what could not be verified).
166
+ - Placeholder copy (`Lorem ipsum`, "John Doe", "Acme Corp") left in the shipped UI.
167
+
168
+ ## Verification
169
+
170
+ After Apply, ensure each box has evidence (command output, screenshot, or `file:line`), not assertion:
171
+
172
+ - [ ] Every **a11y** and **fingerprint** finding is fixed or deferred with a reason.
173
+ - [ ] Token changes cite `DESIGN.md`, the live theme file, or a subject-specific reason (source named).
174
+ - [ ] Existing tests still pass; new imports exist in the dependency manifest.
175
+ - [ ] Shared layouts/components that consume the changed tokens still render consistently — cross-check each route that shares them.
176
+ - [ ] Browser (or closest substitute): golden path + empty/error/focus; desktop and mobile viewports when layout or spacing changed.
177
+ - [ ] `prefers-reduced-motion` still disables added motion.
178
+ - [ ] Document what could not be verified (no browser tools → say so; do not claim visual QA).
179
+
180
+ ## See also
181
+
182
+ - **`sp:source-driven-development`** — verify framework/CSS API facts against the pinned version before editing config.
183
+ - **`sp:code-implementation`** — owns feature implementation; this skill owns the visual upgrade pass.
184
+ - **`sp:code-review`** — review the visual diff for regressions and out-of-scope stack changes.
@@ -0,0 +1,121 @@
1
+ # Audit checklist
2
+
3
+ Lookup for `sp:redesign-web-ui` Diagnose. Every hit becomes a findings-table row with `path:line`
4
+ evidence and an in-stack fix. Severity values (`a11y` / `fingerprint` / `polish`) and when to
5
+ apply each are defined in the skill's Diagnose step.
6
+
7
+ A category with no hits is recorded as `none`. Do not invent findings to fill the table.
8
+
9
+ ---
10
+
11
+ ## Typography
12
+
13
+ | Problem | In-stack fix | Severity |
14
+ |---|---|---|
15
+ | Browser default, Inter, Roboto, or Arial as the only face | Pick a display + body pair for *this* product's subject and cite why. Repeating Inter, or swapping Inter for Geist/Outfit/Satoshi with no subject reason, is still a default. | fingerprint |
16
+ | Headlines lack presence | Increase display size, tighten letter-spacing, reduce line-height so titles feel intentional. | fingerprint |
17
+ | Body line length unconstrained | Cap paragraph measure near 65 characters; raise line-height for reading blocks. | polish |
18
+ | Only 400 and 700 weights | Add 500/600 where hierarchy needs a middle step. | polish |
19
+ | Proportional figures in tables, prices, metrics | Tabular nums (`font-variant-numeric: tabular-nums`) or a monospace face for data. | polish |
20
+ | No tracking on display vs. labels | Negative tracking on large headers; slight positive tracking on small labels/small-caps. | polish |
21
+ | All-caps subheaders as the only accent | Sentence case, small-caps, or italic — one treatment, used sparingly. | fingerprint |
22
+ | Orphaned last words in headings | `text-wrap: balance` (headings) or `text-wrap: pretty` (body). | polish |
23
+
24
+ ## Color and surfaces
25
+
26
+ | Problem | In-stack fix | Severity |
27
+ |---|---|---|
28
+ | Pure `#000` canvas or pure `#fff` only | Off-black / off-white or a tinted dark from the authority palette. | fingerprint |
29
+ | Oversaturated accents | Keep saturation in range with surrounding neutrals; one chromatic accent unless authority specifies more. | fingerprint |
30
+ | Mixing warm and cool gray families | One gray family, tinted with a consistent hue. | fingerprint |
31
+ | Purple/blue "AI gradient" (or cream+serif+terracotta, or acid-green-on-black used as a default) | Neutral bases + the authority accent. Those three looks are legitimate for some briefs; they are fingerprints when chosen without a subject reason. | fingerprint |
32
+ | Generic black `box-shadow` | Tint shadows to the surface hue. | polish |
33
+ | Perfectly even 45° linear fades | Radial, mesh, or a noise overlay — or no gradient. | fingerprint |
34
+ | Conflicting light sources across shadows | One implied light direction. | polish |
35
+ | A single inverted-color band in an otherwise consistent page | Same palette, shifted shade — or a full committed dark/light mode. | fingerprint |
36
+ | Empty flat sections that need presence | Texture, a restrained ambient gradient, or an existing product image. Use the project's image pipeline; do not inject random stock URLs. | polish |
37
+
38
+ ## Layout
39
+
40
+ | Problem | In-stack fix | Severity |
41
+ |---|---|---|
42
+ | Everything centered and symmetrical | Offset, mixed aspect ratios, or left-aligned headers over centered content — when the content supports it. | fingerprint |
43
+ | Three equal card columns as the feature row | Asymmetric grid, 2-column zig-zag, or a single highlighted module. | fingerprint |
44
+ | `height: 100vh` full-screen sections | `min-height: 100dvh` (mobile browser chrome). | a11y |
45
+ | No max-width on reading/marketing content | Container ~1200–1440px with auto margins. Data-dense dashboards may stay full-bleed. | polish |
46
+ | Uniform radius on every element | Tighter radius on inner controls, softer on outer containers — or sharp, if authority is sharp. | polish |
47
+ | Missing whitespace on marketing pages | Increase spacing until groups read as groups. Dense is correct for data tables. | polish |
48
+ | Card CTAs / feature lists at uneven baselines | Align shared elements (title, price, list start, button) across the row. | polish |
49
+ | Optical vs. mathematical centering (icon-in-circle, play button) | 1–2px optical adjustment. | polish |
50
+
51
+ Do **not** treat "dashboard has a left sidebar" as a defect. Changing IA is out of scope.
52
+
53
+ ## Interactivity and states
54
+
55
+ | Problem | In-stack fix | Severity |
56
+ |---|---|---|
57
+ | No hover on pointer-capable buttons/links | Background, border, or 1px translate — 150–250ms. | fingerprint |
58
+ | No active/pressed feedback | `scale(0.98)` or `translateY(1px)`. | polish |
59
+ | Instant transitions (`transition: none` on chrome) | 150–250ms on interactive chrome; leave data-dense tables snappy. | polish |
60
+ | Missing visible focus ring | Visible `:focus-visible` using the authority accent. Keyboard path is required. | a11y |
61
+ | Spinner-only loading | Skeleton that matches the layout shape. | polish |
62
+ | Blank empty states | A composed getting-started / zero-data view with one next action. | polish |
63
+ | Errors via `window.alert()` or no inline message | Inline field/form error in the product voice. | a11y |
64
+ | Buttons that go to `#` | Real href, or a disabled control with a reason. | a11y |
65
+ | No current-page indication in nav | Distinct active style. | a11y |
66
+ | Instant anchor jumps | `scroll-behavior: smooth` on the document, with reduced-motion fallback to instant. | polish |
67
+ | Animating `top` / `left` / `width` / `height` | Animate `transform` and `opacity`. | polish |
68
+
69
+ ## Content
70
+
71
+ | Problem | In-stack fix | Severity |
72
+ |---|---|---|
73
+ | `Lorem ipsum` or `placeholder` copy | Real draft copy for this product. | fingerprint |
74
+ | "John Doe", "Jane Smith", "Acme Corp", "Nexus", "SmartFlow" | Contextual names. | fingerprint |
75
+ | Fake round metrics (`99.99%`, `$100.00`) | Organic figures, or label them as examples. | fingerprint |
76
+ | AI cliches: Elevate, Seamless, Unleash, Next-Gen, Game-changer, Delve, Tapestry, "In the world of…" | Plain, specific language. | fingerprint |
77
+ | "Oops!" / exclamation-mark success toasts | Direct: "Saved." / "Connection failed. Try again." | fingerprint |
78
+ | Title Case On Every Header | Sentence case, unless the brand guide says otherwise. | polish |
79
+ | Identical dates or avatars on every dummy person | Unique assets per distinct person, or drop the avatars. | fingerprint |
80
+
81
+ ## Component patterns
82
+
83
+ | Problem | In-stack fix | Severity |
84
+ |---|---|---|
85
+ | Card = border + shadow + white fill on every block | Cards only when elevation encodes hierarchy; otherwise background or spacing. | fingerprint |
86
+ | Always one filled + one ghost button | Text/tertiary action when the second action is low emphasis. | polish |
87
+ | Pill "New"/"Beta" badges as decoration | Square badge, flag, or plain label — or remove. | polish |
88
+ | Accordion FAQ / 3-card testimonial carousel / 3-tower pricing as empty decoration | A layout that matches the actual content. Keep the pattern when it *is* the product's IA. | fingerprint |
89
+ | Modal for a single-field edit | Inline edit or a slide-over. | polish |
90
+ | Footer link farm (4+ columns of unused links) | Primary paths + real legal destinations the product already has. | polish |
91
+
92
+ ## Iconography and media
93
+
94
+ | Problem | In-stack fix | Severity |
95
+ |---|---|---|
96
+ | Mixed icon sets / mixed stroke widths | Standardize on the set already in the dependency manifest. Do not add Phosphor/Heroicons/Lucide as a second library. | fingerprint |
97
+ | Rocket = Launch, shield = Security, as the only metaphors | Less obvious icons from the *same* set, or text. | polish |
98
+ | Missing favicon | Branded favicon in the project's existing public/asset pipeline. | polish |
99
+ | Random stock "team" photos | Real assets, a consistent illustration style, or no people photos. | fingerprint |
100
+
101
+ ## Code quality (UI)
102
+
103
+ | Problem | In-stack fix | Severity |
104
+ |---|---|---|
105
+ | Non-semantic soup for nav/main/content | `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>` where they match the role. | a11y |
106
+ | Inline styles mixed into a class-based system | Move the declaration into the project's styling system. | polish |
107
+ | Hardcoded px widths on fluid layouts | `%`, `rem`, `em`, `max-width`, or the system's spacing scale. | polish |
108
+ | Meaningful images with empty or `alt="image"` | Describe the image; decorative images get `alt=""` plus `role="presentation"` if needed. | a11y |
109
+ | `z-index: 9999` and friends | A documented z-scale on the theme. | polish |
110
+ | Missing `<title>`, description, or social meta | Fill from the product name and the page's job. | polish |
111
+ | Import not in the dependency manifest | Use an already-installed package, or stop and ask before adding one. | fingerprint |
112
+
113
+ ## Completeness (product UI, not decoration)
114
+
115
+ | Problem | In-stack fix | Severity |
116
+ |---|---|---|
117
+ | No skip-to-content link | Visually hidden skip link targeting `<main>`. | a11y |
118
+ | Dead-end views with no way back | A back/close path that uses the existing router. | a11y |
119
+ | No custom 404 | Branded empty-route view with a path home. | polish |
120
+ | Forms without client-side required/format checks | Validate in the existing form library; keep server-side as source of truth. | a11y |
121
+ | Footer legal links that 404 | Point at real routes, or omit. | polish |
@@ -0,0 +1,66 @@
1
+ # Upgrade techniques
2
+
3
+ Optional moves for `sp:redesign-web-ui` Plan/Apply. Load this file only when a Diagnose finding
4
+ needs a technique from it.
5
+
6
+ Every technique here is **polish**. Accessibility and token authority always win. Honor
7
+ `prefers-reduced-motion: reduce` by disabling or replacing motion with an instant state change.
8
+
9
+ Product/app chrome (dashboards, settings, editors) stays restrained. Marketing/landing pages can
10
+ spend more on one signature moment. Spend boldness in **one** place.
11
+
12
+ ---
13
+
14
+ ## When a technique is in play
15
+
16
+ Use a technique when:
17
+
18
+ - The finding is `polish`, and
19
+ - The page type supports it (landing/marketing, or a single product moment), and
20
+ - The authority layer (`DESIGN.md` / theme) does not forbid it.
21
+
22
+ Skip the technique when:
23
+
24
+ - It requires a new animation library or a CSS-framework migration.
25
+ - It hijacks scroll (inertia/custom scrollbar physics) on a product UI.
26
+ - It would be the second signature moment on the same page.
27
+
28
+ ---
29
+
30
+ ## Typography
31
+
32
+ - **Variable-font weight/width** on hover or a short scroll range — one word or one heading, not every line.
33
+ - **Outlined-to-fill** on a display line that is the page's thesis.
34
+ - **Text as mask** only when a real, owned video/image sits behind it.
35
+
36
+ ## Layout
37
+
38
+ - **Broken grid / overlap** — one element bleeds or overlaps on purpose; the rest stay on the grid.
39
+ - **Whitespace maximization** — one block gets aggressive negative space so it is the only focus.
40
+ - **Sticky stack** — sections pin and stack on scroll on a marketing long-scroll, not inside app chrome.
41
+ - **Split-screen scroll** — two panes moving in opposition; marketing only, and never the only way to reach content.
42
+
43
+ ## Motion
44
+
45
+ - **Staggered entry** — small Y + opacity cascade on first paint of a group (40–80ms steps).
46
+ - **Spring on press** — interactive controls, not page load.
47
+ - **Scroll-driven reveal** — mask, wipe, or SVG draw tied to scroll *progress*, with a reduced-motion static end-state.
48
+
49
+ Do not add smooth-scroll inertia, scrolljacking, or a custom scrollbar on product UI. Native
50
+ `scroll-behavior: smooth` plus a reduced-motion instant fallback is the ceiling unless the operator
51
+ asks for more.
52
+
53
+ ## Surfaces
54
+
55
+ - **Glass** — `backdrop-filter` plus a 1px inner border and a faint inner shadow; only over content
56
+ that remains readable.
57
+ - **Spotlight border** — cursor-tracking edge light on one featured card.
58
+ - **Grain overlay** — `pointer-events: none`, fixed, very low contrast; skip on dense data tables.
59
+ - **Tinted shadows** — shadow hue matches the surface, not generic black.
60
+
61
+ ---
62
+
63
+ ## Signature test
64
+
65
+ After picking techniques, keep one memorable moment. If two techniques compete, drop the weaker
66
+ one. The surrounding UI stays quiet so the signature can read.
@@ -48,7 +48,7 @@ through a coding agent as an external process, producing a persisted run record
48
48
 
49
49
  | Flag | Purpose |
50
50
  | ------ | --------- |
51
- | `--agent <name>` | Role, executor, agent binary, `auto`, or `inline`. A **role** (`scribe`/`coder`/`reviewer`/`planner`, from `plugins/sp/references/roles.md`) selects the starting tier; an **executor** (an `agent.executors` entry) is a permanent pin; a **bare binary name** works with a one-time warning (transition shim); `auto` uses the declared/default role. **`inline` is host-session-only** (G5 / ADR-047 amendment): `agent run` is a headless subprocess surface, so explicit `inline` is rejected with exit 2 and a stable error messageit never normalizes to `agent.default`. |
51
+ | `--agent <name>` | Role, executor, agent binary, `auto`, or `inline`. A **role** (`scribe`/`coder`/`reviewer`/`planner`, from `plugins/sp/references/roles.md`) selects the starting tier; an **executor** (an `agent.executors` entry) is a permanent pin; a **bare binary name** works with a one-time warning (transition shim); `auto` uses the declared/default role. `inline` is the default selector (0687 / ADR-087): on a host session the work runs in-session; on a headless subprocess surface like `agent run` it substitutes tier resolution and warns once naming the resolved executor no rejection, no `agent.default` normalization. |
52
52
  | `--model <name>` | Agent model argument (e.g. `o3`, `sonnet`). Passed through to the agent's model flag. |
53
53
  | `--mode <mode>` | Agent output mode: `text` or `json`. |
54
54
  | `--continue` | Resume the previous agent session instead of starting fresh. |
@@ -218,9 +218,14 @@ verifying shape, or stand in a `note` action until the path is proven, then swap
218
218
 
219
219
  ## Authoring checklist
220
220
 
221
+ - [ ] Fit gate cleared before the mode gate — replay + machine-checkable branch + durable record
222
+ ([workflow-fit-and-tuning.md](workflow-fit-and-tuning.md#1-fit-gate--workflow-or-prose)).
221
223
  - [ ] Mode chosen deliberately (loop → state-machine; pipeline → transition-flow); recorded the reason.
222
224
  - [ ] `kind: transition-flow` set for flows; `$schema` quoted.
223
225
  - [ ] Initial + terminal states/nodes declared; every transition/edge target exists.
224
226
  - [ ] Guards/conditions ordered so the specific case precedes the fallback.
225
227
  - [ ] `iterationBound` set for any loop; `env.allow` lists every `${env.X}` used.
228
+ - [ ] Every node inside the simplicity budget — `shell` at or under 5 non-comment units,
229
+ `agent.run` input referencing a command rather than a raw prompt, guards a single predicate
230
+ ([workflow-fit-and-tuning.md](workflow-fit-and-tuning.md#3-node-simplicity-budget)).
226
231
  - [ ] Validates clean AND dry-run reaches the expected terminal state.
@@ -161,22 +161,31 @@ Turn a described process into a validated, dry-run-verified workflow in the righ
161
161
  1. **Clarify intent** — restate the process as one or two sentences: the steps, the success terminal,
162
162
  the loop/branch points. If ambiguous (which step retries? what ends it?), state the interpretation
163
163
  taken.
164
- 2. **Mode-selection gate** — run [mode-selection gate](#sub-procedure-mode-selection-gate). This is
164
+ 2. **Fit gate** — run the three-part test in
165
+ [workflow-fit-and-tuning.md](workflow-fit-and-tuning.md#the-three-part-test) *before* the mode
166
+ gate: the process earns a workflow only if it replays, branches on a machine-checkable predicate,
167
+ and needs a durable per-run record. Fewer than three → recommend a descriptive procedure /
168
+ checklist instead and stop; do not author YAML the process will not use.
169
+ 3. **Mode-selection gate** — run [mode-selection gate](#sub-procedure-mode-selection-gate). This is
165
170
  mandatory and gating: surface the recommended mode with its reason and the rejected alternative,
166
171
  and **confirm before authoring**. Honor an explicit `--kind`.
167
- 3. **Reconcile against existing workflows** — run [find-existing-workflow](#sub-procedure-find-existing-workflow).
172
+ 4. **Reconcile against existing workflows** — run [find-existing-workflow](#sub-procedure-find-existing-workflow).
168
173
  If the process is already covered, **stop and hand to refine (or extend the existing flow) on
169
174
  confirmation** — do not author a redundant workflow. Only the "no real match" / "add-new" branch
170
175
  proceeds to author below.
171
- 4. **Author the YAML** — use the **real schema shape** for the chosen mode
176
+ 5. **Author the YAML** — use the **real schema shape** for the chosen mode
172
177
  ([authoring-workflows.md → Per-mode shapes](authoring-workflows.md#per-mode-shapes)). Set `name`,
173
178
  `description` (the WHY), the initial + terminal states/nodes, the steps with their actions, the
174
179
  transitions/edges with guards/conditions in the right declaration order, `iterationBound` for any
175
180
  loop, `env.allow` for any `${env.X}`, and a quoted `$schema`. For transition-flow, set
176
181
  `kind: transition-flow`.
177
- 5. **Place the file** default `.spur/workflows/<name>.yaml` (a `--file` arg overrides), named for
182
+ Keep each node inside the simplicity budget
183
+ ([workflow-fit-and-tuning.md](workflow-fit-and-tuning.md#3-node-simplicity-budget)): `shell`
184
+ commands at or under 5 non-comment units, `agent.run` inputs referencing a slash command rather
185
+ than carrying a raw prompt, guards a single predicate.
186
+ 6. **Place the file** — default `.spur/workflows/<name>.yaml` (a `--file` arg overrides), named for
178
187
  what the workflow does.
179
- 6. **Verify** — run the [validate-and-dry-run core](#sub-procedure-validate-and-dry-run) with the
188
+ 7. **Verify** — run the [validate-and-dry-run core](#sub-procedure-validate-and-dry-run) with the
180
189
  expected terminal state. Not done until the definition validates AND the dry-run reaches it.
181
190
 
182
191
  Output contract: YAML workflow content + chosen mode + reason + destination path + validate result +
@@ -197,6 +206,12 @@ Adjust an existing workflow with the smallest change that meets the intent. Proc
197
206
  - missing step → add a state/node + its transition/edge in the correct declaration order
198
207
  - runaway loop → set or raise `iterationBound`
199
208
  - missing variable/env → add to `vars` or `env.allow`
209
+ - too slow / unreadable trace (not a correctness bug) → the
210
+ [optimize procedure](workflow-fit-and-tuning.md#optimize--refine-an-accepted-workflow-in-place),
211
+ backed by a before/after `spur workflow trace <run-id> --json` pair
212
+ - the whole file is the wrong surface (all nodes raw `agent.run`, no branching, edited more than
213
+ run) → not a refine: the
214
+ [demote procedure](workflow-fit-and-tuning.md#demote--workflow--descriptive-procedure)
200
215
  See [authoring-workflows.md](authoring-workflows.md) for each mechanism's real shape. **Do not
201
216
  switch mode** in a refine — a mode change is a rewrite; hand it back to `add`.
202
217
  3. **Apply the smallest change.** Preserve declaration order semantics (the first passing