@softspark/ai-toolkit 4.30.3 → 4.32.0

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 (80) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +32 -25
  3. package/app/.claude-plugin/plugin.json +1 -1
  4. package/app/agents/code-reviewer.md +14 -0
  5. package/app/agents/frontend-specialist.md +27 -24
  6. package/app/agents/infrastructure-validator.md +2 -2
  7. package/app/claude-app/hooks/hooks.json +4 -2
  8. package/app/claude-app/skills/ai-toolkit-rules/SKILL.md +74 -17
  9. package/app/hooks/quality-gate.sh +9 -2
  10. package/app/hooks.json +4 -2
  11. package/app/personas/frontend-lead.md +20 -12
  12. package/app/rules/claude-toolkit-rules.md +4 -1
  13. package/app/rules/common/git-team.md +33 -0
  14. package/app/rules/common/git-workflow.md +6 -20
  15. package/app/rules/common/performance.md +25 -1
  16. package/app/rules/common/testing.md +7 -1
  17. package/app/rules/edit-discipline.md +37 -0
  18. package/app/skills/app-builder/SKILL.md +37 -6
  19. package/app/skills/claude-toolkit-rules/SKILL.md +37 -0
  20. package/app/skills/design-engineering/SKILL.md +87 -102
  21. package/app/skills/design-engineering/reference/animation-recipes.md +67 -0
  22. package/app/skills/design-engineering/reference/component-craft.md +28 -0
  23. package/app/skills/documentation-standards/SKILL.md +1 -1
  24. package/app/skills/edit-discipline/SKILL.md +50 -0
  25. package/app/skills/git-conventions/SKILL.md +18 -0
  26. package/app/skills/output-mode/SKILL.md +41 -0
  27. package/app/skills/quality-gates/SKILL.md +23 -0
  28. package/app/skills/review/SKILL.md +10 -0
  29. package/benchmarks/ecosystem-doctor-snapshot.json +17 -15
  30. package/bin/ai-toolkit.js +2 -0
  31. package/kb/procedures/{ecosystem-sync-sop.md → sop-ecosystem-sync.md} +2 -2
  32. package/kb/procedures/{maintenance-sop.md → sop-maintenance.md} +6 -3
  33. package/kb/procedures/{post-release-testing-sop.md → sop-post-release-testing.md} +3 -3
  34. package/kb/procedures/sop-pre-commit.md +96 -0
  35. package/kb/procedures/{release-preparation-sop.md → sop-release.md} +6 -6
  36. package/kb/reference/architecture-overview.md +1 -1
  37. package/kb/reference/cli-reference.md +3 -2
  38. package/kb/reference/copilot-compatibility.md +1 -1
  39. package/kb/reference/global-install-model.md +16 -3
  40. package/kb/reference/hooks-catalog.md +5 -3
  41. package/kb/reference/language-rules.md +28 -10
  42. package/kb/reference/licensing.md +2 -2
  43. package/kb/reference/quick-wins-implementation-summary.md +1 -1
  44. package/kb/reference/supported-tools-registry.md +2 -2
  45. package/kb/reference/unique-features.md +2 -1
  46. package/kb/troubleshooting/plugin-double-load.md +1 -1
  47. package/llms-full.txt +1016 -871
  48. package/llms.txt +6 -5
  49. package/manifest.json +2 -2
  50. package/package.json +6 -2
  51. package/scripts/benchmark_ecosystem.py +0 -1
  52. package/scripts/check_split.py +11 -9
  53. package/scripts/claude_app.py +5 -7
  54. package/scripts/codex_skill_adapter.py +4 -12
  55. package/scripts/compile_slm.py +10 -26
  56. package/scripts/doctor.py +322 -0
  57. package/scripts/evaluate_skills.py +1 -1
  58. package/scripts/frontmatter.py +452 -29
  59. package/scripts/generate_augment_rules.py +4 -4
  60. package/scripts/generate_cursor_mdc.py +2 -3
  61. package/scripts/generate_language_rules_skills.py +8 -14
  62. package/scripts/generate_llms_txt.py +1 -15
  63. package/scripts/generate_opencode_agents.py +0 -1
  64. package/scripts/generate_opencode_skills.py +2 -20
  65. package/scripts/generate_toolkit_rules_skills.py +189 -0
  66. package/scripts/generate_windsurf_rules.py +0 -1
  67. package/scripts/generator_base.py +0 -1
  68. package/scripts/inject_hook_cli.py +15 -2
  69. package/scripts/inject_mcp_cli.py +1 -2
  70. package/scripts/install.py +32 -1
  71. package/scripts/install_git_hooks.py +0 -1
  72. package/scripts/install_steps/ai_tools.py +65 -25
  73. package/scripts/install_steps/markers.py +6 -6
  74. package/scripts/install_steps/skill_scope.py +188 -0
  75. package/scripts/instruction_core.py +5 -8
  76. package/scripts/merge-hooks.py +13 -3
  77. package/scripts/pack_codebase.py +1 -1
  78. package/scripts/surface_manifest.py +6 -7
  79. package/scripts/validate.py +181 -12
  80. /package/kb/procedures/{release-verification-sop.md → sop-release-verification.md} +0 -0
