@delegance/claude-autopilot 5.2.2 → 6.2.2

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 (130) hide show
  1. package/CHANGELOG.md +1027 -1
  2. package/README.md +104 -17
  3. package/dist/src/adapters/council/claude.js +2 -1
  4. package/dist/src/adapters/council/openai.js +14 -7
  5. package/dist/src/adapters/deploy/_http.d.ts +43 -0
  6. package/dist/src/adapters/deploy/_http.js +99 -0
  7. package/dist/src/adapters/deploy/fly.d.ts +206 -0
  8. package/dist/src/adapters/deploy/fly.js +696 -0
  9. package/dist/src/adapters/deploy/generic.d.ts +39 -0
  10. package/dist/src/adapters/deploy/generic.js +98 -0
  11. package/dist/src/adapters/deploy/index.d.ts +15 -0
  12. package/dist/src/adapters/deploy/index.js +78 -0
  13. package/dist/src/adapters/deploy/render.d.ts +181 -0
  14. package/dist/src/adapters/deploy/render.js +550 -0
  15. package/dist/src/adapters/deploy/types.d.ts +221 -0
  16. package/dist/src/adapters/deploy/types.js +15 -0
  17. package/dist/src/adapters/deploy/vercel.d.ts +143 -0
  18. package/dist/src/adapters/deploy/vercel.js +426 -0
  19. package/dist/src/adapters/pricing.d.ts +36 -0
  20. package/dist/src/adapters/pricing.js +40 -0
  21. package/dist/src/adapters/review-engine/claude.js +2 -1
  22. package/dist/src/adapters/review-engine/codex.js +12 -8
  23. package/dist/src/adapters/review-engine/gemini.js +2 -1
  24. package/dist/src/adapters/review-engine/openai-compatible.js +2 -1
  25. package/dist/src/adapters/sdk-loader.d.ts +15 -0
  26. package/dist/src/adapters/sdk-loader.js +77 -0
  27. package/dist/src/cli/autopilot.d.ts +71 -0
  28. package/dist/src/cli/autopilot.js +735 -0
  29. package/dist/src/cli/brainstorm.d.ts +23 -0
  30. package/dist/src/cli/brainstorm.js +131 -0
  31. package/dist/src/cli/costs.d.ts +15 -1
  32. package/dist/src/cli/costs.js +99 -10
  33. package/dist/src/cli/deploy.d.ts +71 -0
  34. package/dist/src/cli/deploy.js +539 -0
  35. package/dist/src/cli/fix.d.ts +18 -0
  36. package/dist/src/cli/fix.js +105 -11
  37. package/dist/src/cli/help-text.d.ts +52 -0
  38. package/dist/src/cli/help-text.js +400 -0
  39. package/dist/src/cli/implement.d.ts +91 -0
  40. package/dist/src/cli/implement.js +196 -0
  41. package/dist/src/cli/index.js +784 -222
  42. package/dist/src/cli/json-envelope.d.ts +187 -0
  43. package/dist/src/cli/json-envelope.js +270 -0
  44. package/dist/src/cli/json-mode.d.ts +33 -0
  45. package/dist/src/cli/json-mode.js +201 -0
  46. package/dist/src/cli/migrate.d.ts +111 -0
  47. package/dist/src/cli/migrate.js +305 -0
  48. package/dist/src/cli/plan.d.ts +81 -0
  49. package/dist/src/cli/plan.js +149 -0
  50. package/dist/src/cli/pr.d.ts +106 -0
  51. package/dist/src/cli/pr.js +191 -19
  52. package/dist/src/cli/preflight.js +102 -1
  53. package/dist/src/cli/review.d.ts +27 -0
  54. package/dist/src/cli/review.js +126 -0
  55. package/dist/src/cli/runs-watch-renderer.d.ts +45 -0
  56. package/dist/src/cli/runs-watch-renderer.js +275 -0
  57. package/dist/src/cli/runs-watch.d.ts +41 -0
  58. package/dist/src/cli/runs-watch.js +395 -0
  59. package/dist/src/cli/runs.d.ts +122 -0
  60. package/dist/src/cli/runs.js +902 -0
  61. package/dist/src/cli/scan.d.ts +93 -0
  62. package/dist/src/cli/scan.js +166 -40
  63. package/dist/src/cli/spec.d.ts +66 -0
  64. package/dist/src/cli/spec.js +132 -0
  65. package/dist/src/cli/validate.d.ts +29 -0
  66. package/dist/src/cli/validate.js +131 -0
  67. package/dist/src/core/config/schema.d.ts +43 -0
  68. package/dist/src/core/config/schema.js +25 -0
  69. package/dist/src/core/config/types.d.ts +17 -0
  70. package/dist/src/core/council/runner.d.ts +10 -1
  71. package/dist/src/core/council/runner.js +25 -3
  72. package/dist/src/core/council/types.d.ts +7 -0
  73. package/dist/src/core/errors.d.ts +1 -1
  74. package/dist/src/core/errors.js +12 -0
  75. package/dist/src/core/logging/redaction.d.ts +13 -0
  76. package/dist/src/core/logging/redaction.js +20 -0
  77. package/dist/src/core/migrate/detector-rules.js +6 -0
  78. package/dist/src/core/migrate/schema-validator.js +22 -1
  79. package/dist/src/core/phases/static-rules.d.ts +5 -1
  80. package/dist/src/core/phases/static-rules.js +2 -5
  81. package/dist/src/core/run-state/budget.d.ts +88 -0
  82. package/dist/src/core/run-state/budget.js +141 -0
  83. package/dist/src/core/run-state/cli-internal.d.ts +21 -0
  84. package/dist/src/core/run-state/cli-internal.js +174 -0
  85. package/dist/src/core/run-state/events.d.ts +59 -0
  86. package/dist/src/core/run-state/events.js +504 -0
  87. package/dist/src/core/run-state/lock.d.ts +61 -0
  88. package/dist/src/core/run-state/lock.js +206 -0
  89. package/dist/src/core/run-state/phase-context.d.ts +60 -0
  90. package/dist/src/core/run-state/phase-context.js +108 -0
  91. package/dist/src/core/run-state/phase-registry.d.ts +137 -0
  92. package/dist/src/core/run-state/phase-registry.js +162 -0
  93. package/dist/src/core/run-state/phase-runner.d.ts +80 -0
  94. package/dist/src/core/run-state/phase-runner.js +447 -0
  95. package/dist/src/core/run-state/provider-readback.d.ts +130 -0
  96. package/dist/src/core/run-state/provider-readback.js +426 -0
  97. package/dist/src/core/run-state/replay-decision.d.ts +69 -0
  98. package/dist/src/core/run-state/replay-decision.js +144 -0
  99. package/dist/src/core/run-state/resolve-engine.d.ts +100 -0
  100. package/dist/src/core/run-state/resolve-engine.js +190 -0
  101. package/dist/src/core/run-state/resume-preflight.d.ts +66 -0
  102. package/dist/src/core/run-state/resume-preflight.js +116 -0
  103. package/dist/src/core/run-state/run-phase-with-lifecycle.d.ts +73 -0
  104. package/dist/src/core/run-state/run-phase-with-lifecycle.js +186 -0
  105. package/dist/src/core/run-state/runs.d.ts +57 -0
  106. package/dist/src/core/run-state/runs.js +288 -0
  107. package/dist/src/core/run-state/snapshot.d.ts +14 -0
  108. package/dist/src/core/run-state/snapshot.js +114 -0
  109. package/dist/src/core/run-state/state.d.ts +40 -0
  110. package/dist/src/core/run-state/state.js +164 -0
  111. package/dist/src/core/run-state/types.d.ts +278 -0
  112. package/dist/src/core/run-state/types.js +13 -0
  113. package/dist/src/core/run-state/ulid.d.ts +11 -0
  114. package/dist/src/core/run-state/ulid.js +95 -0
  115. package/dist/src/core/schema-alignment/extractor/index.d.ts +1 -1
  116. package/dist/src/core/schema-alignment/extractor/index.js +2 -2
  117. package/dist/src/core/schema-alignment/extractor/prisma.d.ts +13 -1
  118. package/dist/src/core/schema-alignment/extractor/prisma.js +65 -10
  119. package/dist/src/core/schema-alignment/git-history.d.ts +19 -0
  120. package/dist/src/core/schema-alignment/git-history.js +53 -0
  121. package/dist/src/core/static-rules/rules/brand-tokens.js +2 -2
  122. package/dist/src/core/static-rules/rules/schema-alignment.js +14 -4
  123. package/package.json +9 -5
  124. package/scripts/autoregress.ts +3 -2
  125. package/skills/claude-autopilot.md +1 -1
  126. package/skills/make-interfaces-feel-better/SKILL.md +104 -0
  127. package/skills/migrate/SKILL.md +193 -47
  128. package/skills/simplify-ui/SKILL.md +103 -0
  129. package/skills/ui/SKILL.md +117 -0
  130. package/skills/ui-ux-pro-max/SKILL.md +90 -0
