agentleFS
crywolfecrywolfe/claude-code-design/.claude/skills/register-asset/SKILL.md

register-asset

Skill0 starsChanged 8 days agoMITView on GitHub

Register a design artifact in design-assets.json, capture a thumbnail, and regenerate assets.html overview grid. Use when an artifact is ready for review, or user says "add to overview", "register", "track this".

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add an artifact to design-assets.json and refresh the visual overview at assets.html.

    line 10
  2. Very specific:

    If --auto and .claude/last-preview.png exists: Bash(cp .claude/last-preview.png assets/thumbs/<slug>-<ts>.png) — reuse

    line 25
  3. Very specific:

    If missing → create with {"items": []}

    line 29
  4. Very specific:

    If new → append with the given or default status / subtitle / group

    line 34
  5. Very specific:

    If node is missing, fall back to inline generation via Write tool with HTML template.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Register Asset

Add an artifact to design-assets.json and refresh the visual overview at assets.html.

Argument parsing

From $ARGUMENTS:

  • Positional 0: html-path (required)
  • --asset "<name>": display name (default: derive from filename, Title Cased)
  • --group <X>: one of Type, Colors, Spacing, Components, Brand (default: Components)
  • --subtitle "<text>": short description
  • --status <X>: needs-review | approved | changes-requested (default: needs-review)
  • --auto: silent mode called by /done — skip thumbnail capture (reuses .claude/last-preview.png), don't print confirmation prompts, one-line report only

Steps

  1. Capture thumbnail:
    • If --auto and .claude/last-preview.png exists: Bash(cp .claude/last-preview.png assets/thumbs/<slug>-<ts>.png) — reuse
    • Otherwise: /preview <html-path> → wait 500ms → mcp__chrome-devtools__take_screenshot → save to assets/thumbs/<slug>-<ts>.png (Bash(mkdir -p assets/thumbs) first)
  2. Read existing design-assets.json:
    • If missing → create with {"items": []}
  3. Upsert entry:

    • Key on (asset, path) pair
    • If exists → refresh thumbnail and bump updated_at. With --auto (the /done path) change nothing else: status, subtitle, group, registered_at and any published_* fields stay as they were, so a re-run of /done never resets an approved asset to needs-review. Without --auto, an explicit --status / --subtitle / --group argument overrides the stored value
    • If new → append with the given or default status / subtitle / group

    Schema:

    {
      "items": [
        {
          "asset": "Primary button",
          "path": "artifacts/button.html",
          "group": "Components",
          "status": "approved",
          "subtitle": "Filled variant with hover state",
          "thumbnail": "assets/thumbs/button-20260420T120000Z.png",
          "registered_at": "2026-04-20T12:00:00Z",
          "updated_at": "2026-04-20T12:00:00Z"
        }
      ]
    }
  4. Write design-assets.json with formatted JSON (2-space indent).
  5. Regenerate assets.html:
    • Bash(node scripts/make-assets-index.mjs) — see script below
    • If node is missing, fall back to inline generation via Write tool with HTML template. Never run node with anything other than that script.
  6. Report: "Registered <asset> in <group>. View at assets.html."

assets.html layout

Sections by group. Each card shows:

  • Thumbnail (clickable → opens source HTML in new tab)
  • Asset name (bold)
  • Subtitle (muted)
  • Status badge (color-coded: green=approved, amber=needs-review, red=changes-requested)
  • Updated date
  • Mini-menu: approve, request-changes, unregister

The HTML is static — no server. Status changes happen via Claude (user says "approve the button asset" → Claude re-runs /register-asset ... --status approved).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.