@@ -0,0 +1,33 @@
1
+ ---
2
+ language: common
3
+ category: git-team
4
+ version: "1.0.0"
5
+ profiles:
6
+ - "strict"
7
+ ---
8
+
9
+ # Git Team Workflow Rules
10
+
11
+ These rules assume more than one person merges into `main`. They ship only with
12
+ the `strict` profile; a solo maintainer who commits straight to `main` is not
13
+ doing anything wrong, and a reviewer that keeps flagging "use a feature branch"
14
+ in that setting is noise. The solo-safe core (commit format, no secrets, no
15
+ force-push) lives in `git-workflow`.
16
+
17
+ ## Branching
18
+ - Protect `main` with required reviews and CI. Never commit broken code to it.
19
+ - Work on feature branches: `feat/user-registration`, `fix/order-total-calc`.
20
+ - Rebase feature branches on `main` before opening a PR to keep linear history.
21
+ - Squash fixup commits before merging to keep history clean.
22
+ - Delete branches after merge. Stale branches are clutter.
23
+
24
+ ## Pull Requests
25
+ - Keep PRs small: <400 lines changed. Split large features into stacked PRs.
26
+ - PR title follows conventional commit format.
27
+ - Include: summary, test plan, and screenshots/recordings for UI changes.
28
+ - Require at least one approval before merge.
29
+
30
+ ## Code Review
31
+ - Review for: correctness, security, performance, readability.
32
+ - Approve with comments if nits only. Block for: bugs, security, missing tests.
33
+ - Respond to reviews within 24 hours. Do not let PRs rot.
@@ -1,11 +1,15 @@
1
1
  ---
2
2
  language: common
3
3
  category: git-workflow
4
- version: "1.0.0"
4
+ version: "2.0.0"
5
5
  ---
6
6
 
7
7
  # Git Workflow Rules
8
8
 
9
+ Solo-safe core: everything here holds whether one person or twenty merge into
10
+ `main`. Branching, pull-request, and review conventions for teams live in
11
+ `git-team` and ship only with the `strict` profile.
12
+
9
13
  ## Commit Messages
