@etus/seven-skill 0.1.0-beta.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 (42) hide show
  1. package/.claude/skills/seven/SKILL.md +162 -0
  2. package/.claude/skills/seven/reference/audit.md +120 -0
  3. package/.claude/skills/seven/reference/brand.md +24 -0
  4. package/.claude/skills/seven/reference/clarify.md +76 -0
  5. package/.claude/skills/seven/reference/color-and-contrast.md +84 -0
  6. package/.claude/skills/seven/reference/motion-design.md +71 -0
  7. package/.claude/skills/seven/reference/polish.md +55 -0
  8. package/.claude/skills/seven/reference/product.md +45 -0
  9. package/.claude/skills/seven/reference/shape.md +85 -0
  10. package/.claude/skills/seven/reference/spatial-design.md +60 -0
  11. package/.claude/skills/seven/reference/typography.md +43 -0
  12. package/.claude/skills/seven/reference/ux-writing.md +47 -0
  13. package/.claude/skills/seven/scripts/load-context.mjs +84 -0
  14. package/.claude-plugin/marketplace.json +34 -0
  15. package/.claude-plugin/plugin.json +12 -0
  16. package/LICENSE +190 -0
  17. package/NOTICE.md +26 -0
  18. package/README.md +118 -0
  19. package/cli/bin/commands/skills.mjs +664 -0
  20. package/cli/bin/seven.mjs +68 -0
  21. package/cli/engine/browser/injected/index.mjs +84 -0
  22. package/cli/engine/cli/main.mjs +215 -0
  23. package/cli/engine/detect-antipatterns-browser.js +3014 -0
  24. package/cli/engine/detect-antipatterns.mjs +44 -0
  25. package/cli/engine/engines/browser/detect-url.mjs +108 -0
  26. package/cli/engine/engines/regex/detect-text.mjs +508 -0
  27. package/cli/engine/engines/static-html/css-cascade.mjs +957 -0
  28. package/cli/engine/engines/static-html/detect-html.mjs +211 -0
  29. package/cli/engine/engines/visual/screenshot-contrast.mjs +192 -0
  30. package/cli/engine/findings.mjs +28 -0
  31. package/cli/engine/node/file-system.mjs +212 -0
  32. package/cli/engine/profile/profiler.mjs +169 -0
  33. package/cli/engine/registry/seven-antipatterns.mjs +494 -0
  34. package/cli/engine/rules/checks.mjs +1518 -0
  35. package/cli/engine/shared/color.mjs +204 -0
  36. package/cli/engine/shared/constants.mjs +91 -0
  37. package/cli/engine/shared/page.mjs +9 -0
  38. package/cli/engine/shared/tokens.mjs +153 -0
  39. package/cli/engine/token-data.generated.mjs +691 -0
  40. package/docs/detector-rules.md +605 -0
  41. package/docs/figma-token-rule-exploration.md +185 -0
  42. package/package.json +76 -0
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: seven
3
+ description: Use when generating or auditing UI for the Seven Design System — ETUS Digital's React 19 + Tailwind v4 + @etus/tokens system. Covers component generation, variant selection, token consumption, typography (Inter only), color (OKLCH mint and lime brand, fuchsia chart-only), spatial design (two radius scales), motion (200ms tactile press), accessibility (WCAG 2.1 AA), pt-BR voice (sentence case, no trailing periods, imperative leads), and anti-pattern audits. Routes sub-commands shape, audit, polish, clarify. Not for backend or non-UI tasks.
4
+ version: 0.1.0-beta.1
5
+ argument-hint: "[command] [target]"
6
+ user-invocable: true
7
+ allowed-tools:
8
+ - Bash(npx seven *)
9
+ license: Apache-2.0
10
+ ---
11
+
12
+ Designs and ships production interfaces with the Seven Design System. Seven is what ETUS Digital uses internally; this skill makes the AI fluent in its tokens, components, voice, and refusals.
13
+
14
+ ## Setup
15
+
16
+ Before any design work or file edits:
17
+
18
+ 1. Load context (`PRODUCT.md`, `DESIGN.md`) at the project root via the loader script.
19
+ 2. Identify the register and apply the matching register reference: [reference/product.md](reference/product.md) (default) or [reference/brand.md](reference/brand.md).
20
+ 3. **If the user invoked a sub-command (`shape`, `audit`, `polish`, `clarify`), load its reference file too.** Non-negotiable. Audit without `audit.md` loaded means you skip the five-dimension scan the user expects.
21
+
22
+ Skipping these produces generic output that ignores Seven.
23
+
24
+ ### 1. Context gathering
25
+
26
+ Two files, case-insensitive, looked up at the project root by default. Override with `SEVEN_CONTEXT_DIR=path/to/dir`.
27
+
28
+ - **`PRODUCT.md`**: required. Register, users, brand personality, anti-references, design principles.
29
+ - **`DESIGN.md`**: optional but strongly recommended. Colors, typography, layout, elevation, shape, components.
30
+
31
+ Load both in one call:
32
+
33
+ ```bash
34
+ node .claude/skills/seven/scripts/load-context.mjs
35
+ ```
36
+
37
+ Consume the full JSON output. Do not pipe through `head`, `tail`, `grep`, or `jq`.
38
+
39
+ If `PRODUCT.md` is missing, empty, or placeholder ([TODO] markers, under 200 chars), surface the gap to the user and use the AskUserQuestion tool before continuing. Seven's product register is the difference between Seven-on-brand output and generic shadcn.
40
+
41
+ If `DESIGN.md` is missing, nudge once per session and proceed — `packages/tokens/dist/tokens.css` carries the numeric truth.
42
+
43
+ ### 2. Register
44
+
45
+ Every design task belongs to one of two registers:
46
+
47
+ - **`product`** (default for Seven): app UI, admin, dashboards, settings, internal tools. Earned familiarity is the bar. Surfaces look like Linear, Figma, Notion, Raycast in their best moments, never like generic shadcn defaults.
48
+ - **`brand`**: marketing pages, campaign surfaces, long-form content. Distinctiveness is the bar. Phase 2 brand layer fleshes this out per ETUS sub-brand.
49
+
50
+ First match wins: (1) cue in the task ("dashboard" vs "landing page"), (2) surface in focus, (3) `Register` field in `PRODUCT.md`.
51
+
52
+ Load the matching reference. Shared design laws below apply to both.
53
+
54
+ ## Source-of-truth ladder
55
+
56
+ When values disagree, walk the ladder top to bottom:
57
+
58
+ ```
59
+ Figma (Core Components, Seven file) > packages/tokens/dist/tokens.css > DESIGN.md > docs/cd/Seven Design System > any other doc
60
+ ```
61
+
62
+ For numeric values (sizes, radii, colors), Figma via the Figma MCP is the source. The HTML extraction skill at `docs/cd/Seven Design System/` can drift; trust Figma, not the extraction.
63
+
64
+ ## Shared design laws
65
+
66
+ Apply to every Seven task, both registers. Claude is capable of decisive design choices. Pick a direction, name the tradeoff, ship the variant. No hedging.
67
+
68
+ ### Color
69
+
70
+ - OKLCH only. Read tokens from `@etus/tokens`, never invent.
71
+ - Mint (`var(--brand-primary-500)`) and lime (`var(--brand-secondary-500)`) are the only brand colors. Fuchsia is reserved for charts, never UI chrome.
72
+ - Pure `#000` and `#fff` are banned. Use the tinted neutrals from the OKLCH ramp.
73
+ - Tailwind v4 arbitrary values referencing color tokens require the `color:` hint:
74
+ ```tsx
75
+ bg-[color:var(--primary)] // CORRECT
76
+ bg-[var(--primary)] // WRONG — Lightning CSS drops it silently
77
+ ```
78
+ See [reference/color-and-contrast.md](reference/color-and-contrast.md) for the full type-hint rule set.
79
+
80
+ ### Typography
81
+
82
+ - Inter is the only sans face — UI, body, headings, display.
83
+ - JetBrains Mono is the only mono face.
84
+ - Space Grotesk and Geist appear in legacy Figma exploration. They never shipped. Substitute Inter at the same size and flag the swap.
85
+ - Sentence case across every chrome surface. Acronyms (KPI, OTP, OIDC) stay uppercase.
86
+ - No trailing periods on buttons, labels, or captions.
87
+
88
+ See [reference/typography.md](reference/typography.md) for the full rule set.
89
+
90
+ ### Shape and elevation
91
+
92
+ - Two radius scales, never mixed: component (`sm 4 / md 8 / lg 12`) for buttons, inputs, badges; surface (`xl 16 / 2xl 20 / 3xl 24 / 4xl 32`) for cards, dialogs, sheets.
93
+ - Pill radius (`9999`) for badges, tags, avatar triggers, and status indicators only. Never on buttons.
94
+ - Borders carry hierarchy. Shadows are reserved for overlays.
95
+
96
+ See [reference/spatial-design.md](reference/spatial-design.md).
97
+
98
+ ### Motion
99
+
100
+ - Default duration 200 ms (`var(--duration-normal)`), easing `var(--ease-default)`.
101
+ - No bounce, no spring, no elastic in chrome.
102
+ - The tactile micro-press is system-wide: every clickable affordance gets `hover:translate-y-px` plus `active:translate-y-0.5` plus an inset shadow, not just `<Button>`.
103
+
104
+ See [reference/motion-design.md](reference/motion-design.md).
105
+
106
+ ### Voice and locale
107
+
108
+ - Pt-BR for product chrome. Imperative leads (`Procurar`, `Exportar`, `Adicionar conta`).
109
+ - No European Portuguese vocabulary in pt-BR surfaces.
110
+ - English for code identifiers, file names, architecture notes, and developer-facing docs.
111
+
112
+ See [reference/ux-writing.md](reference/ux-writing.md).
113
+
114
+ ### Iconography
115
+
116
+ - Lucide only. 2 px stroke, round caps, `currentColor`.
117
+ - No emoji in chrome. No Unicode dingbats.
118
+ - If a glyph is missing in Lucide, draw a custom SVG matching the 2 px stroke and round-caps spec.
119
+
120
+ ## Component generation checklist
121
+
122
+ Before writing or editing a Seven component:
123
+
124
+ 1. **Does it exist in `@etus/ui`?** Import it. Do not reimplement.
125
+ 2. **Does the variant exist?** Check the component's `*.variants.ts` (CVA). If the variant you need is not there, stop. Seven follows the rule: no variants in code that do not exist in Figma. Surface the gap to the user instead of inventing.
126
+ 3. **Do the tokens exist?** Read `packages/tokens/dist/tokens.css` and use the CSS variable directly. Do not invent tokens.
127
+ 4. **Type hints on arbitrary values.** `[color:var(--...)]` for color, `[length:var(--...)]` for font-size and line-height. No `hsl(var(--...))`.
128
+ 5. **Tactile press plus 4 px focus ring** on every clickable affordance.
129
+ 6. **Sentence case, pt-BR copy, no trailing periods.**
130
+
131
+ ## When the user asks for something off-system
132
+
133
+ Surface the conflict. Do not silently comply.
134
+
135
+ - "Make the button purple" — "Seven brand is mint and lime. Fuchsia exists but is chart-only. I can use `var(--brand-secondary)` (lime), or flag this as a deliberate one-off and document it."
136
+ - "Use Space Grotesk for the H1" — "Inter is the only sans face in Seven. Space Grotesk in the Figma library is legacy exploration. I will use Inter at the same size; flag if you wanted a one-off override."
137
+ - "Add a hover bounce" — "Seven motion is `var(--ease-default)` (decelerated, no bounce). The 200 ms hover is the standard. Surface this as a deliberate exception?"
138
+
139
+ ## Commands
140
+
141
+ | Command | Category | Reference | Description |
142
+ | --------------------------------- | -------- | -------------------------------------------- | --------------------------------------------------------------------------------------- |
143
+ | `/seven shape` | Plan | [reference/shape.md](reference/shape.md) | Plan UX shape before code. Resolve scope, register, and variants up front. |
144
+ | `/seven audit` | Verify | [reference/audit.md](reference/audit.md) | Five-dimension scan: a11y, performance, theming, responsive, anti-patterns. |
145
+ | `/seven polish` | Refine | [reference/polish.md](reference/polish.md) | Final pass. Align drift to Seven tokens and conventions; name root cause. |
146
+ | `/seven clarify` | UX copy | [reference/clarify.md](reference/clarify.md) | UX copy in pt-BR: imperative leads, sentence case, no trailing periods, plain language. |
147
+
148
+ Phase 2 adds `craft`, `harden`, `layout`, `typeset`.
149
+
150
+ ## Related skills
151
+
152
+ - **`frontend-dev-guidelines`** — React 19, Tailwind v4, TanStack patterns. Seven is the _what_; `frontend-dev-guidelines` is the _how to build it_.
153
+ - **`figma-sync`** — pulls Figma changes into `packages/tokens` and `packages/ui`. Use it when you need to know what changed in Figma, not what Seven looks like.
154
+ - **`component-audit`** — auditing existing components against Figma parity, with the canonical Button.md template as the gold standard.
155
+
156
+ ## See also
157
+
158
+ - `PRODUCT.md` at repo root for register, users, anti-references.
159
+ - `DESIGN.md` at repo root for the Google Labs visual identity spec.
160
+ - `packages/tokens/dist/tokens.css` for the runtime CSS variables.
161
+ - `packages/ui/src/components/` for component source.
162
+
@@ -0,0 +1,120 @@
1
+ # Audit
2
+
3
+ Run systematic technical quality checks on a Seven surface or component and generate a report. The audit documents issues; it does not fix them. Hand findings to `polish` or to direct implementation.
4
+
5
+ ## Scope
6
+
7
+ Code-level audit, not design critique. Check what is measurable and verifiable against `@etus/ui`, `@etus/tokens`, and Seven's documented rules.
8
+
9
+ ## Five-dimension diagnostic scan
10
+
11
+ Score each dimension 0-4 using the criteria below. The detector ships rule IDs you can cite directly.
12
+
13
+ ### 1. Accessibility (a11y)
14
+
15
+ Check for:
16
+
17
+ - Text contrast ratios below 4.5:1 (or 3:1 for large text). Verify against the OKLCH math from `@etus/tokens`, not eyeballed.
18
+ - Missing ARIA roles, labels, or states on interactive elements built from non-semantic primitives.
19
+ - Keyboard traps, missing focus indicators, illogical tab order.
20
+ - Improper heading hierarchy, missing landmarks, `<div onClick>` instead of `<button>`.
21
+ - Image and icon-only buttons without accessible names.
22
+ - Forms with inputs missing labels, error messages missing `aria-describedby`, required state not announced.
23
+ - `prefers-reduced-motion` not honored.
24
+
25
+ Scoring: 0 = fails WCAG A, 1 = major gaps, 2 = partial, 3 = WCAG AA mostly met, 4 = AA fully met and approaching AAA.
26
+
27
+ ### 2. Performance
28
+
29
+ Check for:
30
+
31
+ - Layout thrashing in loops.
32
+ - Animation on CSS layout properties (`width`, `height`, `top`, `left`). Transform and opacity only.
33
+ - Unbounded blur, filter, shadow effects that visibly drop frames.
34
+ - Images without `loading="lazy"`, unoptimized assets, missing dimensions.
35
+ - Unnecessary re-renders, missing `useMemo` or `React.memo` where measurement shows benefit (do not memoize speculatively).
36
+ - Heavy imports pulled in eagerly when a dynamic import would do.
37
+
38
+ Scoring: 0 = severe issues, 1 = major problems, 2 = partial optimization, 3 = mostly optimized, 4 = lean and fast.
39
+
40
+ ### 3. Theming
41
+
42
+ Check for:
43
+
44
+ - Hardcoded color literals in runtime code. Hex inside `packages/tokens/sources/` is fine; anywhere else is drift. Detector rule: `hardcoded-color-not-token`.
45
+ - Pure `#000` and `#fff`. Detector rule: `pure-black-or-white`.
46
+ - Tailwind v4 arbitrary values referencing color tokens without the `color:` hint. Detector rule: `missing-color-type-hint`.
47
+ - Font-size or line-height arbitrary values without `length:`. Detector rule: `missing-length-type-hint`.
48
+ - `leading-none` combined with `text-[length:var(--*)]`. Detector rule: `leading-none-with-length-var`.
49
+ - Wrong token used: `var(--background)` where `var(--muted)` would have read better; mixing token families.
50
+ - Dark mode visually broken: tokens that look fine in light fail at AAA contrast in dark, or vice versa.
51
+
52
+ Scoring: 0 = no token usage, 1 = minimal tokens, 2 = partial token coverage with gaps, 3 = good token usage with minor literals, 4 = full token system with verified dark mode.
53
+
54
+ ### 4. Responsive design
55
+
56
+ Check for:
57
+
58
+ - Fixed widths that break on narrow viewports.
59
+ - Touch targets below 44 x 44.
60
+ - Horizontal scroll on mobile.
61
+ - Text scaling: layout breaks when the user bumps base font size.
62
+ - Missing or wrong-direction breakpoints (mobile-first vs desktop-first inconsistency in the same component).
63
+
64
+ Scoring: 0 = desktop-only, 1 = major issues, 2 = partial, 3 = good with minor issues, 4 = fluid across viewports.
65
+
66
+ ### 5. Anti-patterns
67
+
68
+ Run the deterministic detector against the surface or component:
69
+
70
+ ```bash
71
+ npx seven detect <path>
72
+ ```
73
+
74
+ Then check the report against the Seven rule set:
75
+
76
+ | Detector rule ID | Catches |
77
+ | ------------------------------ | ----------------------------------------------------------------------- |
78
+ | `non-inter-font` | Font family other than Inter or JetBrains Mono in consumer code |
79
+ | `hardcoded-color-not-token` | Hex, rgb, hsl, OKLCH literal where a token exists |
80
+ | `missing-color-type-hint` | Tailwind v4 arbitrary color value missing the `color:` hint |
81
+ | `missing-length-type-hint` | Tailwind v4 arbitrary length value missing the `length:` hint |
82
+ | `leading-none-with-length-var` | `leading-none` combined with `text-[length:var(--*)]` |
83
+ | `fuchsia-in-ui-chrome` | Fuchsia color on UI chrome (allowed on `data-role="chart"` and `<svg>`) |
84
+ | `pt-pt-vocab` | European Portuguese vocabulary in pt-BR surfaces |
85
+ | `pure-black-or-white` | `#000`, `#fff`, `rgb(0,0,0)`, `rgb(255,255,255)` in consumer code |
86
+
87
+ Deep detector rules also include `missing-tactile-press`, `radius-mixed-scales`, `pill-on-button`, `forbidden-em-dash`, `gradient-text-decorative`, `side-stripe-border`, `non-lucide-icon`, and `emoji-in-chrome`.
88
+
89
+ Scoring: 0 = five or more findings, 1 = three or four findings, 2 = one or two findings, 3 = clean detector pass, 4 = clean detector pass plus no additional manual issues evident in review.
90
+
91
+ ## Report shape
92
+
93
+ For each dimension, write:
94
+
95
+ ```
96
+ ### <Dimension> — <score>/4
97
+
98
+ **Findings**
99
+ - <Finding 1 with file:line reference and detector rule ID when available>
100
+ - <Finding 2>
101
+
102
+ **Suggested fixes**
103
+ - <Concrete next step keyed to the finding>
104
+ ```
105
+
106
+ End with:
107
+
108
+ ```
109
+ ### Overall — <average>/4
110
+
111
+ Top 3 actions:
112
+ 1. ...
113
+ 2. ...
114
+ 3. ...
115
+ ```
116
+
117
+ ## Refusals
118
+
119
+ - "Just fix the issues you find" — Audit documents, polish fixes. Surface this boundary and offer to invoke `polish` after the audit closes.
120
+ - "Skip the anti-patterns dimension, it always fires" — If anti-patterns always fire on a surface, the surface needs polish, not a softer audit. Run the dimension; record the findings.
@@ -0,0 +1,24 @@
1
+ # Brand register (Phase 2 stub)
2
+
3
+ Loaded when the surface is `brand`: marketing pages, campaign surfaces, long-form content, public-facing landing pages.
4
+
5
+ ## Phase 1 status
6
+
7
+ Phase 1 of Seven ships with the brand register as a stub. The Seven Design System itself is a product register: app UI, admin, dashboards, internal tools. Brand surfaces in Phase 1 fall back to the shared design laws in `SKILL.md` and the domain references (`typography`, `color-and-contrast`, `spatial-design`, `motion-design`, `ux-writing`).
8
+
9
+ If the user explicitly requests brand work and `BRAND.md` selects a brand name other than `etus`, Phase 2 will load the matching `reference/brands/<name>.md` here. Phase 2 also adds dedicated brand-register design laws (color strategy, visual direction probes, type display, scene-sentence for theme).
10
+
11
+ ## Bar (Phase 2 target)
12
+
13
+ Distinctiveness. A brand surface should be recognizably ETUS at a glance, not "a SaaS landing page".
14
+
15
+ ## Defaults expected in Phase 2
16
+
17
+ - Wider type display lane (Inter Display weights, optical sizes).
18
+ - Maximalist color strategy options (`Committed`, `Full palette`, `Drenched`) instead of the product default `Restrained`.
19
+ - Editorial spacing rhythm (varied, intentional, breathing room).
20
+ - Section-level scene sentences forcing dark vs light per surface, not per project.
21
+
22
+ ## Until Phase 2
23
+
24
+ Apply the shared design laws and the domain references. Surface to the user that brand-register depth lands in Phase 2 of the port; do not invent Phase 2 features in Phase 1 brand work.
@@ -0,0 +1,76 @@
1
+ # Clarify
2
+
3
+ Improve UX copy in Seven surfaces. Brazilian Portuguese, sentence case, no trailing periods, imperative leads, plain language. The voice is direct, decisive, brazilian.
4
+
5
+ ## Scope
6
+
7
+ Clarify rewrites chrome copy: button text, labels, empty states, validation errors, toast messages, menu items, navigation, table column headers, breadcrumbs, tabs, badges, tooltips, dialog titles and descriptions.
8
+
9
+ Clarify does not rewrite body prose, long-form content, or marketing copy. Those belong to the brand register (Phase 2).
10
+
11
+ ## Rewrite rules
12
+
13
+ ### Voice
14
+
15
+ - Direct. The label says what the action does. `Adicionar conta`, not `Clique aqui para adicionar uma nova conta`.
16
+ - Decisive. No `talvez`, `poderia`, `seria possível`. If the system suggests an action, it commits.
17
+ - Concrete. Specific over abstract. `Salvo às 14:32` beats `Alterações salvas com sucesso`.
18
+
19
+ ### Case
20
+
21
+ Sentence case across every chrome surface. Capitalize only the first word and proper nouns. Acronyms (KPI, OTP, OAuth, SSO) stay uppercase.
22
+
23
+ ### Punctuation
24
+
25
+ - No trailing periods on chrome labels (buttons, menu items, breadcrumbs, table headers, badges, tabs, captions).
26
+ - Periods stay in body prose inside paragraphs.
27
+ - No em-dashes in prose voice. Use periods, commas, or restructure the sentence.
28
+
29
+ ### Language
30
+
31
+ - Pt-BR for chrome. No pt-PT vocabulary (`ficheiro`, `telemóvel`, `ecrã`, `tu` as pronoun).
32
+ - English only for code identifiers, file paths, API names, and developer-facing technical docs.
33
+
34
+ ## Pattern library
35
+
36
+ | Surface | Before (drift) | After (Seven) |
37
+ | ------------------- | --------------------------------------- | -------------------------------------------------- |
38
+ | Primary button | `Clique aqui para salvar.` | `Salvar` |
39
+ | Primary button | `Adicionar nova conta` | `Adicionar conta` |
40
+ | Destructive button | `Por favor, excluir esta conta` | `Excluir conta` |
41
+ | Cancel button | `Cancelar operação` | `Cancelar` |
42
+ | Toast (success) | `Alterações salvas com sucesso!` | `Conta atualizada` |
43
+ | Toast (error) | `Algo deu errado` | `Não foi possível salvar. Tente novamente.` |
44
+ | Empty state | `Nenhum dado disponível no momento` | `Nenhuma conta. Adicione a primeira para começar.` |
45
+ | Placeholder | `Digite o seu email aqui` | `nome@email.com` |
46
+ | Validation error | `O campo email é um campo obrigatório.` | `Email obrigatório` |
47
+ | Menu item | `Editar este item.` | `Editar` |
48
+ | Table column header | `Nome do usuário.` | `Nome` |
49
+ | Tab | `Configurações gerais` | `Geral` |
50
+ | Badge (status) | `Ativo no momento` | `Ativo` |
51
+ | Breadcrumb | `Página inicial > Contas` | `Início › Contas` |
52
+
53
+ ## Numbers, dates, currency
54
+
55
+ - Numbers: `1.234,56` (Brazilian convention).
56
+ - Dates: `dd/mm/yyyy` in chrome (`12/03/2026`). ISO `2026-03-12` in data tables and logs.
57
+ - Currency: `R$ 1.234,56` with non-breaking space.
58
+ - Relative time for recent events: `há 2 minutos`, `há 1 hora`. Absolute date past 24 hours.
59
+
60
+ ## Workflow
61
+
62
+ 1. List the chrome surfaces in scope (buttons, labels, empty states, errors, toasts).
63
+ 2. For each surface, apply the pattern library. Surface anything that does not fit the pattern.
64
+ 3. Verify the rewrites against the detector's `pt-pt-vocab` rule:
65
+
66
+ ```bash
67
+ npx seven detect <path>
68
+ ```
69
+
70
+ 4. Write the rewrites as a diff or table; do not commit until the user confirms.
71
+
72
+ ## Refusals
73
+
74
+ - "Add 'por favor' to every button to be polite" — Seven voice is direct. Politeness reads as hedging. Buttons are imperatives. Decline politely and explain.
75
+ - "Use English buttons because the team is bilingual" — Pt-BR is the default for chrome. Surface this as a register-layer decision; do not silently switch languages.
76
+ - "Add an em-dash for emphasis in the empty state" — No em-dashes in Seven prose. Restructure the sentence.
@@ -0,0 +1,84 @@
1
+ # Color and contrast
2
+
3
+ Seven's color truth lives in `packages/tokens/dist/tokens.css`. Every runtime value is a CSS custom property derived from OKLCH math, never a hex literal.
4
+
5
+ ## Brand colors
6
+
7
+ - **Mint** — `var(--brand-primary-500)`. The primary brand. Used for primary buttons, active states, focus rings, brand surfaces.
8
+ - **Lime** — `var(--brand-secondary-500)`. The secondary brand. Used for secondary buttons, highlight bars, supporting accents.
9
+
10
+ Mint and lime are the only brand colors. Do not introduce a third, do not substitute, do not blend.
11
+
12
+ ## Status ramps
13
+
14
+ Status colors come from the semantic ramps only:
15
+
16
+ - `var(--destructive)` for errors, destructive actions, deletion confirmations.
17
+ - `var(--warning)` for caution, expiring tokens, soft warnings.
18
+ - `var(--success)` for confirmation, completion, healthy state.
19
+ - `var(--info)` for neutral information.
20
+
21
+ Do not improvise red, yellow, green, blue values outside these tokens.
22
+
23
+ ## Fuchsia
24
+
25
+ `#d946ef` style fuchsia is reserved for charts. Never UI chrome. The detector flags fuchsia chroma on buttons, inputs, borders, and other chrome elements; the only allowed habitat is inside `<svg>` and elements tagged `data-role="chart"`.
26
+
27
+ ## Neutrals
28
+
29
+ Seven neutrals are true grey on the OKLCH ramp. No warm tint, no cool tint, no `oklch(... 0.005 280)` blue-shifted greys that ship as default in some libraries. The ramp goes from `var(--background)` at the top to `var(--foreground)` at the bottom; `var(--muted)`, `var(--muted-foreground)`, `var(--border)` populate the middle.
30
+
31
+ Pure `#000` and `#fff` are banned. Use the tinted tokens.
32
+
33
+ ## Raw Tailwind palette utilities
34
+
35
+ Do not use raw Tailwind color utilities in runtime UI (`text-neutral-900`, `bg-green-500`, `border-red-200`, `ring-blue-500`). They bypass the semantic token layer exactly like hex literals do. Use Seven semantic variables instead:
36
+
37
+ ```tsx
38
+ // Correct
39
+ bg-[color:var(--primary)]
40
+ text-[color:var(--primary-foreground)]
41
+ border-[color:var(--border)]
42
+ ring-[color:var(--ring)]
43
+ ```
44
+
45
+ ## Tailwind v4 type hints (mandatory)
46
+
47
+ Tailwind v4 uses Lightning CSS. Lightning requires type hints for ambiguous arbitrary values referencing CSS custom properties. OKLCH colors look like function calls; without a hint, Lightning drops them silently.
48
+
49
+ ```tsx
50
+ // Correct: color: hint on color tokens
51
+ bg-[color:var(--primary)]
52
+ text-[color:var(--primary-foreground)]
53
+ border-[color:var(--border)]
54
+ ring-[color:var(--ring)]
55
+
56
+ // Correct: length: hint on font-size and line-height tokens
57
+ text-[length:var(--tabs-trigger-base-text)]
58
+
59
+ // Correct: dimensions, radius, spacing need no hint
60
+ rounded-[var(--radius-md)]
61
+ h-[var(--button-size-md-h)]
62
+ p-[var(--spacing-4)]
63
+
64
+ // Wrong: no hint, hsl wrapper, or color literal — all drift back to no-op
65
+ bg-[var(--primary)]
66
+ bg-[hsl(var(--primary))]
67
+ bg-[#19e699]
68
+ ```
69
+
70
+ The detector ships `missing-color-type-hint` and `missing-length-type-hint` rules to catch these at scan time.
71
+
72
+ ## Contrast
73
+
74
+ WCAG 2.1 AA on every component is the baseline. Body text against background hits 4.5:1 minimum; large text 3:1. Verify against the OKLCH math, not by eyeballing the rendered swatch. Pairs to double-check:
75
+
76
+ - `var(--muted-foreground)` on `var(--background)` — sits on the edge; never use for body copy.
77
+ - `var(--primary-foreground)` on `var(--primary)` — passes for default Seven mint; verify for any brand-layer override.
78
+ - Focus ring color on canvas — must hit 3:1.
79
+
80
+ ## Refusals
81
+
82
+ - "Make this button orange to draw attention" — Orange is not in the Seven palette. Suggest emphasizing via primary mint plus surrounding lower-contrast siblings, or using `var(--warning)` if the intent is caution.
83
+ - "Use a fuchsia primary for this admin panel" — Fuchsia is chart-only in Seven. Surface the conflict and recommend mint.
84
+ - "Hardcode `#19e699` here because the variable is not loaded" — Variables are always loaded in the consumer; the failure is upstream. Resolve the missing import rather than working around it.
@@ -0,0 +1,71 @@
1
+ # Motion design
2
+
3
+ Seven motion is decisive and tactile. No bounce, no spring, no elastic in chrome. The system communicates state through restrained transitions and a system-wide micro-press.
4
+
5
+ ## Defaults
6
+
7
+ - Duration: `var(--duration-normal)` = 200 ms. Use `var(--duration-fast)` (100 ms) for instant feedback (button press, hover), `var(--duration-slow)` (320 ms) for surface entries (dialog open, sheet slide).
8
+ - Easing: `var(--ease-default)` = `cubic-bezier(0.4, 0, 0.2, 1)` (decelerated). For entries that need a confident finish, use `var(--ease-out-quart)`.
9
+ - Never animate layout properties (`width`, `height`, `top`, `left`). Transform or opacity only; layout animation triggers reflow and looks janky.
10
+
11
+ ## The tactile micro-press
12
+
13
+ Every clickable affordance in Seven gets the same micro-press, not just `<Button>`:
14
+
15
+ ```css
16
+ .clickable {
17
+ transition:
18
+ transform var(--duration-fast) var(--ease-default),
19
+ box-shadow var(--duration-fast) var(--ease-default);
20
+ }
21
+ .clickable:hover {
22
+ transform: translateY(-1px);
23
+ }
24
+ .clickable:active {
25
+ transform: translateY(0.5px);
26
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
27
+ }
28
+ ```
29
+
30
+ Apply to `<button>`, `<a>` with `role="button"`, the trigger row of `<Combobox>`, the avatar pill in the topbar, table row click affordances, every interactive list item. The detector ships a `missing-tactile-press` rule (Phase 2) that catches affordances that opted out.
31
+
32
+ Disabled state does not press. Loading state does not press. Reduced-motion users do not press: the entire system honors `prefers-reduced-motion: reduce` and falls back to instant state changes plus an opacity fade.
33
+
34
+ ## Banned motion patterns
35
+
36
+ - Bounce-back spring on entry. Seven entries decelerate and stop.
37
+ - Elastic overshoot on hover.
38
+ - Wiggle, jiggle, pulse-loop on chrome. Loop animations are reserved for explicit loading indicators (`<Spinner>`).
39
+ - Parallax on product pages. Brand register may use it deliberately.
40
+ - Animated gradient sweeps as decoration.
41
+
42
+ ## Loading and state
43
+
44
+ - Skeleton screens for content load (rectangles in `var(--muted)`).
45
+ - Inline spinners only when the affordance is itself the loading region (a button mid-submit).
46
+ - Toast for confirmations (success, info), 4 second auto-dismiss, top-right by default.
47
+ - Inline error region for form failures, never a toast.
48
+
49
+ ## Reduced motion
50
+
51
+ The system honors `prefers-reduced-motion: reduce` site-wide:
52
+
53
+ ```css
54
+ @media (prefers-reduced-motion: reduce) {
55
+ *,
56
+ *::before,
57
+ *::after {
58
+ transition-duration: 1ms !important;
59
+ animation-duration: 1ms !important;
60
+ animation-iteration-count: 1 !important;
61
+ }
62
+ }
63
+ ```
64
+
65
+ The tactile micro-press collapses to an opacity step under reduced motion. State changes remain visible, just not animated.
66
+
67
+ ## Refusals
68
+
69
+ - "Add a bounce when the toast appears" — Seven motion is decelerated, no bounce. Suggest a 200 ms slide-in plus a subtle fade.
70
+ - "Make the button wiggle on hover" — Hover is the tactile press, not a wiggle. Surface this as a deliberate exception or remap to the press.
71
+ - "Animate the card width on resize" — Layout animation reflows. Suggest opacity plus translate transition, or no transition at all.
@@ -0,0 +1,55 @@
1
+ # Polish
2
+
3
+ Final pass on a Seven implementation. Align drift to tokens and conventions. Name the root cause of each fix so the team learns from it, not just patches it.
4
+
5
+ ## Scope
6
+
7
+ Polish is not greenfield design. The component or surface already exists; this command tightens it to Seven's standards. If the surface is new and incomplete, run `shape` first.
8
+
9
+ ## Three classes of drift
10
+
11
+ Every polish finding falls into one of three buckets. Name the bucket in your fix description so the user sees the pattern:
12
+
13
+ 1. **Missing token**. The code uses a hex or arbitrary value where a token exists in `@etus/tokens`. Fix: replace literal with `var(--...)` and (for color tokens) add the `color:` type hint.
14
+ 2. **One-off implementation**. The code reimplements a component that already exists in `@etus/ui`. Fix: import from `@etus/ui` and delete the local copy. If the local has a needed variant the imported version lacks, flag it as a variant request, do not duplicate.
15
+ 3. **Conceptual misalignment**. The code follows shadcn or generic defaults that do not match Seven's identity (purple primary, pill-on-button, em-dash in pt-BR prose, gradient text, glassmorphism). Fix: rewrite to Seven's pattern and document the swap.
16
+
17
+ ## Workflow
18
+
19
+ 1. **Run the detector first**:
20
+
21
+ ```bash
22
+ npx seven detect <path>
23
+ ```
24
+
25
+ The deterministic findings cover token drift and identity-level violations. Address them before manual review.
26
+
27
+ 2. **Read the implementation alongside the matching Figma node.** If there is no Figma node for the variant, flag it as a "variant invented in code" finding; do not silently align to whatever the code already does.
28
+
29
+ 3. **Manual review pass** covering:
30
+ - Spacing rhythm (vary intentionally; same padding everywhere reads flat).
31
+ - Border vs shadow hierarchy (borders carry chrome; shadows for overlays only).
32
+ - Tactile micro-press on every clickable affordance.
33
+ - 4 px focus ring with 1 px offset on every focusable surface.
34
+ - Sentence case and no trailing periods on chrome copy.
35
+ - Pt-BR vocabulary across labels, buttons, empty states, errors.
36
+
37
+ 4. **Write the fix list with root-cause buckets named.**
38
+
39
+ 5. **Apply the fixes** in commit-sized batches:
40
+ - One commit per logical fix family (all token replacements, all variant consolidations, all copy fixes).
41
+ - Conventional commit messages, lowercase subject (Seven commit rule).
42
+ - Tests pass before each commit.
43
+
44
+ ## What polish never does
45
+
46
+ - Add new variants that do not exist in Figma. Surface the gap, do not invent.
47
+ - Refactor unrelated code because it "looks bad". Surgical changes only.
48
+ - Change public component APIs. If a prop should change, that is a separate proposal, not polish.
49
+ - Touch `packages/tokens/sources/`. Token changes flow from Figma via the figma-sync skill, not from polish.
50
+
51
+ ## Refusals
52
+
53
+ - "Refactor the whole file while you are in there" — Polish is surgical. Document the additional issues as a follow-up, do not bundle them.
54
+ - "Add a fancy hover state to make it pop" — Seven hover is the tactile press. Adding decorative hover is drift. Surface and decline.
55
+ - "Replace the import with a custom component because the variant is missing" — That is a Figma variant request. Document it, ask the user, do not duplicate.
@@ -0,0 +1,45 @@
1
+ # Product register
2
+
3
+ Loaded when the surface is `product`: app UI, admin, dashboards, settings, internal tools. The default for Seven.
4
+
5
+ ## Bar
6
+
7
+ Earned familiarity. A fluent user of Linear, Figma, Notion, Raycast, or Stripe Dashboard should trust the surface within five seconds. That trust is built from consistent affordances, predictable spacing, and tactile feedback, not from cleverness.
8
+
9
+ ## Defaults
10
+
11
+ When in doubt:
12
+
13
+ - Card-on-canvas layouts with the workhorse 1 px `var(--border)`. Shadows only on overlays.
14
+ - Two-column or sidebar-and-detail shells. Avoid wide single-column dashboards.
15
+ - Density: comfortable, not compact. Buttons are 36 px medium by default, inputs match.
16
+ - States exposed by border or surface tint, not by motion. Loading is a skeleton; success is an inline confirmation; error is inline plus a destructive border on the offending field.
17
+
18
+ ## Iconography
19
+
20
+ - Lucide only. 2 px stroke, round caps, `currentColor`. Filled variants only where Lucide ships them.
21
+ - Icon size matches the line-height of the adjacent text (16 px next to body, 20 px next to headings).
22
+ - No emoji in chrome. No Unicode dingbats. No legacy Material icons.
23
+ - Custom SVGs match the Lucide stroke and cap conventions or they are not Seven icons.
24
+
25
+ ## Affordances
26
+
27
+ Every clickable surface — `<button>`, `<a>`, `[role="button"]`, the trigger of a `<Popover>`, the row of a `<Combobox>` — picks up the tactile micro-press system-wide. Hover translates 1 px up, active translates back down, an inset shadow confirms the press.
28
+
29
+ Focus ring is 4 px on the focus token color, with a 1 px offset against the canvas. Never use the browser default `outline`.
30
+
31
+ Disabled state: muted foreground, no pointer cursor, no tactile press, no focus ring.
32
+
33
+ ## Refusals
34
+
35
+ Surface the conflict, do not silently comply.
36
+
37
+ - "Make this a single big primary button" on a dashboard with three primary actions — explain the visual hierarchy cost and recommend a single primary plus two secondary, or a split button.
38
+ - "Add a glow under the active row" — Seven does not use glow on chrome. Recommend a brand-tinted background or a left-accent rule that is part of the row's structure, not a decorative halo.
39
+ - "Show this metric in a gradient" — Seven prose forbids gradient text. The metric belongs in a solid `var(--foreground)` with hierarchy from scale and weight.
40
+
41
+ ## Sub-commands that apply
42
+
43
+ All four Phase 1 sub-commands (`shape`, `audit`, `polish`, `clarify`) apply to product surfaces.
44
+
45
+ For Phase 2 brand register surfaces, load [reference/brand.md](brand.md) instead. The shared design laws in `SKILL.md` apply to both.