@jack200714/mafw 4.5.1 → 4.8.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.
- package/README.md +5 -2
- package/bin/mafw.js +16 -14
- package/gateway/dist/index.js +52 -38
- package/gateway/dist/media/media-plugin-loader.js +0 -12
- package/gateway/dist/plugins/hub.js +153 -19
- package/gateway/dist/routes/plugins.js +15 -5
- package/gateway/dist/runtime/event-broadcast.js +33 -0
- package/gateway/dist/runtime/loader.js +23 -13
- package/gateway/dist/usage/builtin-plugins/gateway.js +25 -3
- package/gateway/dist/usage/plugin-loader.js +0 -11
- package/gateway/package.json +2 -2
- package/package.json +1 -7
- package/packages/tui/dist/cli.js +8 -3
- package/.opencode/mafw/.backup-v61/parametric/base-skill-manifest.yaml +0 -2
- package/.opencode/mafw/STATUS.md +0 -6
- package/.opencode/mafw/ledger.md +0 -20
- package/.opencode/mafw/memory/.harmonic_index.json +0 -28
- package/.opencode/mafw/memory/.review_queue.json +0 -1
- package/.opencode/mafw/memory/tier3/parametric.json +0 -13
- package/.opencode/mafw/memory/tier3/test-goal.json +0 -19
- package/.opencode/mafw/memory-index.json +0 -6
- package/.opencode/mafw/parametric/base-skill-manifest.yaml +0 -2
- package/.opencode/mafw/waves.json +0 -4
- package/.opencode/opencode.json +0 -3
- package/.opencode/plugins/mafw-plugin.ts +0 -8
- package/.opencode/skills/banner-design/SKILL.md +0 -196
- package/.opencode/skills/banner-design/references/banner-sizes-and-styles.md +0 -118
- package/.opencode/skills/brand/SKILL.md +0 -97
- package/.opencode/skills/brand/references/approval-checklist.md +0 -169
- package/.opencode/skills/brand/references/asset-organization.md +0 -157
- package/.opencode/skills/brand/references/brand-guideline-template.md +0 -140
- package/.opencode/skills/brand/references/color-palette-management.md +0 -186
- package/.opencode/skills/brand/references/consistency-checklist.md +0 -94
- package/.opencode/skills/brand/references/logo-usage-rules.md +0 -185
- package/.opencode/skills/brand/references/messaging-framework.md +0 -85
- package/.opencode/skills/brand/references/typography-specifications.md +0 -214
- package/.opencode/skills/brand/references/update.md +0 -118
- package/.opencode/skills/brand/references/visual-identity.md +0 -96
- package/.opencode/skills/brand/references/voice-framework.md +0 -88
- package/.opencode/skills/brand/scripts/extract-colors.cjs +0 -341
- package/.opencode/skills/brand/scripts/inject-brand-context.cjs +0 -349
- package/.opencode/skills/brand/scripts/sync-brand-to-tokens.cjs +0 -248
- package/.opencode/skills/brand/scripts/tests/test_sync_brand_to_tokens.py +0 -52
- package/.opencode/skills/brand/scripts/validate-asset.cjs +0 -387
- package/.opencode/skills/brand/templates/brand-guidelines-starter.md +0 -275
- package/.opencode/skills/design/SKILL.md +0 -313
- package/.opencode/skills/design/data/cip/deliverables.csv +0 -51
- package/.opencode/skills/design/data/cip/industries.csv +0 -21
- package/.opencode/skills/design/data/cip/mockup-contexts.csv +0 -21
- package/.opencode/skills/design/data/cip/styles.csv +0 -21
- package/.opencode/skills/design/data/icon/styles.csv +0 -16
- package/.opencode/skills/design/data/logo/colors.csv +0 -56
- package/.opencode/skills/design/data/logo/industries.csv +0 -56
- package/.opencode/skills/design/data/logo/styles.csv +0 -56
- package/.opencode/skills/design/references/banner-sizes-and-styles.md +0 -118
- package/.opencode/skills/design/references/cip-deliverable-guide.md +0 -95
- package/.opencode/skills/design/references/cip-design.md +0 -121
- package/.opencode/skills/design/references/cip-prompt-engineering.md +0 -84
- package/.opencode/skills/design/references/cip-style-guide.md +0 -68
- package/.opencode/skills/design/references/design-routing.md +0 -207
- package/.opencode/skills/design/references/icon-design.md +0 -122
- package/.opencode/skills/design/references/logo-color-psychology.md +0 -101
- package/.opencode/skills/design/references/logo-design.md +0 -92
- package/.opencode/skills/design/references/logo-prompt-engineering.md +0 -158
- package/.opencode/skills/design/references/logo-style-guide.md +0 -109
- package/.opencode/skills/design/references/slides-copywriting-formulas.md +0 -84
- package/.opencode/skills/design/references/slides-create.md +0 -4
- package/.opencode/skills/design/references/slides-html-template.md +0 -295
- package/.opencode/skills/design/references/slides-layout-patterns.md +0 -137
- package/.opencode/skills/design/references/slides-strategies.md +0 -94
- package/.opencode/skills/design/references/slides.md +0 -42
- package/.opencode/skills/design/references/social-photos-design.md +0 -329
- package/.opencode/skills/design/scripts/cip/core.py +0 -215
- package/.opencode/skills/design/scripts/cip/generate.py +0 -484
- package/.opencode/skills/design/scripts/cip/render-html.py +0 -424
- package/.opencode/skills/design/scripts/cip/search.py +0 -127
- package/.opencode/skills/design/scripts/icon/generate.py +0 -487
- package/.opencode/skills/design/scripts/logo/core.py +0 -175
- package/.opencode/skills/design/scripts/logo/generate.py +0 -362
- package/.opencode/skills/design/scripts/logo/search.py +0 -114
- package/.opencode/skills/design-system/SKILL.md +0 -244
- package/.opencode/skills/design-system/data/slide-backgrounds.csv +0 -11
- package/.opencode/skills/design-system/data/slide-charts.csv +0 -26
- package/.opencode/skills/design-system/data/slide-color-logic.csv +0 -14
- package/.opencode/skills/design-system/data/slide-copy.csv +0 -26
- package/.opencode/skills/design-system/data/slide-layout-logic.csv +0 -16
- package/.opencode/skills/design-system/data/slide-layouts.csv +0 -26
- package/.opencode/skills/design-system/data/slide-strategies.csv +0 -16
- package/.opencode/skills/design-system/data/slide-typography.csv +0 -15
- package/.opencode/skills/design-system/references/component-specs.md +0 -236
- package/.opencode/skills/design-system/references/component-tokens.md +0 -214
- package/.opencode/skills/design-system/references/primitive-tokens.md +0 -203
- package/.opencode/skills/design-system/references/semantic-tokens.md +0 -215
- package/.opencode/skills/design-system/references/states-and-variants.md +0 -241
- package/.opencode/skills/design-system/references/tailwind-integration.md +0 -251
- package/.opencode/skills/design-system/references/token-architecture.md +0 -224
- package/.opencode/skills/design-system/scripts/embed-tokens.cjs +0 -99
- package/.opencode/skills/design-system/scripts/fetch-background.py +0 -317
- package/.opencode/skills/design-system/scripts/generate-slide.py +0 -770
- package/.opencode/skills/design-system/scripts/generate-tokens.cjs +0 -205
- package/.opencode/skills/design-system/scripts/html-token-validator.py +0 -327
- package/.opencode/skills/design-system/scripts/search-slides.py +0 -218
- package/.opencode/skills/design-system/scripts/slide-token-validator.py +0 -35
- package/.opencode/skills/design-system/scripts/slide_search_core.py +0 -453
- package/.opencode/skills/design-system/scripts/tests/test_validate_tokens.py +0 -48
- package/.opencode/skills/design-system/scripts/validate-tokens.cjs +0 -246
- package/.opencode/skills/design-system/templates/design-tokens-starter.json +0 -143
- package/.opencode/skills/frontend-design/LICENSE.txt +0 -21
- package/.opencode/skills/frontend-design/SKILL.md +0 -115
- package/.opencode/skills/mafw-automation-interview/SKILL.md +0 -43
- package/.opencode/skills/mafw-cli-scanner/SKILL.md +0 -37
- package/.opencode/skills/mafw-compression-verifier/SKILL.md +0 -52
- package/.opencode/skills/mafw-desktop-inspector/SKILL.md +0 -170
- package/.opencode/skills/mafw-execute/SKILL.md +0 -62
- package/.opencode/skills/mafw-gateway-restart/SKILL.md +0 -87
- package/.opencode/skills/mafw-github-scanner/SKILL.md +0 -38
- package/.opencode/skills/mafw-goal/SKILL.md +0 -76
- package/.opencode/skills/mafw-interview/SKILL.md +0 -68
- package/.opencode/skills/mafw-memory-extractor/SKILL.md +0 -65
- package/.opencode/skills/mafw-plan/SKILL.md +0 -58
- package/.opencode/skills/mafw-review/SKILL.md +0 -85
- package/.opencode/skills/runtime-plugin-authoring/SKILL.md +0 -791
- package/.opencode/skills/slides/SKILL.md +0 -40
- package/.opencode/skills/slides/references/copywriting-formulas.md +0 -84
- package/.opencode/skills/slides/references/create.md +0 -4
- package/.opencode/skills/slides/references/html-template.md +0 -295
- package/.opencode/skills/slides/references/layout-patterns.md +0 -137
- package/.opencode/skills/slides/references/slide-strategies.md +0 -94
- package/.opencode/skills/ui-styling/LICENSE.txt +0 -202
- package/.opencode/skills/ui-styling/SKILL.md +0 -324
- package/.opencode/skills/ui-styling/references/canvas-design-system.md +0 -320
- package/.opencode/skills/ui-styling/references/shadcn-accessibility.md +0 -471
- package/.opencode/skills/ui-styling/references/shadcn-components.md +0 -424
- package/.opencode/skills/ui-styling/references/shadcn-theming.md +0 -373
- package/.opencode/skills/ui-styling/references/tailwind-customization.md +0 -483
- package/.opencode/skills/ui-styling/references/tailwind-responsive.md +0 -382
- package/.opencode/skills/ui-styling/references/tailwind-utilities.md +0 -455
- package/.opencode/skills/ui-styling/scripts/requirements.txt +0 -17
- package/.opencode/skills/ui-styling/scripts/shadcn_add.py +0 -308
- package/.opencode/skills/ui-styling/scripts/tailwind_config_gen.py +0 -473
- package/.opencode/skills/ui-styling/scripts/tests/coverage-ui.json +0 -1
- package/.opencode/skills/ui-styling/scripts/tests/requirements.txt +0 -3
- package/.opencode/skills/ui-styling/scripts/tests/test_shadcn_add.py +0 -266
- package/.opencode/skills/ui-styling/scripts/tests/test_tailwind_config_gen.py +0 -394
- package/.opencode/skills/ui-ux-pro-max/SKILL.md +0 -388
- package/.opencode/skills/ui-ux-pro-max/data/app-interface.csv +0 -31
- package/.opencode/skills/ui-ux-pro-max/data/charts.csv +0 -26
- package/.opencode/skills/ui-ux-pro-max/data/colors.csv +0 -193
- package/.opencode/skills/ui-ux-pro-max/data/google-fonts.csv +0 -1924
- package/.opencode/skills/ui-ux-pro-max/data/icons.csv +0 -106
- package/.opencode/skills/ui-ux-pro-max/data/landing.csv +0 -35
- package/.opencode/skills/ui-ux-pro-max/data/motion.csv +0 -17
- package/.opencode/skills/ui-ux-pro-max/data/products.csv +0 -193
- package/.opencode/skills/ui-ux-pro-max/data/react-performance.csv +0 -45
- package/.opencode/skills/ui-ux-pro-max/data/stacks/angular.csv +0 -51
- package/.opencode/skills/ui-ux-pro-max/data/stacks/astro.csv +0 -54
- package/.opencode/skills/ui-ux-pro-max/data/stacks/avalonia.csv +0 -57
- package/.opencode/skills/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
- package/.opencode/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
- package/.opencode/skills/ui-ux-pro-max/data/stacks/javafx.csv +0 -76
- package/.opencode/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
- package/.opencode/skills/ui-ux-pro-max/data/stacks/laravel.csv +0 -51
- package/.opencode/skills/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
- package/.opencode/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -71
- package/.opencode/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
- package/.opencode/skills/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
- package/.opencode/skills/ui-ux-pro-max/data/stacks/react.csv +0 -54
- package/.opencode/skills/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
- package/.opencode/skills/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
- package/.opencode/skills/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
- package/.opencode/skills/ui-ux-pro-max/data/stacks/threejs.csv +0 -54
- package/.opencode/skills/ui-ux-pro-max/data/stacks/uno.csv +0 -60
- package/.opencode/skills/ui-ux-pro-max/data/stacks/uwp.csv +0 -56
- package/.opencode/skills/ui-ux-pro-max/data/stacks/vue.csv +0 -50
- package/.opencode/skills/ui-ux-pro-max/data/stacks/winui.csv +0 -60
- package/.opencode/skills/ui-ux-pro-max/data/stacks/wpf.csv +0 -57
- package/.opencode/skills/ui-ux-pro-max/data/styles.csv +0 -85
- package/.opencode/skills/ui-ux-pro-max/data/typography.csv +0 -75
- package/.opencode/skills/ui-ux-pro-max/data/ui-reasoning.csv +0 -162
- package/.opencode/skills/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
- package/.opencode/skills/ui-ux-pro-max/scripts/core.py +0 -464
- package/.opencode/skills/ui-ux-pro-max/scripts/design_system.py +0 -1479
- package/.opencode/skills/ui-ux-pro-max/scripts/search.py +0 -162
- package/.opencode/skills/ui-ux-pro-max/scripts/tests/test_core.py +0 -134
- package/.opencode/skills/ui-ux-pro-max/scripts/tests/test_design_system_mode.py +0 -159
- package/.opencode/skills/ui-ux-pro-max/scripts/validate_data.py +0 -114
- package/dist/hooks/bash-python-guide.d.ts +0 -4
- package/dist/hooks/bash-python-guide.d.ts.map +0 -1
- package/dist/hooks/bash-python-guide.js +0 -67
- package/dist/hooks/bash-python-guide.js.map +0 -1
- package/dist/hooks/handoff.d.ts +0 -9
- package/dist/hooks/handoff.d.ts.map +0 -1
- package/dist/hooks/handoff.js +0 -8
- package/dist/hooks/handoff.js.map +0 -1
- package/dist/hooks/hook-manager.d.ts +0 -32
- package/dist/hooks/hook-manager.d.ts.map +0 -1
- package/dist/hooks/hook-manager.js +0 -91
- package/dist/hooks/hook-manager.js.map +0 -1
- package/dist/hooks/llm-after.d.ts +0 -8
- package/dist/hooks/llm-after.d.ts.map +0 -1
- package/dist/hooks/llm-after.js +0 -8
- package/dist/hooks/llm-after.js.map +0 -1
- package/dist/hooks/media-ingest.d.ts +0 -43
- package/dist/hooks/media-ingest.d.ts.map +0 -1
- package/dist/hooks/media-ingest.js +0 -269
- package/dist/hooks/media-ingest.js.map +0 -1
- package/dist/hooks/memory-guide.d.ts +0 -3
- package/dist/hooks/memory-guide.d.ts.map +0 -1
- package/dist/hooks/memory-guide.js +0 -47
- package/dist/hooks/memory-guide.js.map +0 -1
- package/dist/hooks/observation-capture.d.ts +0 -17
- package/dist/hooks/observation-capture.d.ts.map +0 -1
- package/dist/hooks/observation-capture.js +0 -20
- package/dist/hooks/observation-capture.js.map +0 -1
- package/dist/hooks/session-compacting.d.ts +0 -6
- package/dist/hooks/session-compacting.d.ts.map +0 -1
- package/dist/hooks/session-compacting.js +0 -6
- package/dist/hooks/session-compacting.js.map +0 -1
- package/dist/hooks/session-ending.d.ts +0 -20
- package/dist/hooks/session-ending.d.ts.map +0 -1
- package/dist/hooks/session-ending.js +0 -113
- package/dist/hooks/session-ending.js.map +0 -1
- package/dist/hooks/session-recall.d.ts +0 -2
- package/dist/hooks/session-recall.d.ts.map +0 -1
- package/dist/hooks/session-recall.js +0 -103
- package/dist/hooks/session-recall.js.map +0 -1
- package/dist/hooks/session-start.d.ts +0 -9
- package/dist/hooks/session-start.d.ts.map +0 -1
- package/dist/hooks/session-start.js +0 -42
- package/dist/hooks/session-start.js.map +0 -1
- package/dist/hooks/tool-before.d.ts +0 -10
- package/dist/hooks/tool-before.d.ts.map +0 -1
- package/dist/hooks/tool-before.js +0 -6
- package/dist/hooks/tool-before.js.map +0 -1
- package/dist/hooks/tool-executed.d.ts +0 -19
- package/dist/hooks/tool-executed.d.ts.map +0 -1
- package/dist/hooks/tool-executed.js +0 -12
- package/dist/hooks/tool-executed.js.map +0 -1
- package/dist/hooks/user-profile.d.ts +0 -2
- package/dist/hooks/user-profile.d.ts.map +0 -1
- package/dist/hooks/user-profile.js +0 -30
- package/dist/hooks/user-profile.js.map +0 -1
- package/dist/hooks/user-prompt.d.ts +0 -9
- package/dist/hooks/user-prompt.d.ts.map +0 -1
- package/dist/hooks/user-prompt.js +0 -8
- package/dist/hooks/user-prompt.js.map +0 -1
- package/dist/hooks/voice-guide.d.ts +0 -8
- package/dist/hooks/voice-guide.d.ts.map +0 -1
- package/dist/hooks/voice-guide.js +0 -101
- package/dist/hooks/voice-guide.js.map +0 -1
- package/dist/plugin.d.ts +0 -55
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -342
- package/dist/plugin.js.map +0 -1
- package/dist/tools/add-memory.d.ts +0 -17
- package/dist/tools/add-memory.d.ts.map +0 -1
- package/dist/tools/add-memory.js +0 -60
- package/dist/tools/add-memory.js.map +0 -1
- package/dist/tools/media-ask.d.ts +0 -14
- package/dist/tools/media-ask.d.ts.map +0 -1
- package/dist/tools/media-ask.js +0 -224
- package/dist/tools/media-ask.js.map +0 -1
- package/dist/tools/media-speak.d.ts +0 -16
- package/dist/tools/media-speak.d.ts.map +0 -1
- package/dist/tools/media-speak.js +0 -78
- package/dist/tools/media-speak.js.map +0 -1
- package/dist/tools/media-upload.d.ts +0 -14
- package/dist/tools/media-upload.d.ts.map +0 -1
- package/dist/tools/media-upload.js +0 -155
- package/dist/tools/media-upload.js.map +0 -1
- package/dist/tools/python-exec.d.ts +0 -13
- package/dist/tools/python-exec.d.ts.map +0 -1
- package/dist/tools/python-exec.js +0 -99
- package/dist/tools/python-exec.js.map +0 -1
- package/dist/tools/python-restart.d.ts +0 -11
- package/dist/tools/python-restart.d.ts.map +0 -1
- package/dist/tools/python-restart.js +0 -33
- package/dist/tools/python-restart.js.map +0 -1
- package/dist/utils/circuit-breaker.d.ts +0 -23
- package/dist/utils/circuit-breaker.d.ts.map +0 -1
- package/dist/utils/circuit-breaker.js +0 -75
- package/dist/utils/circuit-breaker.js.map +0 -1
- package/dist/utils/config-loader.d.ts +0 -20
- package/dist/utils/config-loader.d.ts.map +0 -1
- package/dist/utils/config-loader.js +0 -194
- package/dist/utils/config-loader.js.map +0 -1
- package/dist/utils/fallback.d.ts +0 -7
- package/dist/utils/fallback.d.ts.map +0 -1
- package/dist/utils/fallback.js +0 -20
- package/dist/utils/fallback.js.map +0 -1
- package/dist/utils/git.d.ts +0 -24
- package/dist/utils/git.d.ts.map +0 -1
- package/dist/utils/git.js +0 -71
- package/dist/utils/git.js.map +0 -1
- package/dist/utils/github.d.ts +0 -37
- package/dist/utils/github.d.ts.map +0 -1
- package/dist/utils/github.js +0 -53
- package/dist/utils/github.js.map +0 -1
- package/dist/utils/global-path.d.ts +0 -2
- package/dist/utils/global-path.d.ts.map +0 -1
- package/dist/utils/global-path.js +0 -32
- package/dist/utils/global-path.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -6
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -69
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/obs-capture.d.ts +0 -7
- package/dist/utils/obs-capture.d.ts.map +0 -1
- package/dist/utils/obs-capture.js +0 -49
- package/dist/utils/obs-capture.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -11
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -45
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/self-wiring.d.ts +0 -13
- package/dist/utils/self-wiring.d.ts.map +0 -1
- package/dist/utils/self-wiring.js +0 -86
- package/dist/utils/self-wiring.js.map +0 -1
- package/dist/utils/state.d.ts +0 -106
- package/dist/utils/state.d.ts.map +0 -1
- package/dist/utils/state.js +0 -166
- package/dist/utils/state.js.map +0 -1
- package/dist/utils/status.d.ts +0 -47
- package/dist/utils/status.d.ts.map +0 -1
- package/dist/utils/status.js +0 -147
- package/dist/utils/status.js.map +0 -1
- package/dist/utils/ttl-map.d.ts +0 -17
- package/dist/utils/ttl-map.d.ts.map +0 -1
- package/dist/utils/ttl-map.js +0 -67
- package/dist/utils/ttl-map.js.map +0 -1
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Validate token usage in codebase
|
|
4
|
-
* Finds hardcoded values that should use design tokens
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* node validate-tokens.cjs --dir src/
|
|
8
|
-
* node validate-tokens.cjs --dir src/ --fix
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const fs = require('fs');
|
|
12
|
-
const path = require('path');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Parse command line arguments
|
|
16
|
-
*/
|
|
17
|
-
function parseArgs() {
|
|
18
|
-
const args = process.argv.slice(2);
|
|
19
|
-
const options = {
|
|
20
|
-
dir: null,
|
|
21
|
-
fix: false,
|
|
22
|
-
ignore: ['node_modules', '.git', 'dist', 'build', '.next']
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
for (let i = 0; i < args.length; i++) {
|
|
26
|
-
if (args[i] === '--dir' || args[i] === '-d') {
|
|
27
|
-
options.dir = args[++i];
|
|
28
|
-
} else if (args[i] === '--fix') {
|
|
29
|
-
options.fix = true;
|
|
30
|
-
} else if (args[i] === '--ignore' || args[i] === '-i') {
|
|
31
|
-
options.ignore.push(args[++i]);
|
|
32
|
-
} else if (args[i] === '--help' || args[i] === '-h') {
|
|
33
|
-
console.log(`
|
|
34
|
-
Usage: node validate-tokens.cjs [options]
|
|
35
|
-
|
|
36
|
-
Options:
|
|
37
|
-
-d, --dir <path> Directory to scan (required)
|
|
38
|
-
--fix Show suggested fixes (no auto-fix)
|
|
39
|
-
-i, --ignore <dir> Additional directories to ignore
|
|
40
|
-
-h, --help Show this help
|
|
41
|
-
|
|
42
|
-
Checks for:
|
|
43
|
-
- Hardcoded hex colors (#RGB, #RRGGBB)
|
|
44
|
-
- Hardcoded pixel values (except 0, 1px)
|
|
45
|
-
- Hardcoded rem values in CSS
|
|
46
|
-
`);
|
|
47
|
-
process.exit(0);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return options;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Patterns to detect hardcoded values
|
|
56
|
-
*/
|
|
57
|
-
const patterns = {
|
|
58
|
-
hexColor: {
|
|
59
|
-
regex: /#([0-9A-Fa-f]{3}){1,2}\b/g,
|
|
60
|
-
message: 'Hardcoded hex color',
|
|
61
|
-
suggestion: 'Use var(--color-*) token'
|
|
62
|
-
},
|
|
63
|
-
rgbColor: {
|
|
64
|
-
regex: /rgb\s*\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)/gi,
|
|
65
|
-
message: 'Hardcoded RGB color',
|
|
66
|
-
suggestion: 'Use var(--color-*) token'
|
|
67
|
-
},
|
|
68
|
-
pixelValue: {
|
|
69
|
-
regex: /:\s*(\d{2,})px/g, // 2+ digit px values
|
|
70
|
-
message: 'Hardcoded pixel value',
|
|
71
|
-
suggestion: 'Use var(--space-*) or var(--radius-*) token'
|
|
72
|
-
},
|
|
73
|
-
remValue: {
|
|
74
|
-
regex: /:\s*\d+\.?\d*rem(?![^{]*\$value)/g, // rem not in token definition
|
|
75
|
-
message: 'Hardcoded rem value',
|
|
76
|
-
suggestion: 'Use var(--space-*) or var(--font-size-*) token'
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* File extensions to scan
|
|
82
|
-
*/
|
|
83
|
-
const extensions = ['.css', '.scss', '.tsx', '.jsx', '.ts', '.js', '.vue', '.svelte'];
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Files/patterns to skip
|
|
87
|
-
*/
|
|
88
|
-
const skipPatterns = [
|
|
89
|
-
/\.min\.(css|js)$/,
|
|
90
|
-
/tailwind\.config/,
|
|
91
|
-
/globals\.css/, // Token definitions
|
|
92
|
-
/tokens\.(css|json)/
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Get all files recursively
|
|
97
|
-
*/
|
|
98
|
-
function getFiles(dir, ignore, files = []) {
|
|
99
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
100
|
-
|
|
101
|
-
for (const entry of entries) {
|
|
102
|
-
const fullPath = path.join(dir, entry.name);
|
|
103
|
-
|
|
104
|
-
if (entry.isDirectory()) {
|
|
105
|
-
if (!ignore.includes(entry.name)) {
|
|
106
|
-
getFiles(fullPath, ignore, files);
|
|
107
|
-
}
|
|
108
|
-
} else if (entry.isFile()) {
|
|
109
|
-
const ext = path.extname(entry.name);
|
|
110
|
-
if (extensions.includes(ext)) {
|
|
111
|
-
files.push(fullPath);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return files;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Check if file should be skipped
|
|
121
|
-
*/
|
|
122
|
-
function shouldSkip(filePath) {
|
|
123
|
-
return skipPatterns.some(pattern => pattern.test(filePath));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Scan file for violations
|
|
128
|
-
*/
|
|
129
|
-
function scanFile(filePath) {
|
|
130
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
131
|
-
const lines = content.split('\n');
|
|
132
|
-
const violations = [];
|
|
133
|
-
|
|
134
|
-
lines.forEach((line, index) => {
|
|
135
|
-
// Skip comments
|
|
136
|
-
if (line.trim().startsWith('//') || line.trim().startsWith('/*')) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
for (const [name, pattern] of Object.entries(patterns)) {
|
|
141
|
-
const matches = line.match(pattern.regex);
|
|
142
|
-
if (matches) {
|
|
143
|
-
matches.forEach(match => {
|
|
144
|
-
// Skip common exceptions
|
|
145
|
-
if (name === 'hexColor' && ['#000', '#fff', '#FFF', '#000000', '#FFFFFF'].includes(match.toUpperCase())) {
|
|
146
|
-
return; // Skip black/white, often intentional
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
violations.push({
|
|
150
|
-
file: filePath,
|
|
151
|
-
line: index + 1,
|
|
152
|
-
column: line.indexOf(match) + 1,
|
|
153
|
-
value: match,
|
|
154
|
-
type: name,
|
|
155
|
-
message: pattern.message,
|
|
156
|
-
suggestion: pattern.suggestion,
|
|
157
|
-
context: line.trim().substring(0, 80)
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
return violations;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Format violation report
|
|
169
|
-
*/
|
|
170
|
-
function formatReport(violations) {
|
|
171
|
-
if (violations.length === 0) {
|
|
172
|
-
return '✅ No token violations found';
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
let report = `⚠️ Found ${violations.length} potential token violations:\n\n`;
|
|
176
|
-
|
|
177
|
-
// Group by file
|
|
178
|
-
const byFile = {};
|
|
179
|
-
violations.forEach(v => {
|
|
180
|
-
if (!byFile[v.file]) byFile[v.file] = [];
|
|
181
|
-
byFile[v.file].push(v);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
for (const [file, fileViolations] of Object.entries(byFile)) {
|
|
185
|
-
report += `📁 ${file}\n`;
|
|
186
|
-
fileViolations.forEach(v => {
|
|
187
|
-
report += ` Line ${v.line}: ${v.message}\n`;
|
|
188
|
-
report += ` Found: ${v.value}\n`;
|
|
189
|
-
report += ` Suggestion: ${v.suggestion}\n`;
|
|
190
|
-
report += ` Context: ${v.context}\n\n`;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Summary
|
|
195
|
-
const byType = {};
|
|
196
|
-
violations.forEach(v => {
|
|
197
|
-
byType[v.type] = (byType[v.type] || 0) + 1;
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
report += `\n📊 Summary:\n`;
|
|
201
|
-
for (const [type, count] of Object.entries(byType)) {
|
|
202
|
-
report += ` ${patterns[type].message}: ${count}\n`;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return report;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Main
|
|
210
|
-
*/
|
|
211
|
-
function main() {
|
|
212
|
-
const options = parseArgs();
|
|
213
|
-
|
|
214
|
-
if (!options.dir) {
|
|
215
|
-
console.error('Error: --dir is required');
|
|
216
|
-
process.exit(1);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const dirPath = path.resolve(process.cwd(), options.dir);
|
|
220
|
-
|
|
221
|
-
if (!fs.existsSync(dirPath)) {
|
|
222
|
-
console.error(`Error: Directory not found: ${dirPath}`);
|
|
223
|
-
process.exit(1);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
console.log(`Scanning ${dirPath} for token violations...\n`);
|
|
227
|
-
|
|
228
|
-
const files = getFiles(dirPath, options.ignore);
|
|
229
|
-
const allViolations = [];
|
|
230
|
-
|
|
231
|
-
for (const file of files) {
|
|
232
|
-
if (shouldSkip(file)) continue;
|
|
233
|
-
|
|
234
|
-
const violations = scanFile(file);
|
|
235
|
-
allViolations.push(...violations);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
console.log(formatReport(allViolations));
|
|
239
|
-
|
|
240
|
-
// Exit with error code if violations found
|
|
241
|
-
if (allViolations.length > 0) {
|
|
242
|
-
process.exit(1);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
main();
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://design-tokens.org/schema.json",
|
|
3
|
-
"primitive": {
|
|
4
|
-
"color": {
|
|
5
|
-
"gray": {
|
|
6
|
-
"50": { "$value": "#F9FAFB", "$type": "color" },
|
|
7
|
-
"100": { "$value": "#F3F4F6", "$type": "color" },
|
|
8
|
-
"200": { "$value": "#E5E7EB", "$type": "color" },
|
|
9
|
-
"300": { "$value": "#D1D5DB", "$type": "color" },
|
|
10
|
-
"400": { "$value": "#9CA3AF", "$type": "color" },
|
|
11
|
-
"500": { "$value": "#6B7280", "$type": "color" },
|
|
12
|
-
"600": { "$value": "#4B5563", "$type": "color" },
|
|
13
|
-
"700": { "$value": "#374151", "$type": "color" },
|
|
14
|
-
"800": { "$value": "#1F2937", "$type": "color" },
|
|
15
|
-
"900": { "$value": "#111827", "$type": "color" },
|
|
16
|
-
"950": { "$value": "#030712", "$type": "color" }
|
|
17
|
-
},
|
|
18
|
-
"blue": {
|
|
19
|
-
"50": { "$value": "#EFF6FF", "$type": "color" },
|
|
20
|
-
"500": { "$value": "#3B82F6", "$type": "color" },
|
|
21
|
-
"600": { "$value": "#2563EB", "$type": "color" },
|
|
22
|
-
"700": { "$value": "#1D4ED8", "$type": "color" },
|
|
23
|
-
"800": { "$value": "#1E40AF", "$type": "color" }
|
|
24
|
-
},
|
|
25
|
-
"red": {
|
|
26
|
-
"500": { "$value": "#EF4444", "$type": "color" },
|
|
27
|
-
"600": { "$value": "#DC2626", "$type": "color" },
|
|
28
|
-
"700": { "$value": "#B91C1C", "$type": "color" }
|
|
29
|
-
},
|
|
30
|
-
"green": {
|
|
31
|
-
"500": { "$value": "#22C55E", "$type": "color" },
|
|
32
|
-
"600": { "$value": "#16A34A", "$type": "color" }
|
|
33
|
-
},
|
|
34
|
-
"yellow": {
|
|
35
|
-
"500": { "$value": "#EAB308", "$type": "color" }
|
|
36
|
-
},
|
|
37
|
-
"white": { "$value": "#FFFFFF", "$type": "color" }
|
|
38
|
-
},
|
|
39
|
-
"spacing": {
|
|
40
|
-
"0": { "$value": "0", "$type": "dimension" },
|
|
41
|
-
"1": { "$value": "0.25rem", "$type": "dimension" },
|
|
42
|
-
"2": { "$value": "0.5rem", "$type": "dimension" },
|
|
43
|
-
"3": { "$value": "0.75rem", "$type": "dimension" },
|
|
44
|
-
"4": { "$value": "1rem", "$type": "dimension" },
|
|
45
|
-
"5": { "$value": "1.25rem", "$type": "dimension" },
|
|
46
|
-
"6": { "$value": "1.5rem", "$type": "dimension" },
|
|
47
|
-
"8": { "$value": "2rem", "$type": "dimension" },
|
|
48
|
-
"10": { "$value": "2.5rem", "$type": "dimension" },
|
|
49
|
-
"12": { "$value": "3rem", "$type": "dimension" },
|
|
50
|
-
"16": { "$value": "4rem", "$type": "dimension" }
|
|
51
|
-
},
|
|
52
|
-
"fontSize": {
|
|
53
|
-
"xs": { "$value": "0.75rem", "$type": "dimension" },
|
|
54
|
-
"sm": { "$value": "0.875rem", "$type": "dimension" },
|
|
55
|
-
"base": { "$value": "1rem", "$type": "dimension" },
|
|
56
|
-
"lg": { "$value": "1.125rem", "$type": "dimension" },
|
|
57
|
-
"xl": { "$value": "1.25rem", "$type": "dimension" },
|
|
58
|
-
"2xl": { "$value": "1.5rem", "$type": "dimension" },
|
|
59
|
-
"3xl": { "$value": "1.875rem", "$type": "dimension" },
|
|
60
|
-
"4xl": { "$value": "2.25rem", "$type": "dimension" }
|
|
61
|
-
},
|
|
62
|
-
"radius": {
|
|
63
|
-
"none": { "$value": "0", "$type": "dimension" },
|
|
64
|
-
"sm": { "$value": "0.125rem", "$type": "dimension" },
|
|
65
|
-
"default": { "$value": "0.25rem", "$type": "dimension" },
|
|
66
|
-
"md": { "$value": "0.375rem", "$type": "dimension" },
|
|
67
|
-
"lg": { "$value": "0.5rem", "$type": "dimension" },
|
|
68
|
-
"xl": { "$value": "0.75rem", "$type": "dimension" },
|
|
69
|
-
"full": { "$value": "9999px", "$type": "dimension" }
|
|
70
|
-
},
|
|
71
|
-
"shadow": {
|
|
72
|
-
"none": { "$value": "none", "$type": "shadow" },
|
|
73
|
-
"sm": { "$value": "0 1px 2px 0 rgb(0 0 0 / 0.05)", "$type": "shadow" },
|
|
74
|
-
"default": { "$value": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", "$type": "shadow" },
|
|
75
|
-
"md": { "$value": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", "$type": "shadow" },
|
|
76
|
-
"lg": { "$value": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)", "$type": "shadow" }
|
|
77
|
-
},
|
|
78
|
-
"duration": {
|
|
79
|
-
"fast": { "$value": "150ms", "$type": "duration" },
|
|
80
|
-
"normal": { "$value": "200ms", "$type": "duration" },
|
|
81
|
-
"slow": { "$value": "300ms", "$type": "duration" }
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"semantic": {
|
|
85
|
-
"color": {
|
|
86
|
-
"background": { "$value": "{primitive.color.gray.50}", "$type": "color" },
|
|
87
|
-
"foreground": { "$value": "{primitive.color.gray.900}", "$type": "color" },
|
|
88
|
-
"primary": { "$value": "{primitive.color.blue.600}", "$type": "color" },
|
|
89
|
-
"primary-hover": { "$value": "{primitive.color.blue.700}", "$type": "color" },
|
|
90
|
-
"primary-foreground": { "$value": "{primitive.color.white}", "$type": "color" },
|
|
91
|
-
"secondary": { "$value": "{primitive.color.gray.100}", "$type": "color" },
|
|
92
|
-
"secondary-foreground": { "$value": "{primitive.color.gray.900}", "$type": "color" },
|
|
93
|
-
"muted": { "$value": "{primitive.color.gray.100}", "$type": "color" },
|
|
94
|
-
"muted-foreground": { "$value": "{primitive.color.gray.500}", "$type": "color" },
|
|
95
|
-
"destructive": { "$value": "{primitive.color.red.600}", "$type": "color" },
|
|
96
|
-
"destructive-foreground": { "$value": "{primitive.color.white}", "$type": "color" },
|
|
97
|
-
"border": { "$value": "{primitive.color.gray.200}", "$type": "color" },
|
|
98
|
-
"ring": { "$value": "{primitive.color.blue.500}", "$type": "color" }
|
|
99
|
-
},
|
|
100
|
-
"spacing": {
|
|
101
|
-
"component": { "$value": "{primitive.spacing.4}", "$type": "dimension" },
|
|
102
|
-
"section": { "$value": "{primitive.spacing.12}", "$type": "dimension" }
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"component": {
|
|
106
|
-
"button": {
|
|
107
|
-
"bg": { "$value": "{semantic.color.primary}", "$type": "color" },
|
|
108
|
-
"fg": { "$value": "{semantic.color.primary-foreground}", "$type": "color" },
|
|
109
|
-
"hover-bg": { "$value": "{semantic.color.primary-hover}", "$type": "color" },
|
|
110
|
-
"padding-x": { "$value": "{primitive.spacing.4}", "$type": "dimension" },
|
|
111
|
-
"padding-y": { "$value": "{primitive.spacing.2}", "$type": "dimension" },
|
|
112
|
-
"radius": { "$value": "{primitive.radius.md}", "$type": "dimension" },
|
|
113
|
-
"font-size": { "$value": "{primitive.fontSize.sm}", "$type": "dimension" }
|
|
114
|
-
},
|
|
115
|
-
"input": {
|
|
116
|
-
"bg": { "$value": "{semantic.color.background}", "$type": "color" },
|
|
117
|
-
"border": { "$value": "{semantic.color.border}", "$type": "color" },
|
|
118
|
-
"focus-ring": { "$value": "{semantic.color.ring}", "$type": "color" },
|
|
119
|
-
"padding-x": { "$value": "{primitive.spacing.3}", "$type": "dimension" },
|
|
120
|
-
"padding-y": { "$value": "{primitive.spacing.2}", "$type": "dimension" },
|
|
121
|
-
"radius": { "$value": "{primitive.radius.md}", "$type": "dimension" }
|
|
122
|
-
},
|
|
123
|
-
"card": {
|
|
124
|
-
"bg": { "$value": "{primitive.color.white}", "$type": "color" },
|
|
125
|
-
"border": { "$value": "{semantic.color.border}", "$type": "color" },
|
|
126
|
-
"shadow": { "$value": "{primitive.shadow.default}", "$type": "shadow" },
|
|
127
|
-
"padding": { "$value": "{primitive.spacing.6}", "$type": "dimension" },
|
|
128
|
-
"radius": { "$value": "{primitive.radius.lg}", "$type": "dimension" }
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"dark": {
|
|
132
|
-
"semantic": {
|
|
133
|
-
"color": {
|
|
134
|
-
"background": { "$value": "{primitive.color.gray.950}", "$type": "color" },
|
|
135
|
-
"foreground": { "$value": "{primitive.color.gray.50}", "$type": "color" },
|
|
136
|
-
"secondary": { "$value": "{primitive.color.gray.800}", "$type": "color" },
|
|
137
|
-
"muted": { "$value": "{primitive.color.gray.800}", "$type": "color" },
|
|
138
|
-
"muted-foreground": { "$value": "{primitive.color.gray.400}", "$type": "color" },
|
|
139
|
-
"border": { "$value": "{primitive.color.gray.800}", "$type": "color" }
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Alan
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: frontend-design
|
|
3
|
-
description: Build a frontend with a deliberate visual direction held through palette, typography, structure, and texture, with on-screen strings that name real information rather than fabricated demo data or filler labels. Use when building or restyling a frontend.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Frontend Design Skill
|
|
7
|
-
|
|
8
|
-
Eight anchors. Each is a distinct aesthetic territory locked to specific CSS tokens. Pick one per brief. Match its tokens.
|
|
9
|
-
|
|
10
|
-
> **Reach for the unexpected. Fidelity to the anchor. Discipline on the content. Nothing left to default.**
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 1. How to work
|
|
15
|
-
|
|
16
|
-
Before writing code, run this sequence:
|
|
17
|
-
|
|
18
|
-
1. **Context** — Identify purpose, audience, domain, content density. State the problem in one sentence.
|
|
19
|
-
2. **Anchor** — Pick one. Lean unexpected. A Swiss punk record label, an Industrial florist, a Brutalist luxury watchmaker, an Aurora tax app, a Chaotic law firm, a Retro-Futuristic wedding photographer, an Organic trading terminal, a Lo-Fi luxury hotel — each more distinctive than its safe counterpart. Safe pairings produce generic work. Unexpectedness is surface-level — what a first-time viewer sees. Don't let "users are technical" or "it's really a data tool" route every brief to Industrial. State the choice and the reason in one line.
|
|
20
|
-
3. **Differentiator** — Define one memorable anchor-internal move: a signature interaction, a typographic gesture, a layout motif, or a material treatment. One sentence. Describable. Visible in the rendered output.
|
|
21
|
-
4. **System** — Match the chosen anchor's tokens exactly. Picking Swiss means white + sans + grid, not "some flavor of clean."
|
|
22
|
-
5. **Implementation** — Outline structure, then build. Content on screen is authored to the discipline in §2 — no fabrication, no filler, no themed replacement for standard UI copy.
|
|
23
|
-
|
|
24
|
-
Commit fully to one anchor. Hybridising ("Swiss with Brutalist edge") is a category error — each signature excludes the others by construction.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 2. Content is not design
|
|
29
|
-
|
|
30
|
-
Design is visuals — palette, typography, structure, texture. **Content — every string, number, and label on screen — is authored separately and has its own discipline.** Token fidelity is not a defence against content slop.
|
|
31
|
-
|
|
32
|
-
The rule: every string on screen must either name real information from the product, or be authored content that knows what it is — headline, button label, legal body, form field name, sample data that reads as sample. What's forbidden is content pretending to be something it isn't.
|
|
33
|
-
|
|
34
|
-
**Forbidden:**
|
|
35
|
-
|
|
36
|
-
- **Fabrication posing as real data.** Invented session personas (`a.chen@grid.co`), fake telemetry (`GRID.FREQ 59.998 Hz`, `BUILD 8.2.0-rc3`). If a slot has no real content, leave it empty — do not fabricate to make the screen look alive.
|
|
37
|
-
- **Filler labels.** Mono-caps subtitles nobody asked for (`SECURE OPERATOR AUTHENTICATION` under a login masthead), `//`-prefixed kickers pretending to be code comments (`// INTELLIGENCE LAYER`). If removing the string removes no information, it was filler.
|
|
38
|
-
- **Themed replacement of standard UI copy.** `Authenticate Session` instead of `Next`; `Remember this operator` instead of `Remember me`. Standard copy for standard actions. Themed copy is a tax that must be paid with actual utility.
|
|
39
|
-
- **Unicode glyphs as icon substitutes.** `▣ Dashboard`, `◊ Market Navigator`. Either use a real icon set or use nothing. ASCII art is not iconography.
|
|
40
|
-
- **AI-slop register.** The model recognises this. Twee subcopy on serious surfaces (`Ask the grid.`), synth-sci-fi status strips on mundane B2B, ornamental "seam"/"joinery" flourishes pretending to be structural. Recognise it in your own output; cut it before the reviewer does.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 3. The eight anchors
|
|
45
|
-
|
|
46
|
-
Each anchor locks specific CSS tokens. Picking the anchor commits to those tokens. If the rendered output drifts outside them, the anchor didn't hold.
|
|
47
|
-
|
|
48
|
-
### 1. Swiss
|
|
49
|
-
|
|
50
|
-
**Surface:** Pure white `#FFFFFF` or neutral `#F7F7F8`. **Typography:** Akzidenz-Grotesk, Helvetica Neue, or Söhne — sans display and body, one family. **Accent:** Swiss Red `#E4002B`, International Orange `#FF4F00`, or Yves Klein Blue `#002FA7` — one, used deliberately. **Structure:** visible grid lines or 1 px hairline rules. Left-aligned typography; asymmetric balance. Numerals as composition elements (dates, folio numbers, page markers set in condensed sans).
|
|
51
|
-
|
|
52
|
-
**Breaks if:** warm paper, serif display, grain texture, or centered typography appears.
|
|
53
|
-
|
|
54
|
-
### 2. Industrial
|
|
55
|
-
|
|
56
|
-
**Surface:** Pitch black `#000000` or warm-black `#0B0C0A`. **Typography:** IBM Plex Mono, JetBrains Mono, or Berkeley Mono — mono for display and body. **Signal color:** one semantic — green `#00E676`, red `#FF3B30`, amber `#FFB800`, or acid lime `#C6FF4A`. **Structure:** flat; 1 px borders instead of shadows. Tabular numerics via `font-variant-numeric: tabular-nums`.
|
|
57
|
-
|
|
58
|
-
**Breaks if:** serif typography, proportional fonts, warm paper, any grain, decorative shadows, or rounded corners appear.
|
|
59
|
-
|
|
60
|
-
### 3. Brutalist
|
|
61
|
-
|
|
62
|
-
**Surface:** Pure primary or anti-primary — `#FF0000`, `#0000FF`, `#FFFF00`, `#000000`, `#FFFFFF`. Pick 2–3, compete equally. **Typography:** system fonts only — Times New Roman, Helvetica, Courier, Arial, system-ui. Mix faces deliberately. **Shadows:** hard offset, no blur — `box-shadow: 8px 8px 0 #000`. **Controls:** native browser — unstyled `<button>`, default `<select>`, underlined blue links that stay blue. Margins crushed; type runs edge-to-edge.
|
|
63
|
-
|
|
64
|
-
**Breaks if:** webfonts, tuned hex beyond pure primaries, soft shadows, rounded corners, or centered layout appear.
|
|
65
|
-
|
|
66
|
-
### 4. Aurora Maximalism
|
|
67
|
-
|
|
68
|
-
**Surface:** Dark saturated gradient — `linear-gradient` or `conic-gradient` through violet `#5D34D0` → magenta `#FF006E` → cyan `#00F0FF`, or `#3B82F6 → #A855F7 → #EC4899`. **Typography:** Inter Variable, PP Neue Machina, or Sharp Grotesk for oversized display (15–25 vw). **Texture:** mesh gradient as primary surface feature; neon `text-shadow` glow on accents (`0 0 20px <accent>`). **Motion:** spring-physics orchestration, scroll-linked parallax.
|
|
69
|
-
|
|
70
|
-
**Breaks if:** flat backgrounds, warm paper, restraint, or hairline rules as primary structure appear.
|
|
71
|
-
|
|
72
|
-
### 5. Chaotic Maximalism
|
|
73
|
-
|
|
74
|
-
**Surface:** Clashing palette — pastels *and* neons in the same composition. Hot pink `#FF71CE` + acid yellow `#DFFF00` + cyan `#00FFFF` + any third. **Typography:** mixed faces deliberately colliding — 3+ faces from different registers on the same page. **Texture:** patterns on every surface (squiggles, dots, zigzags, checker — SVG or `repeating-linear-gradient`). Oversized display crashing against busy ground.
|
|
75
|
-
|
|
76
|
-
**Breaks if:** coherent palette, single typeface, whitespace as structural element, or 60/30/10 dominance appears.
|
|
77
|
-
|
|
78
|
-
### 6. Retro-Futuristic
|
|
79
|
-
|
|
80
|
-
**Surface:** Pitch black `#0A0014` or deep navy-black. **Typography:** period-specific — VT323 (CRT), Orbitron (synthwave), Space Mono (cyberpunk), Monoton (Miami-neon), Press Start 2P (arcade), IBM Plex Mono (terminal). **Accent:** neon pair — magenta `#FF006E` + cyan `#00FFFF` (synthwave) or phosphor green `#00FF41` + amber `#FFB000` (terminal). **Texture:** CRT scanlines via `::before` `repeating-linear-gradient` overlay, or chromatic aberration (`text-shadow: 2px 0 #FF0000, -2px 0 #00FFFF`), or both. Glow committed.
|
|
81
|
-
|
|
82
|
-
**Breaks if:** flatness, modern sans-serifs (Inter, Söhne), paper surfaces, or absence of texture appears.
|
|
83
|
-
|
|
84
|
-
### 7. Organic
|
|
85
|
-
|
|
86
|
-
**Surface:** Earth tones — sage `#8B9D83`, clay `#B08B6E`, terracotta `#C66B3D`, ochre `#C08E3A`, moss `#606C38`. When a light surface is needed: sand `#E8DCC7` or oat `#D4B895`. **Never cream `#F0-F8` warm-paper range.** **Typography:** humanist serif (Freight, Caslon, Fraunces — Fraunces is restricted to this anchor only) or warm geometric sans (Greycliff, Epilogue, Recoleta). **Structure:** rounded corners 16–32 px. **Texture:** grain at 1–3 % via SVG feTurbulence. **Motion:** gentle ease 300–500 ms, breathing animations on hero elements.
|
|
87
|
-
|
|
88
|
-
**Breaks if:** cream backgrounds (warm-tinted `#F0+`), cold greys, pure whites, pure blacks, or hard rectangles appear.
|
|
89
|
-
|
|
90
|
-
### 8. Lo-Fi
|
|
91
|
-
|
|
92
|
-
**Surface:** Paper-yellow `#E8E0C0` or `#EDE4CF` — more saturated than cream. **Typography:** mixed system fonts on the same page (Times + Helvetica + Courier colliding deliberately). **Structure:** rotated elements (2–8° off-grid via `transform: rotate`). **Texture:** halftone dot transitions (SVG pattern or `radial-gradient` tile) on imagery; Risograph misregistration (2–4 px RGB channel offset via `text-shadow: 3px 0 #FF006E, -3px 0 #00FFCC`). SVG staple, tape, torn-edge elements.
|
|
93
|
-
|
|
94
|
-
**Breaks if:** precision, single typeface, smooth motion, rectangles squared to the grid, or cream (the surface is specifically paper-yellow, more saturated) appears.
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## 4. Output
|
|
99
|
-
|
|
100
|
-
Every implementation delivers:
|
|
101
|
-
|
|
102
|
-
- **Stated direction** — A short preamble in a designer's prose before the code, naming: the chosen anchor, why this pairing over the safe one, the differentiator, and the key palette / typefaces / texture choices pulled from the anchor. Written with conviction, not as a checklist.
|
|
103
|
-
- **Token fidelity** — The rendered CSS matches the anchor's tokens exactly. If Swiss is chosen, the CSS contains no warm paper, no Fraunces, no grain. If Industrial is chosen, every typeface declared is monospace. Token drift means the anchor didn't hold.
|
|
104
|
-
- **Content discipline** — Every string, number, and label on screen names real information or is authored content that knows what it is. No fabricated data, no filler labels, no themed replacement for standard UI copy, no unicode-glyph icons. Token fidelity alone is not sufficient; content ships too.
|
|
105
|
-
- **Differentiator visible** — The one memorable move is implemented in the rendered output, not merely described.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 5. Before shipping
|
|
110
|
-
|
|
111
|
-
- **Unexpected pairing** — Did the choice reach for creative tension, or default to the safe pairing?
|
|
112
|
-
- **Token fidelity** — Does every rendered token live inside the anchor's allowed range? If tokens appear that the anchor doesn't allow, the anchor didn't hold.
|
|
113
|
-
- **Content discipline** — Every label names real information; standard UI copy for standard actions; no fabrication, filler mono-caps, `//` kickers, unicode-glyph icons, twee subcopy, or AI-slop register. If any appeared, cut.
|
|
114
|
-
- **Differentiator visible** — Is the memorable anchor-internal move actually rendered?
|
|
115
|
-
- **Hybrid resistance** — Was one anchor held, or did the execution drift into "Swiss with Brutalist edge"?
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# MAFW Automation Interview Skill
|
|
2
|
-
|
|
3
|
-
## 职责
|
|
4
|
-
|
|
5
|
-
帮助用户配置自动化规则(automations/*.json)。
|
|
6
|
-
|
|
7
|
-
## 工作流程
|
|
8
|
-
|
|
9
|
-
1. 询问用户:触发条件(cron schedule)
|
|
10
|
-
2. 询问用户:发现方式(Skill 名称)
|
|
11
|
-
3. 询问用户:结果处理方式(triage 或 direct goal)
|
|
12
|
-
4. 询问用户:默认 Goal 参数(maxLoops, metrics)
|
|
13
|
-
5. 确认后写入 automations/{id}.json
|
|
14
|
-
|
|
15
|
-
## 输出格式
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"id": "daily-github",
|
|
20
|
-
"enabled": true,
|
|
21
|
-
"trigger": {
|
|
22
|
-
"type": "cron",
|
|
23
|
-
"schedule": "0 7 * * *",
|
|
24
|
-
"timezone": "Asia/Shanghai"
|
|
25
|
-
},
|
|
26
|
-
"skill": "mafw-github-scanner",
|
|
27
|
-
"args": {},
|
|
28
|
-
"onResult": {
|
|
29
|
-
"type": "triage",
|
|
30
|
-
"auto_confirm": false
|
|
31
|
-
},
|
|
32
|
-
"goal_defaults": {
|
|
33
|
-
"maxLoops": 3
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## 约束
|
|
39
|
-
|
|
40
|
-
- schedule 必须是有效的 cron 表达式
|
|
41
|
-
- skill 必须是已注册的扫描器 Skill
|
|
42
|
-
- 用户确认后才写入文件
|
|
43
|
-
- 写入后触发 RELOAD_AUTOMATIONS 控制信号
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# MAFW CLI Scanner Skill
|
|
2
|
-
|
|
3
|
-
## 职责
|
|
4
|
-
|
|
5
|
-
通过本地命令行扫描项目状态,发现需要 Agent 处理的工作。
|
|
6
|
-
|
|
7
|
-
## 工作流程
|
|
8
|
-
|
|
9
|
-
1. 执行本地命令(如 `git status`, `npm outdated`)
|
|
10
|
-
2. 解析输出
|
|
11
|
-
3. 返回 findings 列表
|
|
12
|
-
|
|
13
|
-
## 输入
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{
|
|
17
|
-
"commands": ["git status --short", "npm outdated --json"],
|
|
18
|
-
"filters": ["modified_files", "outdated_packages"]
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 输出
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"findings": [
|
|
27
|
-
{ "type": "modified_file", "count": 5 },
|
|
28
|
-
{ "type": "outdated_package", "count": 2 }
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 约束
|
|
34
|
-
|
|
35
|
-
- 不直接创建 Goal,只返回 findings
|
|
36
|
-
- Automation Engine 决定如何处理 findings
|
|
37
|
-
- 命令执行超时 30 秒
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# MAFW Compression Verifier — Compaction Verification Skill
|
|
2
|
-
|
|
3
|
-
## 角色
|
|
4
|
-
|
|
5
|
-
Compression Verifier Agent — 验证 L2 压缩后的 Lesson 是否丢失关键信息。
|
|
6
|
-
|
|
7
|
-
## 职责
|
|
8
|
-
|
|
9
|
-
1. 对比压缩前后的 Lesson 内容
|
|
10
|
-
2. 运行 5 项验证清单
|
|
11
|
-
3. 发现丢失时拒绝压缩,保留原始版本
|
|
12
|
-
4. 确保压缩后 YAML 可被 MemoryExtractor 正确解析
|
|
13
|
-
|
|
14
|
-
## 输入
|
|
15
|
-
|
|
16
|
-
- 原始 RawLesson(自然语言)
|
|
17
|
-
- 压缩后 CompactedLesson(YAML)
|
|
18
|
-
|
|
19
|
-
## 5 项验证清单
|
|
20
|
-
|
|
21
|
-
| # | 规则 | 检查内容 |
|
|
22
|
-
|---|------|----------|
|
|
23
|
-
| V1 | loop 不丢失 | comp.loop === orig.loop |
|
|
24
|
-
| V2 | result 不丢失 | comp.result === orig.result |
|
|
25
|
-
| V3 | domain 不丢失 | comp.domain === orig.domain |
|
|
26
|
-
| V4 | 核心动作不丢失 | lesson 必须包含"必须/禁止/should/must"等动词 |
|
|
27
|
-
| V5 | violation.rule 不丢失 | 若原始有 violation,压缩后 rule 必须保留 |
|
|
28
|
-
|
|
29
|
-
## 输出
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"pass": false,
|
|
34
|
-
"failures": [
|
|
35
|
-
"[V4] lesson 核心动作丢失: 原始包含'必须引用AGENTS.md',压缩后未保留"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## 核心约束
|
|
41
|
-
|
|
42
|
-
- 任何一项失败 → 拒绝压缩,保留原始版本
|
|
43
|
-
- 不能为了压缩率而牺牲信息完整性
|
|
44
|
-
- 压缩后的 YAML 必须语法正确,可被解析
|
|
45
|
-
- 原始文件必须保留备份(至少保留 30 天)
|
|
46
|
-
|
|
47
|
-
## 自检清单
|
|
48
|
-
|
|
49
|
-
验证完成后,必须回答:
|
|
50
|
-
1. [ ] 5 项检查是否全部通过?
|
|
51
|
-
2. [ ] 压缩后的 YAML 是否可解析?
|
|
52
|
-
3. [ ] 若失败,是否保留了原始版本?
|