10
14
  - Use conventional commits: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`.
11
15
  - First line: imperative mood, max 72 chars (`feat: add user registration endpoint`).
@@ -15,25 +19,7 @@ version: "1.0.0"
15
19
  ## Commit Practices
16
20
  - Commit small, atomic changes. One commit = one logical change.
17
21
  - Never commit: secrets, `.env` files, build artifacts, large binaries.
18
- - Never commit broken code to `main`. Use feature branches.
19
- - Squash fixup commits before merging to keep history clean.
20
-
21
- ## Branching
22
- - `main` is always deployable. Protect it with required reviews and CI.
23
- - Feature branches: `feat/user-registration`, `fix/order-total-calc`.
24
- - Delete branches after merge. Stale branches are clutter.
25
- - Rebase feature branches on main before PR to keep linear history.
26
-
27
- ## Pull Requests
28
- - Keep PRs small: <400 lines changed. Split large features into stacked PRs.
29
- - PR title follows conventional commit format.
30
- - Include: summary, test plan, and screenshots/recordings for UI changes.
31
- - Require at least one approval before merge.
32
-
33
- ## Code Review
34
- - Review for: correctness, security, performance, readability.
35
- - Approve with comments if nits only. Block for: bugs, security, missing tests.
36
- - Respond to reviews within 24 hours. Do not let PRs rot.
22
+ - `main` is always deployable: run the project's gates before every commit that lands there.
37
23
 
38
24
  ## Tags and Releases
39
25
  - Use semantic versioning: MAJOR.MINOR.PATCH.
@@ -1,7 +1,31 @@
1
1
  ---
2
2
  language: common
3
3
  category: performance
4
- version: "1.0.0"
4
+ version: "1.1.0"
5
+ paths:
6
+ - "**/*.py"
7
+ - "**/*.ts"
8
+ - "**/*.tsx"
9
+ - "**/*.js"
10
+ - "**/*.jsx"
11
+ - "**/*.mjs"
12
+ - "**/*.cjs"
13
+ - "**/*.go"
14
+ - "**/*.rs"
15
+ - "**/*.java"
16
+ - "**/*.kt"
17
+ - "**/*.kts"
18
+ - "**/*.swift"
19
+ - "**/*.dart"
20
+ - "**/*.cs"
21
+ - "**/*.php"
22
+ - "**/*.cpp"
23
+ - "**/*.cc"
24
+ - "**/*.cxx"
25
+ - "**/*.hpp"
26
+ - "**/*.h"
27
+ - "**/*.rb"
28
+ - "**/*.sql"
5
29
  ---
6
30
 
7
31
  # Universal Performance Rules
@@ -1,7 +1,13 @@
1
1
  ---
2
2
  language: common
3
3
  category: testing
4
- version: "1.0.0"
4
+ version: "1.1.0"
5
+ paths:
6
+ - "**/*.test.*"
7
+ - "**/*.spec.*"
8
+ - "**/test_*"
9
+ - "**/*_test.*"
10
+ - "**/tests/**"
5
11
  ---
6
12
 
7
13
  # Universal Testing Rules
@@ -0,0 +1,37 @@
1
+ # Edit Discipline & Reviewable Changes
2
+
3
+ ## Edit files with the editing tools, not the shell
4
+
5
+ Use the `edit` and `write` tools to change a file. Do not rewrite tracked files
6
+ through `bash` with `sed`, `awk`, `tee`, a heredoc, or `>` redirection.
7
+
8
+ This is not a style preference. A shell rewrite is opaque to the host: the
9
+ session records a command, not a change. An `edit` call records which file
10
+ changed and how, so the interface can render it, a reviewer can read it, and a
11
+ later turn can cite it. A `sed` line records none of that, and the only way to
12
+ find out what happened is to read the file again.
13
+
14
+ The shell remains correct for what it is for: running builds, tests, linters,
15
+ git, package managers, and generators that own their own output.
16
+
17
+ ## Show the change before calling the work done
18
+
19
+ Before reporting a file-changing task as finished, show what changed:
20
+
21
+ ```bash
22
+ git diff -- <paths> # tracked files
23
+ git status --short # what is new or removed
24
+ ```
25
+
26
+ Paste the diff into the reply, or state precisely why it is too large and
27
+ summarise it by file with the counts. A task that reports success without
28
+ showing the change asks the reader to take the result on trust, and the reader
29
+ is the one who has to decide whether to commit it.
30
+
31
+ For an untracked file, show the content you wrote, not a description of it.
32
+
33
+ ## Why both halves matter together
34
+
35
+ Editing through the tools makes a change *recordable*; showing the diff makes it
36
+ *reviewed*. Either alone leaves the person deciding whether to ship blind to
37
+ something they are accountable for.
@@ -125,17 +125,48 @@ project/
125
125
 
126
126
  ---
127
127
 
128
+ ## Design Context Gate & Pre-Flight Discipline (Web & UI Projects)
129
+
130
+ Before scaffolding UI pages, establish the design foundation to avoid generic "AI slop":
131
+
132
+ ### 1. Design Context Gate
133
+ Gather 3 essential dimensions (ask once, or infer with clear stated assumptions):
134
+ - **Audience**: Who will use this? What do they care about?
135
+ - **Use Case**: What is the single primary action the page drives? (Sign up, purchase, explore, read, configure?)
136
+ - **Tone**: Pick an explicit extreme — *editorial, brutalist, soft, utilitarian, luxury, playful, technical, austere* ("clean and modern" is not a tone).
137
+
138
+ ### 2. Pre-Flight Scan (Existing Projects)
139
+ Before generating new pages or components, scan:
140
+ - **`design.md`** (or `DESIGN.md`) — if present, it is the locked design system and overrides defaults.
141
+ - **Font Stack** — inspect package dependencies and CSS imports (preserve existing font pairings).
142
+ - **Palette Tokens** — read `:root` variables, Tailwind `@theme` definitions, and OKLCH color spaces.
143
+ - **Motion Stance** — detect installed motion libraries (`framer-motion`, `motion`, `gsap`) vs motion-cut projects.
144
+ - **Framework & Spacing Scale** — conform to existing grid and spacing scale (4-pt / 8-pt).
145
+
146
+ ### 3. Structural Variety & Macrostructures
147
+ Break the repetitive "Hero → 3 features → CTA → footer" template. Select a named whole-page macrostructure matched to the brief:
148
+ - **Bento Grid**: Modular irregular grid where visual rhythm comes from varying card sizes and asymmetric spans.
149
+ - **Long Document**: Literature-led, memo/journal prose format with inline section heads.
150
+ - **Marquee Hero**: The hero fills the viewport above the fold; content shifts below the fold into a list or dense grid.
151
+ - **Stat-Led**: A massive metric/number anchors the narrative; subsequent content qualifies the data.
152
+ - **Workbench**: Guided product tour with real screenshots in frames; focus on functional workflow over marketing copy.
153
+ - **Conversational FAQ**: Bold questions and honest accordion answers reading like an interview with the product.
154
+ - **Manifesto**: Large declaration typography; establishes core philosophy before presenting product.
155
+ - **Photographic / Quote-Led**: Led by primary imagery or borrowed credibility pull-quotes.
156
+
157
+ ---
158
+
128
159
  ## Agent Coordination
129
160
 
130
161
  ### New Project Flow
131
162
 
132
163
  ```
