skillui 1.1.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/dist/cli.d.ts +3 -0
- package/dist/cli.js +202 -0
- package/dist/extractors/components.d.ts +11 -0
- package/dist/extractors/components.js +455 -0
- package/dist/extractors/framework.d.ts +4 -0
- package/dist/extractors/framework.js +126 -0
- package/dist/extractors/tokens/computed.d.ts +7 -0
- package/dist/extractors/tokens/computed.js +249 -0
- package/dist/extractors/tokens/css.d.ts +3 -0
- package/dist/extractors/tokens/css.js +510 -0
- package/dist/extractors/tokens/http-css.d.ts +14 -0
- package/dist/extractors/tokens/http-css.js +1689 -0
- package/dist/extractors/tokens/tailwind.d.ts +3 -0
- package/dist/extractors/tokens/tailwind.js +353 -0
- package/dist/extractors/tokens/tokens-file.d.ts +3 -0
- package/dist/extractors/tokens/tokens-file.js +229 -0
- package/dist/extractors/ultra/animations.d.ts +21 -0
- package/dist/extractors/ultra/animations.js +530 -0
- package/dist/extractors/ultra/components-dom.d.ts +13 -0
- package/dist/extractors/ultra/components-dom.js +152 -0
- package/dist/extractors/ultra/interactions.d.ts +14 -0
- package/dist/extractors/ultra/interactions.js +225 -0
- package/dist/extractors/ultra/layout.d.ts +14 -0
- package/dist/extractors/ultra/layout.js +126 -0
- package/dist/extractors/ultra/pages.d.ts +16 -0
- package/dist/extractors/ultra/pages.js +231 -0
- package/dist/font-resolver.d.ts +10 -0
- package/dist/font-resolver.js +280 -0
- package/dist/modes/dir.d.ts +6 -0
- package/dist/modes/dir.js +213 -0
- package/dist/modes/repo.d.ts +6 -0
- package/dist/modes/repo.js +76 -0
- package/dist/modes/ultra.d.ts +22 -0
- package/dist/modes/ultra.js +285 -0
- package/dist/modes/url.d.ts +14 -0
- package/dist/modes/url.js +161 -0
- package/dist/normalizer.d.ts +11 -0
- package/dist/normalizer.js +867 -0
- package/dist/screenshot.d.ts +9 -0
- package/dist/screenshot.js +94 -0
- package/dist/types-ultra.d.ts +157 -0
- package/dist/types-ultra.js +4 -0
- package/dist/types.d.ts +182 -0
- package/dist/types.js +4 -0
- package/dist/writers/animations-md.d.ts +17 -0
- package/dist/writers/animations-md.js +313 -0
- package/dist/writers/components-md.d.ts +8 -0
- package/dist/writers/components-md.js +151 -0
- package/dist/writers/design-md.d.ts +7 -0
- package/dist/writers/design-md.js +704 -0
- package/dist/writers/interactions-md.d.ts +8 -0
- package/dist/writers/interactions-md.js +146 -0
- package/dist/writers/layout-md.d.ts +8 -0
- package/dist/writers/layout-md.js +120 -0
- package/dist/writers/skill.d.ts +12 -0
- package/dist/writers/skill.js +1006 -0
- package/dist/writers/tokens-json.d.ts +11 -0
- package/dist/writers/tokens-json.js +164 -0
- package/package.json +78 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DesignProfile } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ultra mode — Token JSON Writer
|
|
4
|
+
*
|
|
5
|
+
* Writes structured JSON token files to tokens/ directory:
|
|
6
|
+
* - tokens/colors.json
|
|
7
|
+
* - tokens/spacing.json
|
|
8
|
+
* - tokens/typography.json
|
|
9
|
+
*/
|
|
10
|
+
export declare function writeTokensJson(profile: DesignProfile, skillDir: string): void;
|
|
11
|
+
//# sourceMappingURL=tokens-json.d.ts.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.writeTokensJson = writeTokensJson;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
/**
|
|
40
|
+
* Ultra mode — Token JSON Writer
|
|
41
|
+
*
|
|
42
|
+
* Writes structured JSON token files to tokens/ directory:
|
|
43
|
+
* - tokens/colors.json
|
|
44
|
+
* - tokens/spacing.json
|
|
45
|
+
* - tokens/typography.json
|
|
46
|
+
*/
|
|
47
|
+
function writeTokensJson(profile, skillDir) {
|
|
48
|
+
const tokensDir = path.join(skillDir, 'tokens');
|
|
49
|
+
fs.mkdirSync(tokensDir, { recursive: true });
|
|
50
|
+
writeColorsJson(profile, tokensDir);
|
|
51
|
+
writeSpacingJson(profile, tokensDir);
|
|
52
|
+
writeTypographyJson(profile, tokensDir);
|
|
53
|
+
}
|
|
54
|
+
// ── colors.json ──────────────────────────────────────────────────────
|
|
55
|
+
function writeColorsJson(profile, tokensDir) {
|
|
56
|
+
const core = {};
|
|
57
|
+
const extended = {};
|
|
58
|
+
const status = {};
|
|
59
|
+
for (const color of profile.colors) {
|
|
60
|
+
const token = {
|
|
61
|
+
value: color.hex,
|
|
62
|
+
role: color.role,
|
|
63
|
+
};
|
|
64
|
+
if (color.name)
|
|
65
|
+
token.name = color.name;
|
|
66
|
+
switch (color.role) {
|
|
67
|
+
case 'background':
|
|
68
|
+
case 'surface':
|
|
69
|
+
case 'text-primary':
|
|
70
|
+
case 'text-muted':
|
|
71
|
+
case 'accent':
|
|
72
|
+
case 'border':
|
|
73
|
+
core[color.role] = token;
|
|
74
|
+
break;
|
|
75
|
+
case 'danger':
|
|
76
|
+
case 'success':
|
|
77
|
+
case 'warning':
|
|
78
|
+
status[color.role] = token;
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
const key = color.name
|
|
82
|
+
? color.name.replace(/\s+/g, '-').toLowerCase()
|
|
83
|
+
: color.hex.replace('#', 'color-');
|
|
84
|
+
extended[key] = token;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const output = {
|
|
88
|
+
$schema: 'https://design-tokens.github.io/community-group/format/',
|
|
89
|
+
core,
|
|
90
|
+
status,
|
|
91
|
+
extended,
|
|
92
|
+
meta: {
|
|
93
|
+
theme: profile.designTraits.isDark ? 'dark' : 'light',
|
|
94
|
+
extracted: new Date().toISOString().slice(0, 10),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
fs.writeFileSync(path.join(tokensDir, 'colors.json'), JSON.stringify(output, null, 2), 'utf-8');
|
|
98
|
+
}
|
|
99
|
+
// ── spacing.json ─────────────────────────────────────────────────────
|
|
100
|
+
function writeSpacingJson(profile, tokensDir) {
|
|
101
|
+
const { base, values, unit } = profile.spacing;
|
|
102
|
+
// Named semantic scale
|
|
103
|
+
const scale = {};
|
|
104
|
+
const sortedValues = [...values].sort((a, b) => a - b);
|
|
105
|
+
// Assign t-shirt sizes
|
|
106
|
+
const labels = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'];
|
|
107
|
+
sortedValues.slice(0, labels.length).forEach((v, i) => {
|
|
108
|
+
scale[labels[i]] = { value: `${v}${unit}`, px: v };
|
|
109
|
+
});
|
|
110
|
+
// Multiplier aliases
|
|
111
|
+
const multipliers = {};
|
|
112
|
+
for (let i = 1; i <= 16; i++) {
|
|
113
|
+
multipliers[`${i}x`] = base * i;
|
|
114
|
+
}
|
|
115
|
+
const output = {
|
|
116
|
+
base: { value: `${base}px`, description: 'Grid unit — all spacing must be multiples of this' },
|
|
117
|
+
unit,
|
|
118
|
+
scale,
|
|
119
|
+
multipliers: Object.fromEntries(Object.entries(multipliers).map(([k, v]) => [k, { value: `${v}px`, raw: v }])),
|
|
120
|
+
meta: {
|
|
121
|
+
totalValues: values.length,
|
|
122
|
+
min: sortedValues[0] ?? 0,
|
|
123
|
+
max: sortedValues[sortedValues.length - 1] ?? 0,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
fs.writeFileSync(path.join(tokensDir, 'spacing.json'), JSON.stringify(output, null, 2), 'utf-8');
|
|
127
|
+
}
|
|
128
|
+
// ── typography.json ──────────────────────────────────────────────────
|
|
129
|
+
function writeTypographyJson(profile, tokensDir) {
|
|
130
|
+
const scale = {};
|
|
131
|
+
for (const token of profile.typography) {
|
|
132
|
+
const key = token.role;
|
|
133
|
+
scale[key] = {
|
|
134
|
+
fontFamily: token.fontFamily,
|
|
135
|
+
fontSize: token.fontSize || null,
|
|
136
|
+
fontWeight: token.fontWeight || null,
|
|
137
|
+
lineHeight: token.lineHeight || null,
|
|
138
|
+
source: token.source,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Unique font families
|
|
142
|
+
const families = [...new Set(profile.typography.map(t => t.fontFamily).filter(Boolean))];
|
|
143
|
+
// Font face declarations
|
|
144
|
+
const fontFaces = profile.fontSources.map(src => ({
|
|
145
|
+
family: src.family,
|
|
146
|
+
src: src.src,
|
|
147
|
+
format: src.format || 'truetype',
|
|
148
|
+
weight: src.weight || '400',
|
|
149
|
+
}));
|
|
150
|
+
const output = {
|
|
151
|
+
families,
|
|
152
|
+
scale,
|
|
153
|
+
fontFaces,
|
|
154
|
+
rules: {
|
|
155
|
+
maxSizesPerScreen: 4,
|
|
156
|
+
headingWeightRange: '600-700',
|
|
157
|
+
bodyWeight: 400,
|
|
158
|
+
lineHeightBody: 1.5,
|
|
159
|
+
lineHeightHeading: 1.2,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
fs.writeFileSync(path.join(tokensDir, 'typography.json'), JSON.stringify(output, null, 2), 'utf-8');
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=tokens-json.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skillui",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Reverse-engineer design systems from any website, repo, or project. Extracts colors, fonts, spacing, animations, and components — packaged as a .skill file for Claude. Pure static analysis, zero AI, zero API keys.",
|
|
5
|
+
"main": "dist/cli.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"skillui": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node dist/cli.js",
|
|
12
|
+
"dev": "ts-node src/cli.ts",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"design-system",
|
|
17
|
+
"design-tokens",
|
|
18
|
+
"static-analysis",
|
|
19
|
+
"css",
|
|
20
|
+
"tailwind",
|
|
21
|
+
"cli",
|
|
22
|
+
"claude",
|
|
23
|
+
"claude-code",
|
|
24
|
+
"skill",
|
|
25
|
+
"ui",
|
|
26
|
+
"figma",
|
|
27
|
+
"reverse-engineer",
|
|
28
|
+
"animations",
|
|
29
|
+
"playwright"
|
|
30
|
+
],
|
|
31
|
+
"author": "Amaan",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"homepage": "https://github.com/amaanbuilds/skillui#readme",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/amaanbuilds/skillui.git"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/amaanbuilds/skillui/issues"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@babel/parser": "^7.24.0",
|
|
43
|
+
"@babel/traverse": "^7.24.0",
|
|
44
|
+
"@babel/types": "^7.24.0",
|
|
45
|
+
"archiver": "^7.0.0",
|
|
46
|
+
"commander": "^12.0.0",
|
|
47
|
+
"css-tree": "^2.3.1",
|
|
48
|
+
"culori": "^4.0.0",
|
|
49
|
+
"glob": "^10.3.0",
|
|
50
|
+
"jiti": "^1.21.0",
|
|
51
|
+
"postcss": "^8.4.0",
|
|
52
|
+
"simple-git": "^3.24.0",
|
|
53
|
+
"tmp": "^0.2.3"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/archiver": "^6.0.0",
|
|
57
|
+
"@types/css-tree": "^2.3.0",
|
|
58
|
+
"@types/node": "^20.0.0",
|
|
59
|
+
"@types/tmp": "^0.2.6",
|
|
60
|
+
"playwright": "^1.59.1",
|
|
61
|
+
"typescript": "^5.4.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"playwright": "^1.40.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependenciesMeta": {
|
|
67
|
+
"playwright": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=18.0.0"
|
|
73
|
+
},
|
|
74
|
+
"files": [
|
|
75
|
+
"dist/**/*.js",
|
|
76
|
+
"dist/**/*.d.ts"
|
|
77
|
+
]
|
|
78
|
+
}
|