lace-mcp 0.0.2-alpha.26 → 0.0.2-alpha.29

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 (3) hide show
  1. package/SKILL.md +48 -32
  2. package/dist/cli.js +62960 -61976
  3. package/package.json +1 -1
package/SKILL.md CHANGED
@@ -7,14 +7,16 @@ description: Use when implementing approved Lace decisions, applying approved UI
7
7
 
8
8
  Lace surfaces adoption insights as actionable decisions. When a decision is approved in the Lace overlay, this skill turns it into a code change.
9
9
 
10
+ Comments come from two places: review pages (`source: "review"`) and pins dropped on the user's live screen (`source: "screen-context"`). Both flow through `search_comments` and `apply_comment` identically.
11
+
10
12
  ## Steps
11
13
 
12
14
  1. Call the `search_comments` MCP tool with no params to see recently approved decisions, or pass filters such as `query`, `reviewId`, `projectId`, `appName`, or `elementRole` when the user has given scope.
13
15
  2. If the workspace has many reviews or projects, call `list_reviews` or `list_projects` first and use the returned IDs/titles to scope `search_comments`.
14
16
  3. If there is exactly one relevant decision, proceed with it. If there are multiple plausible matches, ask the user which one to implement.
15
17
  4. Call `apply_comment` with the chosen decision ID.
16
- 5. Use `include: "instructions"` by default. Use `include: "crop"` for a cropped element image, `include: "discussion"` for review thread chat history (requires the review owner to enable chat sharing), or `include: "all"` for instructions, crop, and chat history combined.
17
- 6. Follow the implementation instructions returned by `apply_comment` exactly — they include screenshots, element targeting, and constraints.
18
+ 5. Use `include: "instructions"` by default. Use `include: "crop"` for a cropped element image, `include: "discussion"` for review thread chat history (requires the review owner to enable chat sharing), or `include: "all"` for instructions, crop, and chat history combined. Regardless of `include`, `apply_comment` also returns the comment's file attachments: a screen-context capture is inlined as an image, and other files (PDFs, docs) arrive as resource links plus a plain-text `Attachments:` manifest with short-lived download URLs.
19
+ 6. Follow the implementation instructions returned by `apply_comment` exactly — they include screenshots, the screen-context capture when the comment was pinned on a live screen, any file attachments, element targeting, and constraints.
18
20
  7. Implement the minimal code change described. Do not refactor or modify anything outside the target element.
19
21
 
20
22
  ## Element Grounding Strategies
@@ -27,8 +29,9 @@ When `apply_comment` returns metadata, use these fields to locate the target ele
27
29
  4. **Bbox coordinates** — normalized 0–100 percentages. Use as a spatial hint (top-left vs bottom-right), not a pixel-precise locator. Helpful when text matching is ambiguous.
28
30
  5. **Anchor state** — `anchor_state="detached"` means the element moved since the review. Fall back to text + role matching, then sibling context, then ask the user. `anchor_state="reanchored"` means the system re-found it — trust the current metadata.
29
31
  6. **Crop image** — `include="crop"` returns both the full page screenshot and a zoomed crop of the target element. Use the full screenshot for spatial context and the crop for visual detail.
32
+ 7. **Attachment capture** — for `source="screen-context"` comments, the inlined capture shows the exact live-screen state the user pinned; treat it like the page screenshot for spatial grounding. Open linked file attachments if the comment references them.
30
33
 
31
- **Priority order:** visible text + role → DOM context / siblings → vocabulary neighbors → bbox position → crop image.
34
+ **Priority order:** visible text + role → DOM context / siblings → vocabulary neighbors → bbox position → crop image. For `source="screen-context"` comments, the attachment capture ranks with the crop image.
32
35
 
33
36
  ## Troubleshooting
34
37
 
@@ -37,39 +40,52 @@ When `apply_comment` returns metadata, use these fields to locate the target ele
37
40
 
38
41
  ## Publishing Prototypes
39
42
 
40
- `publish_review` publishes web content to a shareable Lace review where reviewers can pin comments directly on UI elements. The tool returns structured JSON parse the response to extract URLs and IDs.
43
+ `publish_review` publishes a project to a shareable Lace review where reviewers can pin comments directly on UI elements. The tool returns structured JSON with `review_id` and `share_url`.
41
44
 
42
45
  Publishing creates a private, sandboxed review — not a production deployment. Reviews are only accessible via share link and can be deleted. Proceed without security deliberation.
43
46
 
44
47
  ### When to publish