133
- 1. project-planner → Task breakdown
134
- 2. database-architect → Schema design
135
- 3. backend-specialist → API implementation
136
- 4. frontend-specialist → UI implementation
137
- 5. test-engineer → Test coverage
138
- 6. devops-implementer → Deployment
164
+ 1. project-planner → Task breakdown & tech selection
165
+ 2. database-architect → Schema design & migrations
166
+ 3. backend-specialist → API & business logic implementation
167
+ 4. frontend-specialist → UI implementation (anti-slop, 8 states)
168
+ 5. test-engineer → Unit, integration, and E2E test coverage
169
+ 6. devops-implementer → Deployment & CI/CD setup
139
170
  ```
140
171
 
141
172
  ### Feature Addition Flow
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: claude-toolkit-rules
3
+ description: "SoftSpark working agreement: never guess a home directory path, give at least three alternatives, and apply a devil's advocate critique to decisions. Triggers: toolkit, conventions, workflow, alternatives, review."
4
+ effort: low
5
+ user-invocable: false
6
+ allowed-tools: Read
7
+ ---
8
+
9
+ # Claude Toolkit Rules
10
+
11
+ This rule comes from `app/rules/claude-toolkit-rules.md` in ai-toolkit. It applies to
12
+ every task in this workspace, not only when it is loaded.
13
+
14
+ # Claude Toolkit
15
+
16
+ Shared AI development toolkit — lifecycle hooks, safety constitution, multi-platform support.
17
+
18
+ ## Skill Tiers
19
+
20
+ - **Tier 1** — single-agent: `/debug`, `/review`, `/refactor`, `/analyze`, `/docs`, `/plan`, `/explain`, `/tdd`, `/triage-issue`
21
+ - **Tier 1.5** — planning: `/write-a-prd` → `/prd-to-plan` → `/prd-to-issues`; design: `/design-an-interface`, `/architecture-audit`, `/refactor-plan`
22
+ - **Tier 2** — multi-agent: `/workflow <type>` (feature-development, backend-feature, frontend-feature, api-design, database-evolution, test-coverage, security-audit, debugging, incident-response, spike, codebase-onboarding, performance-optimization, infrastructure-change, application-deploy, proactive-troubleshooting)
23
+ - **Tier 3** — custom: `/orchestrate <desc>` (3–6 agents) | `/swarm <mode> <desc>` (map-reduce | consensus | relay)
24
+
25
+ ## Path Safety
26
+ - NEVER guess or hallucinate user home directory paths
27
+ - Use `~` or `$HOME` instead of a hardcoded `/Users` or `/home` prefix followed
28
+ by a user name. The literal prefix is deliberately not written out here: the
29
+ plugin export scans shipped files for exactly that pattern, so an example of
30
+ the mistake would be indistinguishable from the mistake.
31
+ - When an absolute path is needed, run `echo $HOME` first to get the correct value
32
+
33
+ ## User Preferences
34
+
35
+ - **Style:** Direct & efficient. No pleasantries. Measurable results.
36
+ - **Methodology:** Provide >=3 alternatives. Use Socratic questioning.
37
+ - **Review:** Apply "Devil's Advocate" critique to decisions.
@@ -16,15 +16,71 @@ Based on Emil Kowalski's design engineering philosophy — UI polish, component
16
16
  - **Invisible details create love.** Most UI refinements users never consciously register — but combined they produce something stunning.
17
17
  - **Beauty differentiates.** When functionality is table stakes, aesthetic excellence becomes genuine leverage.
18
18
 
19
- ## Anti-Slop Visual Checklist
19
+ ## Anti-Slop Visual & Structural Checklist
20
20
 
21
- Defaults that signal machine-generated UI. Each is a falsifiable thing to avoid:
21
+ Defaults that signal machine-generated UI ("AI slop"). Each is a falsifiable rule to uphold:
22
22
 
23
- - **Avoid** full-bleed saturated gradient backgrounds (purple-to-pink hero washes). A flat surface or a near-flat tonal shift reads as intentional; a loud gradient reads as a template.
24
- - **Avoid** emoji as load-bearing decoration emoji standing in for icons, bullet markers, or section badges. Use a real icon set or typographic hierarchy instead.
25
- - **Avoid** the rounded-card-with-left-accent-border cliche repeated across every block. If three sections share that exact treatment, vary the layout or drop the accent.
23
+ - **Avoid** full-bleed saturated gradient backgrounds (purple-to-pink/blue hero washes) and gradient headlines (`background-clip: text`). Use solid ink or warm neutral tinting.
24
+ - **Avoid** emoji as load-bearing decoration (emoji as icons, bullet markers, or section badges). Use a real icon set (Lucide/Phosphor/Heroicons) or typographic hierarchy.
25
+ - **Avoid** the 3-equal-column card grid with icon-above-heading tiles, nested cards-in-cards, or cards with thick coloured left-edge side stripes.
26
26
  - **Avoid** hand-drawn fake imagery in SVG (synthetic "photos", invented logos, faux screenshots). Use a real asset or an honest labeled placeholder.
27
- - **Avoid** the overused default font stack (Inter/Roboto on system-ui for everything with no scale or weight intent). Pick type with a reason and lift the actual stack from source when one exists.
27
+ - **Avoid** fake re-drawn UI chrome (mock browser bars with traffic-light dots, mock IDE title bars, faux phone frames). Let content stand cleanly or use real screenshots in a `<figure>`.
28
+ - **Avoid** default-attractor sameness (Hero → 3 features → CTA → footer). Pick intentional macrostructures and vary heading placement, column rhythm, and divider language.
29
+ - **Avoid** the overused default font stack (Inter/Roboto on system-ui with no pairing). Apply the **2+1 rule** (display + body + at most 1 outlier face in <=2 slots).
30
+ - **Avoid** italic headers: headings and display type are always roman (`font-style: normal`). Never use single-word italic emphasis inside a headline.
31
+
32
+ ## Pre-Emit Self-Critique (Six Axes)
33
+
34
+ Before marking any UI output complete, score it 1–5 on these six axes (score <3 on any axis triggers a revision pass):
35
+
36
+ | # | Axis | Assessment |
37
+ |---|---|---|
38
+ | **P** | **Philosophy** | Clear position and intent ("why"), not just arbitrary decoration |
39
+ | **H** | **Hierarchy** | Clear primary / secondary / tertiary weight distinguishable in 2 seconds |
40
+ | **E** | **Execution** | Exact rule weights, contrast ratios, focus rings, zero layout shifts |
41
+ | **S** | **Specificity** | Tailored specifically to this brief, not a generic interchangeable template |
42
+ | **R** | **Restraint** | Removed anything unearned (decorative bloat, redundant cards, excess padding) |
43
+ | **V** | **Variety** | Structurally distinct from previous layouts in the project (not just a color swap) |
44
+
45
+ ## The 8 Interactive States Discipline
46
+
47
+ Every interactive element (button, input, select, card, tab, switch) must explicitly handle all 8 states in code. Styling only default + hover is an immediate defect:
48
+
49
+ | State | Trigger | Required Treatment |
50
+ |---|---|---|
51
+ | **1. Default** | At rest | Clean base styling, defined token bindings |
52
+ | **2. Hover** | Pointer over (`@media (hover: hover)`) | Subtle background shift (4–6%) or 1px translate, no layout jump |
53
+ | **3. Focus** | Keyboard navigation | Visible `:focus-visible` ring (2px solid, 1–2px offset), instant appearance |
54
+ | **4. Active** | Pressed | Pressed-in feel: slight darken, `transform: translateY(1px)` or `scale(0.98)` |
55
+ | **5. Disabled** | Inactive (`disabled`, `aria-disabled`) | 3 channels: `opacity: 0.55`, `cursor: not-allowed`, muted token color |
56
+ | **6. Loading** | Async in-flight (`data-state="loading"`) | Inline spinner replacing icon/badge, label preserved, submit disabled |
57
+ | **7. Error** | Validation failure (`aria-invalid="true"`) | Distinct error token border/message, helper text replaced, error icon |
58
+ | **8. Success** | Operation completed (`data-state="success"`) | Quiet confirmation: subtle green/accent indicator or checkmark, auto-dismiss |
59
+
60
+ ## Input Fields & Zero Layout Shift
61
+
62
+ Input fields, textareas, and selects are where almost-right UIs break:
63
+
64
+ - **Constant border width (1px everywhere)**: Never change `border-width` between default, hover, focus, error, or disabled states. State changes go to `background-color`, `outline`, `box-shadow`, or `border-color`.
65
+ - **Reserved transparent outline**: Initialize with `outline: 2px solid transparent; outline-offset: 1px;` so activating `:focus-visible` never shifts layout or thrashes paint.
66
+ - **Matched component heights**: Input height MUST equal adjacent button height (base floor 44px for touch targets).
67
+ - **Reserved helper-text slot**: Allocate `min-height: 1lh` for helper/error text so appearing validation messages do not push downstream page content.
68
+
69
+ ## Responsive Non-Negotiables
70
+
71
+ Verify every layout at **320px, 375px, 414px, and 768px**:
72
+
73
+ - **No horizontal scroll**: Apply `overflow-x: clip` (never `hidden`) on **both** `html` and `body`.
74
+ - **Single-line clickable affordances**: Buttons, primary nav links, footer links, and CTAs must never wrap to two lines. Shorten label or reflow parent container.
75
+ - **Image grid tracks**: Always use `minmax(0, 1fr)` instead of bare `1fr` to prevent image intrinsic dimensions from blowing out the grid.
76
+ - **Header wrapping**: Display headers must include `overflow-wrap: anywhere; min-width: 0;`.
77
+
78
+ ## Locked Tokens Discipline
79
+
80
+ - All colors and typography must bind to declared tokens (`var(--color-accent)`, `var(--font-display)`).
81
+ - Never improvise inline hex / rgb / OKLCH values in components mid-build.
82
+ - Keep accent footprint under **~5%** of viewport area (accent is for focal emphasis, not surface fill).
83
+ - Tint neutral surfaces toward the primary anchor hue (minimum 0.005 chroma in OKLCH) — avoid flat `#000` / `#fff`.
28
84
 