@@ -1,83 +1,229 @@
1
1
  ---
2
2
  name: migrate
3
- description: Run database migrations against Supabase environments (dev QA prod). Validates SQL, executes with ledger tracking, and auto-generates types/supabase.ts.
3
+ description: Framework-agnostic database migration orchestrator. Reads .autopilot/stack.md, runs the configured per-env command (Rails, Alembic, Prisma, Drizzle, golang-migrate, dbmate, flyway, supabase-cli, custom), enforces policy gates, and emits a structured result artifact. For Supabase-specific repos with data/deltas/* layout use `migrate-supabase` instead.
4
4
  ---
5
5
 
6
- # Database Migration
6
+ # /migrate — Generic database migration orchestrator
7
7
 
8
- Run a migration through the dev QA prod pipeline with validation at each step.
8
+ The thin, framework-agnostic migrate skill. Wraps any migration tool in a uniform contract:
9
9
 
10
- ## Usage
10
+ 1. Validate `.autopilot/stack.md` against the JSON schema
11
+ 2. Resolve the configured skill + apply policy (clean git, manual approval, prod-in-CI gate)
12
+ 3. Run `migrate.envs.<env>.command` via `spawn(shell: false)` — no shell injection surface
13
+ 4. Capture stdout/stderr, parse the result artifact, append an audit-log entry
14
+ 5. Return a `ResultArtifact` to the caller (autopilot pipeline or CLI)
11
15
 
12
- ### 1. Identify the migration file
16
+ This skill **does not know what your migration tool is**. It just executes the command you point it at and reports the outcome. Tool-specific behavior (e.g., Supabase's `data/deltas/*.sql` ledger or auto-regenerating `types/supabase.ts`) lives in `migrate-supabase`. Everything else uses this one.
13
17
 
14
- If given as argument, use that. Otherwise find the most recently modified `.sql` file in `data/deltas/`.
18
+ ## Usage
15
19
 
16
- ### 2. Validate (dry run on dev)
20
+ ### CLI
17
21
 
18
22
  ```bash
19
- npx tsx scripts/supabase/migrate.ts <file> --env dev --dry-run
23
+ claude-autopilot migrate # default env: dev
24
+ claude-autopilot migrate --env qa
25
+ claude-autopilot migrate --env prod --yes # required for prod (manual approval)
26
+ claude-autopilot migrate doctor # validate stack.md without running
20
27
  ```
21
28
 
22
- Present validation results. If errors, help the user fix them before proceeding.
29
+ ### Autopilot pipeline
30
+
31
+ The dispatcher invokes the skill automatically when `migrate` is in the pipeline plan. The skill receives the invocation envelope via `AUTOPILOT_ENVELOPE` and writes its result to `AUTOPILOT_RESULT_PATH`.
32
+
33
+ ## Configuration
34
+
35
+ Add a `migrate` block to `.autopilot/stack.md`:
36
+
37
+ ```yaml
38
+ schema_version: 1
39
+ migrate:
40
+ skill: "migrate@1"
41
+ envs:
42
+ dev:
43
+ command: { exec: "<tool>", args: ["<args>"] }
44
+ env_file: ".env.dev"
45
+ qa:
46
+ command: { exec: "<tool>", args: ["<args>"] }
47
+ prod:
48
+ command: { exec: "<tool>", args: ["<args>"] }
49
+ policy:
50
+ allow_prod_in_ci: false
51
+ require_clean_git: true
52
+ require_manual_approval: true
53
+ require_dry_run_first: false
54
+ ```
23
55
 
24
- ### 3. Run on dev
56
+ The `init` flow auto-detects most common toolchains and pre-fills sensible commands. Run `claude-autopilot init` once to bootstrap.
25
57
 
26
- ```bash
27
- npx tsx scripts/supabase/migrate.ts <file> --env dev
58
+ ## Examples by toolchain
59
+
60
+ ### Rails (Active Record)
61
+
62
+ ```yaml
63
+ migrate:
64
+ skill: "migrate@1"
65
+ envs:
66
+ dev:
67
+ command: { exec: "rails", args: ["db:migrate"] }
68
+ env_file: ".env.development"
69
+ prod:
70
+ command: { exec: "rails", args: ["db:migrate", "RAILS_ENV=production"] }
28
71
  ```
29
72
 
30
- ### 4. Ask the user
73
+ ### Alembic (Python)
74
+
75
+ ```yaml
76
+ migrate:
77
+ skill: "migrate@1"
78
+ envs:
79
+ dev:
80
+ command: { exec: "alembic", args: ["upgrade", "head"] }
81
+ env_file: ".env.dev"
82
+ prod:
83
+ command: { exec: "alembic", args: ["-x", "env=prod", "upgrade", "head"] }
84
+ ```
31
85
 
32
- > "Migration succeeded on dev. `types/supabase.ts` updated. Promote to QA?"
86
+ ### Django
33
87
 
34
- ### 5. Run on QA
88
+ ```yaml
89
+ migrate:
90
+ skill: "migrate@1"
91
+ envs:
92
+ dev:
93
+ command: { exec: "python", args: ["manage.py", "migrate"] }
94
+ env_file: ".env.dev"
95
+ ```
35
96
 
36
- ```bash
37
- npx tsx scripts/supabase/migrate.ts --promote qa
97
+ ### golang-migrate
98
+
99
+ ```yaml
100
+ migrate:
101
+ skill: "migrate@1"
102
+ envs:
103
+ dev:
104
+ command: { exec: "migrate", args: ["-database", "$DATABASE_URL", "-path", "migrations", "up"] }
105
+ env_file: ".env.dev"
38
106
  ```
39
107
 
40
- ### 6. Ask the user
108
+ ### Prisma
41
109
 
42
- > "Migration succeeded on QA. Promote to prod?"
110
+ ```yaml
111
+ migrate:
112
+ skill: "migrate@1"
113
+ envs:
114
+ dev:
115
+ command: { exec: "prisma", args: ["migrate", "dev"] }
116
+ prod:
117
+ command: { exec: "prisma", args: ["migrate", "deploy"] }
118
+ ```
43
119
 
44
- ### 7. Run on prod
120
+ ### Drizzle
45
121
 
46
- ```bash
47
- npx tsx scripts/supabase/migrate.ts --promote prod --confirm-prod
122
+ ```yaml
123
+ migrate:
124
+ skill: "migrate@1"
125
+ envs:
126
+ dev:
127
+ command: { exec: "drizzle-kit", args: ["migrate"] }
128
+ env_file: ".env.dev"
48
129
  ```
49
130
 
50
- ### 8. Commit
131
+ ### dbmate
51
132
 
52
- After all environments are done, commit the updated `types/supabase.ts` and the migration file:
133
+ ```yaml
134
+ migrate:
135
+ skill: "migrate@1"
136
+ envs:
137
+ dev:
138
+ command: { exec: "dbmate", args: ["up"] }
139
+ env_file: ".env.dev"
140
+ ```
53
141
 
54
- ```bash
55
- git add types/supabase.ts data/deltas/<migration-file>
56
- git commit -m "feat: <description of schema change>"
142
+ ### Flyway
143
+
144
+ ```yaml
145
+ migrate:
146
+ skill: "migrate@1"
147
+ envs:
148
+ dev:
149
+ command: { exec: "flyway", args: ["migrate"] }
57
150
  ```
58
151
 
59
- ## Flags
152
+ ### Supabase CLI
153
+
154
+ ```yaml
155
+ migrate:
156
+ skill: "migrate@1"
157
+ envs:
158
+ dev:
159
+ command: { exec: "supabase", args: ["migration", "up"] }
160
+ ```
60
161
 
61
- | Flag | Purpose |
62
- |------|---------|
63
- | `--env dev\|qa\|prod` | Target environment |
64
- | `--dry-run` | Validate only, don't execute |
65
- | `--force` | Allow destructive operations (DROP, TRUNCATE) |
66
- | `--confirm-prod` | Required for prod execution |
67
- | `--promote qa\|prod` | Run missing migrations from source env |
162
+ ### Custom script
68
163
 
69
- ## Validation Checks
164
+ Anything goes — the dispatcher just runs `exec` with `args`:
70
165
 
71
- The system validates before every execution:
72
- - Duplicate table/column detection
73
- - snake_case naming enforcement
74
- - RLS + policy required for every new table
75
- - Destructive operation blocking (unless --force)
76
- - Cross-env prerequisite verification
77
- - Checksum integrity (modified files are rejected)
78
- - Promotion chain enforcement (prod requires QA first)
166
+ ```yaml
167
+ migrate:
168
+ skill: "migrate@1"
169
+ envs:
170
+ dev:
171
+ command: { exec: "./scripts/db/migrate.sh", args: ["--env", "dev"] }
172
+ env_file: ".env.dev"
173
+ ```
174
+
175
+ ## When to use `migrate-supabase` instead
176
+
177
+ Use `migrate.supabase@1` if your repo has the canonical Delegance/Supabase layout:
178
+ - `data/deltas/<timestamp>_<name>.sql` files as the source of truth
179
+ - `.claude/supabase-envs.json` with per-env `dbUrl`
180
+ - Auto-regeneration of `types/supabase.ts` after each apply
181
+ - Built-in promotion chain (dev → qa → prod with checksum verification)
182
+
183
+ Otherwise, use `migrate@1` with the appropriate command above.
184
+
185
+ ## Policy enforcement
186
+
187
+ Every run goes through `policy-enforcer.ts` before the command executes. The default policy:
188
+
189
+ | Setting | Default | Effect |
190
+ |---------|---------|--------|
191
+ | `allow_prod_in_ci` | `false` | Fail if `--env prod` runs in CI without explicit override |
192
+ | `require_clean_git` | `true` | Fail if working tree has uncommitted changes |
193
+ | `require_manual_approval` | `true` | Fail prod runs without `--yes` flag |
194
+ | `require_dry_run_first` | `false` | Force a dry-run before apply (opt-in) |
195
+
196
+ Override per-environment if your workflow needs it. Tighter is better — these defaults catch real foot-guns.
197
+
198
+ ## Result artifact
199
+
200
+ When invoked under the autopilot pipeline (`AUTOPILOT_ENVELOPE` set), the skill writes:
201
+
202
+ ```json
203
+ {
204
+ "contractVersion": "1.0",
205
+ "skillId": "migrate@1",
206
+ "invocationId": "<uuid>",
207
+ "nonce": "<from envelope>",
208
+ "status": "applied" | "skipped" | "validation-failed" | "needs-human" | "error",
209
+ "reasonCode": "<short string>",
210
+ "appliedMigrations": [],
211
+ "destructiveDetected": false,
212
+ "sideEffectsPerformed": ["no-side-effects"],
213
+ "nextActions": []
214
+ }
215
+ ```
216
+
217
+ The generic skill cannot enumerate `appliedMigrations` (that's tool-specific) — it leaves the array empty and reports `status: "applied"` if the command exited 0. Tool-specific result enrichment is the job of skills like `migrate-supabase` that understand the migration ledger format.
218
+
219
+ ## Auditing
220
+
221
+ Every dispatch — success, failure, dry-run — writes one entry to `.autopilot/audit.log` (chained via `seq` + `prev_hash`). Inspect with:
222
+
223
+ ```bash
224
+ claude-autopilot migrate doctor --audit-tail 10
225
+ ```
79
226
 
80
- ## Requirements
227
+ ## Stack.md schema
81
228
 
82
- - `.claude/supabase-envs.json` with `dbUrl` for each env (gitignored)
83
- - `postgres` npm package installed
229
+ See `presets/schemas/migrate.schema.json` for the full JSON schema. Validation happens automatically on every dispatch — invalid `.autopilot/stack.md` fails closed before any command runs.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: simplify-ui
3
+ description: Ruthless subtraction pass on an existing UI — visual/UX reduction only. Use when the user says "cut it down", "too much going on", "too cluttered", "remove noise", "pare down", "less is more", "it's too busy", or wants the page trimmed without rebuilding it. This is the "remove before adding" lens — complementary to /ui (full polish pass), /ui-ux-pro-max (correctness audit), and /make-interfaces-feel-better (craft layer). For code-level deduplication, use the plugin /simplify instead.
4
+ ---
5
+
6
+ # Simplify — remove before you add
7
+
8
+ You are looking at a UI and cutting what doesn't earn its place. The default answer is **delete**. Every element has to justify why it survives. If you can't state its purpose in a short sentence, it goes.
9
+
10
+ ## The guiding question
11
+
12
+ For every visible element on the screen, answer:
13
+
14
+ > "What would break for the user if this weren't here?"
15
+
16
+ If the answer is "nothing" or "aesthetics", delete it. If the answer names a concrete user failure, keep it — and then see if it can be smaller.
17
+
18
+ ## What to cut, in priority order
19
+
20
+ ### Tier 1 — cut without thinking
21
+
22
+ 1. **Section headers above single-item sections.** "LIABILITY COVERAGE" over a single field is structural vanity.
23
+ 2. **Helper text that restates the label.** "Enter your email address" under an "Email" field. Pick one.
24
+ 3. **Placeholders that duplicate labels.** Ditto.
25
+ 4. **Status pills identical to adjacent counts.** "5/5" badge next to a "5 of 5 complete" progress bar.
26
+ 5. **Default-zero values displayed as content.** `$0`, `0%`, `null` — render as empty.
27
+ 6. **Decorative icons** that don't carry meaning or affordance. Briefcase next to "Company" is ornament.
28
+ 7. **Explanatory captions** for patterns the user already knows ("Click Submit to submit").
29
+ 8. **"Powered by…" footers on internal tools.**
30
+ 9. **Animated spinners on < 200ms operations.** They flash and look broken.
31
+
32
+ ### Tier 2 — cut after a second look
33
+
34
+ 1. **Duplicate buttons.** "Save" at top and bottom of a form — keep one, usually the bottom if the form is long.
35
+ 2. **Multiple paths to the same action.** A "Create quote" primary button + a "+" FAB + a "New quote" menu item.
36
+ 3. **Breadcrumbs on 2-level-deep pages.** Overkill; use a back button.
37
+ 4. **Card shadows stacked on card borders.** Pick one.
38
+ 5. **Grid lines *and* alternating row backgrounds.** Pick one.
39
+ 6. **Count/progress indicators that update instantly.** If the user answered the field, they know.
40
+ 7. **Summary sentences above tables** that restate what the table shows. ("This table shows quotes. There are 3 quotes.")
41
+ 8. **Emoji or flag icons** next to text that already says the same thing.
42
+ 9. **Confirmation dialogs for non-destructive actions.** "Save draft?" — just save.
43
+
44
+ ### Tier 3 — cut with caution (verify with the user)
45
+
46
+ 1. **Tooltips on self-explanatory controls.** If the icon is standard (× for close), no tooltip needed — unless a11y is the reason.
47
+ 2. **Onboarding hints that persist after first use.**
48
+ 3. **Tutorial steps that could be inferred from labels.**
49
+ 4. **Analytics-only elements** that don't serve the user (tracking pixels belong in code, not chrome).
50
+
51
+ ## What not to cut (hold the line)
52
+
53
+ - Labels, even when obvious — they are your a11y surface.
54
+ - Error messages — always keep; tune the copy under `/make-interfaces-feel-better`.
55
+ - Validation — never cut; maybe defer to blur instead of on-change.
56
+ - Skip links and screen-reader-only text.
57
+ - The single "Undo" or "Back" that lets users recover.
58
+
59
+ ## Density rules after simplification
60
+
61
+ Once you've cut:
62
+ - **3–6 fields per card.** Fewer = sleepy; more = oppressive.
63
+ - **One accent color dominant per card.** Not one per chip.
64
+ - **At most 2 type sizes per card** (label + input/value). Title of the card is the third.
65
+ - **One CTA per screen region.** Multiple = the user has to choose, and they'd rather not.
66
+ - **Zero horizontal scroll.** If the layout forces it on common widths, the layout is wrong.
67
+
68
+ ## Workflow
69
+
70
+ 1. **Screenshot or open the screen.** Read every visible string. Don't cut blind.
71
+ 2. **List every distinct element.** Cards, headers, chips, buttons, helper text, icons, images.
72
+ 3. **Mark each: keep / cut / reduce.** "Reduce" means the element stays but smaller/shorter/less prominent.
73
+ 4. **Cut Tier 1 items immediately.** No discussion.
74
+ 5. **Surface Tier 2/3 cuts as proposals** to the user before applying.
75
+ 6. **After the cut, measure.** Did vertical density improve? Did the primary action get more visible? If neither, you cut the wrong things.
76
+
77
+ ## Micro-patterns
78
+
79
+ - **Collapse single-field sections into the parent card.** Don't delete the field, delete the section wrapper.
80
+ - **Merge two adjacent chips with the same color into one.** "Required + Auto-filled" → "Auto-filled (required)".
81
+ - **Replace "X of Y" with "Y - X remaining"** when remaining is what the user cares about.
82
+ - **Fold secondary actions into an overflow menu (⋯).** Don't show 5 buttons when 1 primary + ⋯ works.
83
+ - **Use whitespace as a divider** before reaching for a `<hr>` or border.
84
+
85
+ ## Red flags that you're over-cutting
86
+
87
+ - Users can't tell which field is required.
88
+ - A keyboard-only user can't move through the form.
89
+ - A screen-reader user can't distinguish regions.
90
+ - The page looks like a wireframe, not a product.
91
+ - You removed something and then had to re-add it in the next session.
92
+
93
+ ## Interactions
94
+
95
+ - Runs best after `/ui-ux-pro-max` (knows what's broken) and before `/make-interfaces-feel-better` (which adds back *quality*, not noise).
96
+ - Combine with `/ui` for a full pass in one shot.
97
+ - Do not run on a screen that's already minimalist — you'll cut into muscle.
98
+
99
+ ## One rule above all
100
+
101
+ > Every element survives by earning its pixel count.
102
+
103
+ If you wouldn't fight to keep it at the next design review, delete it now.
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: ui
3
+ description: Opinionated full-pass UI polish on an existing screen — audit, simplify, align, polish in one shot. Use when the user wants to condense, level, align, clean up, tighten, or "make it feel better." Trigger phrases include "condense the UI", "level these out", "clean up and condense", "waste of space", "align better", "feels cluttered", "tighten this up", "polish", "not a great use of space", "make it look right", "fix the alignment". Self-contained — runs all four lenses internally. For subtraction-only, use /simplify-ui. For correctness-only audit, use /ui-ux-pro-max. For craft/feel-only, use /make-interfaces-feel-better. For greenfield design, escalate to frontend-design:frontend-design.
4
+ ---
5
+
6
+ # UI polish pass
7
+
8
+ You are doing a targeted polish of an **existing** UI, not a greenfield design. The user already has something on screen and wants it to feel better. Match their energy — if they send a screenshot with one complaint, fix that complaint first; don't redesign the whole thing.
9
+
10
+ Run the four steps below **in order**. Skip steps that don't apply — but never skip step 1 (audit).
11
+
12
+ ## Scope contract — what this skill will and won't do
13
+
14
+ **Will:** improve hierarchy, spacing, alignment, copy density, interaction states, typographic balance, and visual finish on the existing screen. Touch the components that produce what's on screen and the styles they inherit.
15
+
16
+ **Won't:** redesign the entire flow, change the data model, restructure information architecture beyond the current screen, introduce a new visual identity, or add net-new features. Preserve the product's existing intent.
17
+
18
+ If the request needs any of the "won't" items, stop and route:
19
+ - New screen / no concept yet → `frontend-design:frontend-design`
20
+ - Subtraction-only ("just cut, don't polish") → `/simplify-ui`
21
+ - Correctness audit only ("what would a senior designer catch?") → `/ui-ux-pro-max`
22
+ - Craft/feel only ("feels off, lacks soul") → `/make-interfaces-feel-better`
23
+
24
+ ## 1. Audit — look at it, don't guess
25
+
26
+ Before touching code:
27
+ - **Look at the actual screen.** If the user sent a screenshot, use Read on it. Don't edit blind.
28
+ - **Measure the complaint.** Read the user's words precisely. "Condense" ≠ "redesign." "Level these out" = fix baseline alignment of specific fields, not every field on the page.
29
+ - **Trace the render path.** Find the component(s) that produced what's on screen. Don't assume — grep for the visible strings (section titles, labels, button text) to locate the exact file/line.
30
+ - **Capture the surrounding system.** Note what styles the component inherits: global input classes, grid wrappers, parent padding, font families. The bug is usually upstream of the visible element.
31
+
32
+ Common blind spots to probe:
33
+ - A "grid alignment issue" is almost always wrapper-margin mismatch, not the grid itself.
34
+ - A "wasted space" complaint is usually `maxWidth` + grid columns + single-field groups compounding.
35
+ - A "doesn't feel right" complaint usually points at typographic hierarchy, not color.
36
+
37
+ ## 2. Simplify — subtract first, add never (almost never)
38
+
39
+ Before adding anything, ask: **what can I remove?**
40
+
41
+ Remove these first, in priority order:
42
+ 1. **Redundant containers and wrappers.** One `<div>` can usually replace three.
43
+ 2. **Subcategory headers for 1-item groups.** "LIABILITY COVERAGE" above a single field burns a row for zero signal. Collapse into the parent.
44
+ 3. **Helper text that restates the label.** "Enter your email here" under an "Email" field is noise.
45
+ 4. **Default-zero values displayed as content.** `$0` and `0` with grey styling look like empty state — just leave empty.
46
+ 5. **Summary/status chips that say what the count already says.** "5 fields required" + a "5/5" badge = one of them goes.
47
+ 6. **Decorative icons that don't map to action or meaning.** A briefcase next to "Company Information" is decoration; a checkmark next to "Complete" is meaning. Keep meaning, cut decoration.
48
+ 7. **Multiple font sizes in the same row.** If a label and its chip are different sizes for no reason, they should match.
49
+
50
+ If something genuinely has to be added, it must carry its weight. A new indicator justifies itself by preventing a user mistake or accelerating a decision; otherwise it's noise.
51
+
52
+ ## 3. Align — everything lives on a grid
53
+
54
+ Misalignment is mostly caused by **inconsistent margins**, not inconsistent grids. Audit these in order:
55
+
56
+ 1. **Wrapper margins across sibling fields.** If `<DateInput>` returns a div with `mb-3` and `<CurrencyInput>` returns a div with `mb-1.5`, an `alignItems: 'end'` grid will put them at different baselines — by exactly the margin delta. Normalize wrappers before touching the grid.
57
+ 2. **Input heights across field types.** Date, select, currency, text, and yes/no all need the same `py` value, same `border-width`, same font-size. One `py-3` among a row of `py-2`s looks like a bug to the eye even if the user can't name it.
58
+ 3. **Label block heights.** Use `min-h-[20px]` on all labels so a 1-line label and a 1-line label-with-chip occupy the same vertical footprint. Labels that wrap to 2 lines *because they have to* are fine; labels that appear to wrap because the column is 20px too narrow are not.
59
+ 4. **Grid column strategies in the same card.** Don't mix `repeat(3, 1fr)` and `repeat(auto-fill, minmax(260px, 1fr))` in sibling rows — column widths will jump between rows for no reason the user understands.
60
+ 5. **`align-items`: prefer `end` for forms.** Anchoring inputs to the row's bottom means they line up regardless of how many lines the labels or helper texts above them take.
61
+
62
+ When a "leveling" complaint comes in, the fix is almost always one of (1) or (2). Check those before rewriting the grid.
63
+
64
+ ## 4. Polish — small things that disproportionately matter
65
+
66
+ These are low-effort, high-payoff tweaks. Apply them in this order:
67
+ - **Sentence-case labels.** "Requested Effective Date" → "Requested effective date" unless the product strongly prefers title case.
68
+ - **Tighten the padding scale.** `py-2 px-3` for inputs, `p-3` / `p-4` for cards, `gap-2` / `gap-3` for flex rows. Don't invent new values.
69
+ - **Right-size interactive affordances.** Yes/No buttons should match adjacent input heights (same `py`). "Submit" buttons should be one step larger, not three.
70
+ - **Consistent green/red semantics.** One accent color for success (`#40C288` / green-100 bg), one for destructive — don't introduce a third.
71
+ - **Chip restraint.** If multiple chips can appear on one label ("Auto-filled", "Suggested", "Required"), reserve one color per meaning and hide conflicting combinations (e.g., a "Suggested" chip disappears the moment "Auto-filled" applies).
72
+ - **Hover states that mean something.** Border color shift > shadow shift > scale transform. Don't use animation where color communicates the change.
73
+ - **Motion only for state changes the user caused.** Page-load staggers are cheap delight; surprise-wiggle on data arrival is usually annoying.
74
+
75
+ ## Opinionated defaults
76
+
77
+ When the user hasn't specified, default to these and move on:
78
+ - **Content width:** 1200px max. Sidebar + main = 220 + 980 with 24–32px gutters. Wider reads as "enterprise app with too many fields"; narrower cramps.
79
+ - **Card padding:** `px-4 py-3`. Cards tighter than this feel underbaked; looser feels sleepy.
80
+ - **Grid gap between fields:** `12px` horizontally, `12px` vertically. Don't exceed 16px unless there's a strong reason.
81
+ - **Typography scale:** label 11–12px semibold, input text 14px regular, body 13px regular, section title 14–15px semibold. Avoid introducing a 4th or 5th size.
82
+ - **Borders:** `1px solid` at all times. `border-2` reads as "please notice me" — reserve it for selected/active states, not defaults.
83
+ - **Corner radius:** `rounded-lg` (8px) for inputs and cards, `rounded-full` only for pills/avatars.
84
+
85
+ ## Anti-patterns — flag these on sight
86
+
87
+ - A single-field "section" with its own uppercase header.
88
+ - `maxWidth` > 1280 on a form-heavy page.
89
+ - `gap: 4` next to `gap: 16` inside the same card.
90
+ - `mb-3` on some wrappers and `mb-1.5` on others, in the same grid.
91
+ - `border-2` on non-selected default states.
92
+ - Helper text that is grammatically a sentence but visually the same size as the label.
93
+ - "Auto-filled" and "Suggested" chips shown simultaneously on one field.
94
+ - Yes/No buttons noticeably taller than neighboring selects.
95
+ - Progress bar counts that include optional fields in the denominator. "X of Y required" is what users actually want.
96
+ - Content that expands to fill whatever width it's given (currency inputs stretched to 600px for a 6-digit number).
97
+
98
+ ## Workflow the user sees
99
+
100
+ 1. **Restate the complaint in one sentence** so the user knows you understood. ("Fields don't line up in Coverage Details" — not "let me analyze the UI.")
101
+ 2. **Diagnose out loud.** Say what's causing it. ("Date wrapper has `mb-3`, currency wrapper has `mb-1.5` — that's the 6px offset.")
102
+ 3. **Make the minimum edit that fixes it.** Don't bundle unrelated cleanup.
103
+ 4. **Say what was left alone and why**, if there are obvious nearby things you chose not to touch.
104
+ 5. **Don't commit** unless the user asked.
105
+
106
+ ## When to escalate
107
+
108
+ Hand off to a different skill when:
109
+ - Request is "design a new X from scratch" → `frontend-design:frontend-design`
110
+ - Request is "write a comprehensive spec for the redesign" → `superpowers:writing-plans`
111
+ - Request is "this feels bad, but I don't know why" and you've already done a polish pass → ask targeted questions before another round.
112
+
113
+ ## Verification
114
+
115
+ After edits, state which complaint was addressed and which were not. If the user sent one screenshot showing one row of fields misaligned, don't report "condensed the whole page" — they'll suspect you did more than asked.
116
+
117
+ If you can run the dev server and re-check visually, do. If you can't (backend-only session, no browser access), say so explicitly: "I can't verify visually — please reload and confirm."
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: ui-ux-pro-max
3
+ description: Senior-level UX audit of an existing screen — produces a prioritized findings list, does NOT auto-fix. Use when the user asks for a "pro review", "expert critique", "ux audit", "senior take", "what would a designer catch", "is this production-grade", or wants rigorous evaluation of information architecture, cognitive load, accessibility, heuristic violations, and error states. Applies Nielsen heuristics, Fitts/Hick, WCAG, and measurable UX principles — not vibes. Complements /simplify-ui (subtraction) and /make-interfaces-feel-better (craft). For one-shot polish that includes audit + fix, use /ui instead.
4
+ ---
5
+
6
+ # UI/UX Pro Max — the senior review
7
+
8
+ Apply senior-designer rigor to an existing screen. This is **evaluation**, not creation. Do not rebuild from scratch; produce a prioritized list of defects with evidence.
9
+
10
+ ## Rules of engagement
11
+
12
+ - **No vibes.** Every finding names a principle (heuristic, law, or WCAG rule) and points at a specific element.
13
+ - **No rewrites during audit.** First list the findings; fix only what the user explicitly approves.
14
+ - **Prioritize by user impact.** Severity ranks: blocker (user cannot complete task) > major (noticeable friction) > minor (polish) > nit.
15
+ - **Cite evidence from the screen.** Don't generalize from principle — point at the component, class name, or pixel distance.
16
+
17
+ ## 1. Heuristics pass (Nielsen + practical extensions)
18
+
19
+ Walk the screen against these in order. Flag violations with severity.
20
+
21
+ 1. **Visibility of system status** — every long operation shows progress; every state change is visible within 1s.
22
+ 2. **Match with real-world language** — field labels use the user's vocabulary, not internal schema names (`bop_160_occupancy` → "Occupancy Type").
23
+ 3. **User control & undo** — destructive actions have confirm + undo; optimistic updates reveal failures.
24
+ 4. **Consistency** — same action uses same verb/icon/color/position across the app. Note inconsistencies by exact location.
25
+ 5. **Error prevention** — disable buttons that can't act yet, constrain inputs (dates, phone masks), validate on blur.
26
+ 6. **Recognition over recall** — never ask users to remember what they typed on page 2 to fill page 3.
27
+ 7. **Flexibility (power users)** — check for keyboard shortcuts, bulk actions, saved state, intelligent defaults.
28
+ 8. **Aesthetic & minimalist design** — every visible element earns its spot; label + chip + helper + placeholder overlap is noise.
29
+ 9. **Help users recognize/recover from errors** — error messages name the field, explain the problem, propose a fix.
30
+ 10. **Help & docs in-context** — help text next to the field, not on a separate help page.
31
+
32
+ ## 2. Physics + cognition
33
+
34
+ - **Fitts' Law** — target size ≥ 44×44 px for touch, ≥ 24×24 px for desktop; dangerous targets need *more* distance and size, not less. Close-buttons on toasts that are 18px is a defect.
35
+ - **Hick's Law** — flag dropdowns > 12 options without search. Lists > 5 items on a form field should be grouped or filtered.
36
+ - **Miller's 7±2** — flag screens asking for > 9 decisions at once; break into steps or collapse the optional ones.
37
+ - **Doherty threshold** — anything > 400ms without feedback reads as "broken". Note any interaction that is synchronous and slow.
38
+ - **Serial-position effect** — important CTAs go first or last, not middle.
39
+
40
+ ## 3. Information architecture
41
+
42
+ - **Section cardinality** — can a user explain what goes in each section in one sentence? If no, the section is doing two jobs.
43
+ - **Field grouping** — fields that are answered from the same mental context go together (address block, employee counts, coverage limits). Cross-group fields that live together are a defect.
44
+ - **Progressive disclosure** — required first, optional expandable, rarely-used hidden. Note any section that leads with optional fields.
45
+ - **Scannability** — can the user scan and find the fields they've already answered in < 2 seconds? Test by reading only bold text and labels.
46
+ - **Density** — count fields per card. Under 3 is sleepy, over 9 is oppressive; target 3–6.
47
+
48
+ ## 4. Accessibility (WCAG 2.2 AA baseline)
49
+
50
+ Run this as a pre-merge gate, not a "nice to have".
51
+
52
+ - **Color contrast** — body text ≥ 4.5:1, large text ≥ 3:1, UI components ≥ 3:1. Chips and pill backgrounds usually fail here; measure them.
53
+ - **Focus visible** — tab through the form. Every focusable element needs a visible ring *different* from the hover state.
54
+ - **Labels programmatically associated** — every input has a `<label for>` or `aria-labelledby`. Placeholder-as-label is a defect.
55
+ - **Error identification** — errors are announced to screen readers via `aria-live="polite"` or `aria-invalid`.
56
+ - **Motion preferences** — any non-essential animation respects `prefers-reduced-motion`.
57
+ - **Target size** — per WCAG 2.2, interactive targets ≥ 24×24 CSS px or have sufficient spacing.
58
+ - **Form autofill** — inputs use appropriate `autocomplete` attributes (email, tel, address-line1, …).
59
+
60
+ ## 5. States — all of them
61
+
62
+ For every interactive component, check: default, hover, focus, active, disabled, loading, empty, error, success. Note which states are missing or visually identical.
63
+
64
+ ## 6. Microcopy
65
+
66
+ - **Button verbs match action.** "Submit" is rarely right — "Send quote", "Save draft", "Request bind" are better.
67
+ - **Labels as statements, not questions.** "Do you own the building?" → "Building ownership" with a Yes/No.
68
+ - **Placeholders don't repeat the label.** "Email" label + "Enter your email" placeholder = pick one.
69
+ - **Error messages propose the fix**, not just the problem.
70
+ - **Empty states** tell users what will appear here and what to do to make it appear.
71
+
72
+ ## Deliverable
73
+
74
+ A severity-sorted list shaped like this:
75
+
76
+ ```
77
+ [blocker] Inputs are rendered without associated <label> — WCAG 1.3.1 violation — app/portal/quotes/new/info/page.tsx:3486
78
+ [major] "Application Progress" denominator counts optional fields; misleads users about completion — sidebar line 5049
79
+ [major] Yes/No buttons (px-6 py-3) are 44px tall next to 32px select inputs — violates consistency heuristic — acord-question-bridge.tsx:67
80
+ [minor] "Auto-filled" + "Suggested" chips render simultaneously on same field — visual noise — page.tsx:3470–3476
81
+ [nit] Section 2 header uses Playfair Display at 26px; rest of form is Figtree — typographic inconsistency
82
+ ```
83
+
84
+ After the list, stop. Wait for the user to pick which to fix. Do not batch everything into one edit — that's a different skill.
85
+
86
+ ## Known interactions
87
+
88
+ - Pair with `/simplify-ui` after this audit: its job is to cut what yours identifies as low-value.
89
+ - Pair with `/make-interfaces-feel-better` after the structural fixes land: its job is the craft layer above correctness.
90
+ - If your audit reveals the screen needs a redesign, not a polish, escalate to `frontend-design:frontend-design`.