@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pedro Barbosa
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.
package/README.md CHANGED
@@ -1,3 +1,195 @@
1
- # Temporary Holding Version
1
+ # Skills
2
+
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@pedroab0/skills"><img src="https://img.shields.io/npm/dm/@pedroab0/skills.svg" alt="npm downloads" /></a>
5
+ <a href="https://www.npmjs.com/package/@pedroab0/skills"><img src="https://img.shields.io/npm/v/@pedroab0/skills.svg" alt="npm version" /></a>
6
+ <a href="https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor"><img src="https://img.shields.io/badge/Figma_Community-Plugin-000000?style=flat&logo=figma&logoColor=white" alt="Figma Community Plugin" /></a>
7
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
8
+ </p>
9
+
10
+ A curated collection of modular, production-ready skills developed for AI coding agents (such as Claude Code, OpenCode, Codex, Google Antigravity, and Cursor).
11
+
12
+ Each skill in this repository is designed to give AI assistants specialized, autonomous capabilities while maintaining:
13
+ - **Token Efficiency**: Pruning unnecessary data and noise to keep agent context windows lean and fast.
14
+ - **Zero or Minimal Dependencies**: Standalone scripts that execute on demand without fragile background daemons.
15
+ - **Domain Intelligence**: Structured, context-aware outputs (such as resolved design tokens and component props) that allow agents to generate production-quality code.
16
+
17
+ ---
18
+
19
+ ## Available Skills
20
+
21
+ | Skill | Role / Workflow | Description | Links |
22
+ | :--- | :--- | :--- | :--- |
23
+ | **[`figma-to-code`](./figma-to-code)** | **One-Shot / Fast Prototyping** | Direct, single-turn conversion of Figma designs into clean, production-ready UI components. Best for rapid prototyping and standalone components. | [Guide](./figma-to-code/README.md) · [`SKILL.md`](./figma-to-code/SKILL.md) |
24
+ | **[`figma-extractor`](./figma-extractor)** | **SDD Step 1 (Ingest)** | Pure specification scraper (CLI / REST API) and companion Figma Desktop plugin that pull compact layout trees, design tokens, and preview images into `./.specs/`. Never touches application code. | [Guide](./figma-extractor/README.md) · [Plugin](./figma-extractor/figma-plugin/README.md) · [Community](https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor) · [`SKILL.md`](./figma-extractor/SKILL.md) |
25
+ | **[`figma-node-builder`](./figma-node-builder)** | **SDD Step 2 (Implement)** | Grounded UI builder that reads extracted Figma Node specifications (`.specs/*.json`) and preview images (`*.png`) to build components without CSS hallucinations. | [Guide](./figma-node-builder/README.md) · [`SKILL.md`](./figma-node-builder/SKILL.md) |
26
+
27
+ ---
28
+
29
+ ## Two Supported Workflows
30
+
31
+ ```mermaid
32
+ flowchart TD
33
+ subgraph PathA ["⚡ Workflow A: Fast Prototyping (One-Shot)"]
34
+ A1["Figma URL"] --> A2["figma-to-code"]
35
+ A2 --> A3["Working UI Component"]
36
+ end
37
+
38
+ subgraph PathB ["📐 Workflow B: Spec-Driven Development (SDD)"]
39
+ B1["Figma URL or Canvas Selection"] --> B2["figma-extractor<br/>(CLI or Figma Desktop Plugin)"]
40
+ B2 --> B3["Specification Contract<br/>.specs/card.json (+ .png)"]
41
+ B3 --> B4["Human Review & Gap Analysis"]
42
+ B4 --> B5["figma-node-builder"]
43
+ B5 --> B6["Grounded Production Component"]
44
+ end
45
+ ```
46
+
47
+ * **Use `figma-to-code`** when you want fast execution: you provide a Figma URL, and the agent extracts and writes the component in one turn.
48
+ * **Use `figma-extractor` + `figma-node-builder`** in formal Spec-Driven Development (SDD): the design specification is extracted to disk first (via CLI or the companion Figma Desktop plugin), reviewed/approved, and then systematically implemented into your design system without premature code edits.
49
+
50
+ ---
51
+
52
+ ### Zero-API Companion: Figma Desktop Plugin
53
+
54
+ <p align="center">
55
+ <img src="./figma-extractor/figma-plugin/assets/cover.png" alt="Figma Node JSON Extractor" width="100%" />
56
+ </p>
57
+
58
+ To extract specifications directly inside Figma Desktop without API tokens or rate limits, use the companion [**Figma Node JSON Extractor**](./figma-extractor/figma-plugin/README.md) plugin:
59
+ * **Figma Community (Recommended)**: Install [**Figma Node JSON Extractor** on Figma Community](https://www.figma.com/community/plugin/1691244420692136789/figma-node-json-extractor) directly, or search for it under Figma Plugins.
60
+ * **Manual Manifest Import (Local Backup)**: In Figma Desktop, go to **Plugins** $\rightarrow$ **Development** $\rightarrow$ **Import plugin from manifest...** and select `manifest.json` from your installed skills folder (e.g. `~/.claude/skills/figma-extractor/figma-plugin/manifest.json` or `~/.gemini/config/skills/figma-extractor/figma-plugin/manifest.json`).
61
+
62
+ ---
63
+
64
+ ## Quick Install via `npx`
65
+
66
+ Install any or all skills into your favorite AI coding assistant with a single interactive command:
67
+
68
+ ```bash
69
+ # Recommended (npm registry):
70
+ npx @pedroab0/skills
71
+
72
+ # Or directly from GitHub:
73
+ npx github:pedroab0/skills
74
+ ```
75
+
76
+ The installer features a clean, interactive terminal UI:
77
+ * **Navigate**: Use keyboard arrows (`↑` / `↓`) or vim keys (`k` / `j`) to move between options.
78
+ * **Select**: Press `[Enter]` or press number keys (`1` - `5`) to select directly.
79
+ * **Exit**: Press `[ESC]` or `q` at any time to cancel cleanly.
80
+
81
+ ### Selection Options & Presets
82
+
83
+ 1. **All skills** `[Enter / 1]`: Installs `figma-to-code`, `figma-extractor`, and `figma-node-builder` (recommended).
84
+ 2. **figma-extractor and figma-node-builder** `[2]`: Spec-Driven Development (SDD) Suite.
85
+ 3. **figma-to-code** `[3]`: Fast prototyping (URL ──► UI Code).
86
+ 4. **figma-extractor** `[4]`: Figma design scraper (extracts layout AST, tokens & preview images to `.specs/`).
87
+ 5. **figma-node-builder** `[5]`: Builds UI components from extracted Figma JSON specs (`.specs/*.json`).
88
+
89
+ Or specify flags for fast, non-interactive setup:
90
+ ```bash
91
+ # Install all skills for Claude Code globally
92
+ npx @pedroab0/skills --agent claude --skill all
93
+
94
+ # Install SDD skills for Google Antigravity
95
+ npx @pedroab0/skills --agent antigravity --skill figma-extractor,figma-node-builder
96
+
97
+ # Install one-shot coder for Cursor (.cursor/rules)
98
+ npx @pedroab0/skills --agent cursor --skill figma-to-code
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Manual Installation Guide
104
+
105
+ If you prefer to install manually, all skills follow the open Agent Skills standard (`SKILL.md` format):
106
+
107
+ ### 1. Claude Code
108
+
109
+ Claude Code supports skills both locally within a repository or globally across your user profile.
110
+
111
+ - **Global Installation (All Projects)**:
112
+ ```bash
113
+ mkdir -p ~/.claude/skills
114
+ ln -s /path/to/skills/figma-to-code ~/.claude/skills/figma-to-code
115
+ ln -s /path/to/skills/figma-extractor ~/.claude/skills/figma-extractor
116
+ ln -s /path/to/skills/figma-node-builder ~/.claude/skills/figma-node-builder
117
+ ```
118
+
119
+ - **Usage & Activation**:
120
+ - **Automatic**: Claude Code inspects `SKILL.md` descriptions on startup and loads the appropriate skill automatically based on your prompt.
121
+ - **Manual Slash Command**: Run `/figma-to-code <FigmaURL>` or `/figma-extractor <FigmaURL>` directly in the chat.
122
+
123
+ ---
124
+
125
+ ### 2. OpenCode
126
+
127
+ OpenCode discovers skills from project or user configuration directories, maintaining full compatibility with the open `SKILL.md` standard.
128
+
129
+ - **Global Installation (All Projects)**:
130
+ ```bash
131
+ mkdir -p ~/.config/opencode/skills
132
+ ln -s /path/to/skills/figma-to-code ~/.config/opencode/skills/figma-to-code
133
+ ln -s /path/to/skills/figma-extractor ~/.config/opencode/skills/figma-extractor
134
+ ln -s /path/to/skills/figma-node-builder ~/.config/opencode/skills/figma-node-builder
135
+ ```
136
+
137
+ ---
138
+
139
+ ### 3. Cursor
140
+
141
+ In Cursor, reference skills via `.cursor/rules/` or mention them in Composer chat:
142
+ * To extract specs: prompt `@figma-extractor extract this frame: <url>`.
143
+ * To implement a spec: prompt `@figma-node-builder implement .specs/card.json`.
144
+
145
+ ---
146
+
147
+ ### 4. Google Antigravity / Gemini CLI
148
+
149
+ Symlink or copy the skills into your Antigravity skills directory (`~/.gemini/config/skills` for Antigravity 2.0, or legacy `~/.gemini/antigravity-cli/skills`):
150
+ ```bash
151
+ mkdir -p ~/.gemini/config/skills
152
+ ln -s /path/to/skills/figma-to-code ~/.gemini/config/skills/figma-to-code
153
+ ln -s /path/to/skills/figma-extractor ~/.gemini/config/skills/figma-extractor
154
+ ln -s /path/to/skills/figma-node-builder ~/.gemini/config/skills/figma-node-builder
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Repository Structure
160
+
161
+ ```text
162
+ skills/
163
+ ├── README.md # Curated skills repository catalog (this file)
164
+ ├── figma-to-code/ # Direct one-shot Figma to UI code generator
165
+ │ ├── SKILL.md # One-shot agent skill definition
166
+ │ ├── README.md # One-shot documentation & flags
167
+ │ └── scripts/ # Extraction scripts & test suite
168
+ ├── figma-extractor/ # SDD Step 1: Pure Figma design specification scraper
169
+ │ ├── SKILL.md # Pure scraper skill definition (outputs to .specs/)
170
+ │ ├── README.md # In-depth scraper documentation & flags
171
+ │ ├── figma-plugin/ # Zero-API Figma Desktop plugin (AST + preview exporter)
172
+ │ └── scripts/ # Standalone Node.js extraction scripts & tests
173
+ └── figma-node-builder/ # SDD Step 2: Spec-driven UI component builder
174
+ ├── SKILL.md # 4-Phase SDD implementation skill definition
175
+ ├── README.md # In-depth builder documentation
176
+ └── scripts/ # Spec inspector CLI & test suite
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Adding New Skills
182
+
183
+ When adding new skills to this curation:
184
+ 1. Create a dedicated directory: `<skill-name>/`
185
+ 2. Include a `SKILL.md` with standard YAML frontmatter (`name`, `description`) and agent instructions.
186
+ 3. Provide a `README.md` with detailed skill-specific documentation and manual execution flags.
187
+ 4. Keep scripts self-contained with minimal external dependencies.
188
+ 5. Update this root `README.md` catalog to list the new skill.
189
+
190
+ ---
191
+
192
+ ## License
193
+
194
+ This project is licensed under the [MIT License](LICENSE).
2
195
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.