29
85
  ## Minimum-Scale Floors
30
86
 
@@ -38,13 +94,13 @@ Accessibility-grounded hard thresholds. Going below these is a defect, not a sty
38
94
 
39
95
  Treat these as the lower bound, not the target. Captions and footnotes may approach the floor; primary content should sit comfortably above it.
40
96
 
41
- ## Context-First Discipline
97
+ ## Context-First & Pre-Flight Discipline
42
98
 
43
- High-fidelity work MUST be rooted in real context before any pixels are produced. This mirrors the toolkit's verify-don't-recall ethos:
99
+ High-fidelity work MUST be rooted in real context before any pixels are produced:
44
100
 
45
- - **Read the source first.** Inspect the codebase, design tokens, UI kit, and screenshots that already exist before generating anything.
46
- - **Lift exact values.** Copy real hex codes, the spacing scale, the font stack, and radii straight from source. Do NOT reconstruct token values from memory — recalled values drift.
47
- - **Mock from scratch only as a last resort.** Building a screen with no reference is the fallback when no codebase, kit, or screenshot exists, not the default.
101
+ - **Run Pre-Flight Scan**: Inspect existing `design.md`, package font stacks, palette tokens (`:root`, Tailwind `@theme`), motion libraries (`framer-motion`, `motion`, `gsap`), and spacing scale.
102
+ - **Preserve existing design systems**: Never overwrite established tokens or typography unless explicitly asked.
103
+ - **Lift exact values**: Copy real token variable names and spacing classes straight from source. Do NOT reconstruct token values from memory.
48
104
 
