@tamsensedev/runner 0.0.0-stage → 0.2.1

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 (82) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +47 -3
  3. package/dist/cli.js +2914 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/recorder.cjs +396 -0
  6. package/dist/recorder.cjs.map +1 -0
  7. package/library/.claude-plugin/plugin.json +5 -0
  8. package/library/THIRD_PARTY_NOTICES.md +123 -0
  9. package/library/agents/code-architect.md +67 -0
  10. package/library/agents/code-explorer.md +61 -0
  11. package/library/agents/code-reviewer.md +73 -0
  12. package/library/agents/code-simplifier.md +62 -0
  13. package/library/agents/design-critic.md +52 -0
  14. package/library/agents/second-opinion.md +64 -0
  15. package/library/agents/security-auditor.md +86 -0
  16. package/library/agents/silent-failure-hunter.md +70 -0
  17. package/library/agents/test-coverage-analyzer.md +78 -0
  18. package/library/agents/test-runner.md +48 -0
  19. package/library/agents/ui-tester.md +49 -0
  20. package/library/licenses/Apache-2.0.txt +202 -0
  21. package/library/skills/accessibility/SKILL.md +144 -0
  22. package/library/skills/accessibility/references/wcag-checks.md +168 -0
  23. package/library/skills/addressing-review-feedback/SKILL.md +109 -0
  24. package/library/skills/app-screens/SKILL.md +96 -0
  25. package/library/skills/app-screens/references/shell-kpis-charts.md +108 -0
  26. package/library/skills/app-screens/references/states-density-phone.md +54 -0
  27. package/library/skills/app-screens/references/tables-forms-settings.md +104 -0
  28. package/library/skills/avoiding-generic-ai-design/SKILL.md +92 -0
  29. package/library/skills/avoiding-generic-ai-design/references/tells.md +112 -0
  30. package/library/skills/clean-commits/SKILL.md +85 -0
  31. package/library/skills/design-review/SKILL.md +107 -0
  32. package/library/skills/design-review/references/critique-passes.md +101 -0
  33. package/library/skills/design-review/references/screenshot-procedure.md +121 -0
  34. package/library/skills/differential-security-review/LICENSE +427 -0
  35. package/library/skills/differential-security-review/SKILL.md +105 -0
  36. package/library/skills/differential-security-review/references/adversarial.md +115 -0
  37. package/library/skills/differential-security-review/references/methodology.md +145 -0
  38. package/library/skills/differential-security-review/references/patterns.md +108 -0
  39. package/library/skills/false-positive-check/LICENSE +427 -0
  40. package/library/skills/false-positive-check/SKILL.md +95 -0
  41. package/library/skills/false-positive-check/references/bug-class-verification.md +128 -0
  42. package/library/skills/false-positive-check/references/deep-verification.md +113 -0
  43. package/library/skills/false-positive-check/references/evidence-templates.md +93 -0
  44. package/library/skills/false-positive-check/references/false-positive-patterns.md +122 -0
  45. package/library/skills/false-positive-check/references/gate-reviews.md +36 -0
  46. package/library/skills/false-positive-check/references/standard-verification.md +80 -0
  47. package/library/skills/focused-implementation/SKILL.md +104 -0
  48. package/library/skills/implementation-plan/SKILL.md +66 -0
  49. package/library/skills/interface-design/SKILL.md +144 -0
  50. package/library/skills/interface-design/references/craft-defaults.md +130 -0
  51. package/library/skills/interface-design/references/new-direction.md +62 -0
  52. package/library/skills/interface-design/references/writing.md +52 -0
  53. package/library/skills/interface-polish/SKILL.md +103 -0
  54. package/library/skills/interface-polish/references/detail-rules.md +154 -0
  55. package/library/skills/interface-polish/references/worst-case-data.md +158 -0
  56. package/library/skills/motion-design/SKILL.md +106 -0
  57. package/library/skills/motion-design/references/recipes.md +243 -0
  58. package/library/skills/postgres-performance/SKILL.md +97 -0
  59. package/library/skills/postgres-performance/references/rules.md +265 -0
  60. package/library/skills/project-orientation/SKILL.md +77 -0
  61. package/library/skills/reviewing-changes/SKILL.md +183 -0
  62. package/library/skills/safe-database-changes/SKILL.md +111 -0
  63. package/library/skills/safe-database-changes/references/backfills.md +75 -0
  64. package/library/skills/safe-database-changes/references/migration-tools.md +69 -0
  65. package/library/skills/safe-database-changes/references/postgres-ddl.md +199 -0
  66. package/library/skills/security-review/SKILL.md +132 -0
  67. package/library/skills/security-review/references/checks-by-area.md +107 -0
  68. package/library/skills/security-review/references/do-not-report.md +86 -0
  69. package/library/skills/spec-writing/SKILL.md +144 -0
  70. package/library/skills/systematic-debugging/SKILL.md +130 -0
  71. package/library/skills/systematic-debugging/references/flaky-tests.md +51 -0
  72. package/library/skills/systematic-debugging/references/root-cause-tracing.md +55 -0
  73. package/library/skills/task-interview/SKILL.md +84 -0
  74. package/library/skills/test-driven-development/SKILL.md +116 -0
  75. package/library/skills/test-driven-development/references/writing-good-tests.md +85 -0
  76. package/library/skills/ui-testing/SKILL.md +102 -0
  77. package/library/skills/ui-testing/references/headless-check.md +280 -0
  78. package/library/skills/ui-testing/references/playwright-patterns.md +134 -0
  79. package/library/skills/ui-testing/references/recording.md +57 -0
  80. package/library/skills/verification-before-completion/SKILL.md +113 -0
  81. package/library/skills/web-interface-guidelines/SKILL.md +202 -0
  82. package/package.json +46 -6
