@pedroab0/skills 0.0.0-stage → 1.0.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 (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +194 -2
  3. package/bin/cli.js +748 -0
  4. package/figma-extractor/README.md +180 -0
  5. package/figma-extractor/SKILL.md +199 -0
  6. package/figma-extractor/demo/desktop_home.json +2434 -0
  7. package/figma-extractor/demo/dt_money_desktop_home.png +0 -0
  8. package/figma-extractor/demo/dt_money_preview.png +0 -0
  9. package/figma-extractor/demo/dt_money_selection.json +472 -0
  10. package/figma-extractor/demo/index.html +188 -0
  11. package/figma-extractor/demo/style.css +360 -0
  12. package/figma-extractor/figma-plugin/README.md +81 -0
  13. package/figma-extractor/figma-plugin/assets/cover-1920.png +0 -0
  14. package/figma-extractor/figma-plugin/assets/cover.jpg +0 -0
  15. package/figma-extractor/figma-plugin/assets/cover.png +0 -0
  16. package/figma-extractor/figma-plugin/assets/icon-128.png +0 -0
  17. package/figma-extractor/figma-plugin/assets/icon.png +0 -0
  18. package/figma-extractor/figma-plugin/code.js +407 -0
  19. package/figma-extractor/figma-plugin/manifest.json +16 -0
  20. package/figma-extractor/figma-plugin/ui.html +470 -0
  21. package/figma-extractor/scripts/fetch_figma.js +1314 -0
  22. package/figma-extractor/scripts/test_fetch_figma.js +601 -0
  23. package/figma-node-builder/README.md +107 -0
  24. package/figma-node-builder/SKILL.md +113 -0
  25. package/figma-node-builder/scripts/inspect_spec.js +514 -0
  26. package/figma-node-builder/scripts/test_inspect_spec.js +148 -0
  27. package/figma-to-code/README.md +160 -0
  28. package/figma-to-code/SKILL.md +211 -0
  29. package/figma-to-code/scripts/fetch_figma.js +1251 -0
  30. package/figma-to-code/scripts/test_fetch_figma.js +581 -0
  31. package/package.json +40 -4
@@ -0,0 +1,360 @@
1
+ /* DT Money - Complete Desktop Home UI */
2
+ :root {
3
+ /* Colors from Figma */
4
+ --gray-100: #e1e1e6;
5
+ --gray-300: #c4c4cc;
6
+ --gray-500: #7c7c8a;
7
+ --gray-600: #323238;
8
+ --gray-700: #29292e;
9
+ --gray-800: #202024;
10
+ --gray-900: #121214;
11
+
12
+ --green-300: #00b37e;
13
+ --green-500: #00875f;
14
+ --green-700: #015f43;
15
+ --red-500: #f75a68;
16
+ --white: #ffffff;
17
+
18
+ /* Typography */
19
+ --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
20
+ --radius-sm: 5px;
21
+ --radius-md: 6px;
22
+ }
23
+
24
+ *, *::before, *::after {
25
+ box-sizing: border-box;
26
+ margin: 0;
27
+ padding: 0;
28
+ }
29
+
30
+ body {
31
+ font-family: var(--font-sans);
32
+ background-color: var(--gray-800);
33
+ color: var(--gray-100);
34
+ min-height: 100vh;
35
+ -webkit-font-smoothing: antialiased;
36
+ }
37
+
38
+ /* Page Header (Dark Top Bar) */
39
+ .page-header {
40
+ background-color: var(--gray-900);
41
+ padding: 40px 0 128px 0;
42
+ }
43
+
44
+ .header-container {
45
+ width: 100%;
46
+ max-width: 1120px;
47
+ margin: 0 auto;
48
+ padding: 0 24px;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: space-between;
52
+ }
53
+
54
+ .logo {
55
+ display: flex;
56
+ align-items: center;
57
+ gap: 16px;
58
+ text-decoration: none;
59
+ }
60
+
61
+ .logo-text {
62
+ font-size: 26px;
63
+ font-weight: 700;
64
+ color: var(--gray-100);
65
+ letter-spacing: -0.5px;
66
+ }
67
+
68
+ .btn-new-transaction {
69
+ background-color: var(--green-500);
70
+ color: var(--white);
71
+ border: none;
72
+ border-radius: var(--radius-md);
73
+ padding: 12px 20px;
74
+ font-size: 16px;
75
+ font-weight: 700;
76
+ cursor: pointer;
77
+ transition: background-color 0.2s, transform 0.1s;
78
+ }
79
+
80
+ .btn-new-transaction:hover {
81
+ background-color: var(--green-700);
82
+ }
83
+
84
+ .btn-new-transaction:active {
85
+ transform: scale(0.98);
86
+ }
87
+
88
+ /* Main Content Area */
89
+ .main-content {
90
+ width: 100%;
91
+ max-width: 1120px;
92
+ margin: 0 auto;
93
+ padding: 0 24px 64px 24px;
94
+ }
95
+
96
+ /* Summary Cards (Overlapping Header by ~68px) */
97
+ .summary-cards {
98
+ display: grid;
99
+ grid-template-columns: repeat(3, 1fr);
100
+ gap: 32px;
101
+ margin-top: -68px;
102
+ }
103
+
104
+ .card {
105
+ background-color: var(--gray-600);
106
+ border-radius: var(--radius-md);
107
+ padding: 24px 24px 24px 32px;
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: 12px;
111
+ min-height: 137px;
112
+ box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2);
113
+ }
114
+
115
+ .card.card-highlight {
116
+ background-color: var(--green-700);
117
+ }
118
+
119
+ .card-header {
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: space-between;
123
+ }
124
+
125
+ .card-title {
126
+ color: var(--gray-300);
127
+ font-size: 16px;
128
+ font-weight: 400;
129
+ line-height: 26px;
130
+ }
131
+
132
+ .card-icon {
133
+ width: 32px;
134
+ height: 32px;
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ flex-shrink: 0;
139
+ }
140
+
141
+ .card-value {
142
+ color: var(--gray-100);
143
+ font-size: 32px;
144
+ font-weight: 700;
145
+ line-height: 45px;
146
+ }
147
+
148
+ /* Search Bar */
149
+ .search-form {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: 16px;
153
+ margin-top: 64px;
154
+ }
155
+
156
+ .search-input {
157
+ flex: 1;
158
+ background-color: var(--gray-900);
159
+ border: 1px solid transparent;
160
+ border-radius: var(--radius-md);
161
+ padding: 16px;
162
+ color: var(--gray-100);
163
+ font-family: var(--font-sans);
164
+ font-size: 16px;
165
+ line-height: 22px;
166
+ outline: none;
167
+ transition: border-color 0.2s;
168
+ }
169
+
170
+ .search-input::placeholder {
171
+ color: var(--gray-500);
172
+ }
173
+
174
+ .search-input:focus {
175
+ border-color: var(--green-300);
176
+ }
177
+
178
+ .btn-search {
179
+ background-color: transparent;
180
+ border: 1px solid var(--green-300);
181
+ border-radius: var(--radius-md);
182
+ color: var(--green-300);
183
+ padding: 14px 32px;
184
+ font-size: 16px;
185
+ font-weight: 700;
186
+ display: flex;
187
+ align-items: center;
188
+ gap: 12px;
189
+ cursor: pointer;
190
+ transition: all 0.2s;
191
+ white-space: nowrap;
192
+ }
193
+
194
+ .btn-search:hover {
195
+ background-color: var(--green-500);
196
+ border-color: var(--green-500);
197
+ color: var(--white);
198
+ }
199
+
200
+ .btn-search svg {
201
+ transition: fill 0.2s;
202
+ }
203
+
204
+ .btn-search:hover svg {
205
+ fill: var(--white);
206
+ }
207
+
208
+ /* Transactions Table */
209
+ .table-container {
210
+ margin-top: 24px;
211
+ width: 100%;
212
+ overflow-x: auto;
213
+ }
214
+
215
+ .transactions-table {
216
+ width: 100%;
217
+ border-collapse: separate;
218
+ border-spacing: 0 8px;
219
+ }
220
+
221
+ .transactions-table tr {
222
+ background-color: var(--gray-700);
223
+ transition: transform 0.15s, background-color 0.15s;
224
+ }
225
+
226
+ .transactions-table tr:hover {
227
+ background-color: #2e2e34;
228
+ }
229
+
230
+ .transactions-table td {
231
+ padding: 20px 32px;
232
+ font-size: 16px;
233
+ line-height: 26px;
234
+ vertical-align: middle;
235
+ }
236
+
237
+ .transactions-table td:first-child {
238
+ border-top-left-radius: var(--radius-sm);
239
+ border-bottom-left-radius: var(--radius-sm);
240
+ color: var(--gray-300);
241
+ width: 48%;
242
+ }
243
+
244
+ .transactions-table td:last-child {
245
+ border-top-right-radius: var(--radius-sm);
246
+ border-bottom-right-radius: var(--radius-sm);
247
+ color: var(--gray-500);
248
+ text-align: right;
249
+ width: 14%;
250
+ }
251
+
252
+ .transactions-table .col-category {
253
+ color: var(--gray-500);
254
+ width: 20%;
255
+ }
256
+
257
+ .transactions-table .col-amount {
258
+ font-weight: 400;
259
+ width: 18%;
260
+ white-space: nowrap;
261
+ }
262
+
263
+ .amount-income {
264
+ color: var(--green-300);
265
+ }
266
+
267
+ .amount-outcome {
268
+ color: var(--red-500);
269
+ }
270
+
271
+ /* Pagination */
272
+ .pagination {
273
+ margin-top: 40px;
274
+ display: flex;
275
+ align-items: center;
276
+ justify-content: center;
277
+ gap: 16px;
278
+ }
279
+
280
+ .pagination-btn {
281
+ background: transparent;
282
+ border: none;
283
+ display: flex;
284
+ align-items: center;
285
+ justify-content: center;
286
+ cursor: pointer;
287
+ padding: 8px;
288
+ }
289
+
290
+ .pagination-btn.disabled {
291
+ cursor: not-allowed;
292
+ opacity: 0.4;
293
+ }
294
+
295
+ .pagination-pages {
296
+ display: flex;
297
+ align-items: center;
298
+ gap: 8px;
299
+ }
300
+
301
+ .page-num {
302
+ width: 40px;
303
+ height: 40px;
304
+ border-radius: var(--radius-md);
305
+ background-color: var(--gray-600);
306
+ color: var(--gray-300);
307
+ border: none;
308
+ font-family: var(--font-sans);
309
+ font-size: 16px;
310
+ font-weight: 700;
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: center;
314
+ cursor: pointer;
315
+ transition: all 0.2s;
316
+ }
317
+
318
+ .page-num:hover:not(.active) {
319
+ background-color: var(--gray-700);
320
+ color: var(--gray-100);
321
+ }
322
+
323
+ .page-num.active {
324
+ background-color: var(--green-500);
325
+ color: var(--white);
326
+ }
327
+
328
+ /* Responsive Breakpoints */
329
+ @media (max-width: 960px) {
330
+ .summary-cards {
331
+ grid-template-columns: 1fr;
332
+ gap: 16px;
333
+ }
334
+
335
+ .transactions-table td {
336
+ padding: 16px 20px;
337
+ font-size: 14px;
338
+ }
339
+
340
+ .card-value {
341
+ font-size: 26px;
342
+ }
343
+ }
344
+
345
+ @media (max-width: 640px) {
346
+ .header-container {
347
+ flex-direction: column;
348
+ gap: 20px;
349
+ align-items: flex-start;
350
+ }
351
+
352
+ .search-form {
353
+ flex-direction: column;
354
+ }
355
+
356
+ .btn-search {
357
+ width: 100%;
358
+ justify-content: center;
359
+ }
360
+ }
@@ -0,0 +1,81 @@
1
+ <p align="center">
2
+ <img src="./assets/icon.png" alt="Figma Node JSON Extractor Icon" width="256" />
3
+ </p>
4
+
5
+ # Figma Node JSON Extractor
6
+
7
+ <p align="center">
8
+ <a href="https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor"><img src="https://img.shields.io/badge/Figma_Community-Figma_Node_JSON_Extractor-000000?style=flat&logo=figma&logoColor=white" alt="Figma Community Plugin" /></a>
9
+ <a href="https://www.npmjs.com/package/@pedroab0/skills"><img src="https://img.shields.io/npm/v/@pedroab0/skills.svg?label=@pedroab0/skills" alt="npm package" /></a>
10
+ <a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
11
+ </p>
12
+
13
+ Inspect, copy, and export compact, design-system-aware Node JSON and high-resolution companion preview images directly from **Figma Desktop** for AI coding assistants (Claude Code, Antigravity, Cursor) and frontend engineering.
14
+
15
+ ---
16
+
17
+ ## Key Features
18
+
19
+ * **Design-System Aware**: Resolves layout flexbox rules (`layoutMode`, `padding`, `gap`), dimensions, hex colors, corner radii, and component variants into clean props.
20
+ * **Token-Optimized AST**: Strips vector paths, render masks, and matrix transforms, reducing payload size by up to 85% compared to raw Figma document trees.
21
+ * **Companion Preview**: Automatically renders high-resolution PNG reference images alongside the JSON contract.
22
+ * **Fast Local Handoff**: Runs locally inside your Figma client using the official Figma Plugin API (`figma.currentPage.selection`) with zero API credentials required.
23
+
24
+ ---
25
+
26
+ ## Installation in Figma
27
+
28
+ ### Option A: Install from Figma Community (Recommended)
29
+ Install directly from the Figma Community:
30
+ 👉 [**Install Figma Node JSON Extractor on Figma Community**](https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor)
31
+
32
+ 1. Open the [plugin page on Figma Community](https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor) or search for **Figma Node JSON Extractor** in Figma Plugins.
33
+ 2. Click **Open in...** or **Save** to add it to your Figma account.
34
+
35
+ ### Option B: Manual Installation (Local / Offline Backup)
36
+ To install the plugin directly from your local skills folder or repository:
37
+ 1. Open the **Figma Desktop app**.
38
+ 2. In the top-left menu, navigate to:
39
+ $$\text{Plugins} \longrightarrow \text{Development} \longrightarrow \text{Import plugin from manifest...}$$
40
+ 3. Select `manifest.json` from your machine based on your setup:
41
+ * **Installed via `npx @pedroab0/skills` (Global)**:
42
+ * **Claude Code**: `~/.claude/skills/figma-extractor/figma-plugin/manifest.json`
43
+ * **Google Antigravity**: `~/.gemini/config/skills/figma-extractor/figma-plugin/manifest.json`
44
+ * **OpenCode**: `~/.config/opencode/skills/figma-extractor/figma-plugin/manifest.json`
45
+ * **Installed in local workspace (`--local`)**:
46
+ * `.claude/skills/figma-extractor/figma-plugin/manifest.json`
47
+ * `.gemini/skills/figma-extractor/figma-plugin/manifest.json`
48
+ * **Cloned Git repository**:
49
+ * `<repo-root>/figma-extractor/figma-plugin/manifest.json`
50
+ 4. The plugin is now permanently loaded under **Plugins** $\rightarrow$ **Development**.
51
+
52
+ ---
53
+
54
+ ## How to Extract Node JSON
55
+
56
+ 1. **Select any frame or component** on your canvas (e.g., Transaction Card, Navbar, Modal).
57
+ 2. Right-click the element $\rightarrow$ **Plugins** $\rightarrow$ **Figma Node JSON Extractor** (or press `⌥ ⌘ P` to re-run).
58
+ 3. In the plugin popup, choose your export format:
59
+ * **📋 Copy Node JSON**: Copies the clean AST specification directly to your clipboard (ready to paste into chat).
60
+ * **💾 .json**: Downloads `<name>.json` containing layout, dimensions, tokens, and props.
61
+ * **🖼 .png**: Downloads the high-resolution 2x visual preview image.
62
+ * **📦 Both (.zip)**: Downloads `<name>.specs.zip` containing both files in a single archive.
63
+ 4. Place the downloaded files into your project's `./.specs/` folder:
64
+ ```text
65
+ my-app/
66
+ └── .specs/
67
+ ├── card.json
68
+ └── card.png
69
+ ```
70
+
71
+ ---
72
+
73
+ ## How to Tell Your Agent to Build the UI
74
+
75
+ Once the specification is in `./.specs/`, simply instruct your agent in Antigravity, Claude Code, or Cursor:
76
+
77
+ ```text
78
+ Build the component from .specs/card.json
79
+ ```
80
+
81
+ The agent will activate **`figma-node-builder`** and synthesize the component directly from the local specification contract without needing access to the Figma REST API.