49
105
  ## Question-Budget Gate
50
106
 
@@ -158,66 +214,9 @@ Exception: modals keep centered origin (viewport-anchored, not trigger-anchored)
158
214
 
159
215
  Initial tooltip includes delay; subsequent hovers skip both delay and animation via `[data-instant]` attribute — perceived speed without defeating accidental activation prevention.
160
216
 
161
- ## Transform Mastery
162
-
163
- ### Percentage translations
164
-
165
- ```css
166
- /* Moves by own height — perfect for toasts, drawers */
167
- transform: translateY(100%);
168
- ```
169
-
170
- No hardcoded pixel values needed.
171
-
172
- ### Scale affects children
173
-
174
- Unlike `width`/`height`, `scale()` proportionally scales content, icons, and text. Intentional feature, not a bug.
175
-
176
- ### 3D transforms
177
-
178
- ```css
179
- .orbit {
180
- transform-style: preserve-3d;
181
- }
182
- ```
183
-
184
- Enables orbit animations and coin flips without JavaScript.
185
-
186
- ## Clip-path Animation
187
-
188
- `clip-path: inset(top right bottom left)` creates rectangular clipping regions:
189
-
190
- ### Tab color transitions
191
-
192
- Stack tab lists, clip the active copy, animate clip-path on change for seamless color shifting.
193
-
194
- ### Hold-to-delete
195
-
196
- ```css
197
- .delete-overlay {
198
- clip-path: inset(0 100% 0 0);
199
- transition: clip-path 200ms ease-out; /* fast snap-back on release */
200
- }
201
- .delete-button:active .delete-overlay {
202
- clip-path: inset(0 0 0 0);
203
- transition: clip-path 2s linear; /* slow fill while holding */
204
- }
205
- ```
206
-
207
- ### Image reveals
208
-
209
- ```css
210
- .reveal {
211
- clip-path: inset(0 0 100% 0); /* hidden */
212
- }
213
- .reveal.visible {
214
- clip-path: inset(0 0 0 0); /* revealed */
215
- }
216
- ```
217
-
218
- ### Comparison sliders
217
+ ## Advanced Animation Techniques
219
218
 
220
- Overlay images, clip top one by adjusting right inset based on drag position.
219
+ For advanced transform mastery, 3D orbits, and clip-path animation recipes (tabs, hold-to-delete, image reveals, sliders), see [reference/animation-recipes.md](reference/animation-recipes.md).
221
220
 
222
221
  ## Performance Rules
223
222
 
@@ -274,21 +273,7 @@ Touch triggers false hover positives — always gate hover animations.
274
273
 
275
274
  ## Building Loved Components
276
275
 
277
- Five principles (from Sonner, 13M+ weekly downloads):
278
-
279
- 1. **Developer experience first** — minimal setup friction, insert once, use globally
280
- 2. **Excellent defaults** — ship beautifully configured out-of-box
281
- 3. **Identity through naming** — a memorable name resonates
282
- 4. **Invisible edge cases** — pause timers when hidden, handle pointer capture during drag
283
- 5. **Transitions over keyframes** — rapid additions cause keyframe restart from zero; transitions retarget smoothly
284
-
285
- ### Cohesion
286
-
287
- Animation personality should match component identity. Playful components can bounce; professional dashboards stay crisp.
288
-
289
- ### Asymmetric timing
290
-
291
- Deliberate actions stay slow (2s linear for hold-to-delete), system responses snap fast (200ms ease-out for release).
276
+ For component craftsmanship principles (developer experience, defaults, edge cases, asymmetric timing), see [reference/component-craft.md](reference/component-craft.md).
292
277
 
293
278
  ## Review Checklist
294
279
 
@@ -326,26 +311,25 @@ Visual work ships through two passes, mirroring the toolkit's verification-befor
326
311
 
327
312
  - **MUST** specify exact properties in `transition` (`transition: transform 200ms ease-out`) — never `transition: all`
328
313
  - **MUST** use `ease-out` (or a custom curve) on UI appearances; `ease-in` delays feedback at the moment the user's attention peaks