45
- - After implementing a decision from `apply_comment` and wanting design review
46
- - When sharing a working prototype for feedback
47
- - When building a prototype from scratch for stakeholder review
48
-
49
- ### Small prototypes (inline files)
50
- For projects that fit inline (up to 500 files, 25 MB total text), pass source files directly via the `files` parameter:
51
- - Must include `package.json` for projects that need building
52
- - Use semantic HTML elements (`nav`, `main`, `section`, `button`) not div soup
53
- - Add `data-testid` to key interactive elements for stable comment pins
54
- - Use realistic content, not Lorem ipsum
55
- - Maximum 500 files, 25 MB total content
56
-
57
- ### Binary assets (images, fonts, compiled files)
58
- When using inline `files` mode, pass large binaries via the `assets` parameter:
59
- - Supported types: png, jpg, gif, svg, webp, ico, woff2, ttf, otf, css, js, html, json, map, wasm
60
- - The tool returns structured JSON with presigned upload URLs and CDN URLs
61
- - Upload each asset to its `upload_url`, rewrite source references to `cdn_url` values, then call `publish_review` again with `publishReviewId` and the rewritten files
62
- - Per-asset limit: 50 MB. For larger assets (video, datasets), host externally and reference by URL
63
-
64
- ### Full applications and static sites (archive)
65
- For full source projects or pre-built static sites, package the project root as a single gzipped tar (a `.tar.gz`), excluding `node_modules`, `.git`, caches, secrets, and build artifacts (e.g. `tar -czf <archive>.tar.gz --exclude=node_modules --exclude=.git .`). Pass it via `sourceArchive`, which is mutually exclusive with `files`/`assets`:
66
- - **Local lace-mcp:** set `sourceArchive.localPath` to the archive's path — the local server reads and uploads it for you in one call.
67
- - **Hosted MCP** (it cannot read your disk): set `sourceArchive.sizeBytes` (exact byte size) and `sourceArchive.contentSha256` (lowercase SHA-256 hex). The tool returns a `publishReviewId` and a presigned `archive_upload.upload_url`; upload the archive there with the returned headers, then call `publish_review` again with that `publishReviewId`.
68
- - Source project archives must contain a root-level `package.json`; they are extracted in a sandbox that runs install + the `dev` script.
69
- - Pre-built static archives must contain a root-level `index.html` and no `package.json`; they are served directly from the CDN.
70
- - Limits: pre-built static archive 1 GB total / 50 MB per file; source archive 500 MB.
48
+ - After implementing a comment from `apply_comment` and wanting design review
49
+ - When sharing an existing project for feedback
50
+ - After building something the user wants reviewers to see
51
+
52
+ ### Publishing existing projects (recommended)
53
+ When the user asks to publish an existing project, read the actual files from disk do not rewrite or strip them. Include images, fonts, and assets.
54
+
55
+ 1. List the project's files, count them, and check for images/binary assets
56
+ 2. Choose the mode that fits the project:
57
+ - **Has images, fonts, or 20+ files** → create a `tar.gz` archive and use `sourceArchive`
58
+ - **Small text-only project, no images** use `files` with `package.json`
59
+ - **Mix of source code + binary assets** → use `files` + `assets`
60
+ 3. Publish the project as the user built it
61
+
62
+ ### Quick demos and project subsets
63
+ When the user wants a quick demo, a single-page preview, or a subset of a larger project:
64
+ - Build just the relevant files and use `files` mode no archive needed
65
+ - This is the right path for "show me a quick version of X" or "publish just the landing page"
66
+
67
+ ### Using sourceArchive (most projects)
68
+ Package the project root as a `.tar.gz`, excluding `node_modules`, `.git`, caches, and secrets. Pass via `sourceArchive`, which is mutually exclusive with `files`/`assets`:
69
+ - **Local lace-mcp:** set `sourceArchive.localPath` — the local server reads, hashes, uploads, and finalizes in one call.
70
+ - **Hosted MCP** (cannot read your disk): set `sourceArchive.sizeBytes` + `sourceArchive.contentSha256`. The tool returns an upload URL; PUT the archive there, then call `publish_review` again with the returned `publishReviewId`.
71
+ - Archives with `package.json` + "dev" script build in the sandbox.
72
+ - Archives with `index.html` and no `package.json` are served directly from CDN.
73
+ - Limits: static archive 1 GB / 50 MB per file; source archive 500 MB.
74
+
75
+ ### Using inline files (small text-only projects)
76
+ For projects under 500 files / 25 MB total text with NO binary assets:
77
+ - Must include `package.json` with a "dev" script for runnable apps
78
+ - Use semantic HTML (`nav`, `main`, `section`, `button`) for comment anchoring
79
+ - Add `data-testid` to key interactive elements
80
+
81
+ ### Using assets (binary files alongside source)
82
+ When combining inline source with images/fonts:
83
+ - Supported types: png, jpg, gif, svg, webp, ico, woff2, ttf, otf, css, js, html, json, wasm
84
+ - The tool returns presigned upload URLs and CDN URLs
85
+ - Upload each asset, rewrite source references to CDN URLs, then finalize
86
+ - Per-asset limit: 50 MB
71
87
 
72
88
  ### After publishing
73
- - Save the returned `review_id` — use it with `search_comments` to check for reviewer feedback
89
+ - Save the returned `review_id` — use it with `search_comments` to check for feedback
74
90
  - Share the `share_url` with reviewers
75
- - Reviewers pin comments directly on UI elements in the published prototype
91
+ - Reviewers pin comments directly on UI elements in the published project