@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
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # @etus/seven-skill
2
+
3
+ Seven Design System skill, plugin, and CLI detector for AI coding agents.
4
+
5
+ This package distributes the Seven Design System guard-rails as a Claude Code plugin and a deterministic CLI detector. Phase 2 expands to Cursor, Codex, Gemini, OpenCode, and other AI harnesses.
6
+
7
+ ## What ships
8
+
9
+ - **Skill source-of-truth** under `source/`: the routing `SKILL.md` plus domain references for typography, color, motion, spatial design, voice, and the Phase 1 sub-commands (`shape`, `audit`, `polish`, `clarify`).
10
+ - **Multi-harness build pipeline** in `build/` that emits one configured skill per target harness. Phase 1 ships Claude Code only at `.claude/skills/seven/`.
11
+ - **Claude Code plugin** wrapper in `.claude-plugin/` with `plugin.json` and `marketplace.json` auto-synced from `package.json`.
12
+ - **Deterministic CLI detector** in `cli/` with 35 Seven-tuned rules (`npx seven detect <path>`).
13
+
14
+ ## Status
15
+
16
+ Phase 1 — hardened Claude Code port. Claude Code target only, 35 detector rules, four sub-commands. Distributed as a Claude Code plugin via the marketplace configuration in this package and as an npm CLI/skill package.
17
+
18
+ ## Install
19
+
20
+ ### Claude Code plugin (recommended)
21
+
22
+ The plugin is configured by `.claude-plugin/marketplace.json` and `.claude-plugin/plugin.json` in this package. Inside the Seven monorepo it is available as a workspace dependency:
23
+
24
+ ```bash
25
+ pnpm add -D @etus/seven-skill --workspace
26
+ ```
27
+
28
+ For external projects, install the package or point the plugin manifest at the git source:
29
+
30
+ ```bash
31
+ pnpm add -D @etus/seven-skill
32
+ claude plugin install @etus/seven-skill
33
+
34
+ # Git source fallback while marketplace propagation catches up:
35
+ claude plugin install github:etusdigital/seven#path=packages/seven-skill
36
+ ```
37
+
38
+ ### CLI detector
39
+
40
+ Inside the monorepo:
41
+
42
+ ```bash
43
+ pnpm --filter @etus/seven-skill exec seven detect packages/ui/src/
44
+ ```
45
+
46
+ ## Commands (Phase 1)
47
+
48
+ | Command | Purpose |
49
+ | ---------------- | -------------------------------------------------------------------------- |
50
+ | `/seven shape` | Plan UX shape before writing component code |
51
+ | `/seven audit` | Five-dimension scan: a11y, performance, theming, responsive, anti-patterns |
52
+ | `/seven polish` | Final-pass cleanup aligned to Seven tokens and conventions |
53
+ | `/seven clarify` | UX copy in pt-BR: imperative leads, sentence case, no trailing periods |
54
+
55
+ Phase 2 adds `craft`, `harden`, `layout`, `typeset`.
56
+
57
+ ## Detector rules
58
+
59
+ The detector ships 35 rules across three engines (regex, static-html,
60
+ browser). Each rule is `quality` (real design / a11y drift) or `slop` (an
61
+ AI tell, Seven-flavored). The full catalog — every rule with its
62
+ justification, a wrong/right example, and the design reference that grounds
63
+ it — is in [`docs/detector-rules.md`](./docs/detector-rules.md).
64
+
65
+ **Token-aware.** Eight rules are grounded in Seven's real design tokens: a
66
+ build step (`build:tokens`) reads `@etus/tokens` and embeds a token-data
67
+ snapshot, so `hardcoded-color-not-token` names the exact token a literal
68
+ maps to, `non-inter-font` reads the font tokens, `radius-mixed-scales` reads
69
+ the radius scale, and `bounce-easing` knows the sanctioned easing tokens.
70
+ When `@etus/tokens` rebuilds from a Figma sync, regenerate the snapshot. The
71
+ other 27 rules are heuristics — language facts, CSS mechanics, and a11y
72
+ standards no token defines. Each rule's verdict is in `RULE_GROUNDING`.
73
+
74
+ Quick map: nine text rules (`non-inter-font`, `hardcoded-color-not-token`,
75
+ `raw-tailwind-palette-color`, `missing-color-type-hint`,
76
+ `missing-length-type-hint`, `leading-none-with-length-var`,
77
+ `fuchsia-in-ui-chrome`, `pt-pt-vocab`, `pure-black-or-white`); three
78
+ inverted from impeccable (`side-stripe-border`, `gradient-text-decorative`,
79
+ `shadows-not-borders`); seventeen universal design-quality / a11y rules; six
80
+ Seven-specific element rules (`missing-tactile-press`, `pill-on-button`,
81
+ `radius-mixed-scales`, `non-lucide-icon`, `emoji-in-chrome`,
82
+ `forbidden-em-dash`).
83
+
84
+ Exit codes follow the impeccable convention: `0` clean, `2` findings present, `1` usage error.
85
+
86
+ ## Architecture
87
+
88
+ ```
89
+ packages/seven-skill/
90
+ ├── source/ # authoring source (not shipped to npm)
91
+ │ ├── SKILL.md # router + shared design laws
92
+ │ ├── reference/ # domain + sub-command references
93
+ │ └── scripts/ # consumer-side runtime scripts (Phase 2)
94
+ ├── build/ # multi-harness build pipeline (not shipped)
95
+ ├── cli/ # deterministic detector (shipped)
96
+ ├── .claude/skills/seven/ # Claude Code build output (shipped, tracked)
97
+ ├── .claude-plugin/ # Claude Code plugin wrapper (shipped)
98
+ └── tests/ # unit + fixture tests
99
+ ```
100
+
101
+ Author in `source/`. Run `pnpm --filter @etus/seven-skill build` to regenerate the per-harness skill outputs and the plugin manifest.
102
+
103
+ ## Development
104
+
105
+ ```bash
106
+ pnpm --filter @etus/seven-skill build # regenerate harness output and manifests
107
+ pnpm --filter @etus/seven-skill test # vitest unit + fixture suite
108
+ pnpm --filter @etus/seven-skill typecheck # tsc strict mode
109
+
110
+ # Detector usage
111
+ pnpm --filter @etus/seven-skill exec seven detect path/to/file-or-dir
112
+ pnpm --filter @etus/seven-skill exec seven detect packages/ui/src/ --json
113
+ pnpm --filter @etus/seven-skill exec seven help
114
+ ```
115
+
116
+ ## License
117
+
118
+ Apache-2.0. See `LICENSE`.