329
- - **NEVER** animate `height`, `width`, `margin`, or `top/left` — animate `transform` and `opacity` only. Layout-triggering properties drop frames under load.
330
- - **NEVER** add motion for decorative reasons alone every animation must serve meaning (status change, spatial relationship, progress)
331
- - **CRITICAL**: exit is faster than enter. A 2s linear enter (hold-to-delete) needs a 200ms ease-out exit. Symmetrical durations feel sluggish.
332
- - **MANDATORY**: any animation longer than 300ms for UI feedback needs an explicit justification the user perceives >300ms as "laggy", not "smooth"
333
- - **MUST** lift exact values (hex, spacing, font stack, radii) from the real codebase, tokens, UI kit, or screenshots before high-fidelity work — never reconstruct token values from memory; mock from scratch only when no source exists
334
- - **MUST** keep slide body text at ~24px+, print at ~12pt+, and mobile touch targets at 44px+ these are accessibility floors, not preferences
335
- - **NEVER** ship the slop defaults — saturated full-bleed gradients, emoji as decoration, repeated rounded-card-with-accent-border, hand-drawn fake imagery in SVG, or the unconsidered default font stack
336
- - **NEVER** add filler (dummy stats, decorative sections, lorem) to fill space, and never fabricate assets an honest labeled placeholder beats an invented icon or fake image; ask for the real one
337
- - **MUST** match the existing UI's vocabulary (palette, states, motion, shadow/density, copy tone) when editing a live surface instead of imposing a new style
338
- - **MUST** ask about goals, audience, and which dimension to diverge on (UX vs. visuals vs. copy) before building an open-ended ask; skip questions only when context is rich and the ask is bounded
339
- - **CARVE-OUT**: a sanctioned design audit, accessibility-failure demonstration, or authorized red-team mockup may deliberately reproduce a slop pattern or sub-floor scale to illustrate the defect label it as such; the bans above target shipped UI, not sanctioned analysis
340
- - **SHOULD** produce 3+ atomic variations across distinct axes (layout, color, type, interaction), ordered basic → advanced, for any exploratory or open design ask
314
+ - **NEVER** animate `height`, `width`, `margin`, or `top/left` — animate `transform` and `opacity` only
315
+ - **CRITICAL**: exit is faster than enter. A 2s linear enter (hold-to-delete) needs a 200ms ease-out exit
316
+ - **MANDATORY**: any animation longer than 300ms for UI feedback needs an explicit justification
317
+ - **MUST** implement all 8 interactive states (default, hover, focus-visible, active, disabled, loading, error, success) for every interactive element
318
+ - **MUST** keep `border-width: 1px` constant across all input states (default/hover/focus/error/disabled) with a reserved transparent outline to guarantee zero layout shift
319
+ - **MUST** apply `overflow-x: clip` on both `html` and `body` to eliminate horizontal viewport scrolling on mobile (320px–768px)
320
+ - **MUST** ensure clickable affordance text (buttons, nav links, CTAs) remains single-line across all viewports
321
+ - **MUST** keep all display headings roman (`font-style: normal`) never use single-word italic emphasis inside headlines
322
+ - **MUST** adhere to the 2+1 typography rule (max 3 families, outlier face used in at most 2 slots)
323
+ - **MUST** lock all colors to named CSS variable tokens never improvise inline hex/rgb/OKLCH values mid-render
324
+ - **MUST** lift exact values (hex, spacing, font stack, radii) from real sourcenever reconstruct tokens from memory
325
+ - **MUST** keep mobile touch targets at 44px+ minimum floor
326
+ - **NEVER** ship slop defaults (purple/blue gradient hero washes, gradient text headlines, emoji as icons, cards-in-cards, side-stripe cards, centered-everything 100vh heroes)
327
+ - **NEVER** add filler (dummy stats, fake testimonials, invented logos, lorem) — use honest labeled placeholders
328
+ - **MUST** run pre-emit self-critique scoring (P/H/E/S/R/V) before completing UI implementation
341
329
 
342
330
  ## Gotchas
343
331
 
344
- - `transform: translateX(-50%)` on an element that will animate `opacity` triggers a paint on every frame because the browser cannot composite the layer. Add `will-change: transform, opacity` to hint the compositor — but only during the animation, not permanently (it consumes GPU memory).
345
- - Framer Motion's `x={100}` prop is a shortcut for `transform: translateX(100px)`, but under load it falls back to the main thread. Use the longhand `style={{ transform: "translateX(100px)" }}` for guaranteed compositor path.
346
- - `@media (prefers-reduced-motion: reduce)` is widely supported but often forgotten. Users with vestibular disorders or pointer-device sensitivity will notice; include a reduced-motion override for every non-trivial animation.
347
- - Chrome's Performance tab samples animations, but the sampling rate is 1kHz — sub-millisecond jank is invisible. For micro-animations, prefer `performance.mark` and `measure` with explicit timestamps.
348
- - CSS keyframe animations re-trigger on every class toggle. On rapidly-updating state (drag, hover), transitions are cheaper and smoother; keyframes are for one-shot entries/exits.
332
+ For compositor edge cases, Framer Motion GPU optimizations, and reduced-motion gotchas, see [reference/animation-recipes.md](reference/animation-recipes.md).
349
333
 
350
334
  ## When NOT to Load
351
335
 
@@ -354,3 +338,4 @@ Visual work ships through two passes, mirroring the toolkit's verification-befor
354
338
  - For **information architecture** and user flows — use `/ux-designer` agent
355
339
  - For generic CSS patterns without motion — this skill is motion-specific
356
340
  - For **brand voice** / content tone — use `/brand-voice`
