ins-clear-card

Community@u252119f2fa58/ins-clear-card
Community skill — not reviewed. It was shared by 秋雨微澜 and has not been checked by Neta. Read SKILL.md below before letting an agent use it.
Installation
npx -y @neta-art/neta-search-cli@latest skills add @u252119f2fa58/ins-clear-card
Summary

Get a phone-friendly clear card maker where fans upload their own character and download a print-ready transparent card.

  • Visitors upload a character and the background is removed automatically in their own browser, at no cost, with brushes to fix any rough edges.
  • Drag, resize, rotate and flip the character and stickers anywhere on a social-post-style frame, even over its edges.
  • Edit the name, likes and caption in handwritten, print, script or logo fonts, and recolour the frame with an eyedropper.
  • Add a backdrop picture that shows only through the card's window, plus an optional film shine in the preview.
  • Download a print-ready card with a truly see-through window, and a preview picture, ready to hand to a print shop.
SKILL.md
# Clear Card Studio

The user ends up with a web Work: a clear-card editor that runs on a phone. A visitor uploads their character, the background is removed in their own browser (no credits, no upload), and they drop the character and stickers anywhere on a post-style frame, even over its edges, then export a print-ready PNG whose window is fully transparent so a print shop can lay clear film behind it.

Read this file fully before writing files. Resolve relative paths from this skill's directory.

## Language

Reply in the user's language, whatever language this file is in — every message, the final handover included. Translate what scripts print instead of pasting it. The page UI follows `--lang` (built in: `en`, `zh-CN`; any other language needs `strings.json`, see Step 3). The Work title follows the user's language; names the user typed stay as written.

## When to use / when not

Use when the user wants a clear-card or transparent-card maker page that visitors use with their own characters. Not for a layered profile card with tint, echo and dots (oc-card-workshop), a trading card with foil, or one finished card image drawn by a model — say this skill builds a clear-card editor page and stop.

## Inputs

| Item | Required | Counts as given when |
|---|---|---|
| Request for a clear-card editor | yes | The user asks for a clear card / transparent card / post-frame card page |
| Preset text | no — default a generic name, `1,314 likes` and a one-line caption in the page language | The user names a character of this world (its name becomes the author name) or gives the name, likes or caption |
| Frame colours | no — default white frame, black lines, red heart, yellow stickers | The user gives colours for the top bar, bottom bar, body, lines, text, heart or stickers |
| Page language | no — default the user's language | The user writes in a language |
| Title | no — default `Clear Card Studio` translated | The user names the Work |

Nothing here needs a question: if the request asks for the editor, build it, state the defaults you took in one line, and deliver. No portrait is baked in — each visitor brings their own character.

## Steps

1. **Read the preset (only if a character is named).** `node /mods/neta/neta atom get <path>` (or read the material under `world/`). Take the display name, optionally a likes line and a caption of at most 60 characters, and frame colours only if the text states them. Never invent colours.

2. **Create the Work folder.**
   ```bash
   node /mods/neta/neta work init web works/webs/<slug> --title "<title in the user's language>"
   ```
   `<slug>` is lowercase kebab-case and new (`ls works/webs/` first; never reuse or delete an existing folder).

3. **Copy the template and write the config.**
   ```bash
   node scripts/setup.mjs --dir works/webs/<slug> --lang <en|zh-CN|...> --title "<title>" \
     [--name "<author name>"] [--likes "<likes line>"] [--caption "<caption>"] \
     [--colors "top=#ffffff,bottom=#ffffff,body=#ffffff,line=#111111,text=#111111,heart=#e8332a,sticker=#ffd84d"]
   ```
   The template is about 62 MB because it carries the cutout model, the ONNX runtime and five fonts; that is expected. For a UI language other than `en` / `zh-CN`, copy every key of the `en` block in `template/i18n.js` into `works/webs/<slug>/strings.json` as `{ "<lang>": { "key": "translation" } }` and rerun the same command. Rerunning is safe.