@@ -0,0 +1,80 @@
1
+ # Standard Verification
2
+
3
+ Linear single-pass checklist for straightforward bugs. No task tracking: work through each step sequentially and document findings inline.
4
+
5
+ ## Escalation Checkpoints
6
+
7
+ Two points in this checklist may trigger escalation to [deep-verification.md](deep-verification.md):
8
+
9
+ 1. **After Step 1 (Data Flow)**: Escalate if 3+ trust boundaries, callbacks/async control flow, or ambiguous validation chain
10
+ 2. **After Step 5 (Devil's Advocate)**: Escalate if any question produces genuine uncertainty you cannot resolve
11
+
12
+ When escalating, hand off all evidence gathered so far: deep verification will continue from where you left off.
13
+
14
+ ## Checklist
15
+
16
+ ### Step 1: Data Flow
17
+
18
+ Trace data from source to the alleged vulnerability sink.
19
+
20
+ - Map trust boundaries crossed (internal/trusted vs external/untrusted)
21
+ - Identify all validation and sanitization between source and sink
22
+ - Check API contracts: many APIs have built-in bounds protection that prevents the alleged issue
23
+ - Check for environmental protections (compiler, runtime, OS, framework) that prevent exploitation entirely (not just raise the bar)
24
+ - Apply class-specific checks from [bug-class-verification.md](bug-class-verification.md)
25
+
26
+ **Key pitfall**: Analyzing the vulnerable code in isolation. Conditional logic upstream may make the vulnerability mathematically unreachable. Trace the full validation chain.
27
+
28
+ **Escalation check**: If you found 3+ trust boundaries, callbacks or async control flow in the path, or an ambiguous validation chain: escalate to deep verification.
29
+
30
+ ### Step 2: Exploitability
31
+
32
+ Prove the attacker can trigger the vulnerability.
33
+
34
+ - **Attacker control**: Prove the attacker controls data reaching the vulnerable operation. Internal storage set by trusted components is not attacker-controlled.
35
+ - **Bounds proof**: For integer/bounds issues, create an explicit algebraic proof using the template in [evidence-templates.md](evidence-templates.md). Verify: IF validation_check_passes THEN bounds_guarantee_holds.
36
+ - **Race feasibility**: For race conditions, prove concurrent access is actually possible. Single-threaded initialization and synchronized contexts cannot have races.
37
+
38
+ ### Step 3: Impact
39
+
40
+ Determine whether exploitation has real security consequences.
41
+
42
+ - Distinguish real security impact (RCE, privesc, info disclosure) from operational robustness issues (crash recovery, cleanup failure)
43
+ - Distinguish primary security controls from defense-in-depth. Failure of a defense-in-depth measure is not a vulnerability if primary protections remain intact.
44
+
45
+ ### Step 4: PoC Sketch
46
+
47
+ Create a pseudocode PoC showing the attack path. Executable and unit test PoCs are optional for standard verification; in review and test steps they run only from a temp directory outside the repository and never against live services (see the ground rules in SKILL.md).
48
+
49
+ ```
50
+ Data Flow: [Source] → [Validation?] → [Transform?] → [Vulnerable Op] → [Impact]
51
+ Attacker controls: [what input, how]
52
+ Trigger: [pseudocode showing the exploit path]
53
+ ```
54
+
55
+ See [evidence-templates.md](evidence-templates.md) for the full PoC template.
56
+
57
+ ### Step 5: Devil's Advocate Spot-Check
58
+
59
+ Answer these 7 questions. If any produces genuine uncertainty, escalate to deep verification.
60
+
61
+ **Against the vulnerability:**
62
+
63
+ 1. Am I seeing a vulnerability because the pattern "looks dangerous" rather than because it actually is? (pattern-matching bias)
64
+ 2. Am I incorrectly assuming attacker control over trusted data? (trust boundary confusion)
65
+ 3. Have I rigorously proven the mathematical condition for vulnerability can occur? (proof rigor)
66
+ 4. Am I confusing defense-in-depth failure with a primary security vulnerability? (defense-in-depth confusion)
67
+ 5. Am I hallucinating this vulnerability? LLMs are biased toward seeing bugs everywhere: is this actually real or am I pattern-matching on scary-looking code? (LLM self-check)
68
+
69
+ **For the vulnerability (always ask: false-negative protection):**
70
+
71
+ 6. Am I dismissing a real vulnerability because the exploit seems complex or unlikely?
72
+ 7. Am I inventing mitigations or validation logic that I haven't verified in the actual source code? Re-read the code after reaching a conclusion.
73
+
74
+ **Escalation check**: If any question above produces genuine uncertainty you cannot resolve with the evidence at hand: escalate to deep verification.
75
+
76
+ ### Step 6: Gate Review
77
+
78
+ Apply all six gates from [gate-reviews.md](gate-reviews.md) and all 13 items from [false-positive-patterns.md](false-positive-patterns.md) to reach a verdict.
79
+
80
+ Part of the `false-positive-check` skill, adapted from https://github.com/trailofbits/skills/tree/main/plugins/fp-check (commit 5c99c03fb8a9ea568432ecbcba5d86e9f4ac2bf0), CC BY-SA 4.0. Changed: read-only rule for proofs of concept, punctuation.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: focused-implementation
3
+ description: Use when implementing a feature, change or fix in the code step, especially one that touches several files: turn the task into checkable goals, build it in small working slices, keep every changed line tied to the task, and record assumptions and side findings for the report instead of asking.
4
+ ---
5
+
6
+ # Focused implementation
7
+
8
+ The reviewer should be able to read your diff and see the task in every line. Nobody answers questions during the run, so you decide, write the decision down, and keep going.
9
+
10
+ Start with `project-orientation` if you have not done it in this run. When the spec has several changes, write the plan first with `implementation-plan`.
11
+
12
+ ## 1. Turn the task into goals you can check
13
+
14
+ Before writing code, write a short list:
15
+
16
+ ```
17
+ Goal: invoices show the VAT amount per line
18
+ Checks:
19
+ - [ ] unit test: 3 lines at 20% VAT give per-line VAT 2.00, 4.00, 0.50
20
+ - [ ] invoice page renders a VAT column (component test or screenshot)
21
+ - [ ] existing invoice tests still pass
22
+ Assumptions:
23
+ - Rounding per line, half up, as in src/money/round.ts (spec does not say)
24
+ ```
25
+
26
+ - Take the acceptance criteria from the spec as they are. Each one becomes at least one check.
27
+ - A vague goal ("make it work", "improve") becomes a concrete check you can run.
28
+ - Where the task or spec is ambiguous, pick the reading that best matches the spec, the existing code and the smallest change. Write it under Assumptions. Do not stop to ask; `task-interview` says which open points deserve a question in the report.
29
+ - If the task as written is impossible or contradicts the code (an API that does not exist, a field that is not stored), do the closest useful thing that stays inside the task, and explain the gap in the report.
30
+
31
+ ## 2. Choose the simplest design that meets the goals
32
+
33
+ - Prefer the plain, obvious solution: a function call over an event bus, two similar components over a configurable framework for two cases. Three similar lines beat a premature abstraction.
34
+ - No speculative features, options, flags or extension points that the task does not need.
35
+ - Reuse what the project already has (helpers, components, error types, query builders) before writing new ones.
36
+ - For a change that spans many modules or needs a real design decision, ask the `code-architect` agent for one concrete blueprint, then follow it unless you find a reason not to (and say why).
37
+
38
+ ## 3. Build in thin slices
39
+
40
+ Work in slices that each leave the project working:
41
+
42
+ 1. Implement the smallest complete piece (vertical: from storage to API to UI for one case, rather than all of the storage first).
43
+ 2. Test it: write the test first where the project has tests (`test-driven-development`), then run the tests near the change.
44
+ 3. Check it builds and type-checks.
45
+ 4. Move to the next slice.
46
+
47
+ Rules:
48
+ - Do not write more than roughly 100 lines without running something.
49
+ - Put the riskiest or least certain piece first, so a dead end shows up early.
50
+ - Never leave the build broken between slices.
51
+ - Commit a slice when it is green if that makes the history clearer (`clean-commits`); one commit at the end is also fine.
52
+ - New behaviour defaults to the safe, conservative option (off, opt-in, read-only) unless the task says otherwise.
53
+
54
+ ## 4. Keep changes surgical
55
+
56
+ Every changed line should trace back to the task.
57
+
58
+ - Do not reformat, rename, reorder imports or "modernise" code you are not otherwise changing.
59
+ - Do not delete comments, code or tests you do not fully understand.
60
+ - Match the surrounding style even if you would write it differently.
61
+ - Clean up what your own change made unused (imports, helpers, variables). Leave older dead code alone.
62
+ - When you notice something wrong outside the task, do not fix it. Add it to a "Noticed, not changed" list for the report:
63
+
64
+ ```
65
+ Noticed, not changed:
66
+ - src/utils/format.ts: unused import of `dayjs` (unrelated)
67
+ - Login form shows the raw server error text (separate task)
68
+ ```
69
+
70
+ Exception: if the task cannot be done correctly without touching it (the bug you are fixing lives there), change it and say why.
71
+
72
+ ## 5. Flag these in the report
73
+
74
+ Do them only when the task needs them, choose the smaller option, and list them in the report so the reviewer looks closely:
75
+
76
+ - New dependencies, or upgrades of existing ones.
77
+ - Database schema changes or migrations (follow `safe-database-changes`).
78
+ - Changes to authentication, authorisation, sessions, CORS, uploads, rate limits, roles or permissions.
79
+ - New external services or new kinds of stored sensitive data.
80
+ - Changes to a public API, a shared contract, CI config or build config.
81
+ - Deleting files, features or tests.
82
+ - Changes in a repository that the task did not obviously involve.
83
+
84
+ Never: commit secrets, edit vendored or generated files by hand (regenerate them the way the project does), weaken or delete a failing test to get green, or disable lint rules to silence your own code.
85
+
86
+ ## 6. Finish
87
+
88
+ 1. Tidy your own diff: remove debug output, leftover TODOs you created, commented-out code. For a large change, the `code-simplifier` agent can do a behaviour-preserving pass over the changed files.
89
+ 2. Run `verification-before-completion`.
90
+ 3. Commit with `clean-commits`.
91
+ 4. Write the report: what changed, how it was checked (commands and results), assumptions, flagged items, noticed-not-changed list, anything left open.
92
+
93
+ ## Common mistakes
94
+
95
+ | Thought | What to do instead |
96
+ |---|---|
97
+ | "While I'm here I'll clean this up" | Note it under "Noticed, not changed". |
98
+ | "I'll test it all at the end" | Test each slice; a bug in slice 1 makes slices 2 to 5 wrong. |
99
+ | "Let me make it configurable, just in case" | Build what the task needs; add options when a second case exists. |
100
+ | "The spec is unclear, I'll wait" | Pick the most reasonable reading, write it under Assumptions, continue. |
101
+ | "This refactor is small enough to include" | Keep refactors out of feature changes unless the task needs them. |
102
+ | "Lint fails on my line, I'll add an ignore comment" | Fix the code; ignore comments only where the project already uses them for the same case, with a reason. |
103
+
104
+ Sources: addyosmani/agent-skills (MIT, commit aeac41d) incremental-implementation, plus ideas restated from the Karpathy coding guidelines. Changed: rewritten for unattended runs.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: implementation-plan
3
+ description: Use at the start of a code step when the spec or task touches more than one file or more than one repository: turn it into an ordered plan of small tasks with exact files, the interfaces passed between them, the checks that prove each one, and a review focus of the inputs no test covers yet.
4
+ ---
5
+
6
+ # Implementation plan
7
+
8
+ A plan is the set of decisions an implementer cannot make alone: which files, which names and signatures, which values from the spec, which tests prove each step. Write those down, nothing more. A plan longer than the code it describes has written the code instead.
9
+
10
+ Start with `project-orientation` if you have not done it in this run. Keep the plan in your working notes; it does not go into the repository unless the project asks for plans there.
11
+
12
+ ## 1. Read the spec as the contract
13
+
14
+ - The acceptance criteria (AC-1, AC-2 and so on) are the finish line. Each one must end up proven by a test or a check.
15
+ - Out of scope is a hard limit: nothing from it goes into the plan.
16
+ - Decisions, assumptions and the code map are settled: follow them. If the code contradicts one, note it for the report and pick the reading closest to the spec.
17
+ - Values the spec pins (texts, limits, names, status codes) are copied verbatim into a "Constraints" list at the top of the plan.
18
+
19
+ ## 2. Map the files
20
+
21
+ List every file you will create or change, with one line on its responsibility. Files that change together live together; follow the project's existing layout.
22
+
23
+ ## 3. Order the tasks
24
+
25
+ Each task is the smallest unit with its own test cycle that a reviewer could accept or reject on its own:
26
+
27
+ ```
28
+ Task 2: CSV export endpoint
29
+ Files: create server/api/boards/[id]/export.get.ts; test test/boardExport.test.ts
30
+ Consumes: canSeeBoard(userId, boardId) from server/utils/boardAccess.ts
31
+ Produces: GET /api/boards/:id/export -> text/csv, header "Title,Status,Owner"
32
+ Proves: AC-1, AC-2
33
+ Steps:
34
+ 1. Test: 3 tasks give 4 lines; no access gives 404 (fails first)
35
+ 2. Implement exportCsv(boardId: number): string and the route
36
+ 3. Run: pnpm test test/boardExport.test.ts -> 2 passed
37
+ ```
38
+
39
+ - Order by dependency: a task uses only what earlier tasks or the existing code provide. Put the riskiest or least certain task as early as its dependencies allow.
40
+ - **Interfaces:** write Consumes and Produces with exact names, parameters, return types and data shapes. This is how the next task learns the names; check that every name used later is produced earlier.
41
+ - **Steps:** each step is one action with a checkable result, and lets you write exactly one reasonable thing. Lines that decide nothing ("handle edge cases", "add validation", "write tests") are gaps: replace them with the case, the rule or the test name.
42
+ - **Tests at the highest seam** that covers the behaviour: an endpoint, a page or a public function, not private helpers. Follow `test-driven-development`.
43
+
44
+ ## 4. Verification
45
+
46
+ Split it in two:
47
+
48
+ - **Automated:** the exact commands (tests, type check, lint, build) and what passing looks like. Take them from the spec's test plan and from `project-orientation`.
49
+ - **Manual:** what a person does and sees, naming the page or command. For interface work, the screens to render with `ui-testing` or `design-review`.
50
+
51
+ Map every acceptance criterion to the task and the check that proves it. A criterion without a check is a gap: add the test.
52
+
53
+ ## 5. Review focus
54
+
55
+ Write up to five input classes or failure modes the spec implies but no planned test exercises, most likely to bite a person first: an empty list, a very long name, a second click, an expired session, a slow network. The spec's silence on an input is not permission for that input to break the program. For each line, add the test to the task that owns the code, or say in the report why it is left.
56
+
57
+ ## 6. Self-check before coding
58
+
59
+ 1. **Coverage:** every criterion has a task and a check; every task proves a criterion.
60
+ 2. **Names:** names and signatures match between Produces and Consumes.
61
+ 3. **Scope:** nothing from out of scope, nothing the spec did not ask for.
62
+ 4. **Proportion:** the plan is shorter than the code it describes.
63
+
64
+ Then build it with `focused-implementation`, one task at a time, and finish with `verification-before-completion`. Put the plan's Review Focus and any deviations from the spec in the report.
65
+
66
+ Sources: adapted from obra/superpowers writing-plans (MIT, commit b739a8a), the plan template and ready-for-development rules of bmad-code-org/BMAD-METHOD (MIT, commit 61e01f8), humanlayer/humanlayer create_plan (Apache-2.0, commit 99abe67) and mattpocock/skills to-spec testing seams (MIT, commit 5beb35b). Changed: condensed into one process for unattended code steps, the plan stays in working notes, execution choices removed.
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: interface-design
3
+ description: Use when building or changing anything people see in a web or app UI (a screen, page, component, restyle, layout, typography, colour or spacing). Covers following the project's design system, hierarchy, type and spacing scales, colour and depth, states, real content, and looking at the rendered result before finishing.
4
+ ---
5
+
6
+ # Interface design
7
+
8
+ The goal is an interface that looks decided, not just correct: one thing leads, the type and spacing follow a system, colour means something, every state exists, and the result belongs to this product. Generated UI usually fails by defaulting, not by breaking. This skill is the process for deciding.
9
+
10
+ ## What wins when rules disagree
11
+
12
+ 1. **The task's explicit wording.** If it asks for a new look, a specific colour or a pattern, do that.
13
+ 2. **The project's own design sources**: DESIGN.md (or a design section in CLAUDE.md / AGENTS.md), theme and token files, the component library, Storybook, and existing screens that do the same job. These always beat any rule or banned pattern in this library. If the product already has a look, extend it.
14
+ 3. **The craft rules and default numbers in this library.** Numbers here are defaults for when the project has none.
15
+ 4. **Taste lists** such as `avoiding-generic-ai-design`. They describe defaults to avoid when a choice is free; they never override the project.
16
+
17
+ The accessibility floor is not taste: if a project token fails contrast or a component has no focus style, use the nearest passing token or add the missing state, and say so in the report. Details live in the `accessibility` skill.
18
+
19
+ Nobody will answer questions during the run. When something is unclear, decide, write the assumption down, and list it in the final report.
20
+
21
+ ## Step 1: Find what already exists
22
+
23
+ Before writing UI code, spend a few minutes on:
24
+
25
+ - Design documents: `DESIGN.md`, `docs/design*`, design notes in CLAUDE.md / AGENTS.md / CONTRIBUTING.
26
+ - Tokens: CSS custom properties, Tailwind config or `@theme`, SCSS variables, a theme object, design-token JSON.
27
+ - Components: the project's `Button`, `Input`, `Dialog`, `Table`, layout shells, icon set, and any headless primitives already installed.
28
+ - The nearest sibling screen that does a similar job. It shows spacing, density, headings, empty states and copy tone in practice.
29
+ - The styling system (Tailwind, CSS modules, plain CSS, CSS-in-JS, a UI kit) and lint rules about styles.
30
+
31
+ Write a short note for yourself:
32
+
33
+ ```
34
+ Design sources: DESIGN.md, src/styles/tokens.css, components/ui/*
35
+ Look: light, neutral greys, one blue accent, 8px radius, borders not shadows, Inter 14px body
36
+ Sibling screen: /settings/members (same table, same empty state)
37
+ Gaps: no warning colour token, no skeleton component
38
+ ```
39
+
40
+ ## Step 2: Extend, or choose a fresh direction
41
+
42
+ - **Extend (the default).** The product has screens, tokens or a component library. Use them. New surfaces should look like they shipped with the rest. Fill gaps (a missing token, a missing state) in the project's own style and name them in the report.
43
+ - **Fresh direction.** Only when the product has no UI yet, or the task explicitly asks for a new look. Then choose one coherent direction yourself (nobody will pick for you), following [references/new-direction.md](references/new-direction.md), and state the direction in the report.
44
+
45
+ Never mix: do not bring a new palette, font or radius into one corner of an existing product because it "looks better".
46
+
47
+ ## Step 3: Name the job of the screen
48
+
49
+ Write three lines before building:
50
+
51
+ - **Who and when.** "Support lead, many times a day, on a laptop." Not "users".
52
+ - **The verb.** What they must get done here: approve, find the failed deploy, invite a teammate.
53
+ - **The focal element.** The one thing that answers the screen's question. It must win through size, weight, contrast or the space around it; everything else is deliberately demoted.
54
+
55
+ Dashboards, tables, admin, settings and other screens people work in: also follow `app-screens`. Landing and marketing pages: see the pages section of [references/new-direction.md](references/new-direction.md).
56
+
57
+ ## Step 4: Build with what exists
58
+
59
+ Controls, in this order:
60
+
61
+ 1. Native HTML that does the job (`<button>`, `<a href>`, `<input>`, `<dialog>`, `<details>`, `<label>`).
62
+ 2. The project's component for it.
63
+ 3. An accessible headless primitive the project already has (Radix, React Aria, Ark, Headless UI, Reka UI, Bits UI, Angular CDK and similar).
64
+ 4. Hand-rolled only as a last resort, and then with the full contract: keyboard (arrows, Enter, Escape), focus trap and return, ARIA roles and states, click outside, scroll lock for overlays.
65
+
66
+ Styling, in this order: the design system's component or variant, then a shared component you extract on the second real reuse, then semantic tokens, then a one-off utility for a genuine one-off. Bind to semantic tokens (`bg-surface`, `var(--text-muted)`), not literals (`#fff`, `gray-500`, `13px`). Never introduce a second styling system or a new UI library for looks.
67
+
68
+ ## Craft rules
69
+
70
+ Exact default numbers are in [references/craft-defaults.md](references/craft-defaults.md). Use the project's values first.
71
+
72
+ **Hierarchy**
73
+ - One focal point per view. Promote it and demote the rest: secondary actions as secondary buttons or text, metadata in a muted tone.
74
+ - Build tiers from size, weight and colour together. A 14px label at 500 in the secondary text colour and a 14px value at 600 in the primary colour separate better than two sizes two pixels apart.
75
+ - If you squint and cannot tell title, body and metadata apart, the hierarchy is too weak.
76
+
77
+ **Type**
78
+ - A scale, not sizes picked by feel: product UI steps by about 1.2 to 1.25, expressive pages by about 1.333. Four to six sizes on a screen, two or three weights.
79
+ - Sentence case for headings, buttons, labels, tabs and table headers, unless the project already uses another case.
80
+ - Leave letter-spacing at the font's default. Only large display text (about 32px and up) may be tightened slightly, -0.01em to -0.02em. Never change it on body text. Keep the project's values if it already sets them.
81
+ - Reading text 45 to 75 characters per line. `text-wrap: balance` on headings, `pretty` on short paragraphs.
82
+ - Tabular figures (`font-variant-numeric: tabular-nums`) on numbers that update or line up in columns.
83
+
84
+ **Space and layout**
85
+ - One spacing scale on a 4px base. Tight inside a group, clearly larger between groups, more space above a heading than below it.
86
+ - Group by proximity before adding boxes. Cards are for things that are actually separate objects; never nest cards.
87
+ - Shared edges: text blocks start on two or three left edges per screen, not six. Rows of cards share a bottom edge. Choose the column count from the number of items so nothing is orphaned.
88
+ - Responsive changes are structural (sidebar folds, table becomes a list, columns stack), not just smaller. Nothing scrolls sideways at 320 to 390px.
89
+
90
+ **Colour**
91
+ - Roles, not swatches: background, surface, raised, border, text (primary, secondary, muted, disabled), accent, focus, success, warning, danger, info.
92
+ - Neutrals carry the structure. The accent goes on primary actions, current selection and meaning, roughly 10% of the screen at most. Colour never decorates.
93
+ - One meaning per colour across the product. Never colour alone: add text, an icon or position.
94
+ - Contrast: text 4.5:1 (placeholders included), large text, icons, control borders and focus indicators 3:1.
95
+
96
+ **Depth and shape**
97
+ - One depth strategy for the product: borders, tone steps, or soft shadows. A border or a shadow on a surface, not both. Real shadows belong to things that float (menus, popovers, dialogs, toasts).
98
+ - One radius scale. Controls follow their cards. Nested corners are concentric: outer radius = inner radius + padding.
99
+
100
+ **States**
101
+ - Every control: default, hover, focus-visible, active, disabled (and why it is disabled), loading where it triggers work.
102
+ - Every data block: loading (skeleton at the final size, no layout shift), empty (says why and offers the next action), error (what failed, what to do, a retry), one item, many items, long values. Use `interface-polish` to stress-test with worst-case data.
103
+
104
+ **Content**
105
+ - Use the task's real content and the product's real words. Never invent metrics, customer names or logos, testimonials, ratings, prices or data. Where content is missing, use clearly neutral placeholders ("Project name", "0 items") or sample data labelled as such, and list them in the report.
106
+ - Copy rules (verbs on buttons, errors, empty states, sentence case) are in [references/writing.md](references/writing.md).
107
+
108
+ ## Step 5: Look at the rendered result
109
+
110
+ Code review of your own CSS will read your intentions into it. Look at pixels.
111
+
112
+ 1. Start the app as `ui-testing` describes (dev server, seed data, login).
113
+ 2. Take screenshots of each changed screen at 1440, 768 and 390px wide, plus the states you built, following the procedure in `design-review`. When you try several directions, number them ("Design option 1", "Design option 2") in the recordings and in the screenshots you attach, each with a purpose that says what it tries.
114
+ 3. Open the images and judge them: does the focal element win, do edges line up, does the phone layout work, is any text clipped or overlapping, does it look like the rest of the product?
115
+ 4. Fix the three worst problems, take new screenshots, look again. Three rounds at most.
116
+
117
+ If the app cannot be started or no browser is available, reason from the code, and say in the report that the rendered check did not run and why.
118
+
119
+ ## Before you finish
120
+
121
+ - [ ] Squint test: the focal element and the groups read in the right order.
122
+ - [ ] Swap test: with the product name hidden, would this screen look the same as any template? If yes, the free choices were defaulted (see `avoiding-generic-ai-design`).
123
+ - [ ] Every value comes from a token or the project's scale; no new one-off colours, sizes or radii without a reason.
124
+ - [ ] All states above exist and were looked at.
125
+ - [ ] 390px: no sideways scroll, targets at least 44px tall, inputs at least 16px font.
126
+ - [ ] Contrast and visible focus checked on the changed elements.
127
+ - [ ] Copy is real, short and consistent with the rest of the product.
128
+
129
+ ## Common mistakes
130
+
131
+ - Restyling a product's existing components "to look better" instead of using them.
132
+ - Everything the same size and weight, so nothing leads.
133
+ - An accent colour on every button, tab and icon.
134
+ - Hard-coded colours and spacing next to an existing token set.
135
+ - Only the happy path built: no loading, empty or error state.
136
+ - Declaring it done without ever looking at a screenshot.
137
+
138
+ ## Report
139
+
140
+ Say briefly: the design sources you followed; whether you extended the existing look or chose a fresh direction (and the direction, if fresh); any tokens or states you had to add; placeholder or sample content that must be replaced; which screens and widths you looked at, and anything you could not check.
141
+
142
+ Related: `app-screens`, `avoiding-generic-ai-design`, `interface-polish`, `motion-design`, `web-interface-guidelines`, `design-review`, `accessibility`, `ui-testing`.
143
+
144
+ Sources: adapted from Dammyjay93/interface-design (MIT), pbakaus/impeccable reference files (Apache-2.0, changed: rewritten and condensed, tool and question steps removed), jakubkrehel/make-interfaces-feel-better (MIT), Leonxlnx/taste-skill (MIT).
@@ -0,0 +1,130 @@
1
+ # Craft defaults
2
+
3
+ Read this when the project has no value for something you need (a type size, a spacing step, a radius, a colour role). Every number below is a default. If the project's tokens, DESIGN.md or existing screens say otherwise, they win.
4
+
5
+ ## Type
6
+
7
+ **Scales.** Pick one ratio and step it from the body size. Round to whole pixels.
8
+
9
+ | Use | Ratio | Example steps (px) |
10
+ |---|---|---|
11
+ | Dense product UI | 1.2 | 12, 14, 16, 20, 24 |
12
+ | Most product UI | 1.25 | 12, 14, 16, 18, 22, 28 |
13
+ | Marketing and editorial pages | 1.333 | 16, 21, 28, 38, 50, 67 |
14
+
15
+ Product screens use fixed sizes in rem, not fluid `clamp()` headings. Marketing pages may let display type respond to width, with a cap of about 6rem.
16
+
17
+ **Roles for product UI** (common clean sets: 12/14/16/24, 12/14/18/24):
18
+
19
+ | Role | Size | Weight | Line height |
20
+ |---|---|---|---|
21
+ | Page title | 20 to 28px (24 default) | 600 | 1.25 |
22
+ | Section or card title | 16px | 500 to 600 | 1.4 |
23
+ | Body, table cells, nav | 14px (13px in very dense tools) | 400 | 20px at 14px |
24
+ | Reading text (help, articles) | 16px | 400 | 24px at 16px (1.5) |
25
+ | Labels, metadata, axis ticks | 12px | 400 to 500 | 16px |
26
+ | Smallest text anywhere | 11px | 500 | 16px |
27
+
28
+ - Body line height 1.45 to 1.6; headings 1.1 to 1.3; display 0.95 to 1.1.
29
+ - Measure: 45 to 75 characters for prose (65 to 75 ideal). Tables and dense data may run wider.
30
+ - Weights: at most three per screen. 700 does one job (a title, or money).
31
+ - Letter-spacing: 0 for body and UI text. Display text from about 32px may go to -0.01em or -0.02em. Do not go tighter than -0.03em.
32
+ - Case: sentence case for headings, buttons, labels, tabs, menu items and table headers. Avoid all-caps labels unless the project uses them.
33
+ - Families: one well-tuned sans covers product UI. A second family needs one clear job (monospace for code and IDs, a display face for marketing headlines). Never three.
34
+ - Phones: form inputs at 16px or more, or iOS Safari zooms the page on focus.
35
+ - Light text on dark surfaces: add a little line height (about +0.05) and consider one step more weight.
36
+
37
+ ## Spacing
38
+
39
+ Base unit 4px. Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96.
40
+
41
+ | Context | Default |
42
+ |---|---|
43
+ | Icon to label | 6 to 8px |
44
+ | Inside a control (vertical, horizontal) | 6 to 8px, 12 to 16px |
45
+ | Between related fields | 16px |
46
+ | Card padding | 16 to 24px (20 default) |
47
+ | Gap between cards | 16px, the same horizontally and vertically |
48
+ | Between sections of a screen | 32 to 48px |
49
+ | Page gutter, desktop | 24 to 40px |
50
+ | Page gutter, phone | 16 to 20px |
51
+ | Between sections of a marketing page | 96 to 160px |
52
+
53
+ - Padding is symmetrical unless content needs otherwise. An icon button side may be 2px less than the text side for optical balance.
54
+ - Density is three settings moved together: row height, padding and type size. Do not shrink type and keep the padding.
55
+
56
+ ## Sizes of controls and rows
57
+
58
+ | Element | Default |
59
+ |---|---|
60
+ | Button and input height, desktop | 32 to 36px (28 in dense toolbars, 40 in long forms) |
61
+ | Button and input height, phone | 44px |
62
+ | Hit area | 44 x 44px on touch, at least 40 x 40 in dense desktop UI (WCAG 2.2 minimum 24 x 24). Extend small controls with padding or a pseudo-element; hit areas never overlap |
63
+ | Table row | 40 to 48px; 32 to 36px dense |
64
+ | List row with avatar and two lines | 56 to 72px |
65
+ | Sidebar width | 224 to 256px; icon rail 48 to 56px |
66
+ | Top bar height | 48 to 56px |
67
+ | Icons | 16px inline and in nav (14 to 20), 1.5px stroke beside regular text, 2px beside semibold |
68
+
69
+ ## Colour
70
+
71
+ - **Contrast (WCAG AA):** text and placeholders 4.5:1; text 24px and up (or 18.7px bold and up) 3:1; icons, control borders, focus indicators and chart marks that carry meaning 3:1 against what they sit on.
72
+ - **Text tiers:** primary, secondary, muted (all at 4.5:1 or better), and disabled. On white, about #111 / #4b5563 / #6b6b6b is the lightest set that still passes. Two greys that are close (#999 and #aaa) read as one grey used twice.
73
+ - **Accent budget:** one accent hue, used for the primary action, the current selection, focus and data highlights. Roughly 60% dominant neutral, 30% secondary neutral, 10% accent at most. Many good product screens have under 5% coloured pixels.
74
+ - **Status:** success, warning, danger, info as pale tint backgrounds with dark text of the same hue for chips and banners; solid colour only for small marks. Example pairs: success #dcfae5 / #04250e, danger #ffedea / #831c1e, warning #fffbeb / #92400e. Green text on white needs a dark green (about #247b50) to reach 4.5:1.
75
+ - **Neutrals:** a little tint from the brand hue is fine if the project already does it; pure greys are fine too. Sidebars use the page background (or one step off it), not a dark or saturated block beside a light canvas.
76
+ - **Dark mode:** design it, do not invert. Elevation by lightness: base, then about +4 to +8% lightness per raised level. Borders around rgba(255,255,255,0.06 to 0.12). Desaturate status colours slightly. Set `color-scheme: dark`.
77
+ - **New palettes:** define them in OKLCH when the project has no colour space convention; vary lightness, lower chroma near white and black.
78
+
79
+ ## Depth
80
+
81
+ Choose one strategy per product and hold it:
82
+
83
+ | Strategy | Suits |
84
+ |---|---|
85
+ | 1px borders, low contrast (about #e5e7eb to #ededed on white, 1.1 to 1.3:1) | Dense tools, tables, admin |
86
+ | Tone steps (surface one step lighter or darker than the page) | Calm apps, dark themes |
87
+ | Soft shadows | Consumer apps with few layers |
88
+
89
+ - A resting card gets a border or a tone step, or at most a faint shadow (about `0 1px 2px rgb(0 0 0 / 0.06)`). Not a 1px border plus a wide soft shadow.
90
+ - A shadow can stand in for a border: `0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04)`; on dark, `0 0 0 1px rgb(255 255 255 / 0.08)`.
91
+ - Floating layers (menus, popovers, dialogs, toasts) get a real shadow with an offset and blur, one level above their parent. Never a zero-offset coloured glow.
92
+ - Keep real borders for dividers, table rules and input outlines.
93
+
94
+ ## Radius
95
+
96
+ Choose a tight or a soft scale once:
97
+
98
+ | Scale | Chips | Controls | Cards | Dialogs |
99
+ |---|---|---|---|---|
100
+ | Tight | 4px | 6px | 8px | 12px |
101
+ | Soft | 6px or full | 8 to 10px | 12 to 16px | 16 to 20px |
102
+
103
+ - Concentric nesting: outer radius = inner radius + padding. When the padding is over about 24px, treat the layers as separate.
104
+ - Pill (fully round) shapes are for chips, toggles and small buttons, not cards.
105
+ - Images in rows: circles for people, 2 to 4px for artwork and logos, the card radius for photos inside cards.
106
+
107
+ ## Motion
108
+
109
+ Short form; full guidance in `motion-design`.
110
+
111
+ | Interaction | Duration | Easing |
112
+ |---|---|---|
113
+ | Press feedback | 100 to 160ms | ease-out |
114
+ | Hover, colour change | 100 to 150ms | ease |
115
+ | Tooltip, small popover | 125 to 200ms | ease-out |
116
+ | Dropdown, menu | 150 to 250ms | ease-out |
117
+ | Dialog, drawer | 200 to 300ms (up to 500 for large drawers) | ease-out |
118
+ | Exit | about 75% of the enter | ease-out |
119
+
120
+ Strong ease-out: `cubic-bezier(0.23, 1, 0.32, 1)`. On-screen movement: `cubic-bezier(0.77, 0, 0.175, 1)`. Never `ease-in` for UI. Respect `prefers-reduced-motion`.
121
+
122
+ ## Browser details people notice
123
+
124
+ - Focus ring: 2px, offset 2px, in the accent or a high-contrast colour, on `:focus-visible`.
125
+ - Text selection colour from the palette when the project themes it.
126
+ - `-webkit-font-smoothing: antialiased` on the root (macOS) if the project does not already set it.
127
+ - Images: explicit width and height or `aspect-ratio`; a 1px inset outline at `rgb(0 0 0 / 0.1)` on light (`rgb(255 255 255 / 0.1)` on dark) separates photos from same-colour backgrounds.
128
+ - Leave scrollbars native in product UI unless the project already styles them.
129
+
130
+ Sources: numbers condensed from Dammyjay93/interface-design (MIT), Leonxlnx/taste-skill app-screens reference (MIT), jakubkrehel/make-interfaces-feel-better (MIT), emilkowalski/skills (MIT) and pbakaus/impeccable craft-floor, operate, typeset, colorize and layout references (Apache-2.0, changed: rewritten as defaults under the project's own system).
@@ -0,0 +1,62 @@
1
+ # Choosing a fresh direction
2
+
3
+ Read this only when the product has no interface yet, or the task explicitly asks for a new look (a redesign, a new brand, a landing page with no existing site). In every other case, extend what exists.
4
+
5
+ Nobody will choose between options for you. Work out one direction, check it against the generic default, build it, and state it in the report.
6
+
7
+ ## 1. Ground it in the subject
8
+
9
+ Write these in your notes before any visual decision:
10
+
11
+ - **Subject, audience, job.** What the product is, who uses it, and the one thing the screen or page must get them to do. If the task does not say, infer it from the repository (README, package names, routes, seed data) and write the assumption down.
12
+ - **Domain.** Five or more concepts, objects and words from the product's world (not features). A scheduling tool for clinics: rota, shift, cover, on call, ward, handover.
13
+ - **Colour world.** Five or more colours that exist in that world, taken from its materials, places and printed things, not from "warm" or "cool".
14
+ - **The defaults.** Three obvious choices you would make for this kind of interface without thinking (for example: violet gradient hero, three icon cards, Inter on white). You cannot avoid patterns you have not named.
15
+ - **One signature.** A single element that could only belong to this product: a schedule set in the rhythm of a real rota, service health drawn as a route map, the product's own object shown large. If you cannot name one, keep exploring the domain.
16
+
17
+ ## 2. Write a compact plan
18
+
19
+ ```
20
+ Direction: calm clinical tool, dense like a ward board, quiet colour
21
+ Palette: ground #f7f8f7, surface #ffffff, ink #14211c, muted #56635d, accent #0f766e, danger #b42318
22
+ Type: one grotesk for everything; 14px body, scale 1.2; tabular figures for times
23
+ Layout: left rail with labelled nav, full-width rota grid, details in a right panel
24
+ Depth: 1px borders, no resting shadows; radius 6/8
25
+ Signature: the rota grid itself, cover gaps shown as hatched cells
26
+ Rejected: gradient header -> flat ground; KPI cards with icons -> one divided summary strip
27
+ ```
28
+
29
+ - Palette: a small set of named roles (ground, surface, ink, muted, accent) plus status colours, with contrast checked.
30
+ - Type: one or two families with clear roles. Use a face the project can load the way it loads its other assets; a system stack is acceptable for product UI. If a font needs a new dependency, say so in the report.
31
+ - Layout: a one-sentence concept per screen and the alignment rule (left-aligned by default; centre at most one moment).
32
+
33
+ ## 3. Check the plan against the generic version
34
+
35
+ Ask: if a similar prompt went to another model, would it land on the same plan? For each part that would (the palette, the hero, the card grid), change it and note what you changed and why. The patterns to check against are in `avoiding-generic-ai-design`.
36
+
37
+ Then build, following the main skill, and run the render-and-look loop.
38
+
39
+ ## 4. Keep the signature where it means something
40
+
41
+ Put the signature where it carries meaning and do not stamp it on every element; a style's move repeated everywhere becomes a costume. On a working screen the direction lends type, palette, density and the one signature, while navigation and controls stay the standard ones people already know. A distinctive direction still meets the craft floor: hierarchy, contrast, states, phone layout, keyboard focus, reduced motion.
42
+
43
+ ## Pages (landing, marketing, docs home)
44
+
45
+ A page is read and scrolled once, so it can carry more voice than an app screen. Rules that hold for pages:
46
+
47
+ - **The first screen says what this is.** A clear title in the page's one `h1` (a name plus what it does, or a short claim of about five words), one supporting sentence directly under it that says plainly what the thing is, and one primary action as a real button. A stranger should know in five seconds what it is, who it is for and what to do.
48
+ - **Headlines fit in two lines** at every width. About 32 characters is safe at a confident size. Cut words before shrinking type.
49
+ - **Sections follow the argument, not the template.** List the page as claims with their proof, one line per section, and delete sections with no claim. The stock order (hero, logo strip, three features, testimonial, pricing, call to action) is the sign of no argument.
50
+ - **Each section has a heading that names it** and a composition different from its neighbours. The same layout three times in a row is the template showing.
51
+ - **Write the full content.** Every section the task asks for carries its real information (the whole price table, every plan's limits). Thin sections lose to busier pages.
52
+ - **Type does the visible work:** a decisive jump from body to headline (three times or more), five sizes at most, body 16 to 20px in full ink, not grey.
53
+ - **Equal outer margins** at every width, no stretch of blank space taller than half a screen, and the gap between sections clearly larger than any gap inside one.
54
+ - **Imagery:** the project's own screenshots, product photos or footage first; real interface fragments of the product beat drawings of fake dashboards. Do not download images from the internet or invent photos of customers. If there is nothing, let type and colour carry the page rather than grey boxes or stock icons.
55
+ - **Proof is never invented.** No made-up customers, logos, quotes, ratings, user counts or benchmarks. If the task asks for a testimonial section and none are supplied, build it with plainly fictional sample content and list it in the report for replacement.
56
+ - **Motion:** one authored moment (a single entrance or one interactive demo) beats fade-ups on every section. Content must be visible if scripts fail. See `motion-design`.
57
+
58
+ ## Report
59
+
60
+ State the direction in two or three lines (palette, type, signature), what you rejected as generic, and any sample content or assets to be replaced.
61
+
62
+ Sources: adapted from Dammyjay93/interface-design (MIT, changed: "does that direction feel right?" and "offer to save" removed, the agent decides and reports), Leonxlnx/taste-skill (MIT, changed: no direction library, no image downloads) and pbakaus/impeccable mode-operate and craft-floor references (Apache-2.0, changed: rewritten, no direction service or user choice).