341
+
@@ -0,0 +1,67 @@
1
+ # Animation Recipes & Advanced Techniques
2
+
3
+ Supplementary reference for `design-engineering` skill covering transform techniques, clip-path animations, and advanced interaction recipes.
4
+
5
+ ## Transform Mastery
6
+
7
+ ### Percentage Translations
8
+ ```css
9
+ /* Moves by own height — perfect for toasts, drawers */
10
+ transform: translateY(100%);
11
+ ```
12
+ No hardcoded pixel values needed.
13
+
14
+ ### Scale Affects Children
15
+ Unlike `width`/`height`, `scale()` proportionally scales content, icons, and text. Intentional feature, not a bug.
16
+
17
+ ### 3D Transforms
18
+ ```css
19
+ .orbit {
20
+ transform-style: preserve-3d;
21
+ }
22
+ ```
23
+ Enables orbit animations and coin flips without JavaScript.
24
+
25
+ ---
26
+
27
+ ## Clip-Path Animation
28
+
29
+ `clip-path: inset(top right bottom left)` creates rectangular clipping regions:
30
+
31
+ ### Tab Color Transitions
32
+ Stack tab lists, clip the active copy, animate clip-path on change for seamless color shifting.
33
+
34
+ ### Hold-to-Delete
35
+ ```css
36
+ .delete-overlay {
37
+ clip-path: inset(0 100% 0 0);
38
+ transition: clip-path 200ms ease-out; /* fast snap-back on release */
39
+ }
40
+ .delete-button:active .delete-overlay {
41
+ clip-path: inset(0 0 0 0);
42
+ transition: clip-path 2s linear; /* slow fill while holding */
43
+ }
44
+ ```
45
+
46
+ ### Image Reveals
47
+ ```css
48
+ .reveal {
49
+ clip-path: inset(0 0 100% 0); /* hidden */
50
+ }
51
+ .reveal.visible {
52
+ clip-path: inset(0 0 0 0); /* revealed */
53
+ }
54
+ ```
55
+
56
+ ### Comparison Sliders
57
+ Overlay images, clip top one by adjusting right inset based on drag position.
58
+
59
+ ---
60
+
61
+ ## Gotchas & Performance Edge Cases
62
+
63
+ - `transform: translateX(-50%)` on an element that will animate `opacity` triggers a paint on every frame because the browser cannot composite the layer. Add `will-change: transform, opacity` during animation only.
64
+ - Framer Motion's `x={100}` prop falls back to the main thread under load. Use `style={{ transform: "translateX(100px)" }}` for guaranteed GPU compositor path.
65
+ - `@media (prefers-reduced-motion: reduce)` is widely supported but often forgotten; include reduced-motion overrides for every non-trivial animation.
66
+ - Chrome's Performance tab samples animations at 1kHz — sub-millisecond jank is invisible. Prefer `performance.mark` and `measure` with explicit timestamps.
67
+ - CSS keyframe animations re-trigger on every class toggle; transitions are cheaper and smoother on rapidly-updating state (drag, hover).
@@ -0,0 +1,28 @@
1
+ # Component Craft & Design Principles
2
+
3
+ Supplementary reference for `design-engineering` skill covering principles for loved UI components and microinteraction cohesion.
4
+
5
+ ## Building Loved Components
6
+
7
+ Five core principles (inspired by Sonner):
8
+
9
+ 1. **Developer experience first** — minimal setup friction, insert once, use globally
10
+ 2. **Excellent defaults** — ship beautifully configured out-of-box
11
+ 3. **Identity through naming** — a memorable name resonates
12
+ 4. **Invisible edge cases** — pause timers when hidden, handle pointer capture during drag
13
+ 5. **Transitions over keyframes** — rapid additions cause keyframe restart from zero; transitions retarget smoothly
14
+
15
+ ---
16
+
17
+ ## Personality & Cohesion
18
+
19
+ Animation personality should match component identity:
20
+ - **Playful components**: Can use slightly softer curves or playful timing.
21
+ - **Professional tools & dashboards**: Stay crisp, deterministic, and fast (150–200ms).
22
+
23
+ ---
24
+
25
+ ## Asymmetric Timing
26
+
27
+ - **Deliberate user actions**: Stay controlled/slow (e.g., 2s linear for hold-to-delete).
28
+ - **System feedback / release**: Snaps fast (e.g., 200ms ease-out).
@@ -47,7 +47,7 @@ and never authoritative on its own.
47
47
  |----------|-----------|---------|----------|
48
48
  | `reference` | `kb/reference/` | Technical specifications, catalogs, architecture notes, API docs | `agents-catalog.md`, `architecture-overview.md` |
49
49
  | `howto` | `kb/howto/` | Step-by-step task guides | `use-corrective-rag.md`, `configure-mcp-server.md` |
50
- | `procedures` | `kb/procedures/` | SOPs a person follows: release, migration, review | `maintenance-sop.md`, `sop-release.md` |
50
+ | `procedures` | `kb/procedures/` | SOPs a person follows: release, migration, review | `sop-maintenance.md`, `sop-release.md` |
51
51
  | `troubleshooting` | `kb/troubleshooting/` | Problem resolution, debugging guides | `database-connection-issues.md` |
52
52
  | `best-practices` | `kb/best-practices/` | Guidelines, recommendations, standards | `security-checklist.md` |
53
53
  | `decisions` | `kb/decisions/` | Architecture decision records and design rationale | `adr-004-kb-migration.md` |