agentleFS
mocchaleramocchalera/mockup-to-code-skill/skills/visual-device-inventory/SKILL.md

visual-device-inventory

Skill0 starsChanged 4 months agoISCView on GitHub

Inventory every visible device, motif, control, decoration, and composite subpart in raster mockups before CSS implementation. Use for screenshot-to-code, mockup-to-code, design-comp decomposition, pre-CSS visual audits, ROI evidence sheets, and hash-bound detail-inventory/v1 specialist reports, especially when source-specific details could otherwise be omitted or flattened.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Create an exhaustive, hash-bound detail-inventory/v1 report before writing CSS.

    line 8
  2. Very specific:

    Use the pack runtime wrapper so commands run with the interpreter selected at installation.

    line 10
  3. Very specific:

    Add one inventory row per independently reproducible device.

    line 18
  4. Very specific:

    Use kind: composite only when the device must be reproduced as a coordinated unit.

    line 19
  5. Distinctive:

    Stop before CSS when validation fails.

    line 52
  6. Very specific:

    Read schemas/detail-inventory-v1.schema.json when creating or transforming a report.

    line 56
  7. Very specific:

    Start from templates/detail-inventory.blocked.json only when inventory cannot honestly proceed.

    line 57
  8. Very specific:

    Run blocked validation explicitly with --allow-blocked.

    line 58
  9. Distinctive:

    Keep ids lowercase and stable.

    line 59
  10. Very specific:

    Use relative, traversal-free paths rooted at --root.

    line 61
  11. Distinctive:

    Run the skill self-check after changes:

    line 66
  12. Distinctive:

    Do not hand-edit generated hashes.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Visual Device Inventory

Create an exhaustive, hash-bound detail-inventory/v1 report before writing CSS. Treat every visible source device as an implementation obligation; do not infer completion from a prose summary.

Use the pack runtime wrapper so commands run with the interpreter selected at installation. Set SKILL_ROOT when the pack uses a non-default destination.

Workflow

  1. Identify the source medium and record the source path before interpreting the design.
  2. Partition the entire source into ordered, non-empty sections. Include seams or transition bands as sections when they carry visible devices.
  3. Sweep each section at high zoom in a fixed order: background, edges/corners, focal object, typography, controls, overlays, decorations, and seams.
  4. Add one inventory row per independently reproducible device. Mark a distinctive source motif sourceSpecific: true and assign it critical or high priority.
  5. Use kind: composite only when the device must be reproduced as a coordinated unit. Inventory at least two atomic compositeParts, each with its own globally unique id, ROI, specificity, and priority.
  6. Draw every ROI in source-image pixel coordinates as {x,y,width,height}. Keep device ROIs inside their section ROI and composite-part ROIs inside their parent device ROI.
  7. Generate crops and the contact sheet before implementation:

    SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}"
    "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \
      "$SKILL_ROOT/visual-device-inventory/scripts/generate_roi_contact_sheet.py" \
      work/detail-inventory.json \
      --root . --output-dir work/device-inventory-evidence
  8. Validate the report and every referenced image byte, bound, dimension, and SHA-256:

    SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}"
    "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \
      "$SKILL_ROOT/visual-device-inventory/scripts/validate_inventory.py" \
      work/detail-inventory.json --root .
  9. Emit the exact receipt object for mockup-to-code:

    SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}"
    "$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \
      "$SKILL_ROOT/visual-device-inventory/scripts/validate_inventory.py" \
      work/detail-inventory.json \
      --root . --receipt

    Store that object at specialistReports.deviceInventory. It has the stable shape {contract:"detail-inventory/v1", path, sha256}. The hash covers the report file bytes; changing the report invalidates the receipt.

  10. Stop before CSS when validation fails. Fix missing rows, bounds, specificity, composite decomposition, or unreadable evidence first.

Contract

  • Read schemas/detail-inventory-v1.schema.json when creating or transforming a report.
  • Start from templates/detail-inventory.blocked.json only when inventory cannot honestly proceed. Replace every placeholder and blocker when work resumes.
  • Run blocked validation explicitly with --allow-blocked; blocked reports never emit a receipt and normal validation exits nonzero.
  • Keep ids lowercase and stable. Ids are globally unique across sections, devices, and composite parts.
  • Cover every declared section with at least one device. Never use one giant row to stand in for several independently reproducible details.
  • Use relative, traversal-free paths rooted at --root. Evidence must be real readable PNG, JPEG, or WebP files with matching hashes and pixel dimensions.
  • Preserve report order. The generator sorts by section order and inventory order and writes deterministic PNG output for identical inputs and Pillow version.

Validation

Run the skill self-check after changes:

SKILL_ROOT="${SKILL_ROOT:-${CODEX_HOME:-$HOME/.codex}/skills}"
"$SKILL_ROOT/mockup-to-code/scripts/skill-pack-python" \
  "$SKILL_ROOT/visual-device-inventory/scripts/quick_validate.py"

Do not hand-edit generated hashes. Regenerate evidence, validate, then copy the emitted receipt into the consuming manifest.

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.