4. **Check it.**
   ```bash
   node scripts/verify.mjs works/webs/<slug>
   ```
   It checks the files, the four model parts and the config, then loads the page in headless Chrome at 390×844 and 1440×900: no console errors, the studio boots, the print export is 1962×3072, the window is transparent in the print export, the preset name and title are present. It writes `verify-report.json` and screenshots in `.verify/`. Look at `.verify/shot-phone.png` yourself. Fix every FAIL and rerun; do not deliver while it fails.

5. **Publish** — see Deliver.

Read `references/card-spec.md` only when the user asks to change a default (geometry, export size, film sheen, fonts, stickers, cutout).

## What the page does (the template already has all of it)

- Frame: top bar, avatar row with the name, a transparent window, action row, likes, caption, bottom bar. Card 654×1024 units; window 589×590.
- OC and stickers: place anywhere, over or under the frame, one finger drags, two fingers resize and rotate; flip, copy, forward, backward; the newest OC is selected by default.
- Cutout: automatic (local ISNet anime model, first run downloads about 45 MB, then cached) plus a magic wand, eraser and restore brushes.
- Text in four fonts, a palette and eyedropper with a loupe that follows the finger, a backdrop image visible only through the window, optional film sheen, 40-step undo.
- Export: a clear-card PNG (transparent window, for printing) and a preview PNG (checker window, film sheen included), both 1962×3072.

## Deliver

A **web Work**:

```bash
node /mods/neta/neta work publish web works/webs/<slug> --title "<title in the user's language>"
```

Then, as the last step — the run is not delivered until it is done:

6. **Hand over with a card.** One `interaction-components` card on its own line, target `{ "type": "work", "workId": "<id>" }`, the id from the publish output (fallback: `cohubWorkId` in `works/webs/<slug>/meta.json`). Never a made-up id, a folder or a `world-file` link to `index.html`. Then one or two lines in the user's language: what the editor does, that the cutout runs in the visitor's browser at no cost, and that the first automatic cutout downloads about 45 MB.

## Out of scope

- Do not change world settings or delete files that existed before the run.
- Do not modify memory, character cards, installed scripts, existing Works or roleplays.
- Make only the editor Work; do not generate card images, covers or extra art.
- Build in this chat, on whatever model it runs; never hand the request to another chat.
- No server: the Work is a static page; never start a backend or publish a `--port` app.
- No print die-lines, bleed marks or ordering flow; the PNG is a file to hand to a print shop.
- Do not edit `template/` files inside the skill; per-Work changes go through `config.js` and `strings.json`.

## When to stop

- The user asks for one finished card image, a foil trading card or a layered profile card: say this skill builds a clear-card editor page and stop.
- `scripts/setup.mjs` says the Work folder has no `meta.json`: run Step 2 first; never point it at an existing Work folder.

## Gotchas

- **The model is four files on purpose.** The publish limit is 20 MB per file and the model is about 44.8 MB, so it ships as four parts that `cutout-worker.js` joins. Never merge them or change one; `verify.mjs` checks that the sizes add up to the total the worker expects.
- **The print PNG has no film sheen.** The real film reflects by itself and semi-transparent white prints grey; the sheen exists only in the editor and the preview image. Keep the export note that says so when translating.
- **Every file loads from the Work folder.** The cutout, the runtime and the fonts are bundled because CDNs are unreliable in some regions; do not swap them for CDN links.
- **One thread unless the page is cross-origin isolated.** The cutout is slower on phones; the page shows progress and falls back to the magic wand when the model cannot start. Do not retry the automatic cutout in a loop.
- **The avatar follows the first OC.** It crops the top of a tall character; the user can also upload an avatar or leave it empty.
- **Third languages need every key.** A partial dictionary falls back to English per key and mixes languages; `verify.mjs` lists the missing keys.
- **Saving needs file access.** Without it the card lives in memory for the visit and the panel says so; this is normal for signed-out visitors.