style-capture 0.0.3 → 1.2.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.
Files changed (2) hide show
  1. package/README.md +27 -39
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,75 +2,63 @@
2
2
  <img src="../../.github/assets/logo.png" width="80" height="80" alt="Style Capture logo" />
3
3
  </p>
4
4
 
5
- <h1 align="center">Style Capture CLI</h1>
5
+ <h1 align="center">Style Capture</h1>
6
6
 
7
- <p align="center">Capture computed CSS and HTML from any web page, map the result to Tailwind utilities, and output a structured prompt for faithful UI recreation.</p>
7
+ <p align="center">Capture computed styles from any web page. Mapped to Tailwind, structured for AI agents.</p>
8
8
 
9
- ## Install
10
-
11
- ```bash
12
- npm install style-capture
13
- ```
14
-
15
- Playwright ships its own Chromium binary. After installing, run `npx playwright install chromium` if you haven't already.
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/style-capture"><img src="https://img.shields.io/npm/v/style-capture.svg" alt="npm version"></a>
11
+ <a href="../../LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
12
+ </p>
16
13
 
17
14
  ## Usage
18
15
 
19
- ### Direct mode
20
-
21
- Pass a URL and CSS selector to capture and print the result to stdout:
22
-
23
16
  ```bash
24
- style-capture https://stripe.com ".hero-section"
25
- style-capture https://linear.app "main > section:nth-child(2)" --mode full
17
+ npx style-capture <url> <selector>
26
18
  ```
27
19
 
28
- ### Interactive mode
29
-
30
- Run without arguments for an interactive prompt:
31
-
32
20
  ```bash
33
- style-capture
21
+ npx style-capture https://stripe.com ".hero-section"
22
+ npx style-capture https://linear.app "main > section:first-child" --mode full
34
23
  ```
35
24
 
36
- You'll be asked for a URL, CSS selector, capture mode, and output destination (clipboard or stdout).
25
+ Run without arguments for interactive mode:
37
26
 
38
- ### Options
27
+ ```bash
28
+ npx style-capture
29
+ ```
39
30
 
40
- | Flag | Description | Default |
41
- | ------------------- | -------------------------------------------------------------------- | --------- |
42
- | `-m, --mode <mode>` | `curated` (common visual properties) or `full` (all computed styles) | `curated` |
31
+ For frequent use, install globally with `npm install -g style-capture`.
43
32
 
44
- ## Agent Skill
33
+ ## Agent skill
45
34
 
46
- Style Capture ships as a [Claude Code skill](https://docs.anthropic.com/en/docs/claude-code) that combines browser automation with the capture CLI. Instead of manually finding selectors, describe the element in natural language:
35
+ Describe the element in natural language no selectors needed:
47
36
 
48
37
  ```
49
38
  /style-capture https://stripe.com the pricing table
50
39
  /style-capture https://linear.app the hero section with the gradient
51
- /style-capture https://vercel.com/dashboard the sidebar navigation
52
40
  ```
53
41
 
54
- The skill opens the page with `agent-browser`, takes an interactive snapshot to locate the element, derives a CSS selector, and runs the capture CLI automatically.
42
+ Install the [Claude Code skill](https://docs.anthropic.com/en/docs/claude-code):
43
+
44
+ ```bash
45
+ npx skills add mblode/style-capture -g --all -y
46
+ ```
55
47
 
56
48
  ## Output
57
49
 
58
- The CLI outputs a `<style_capture>` block containing:
50
+ A `<style_capture>` block containing:
59
51
 
60
- - **html_capture** — sanitized, annotated HTML of the subtree
52
+ - **html_capture** — sanitised HTML of the subtree
61
53
  - **css_capture** — computed CSS grouped by element
62
- - **tailwind_hints** — suggested Tailwind utility classes with confidence scores
63
- - **open_questions** — low-confidence mappings flagged for review
64
-
65
- Use this output to faithfully recreate or refactor the captured UI in code.
66
-
67
- ## Requirements
54
+ - **tailwind_hints** — Tailwind utilities with confidence scores
55
+ - **open_questions** — ambiguous mappings flagged for review
68
56
 
69
- - Node.js `22+`
57
+ Paste into Claude Code, Cursor, or any AI tool.
70
58
 
71
59
  ## Privacy
72
60
 
73
- All capture, mapping, and export steps happen locally. No page data is sent to a remote service.
61
+ All processing happens locally. No data leaves your machine.
74
62
 
75
63
  ## License
76
64
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "style-capture",
3
- "version": "0.0.3",
4
- "description": "Capture computed CSS and HTML from web pages, map to Tailwind utilities",
3
+ "version": "1.2.0",
4
+ "description": "Capture computed CSS from any web page and map to Tailwind. Structured context for AI coding agents",
5
5
  "keywords": [
6
6
  "ai",
7
7
  "claude",