Skip to content
Back to skills

Design Faithful

ASecurity

Implement a screen/component in the repo''s FE app with high visual fidelity to a Claude Design handoff — mirror the nearest analog, reuse the repo''s primitives and tokens, then live-render self-verify against the bundled screenshot and commit. Use to turn a design-faithful-spec (or a handoff) into committed FE code. Dispatched by a session''s choice under the outcome-gated lane.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsrustgobashnodegit

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 20, 2026

npx -y skills add manoldonev/second-shift --skill design-faithful --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Design Faithful?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Design Faithful
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/manoldonev-design-faithful/badge)](https://www.skillsdirectory.com/skills/manoldonev-design-faithful)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: design-faithful
description: 'Implement a screen/component in the repo''s FE app with high visual fidelity to a Claude Design handoff — mirror the nearest analog, reuse the repo''s primitives and tokens, then live-render self-verify against the bundled screenshot and commit. Use to turn a design-faithful-spec (or a handoff) into committed FE code. Dispatched by a session''s choice under the outcome-gated lane.'
---

You implement a screen/component in the repo's FE app that is **visually faithful** to a
Claude Design handoff, then commit it. You read the handoff via `DesignSync` + the contract lib
(same read path as [`design-faithful-spec`](../design-faithful-spec/SKILL.md)), prefer a
`design-faithful-spec` artifact as your primary input when one exists, implement onto the
repo's **real** stack, self-verify against the bundled screenshot, and commit via bot
identity.

**Load the repo's design-system reference from `.claude/second-shift/design-tokens/*.md`** —
it declares the FE app dir, the primitives package and its component inventory, the global
token roles and their source file, and the design-handoff bundle location. If absent,
discover conservatively (find the FE app, its component library, its global CSS token file)
and say so in your output.

> This directory also ships the **contract library** (`lib/`, see [README.md](./README.md))
> and its fixtures/tests. This SKILL.md is the invocable implement skill; the lib is what it
> imports.

## Inputs (from the dispatch prompt)

- `projectId` — the handoff project, **opened by id** (required).
- `screen` — the screen/component to implement, e.g. `detail` (required).
- A `design-faithful-spec` artifact for the screen, when available — treat it as the
  authoritative inventory / behavioral contract / component map.

## Read path

Identical to `design-faithful-spec`: `get_project` (assert `PROJECT_TYPE_PROJECT`) →
`list_files` → `get_file` → **sanitize every byte** (`lib/sanitize.mjs`) → `extractContract`
(`lib/extractor.mjs`). Apply the `lib/read-plan.mjs` limit classification. `list_projects`
does not list handoff bundles — open by id only.

## Write the translation plan (pre-implementation gate)

Before writing any code, write the **translation plan** as a file: the resolved-component list
with a stated reason per component, the per-node dimensions, the chosen analog screen (below), the
**placement decision** (which container each node mounts under, and at what level), and the file
list you will create/edit. This is the cheapest place to catch a wrong control — one line to fix
here vs. the same component spread across call-sites after the build.

<!-- LOCKSTEP-BEGIN plan-table-columns -->
Two tables in it carry the contract:

- a table declaring a **`why this component`** column, one row per resolved component;
- a table declaring a **`dimensions`** column, one row per sized node, with three columns beside
  it — **`node`**, **`RS`** and **`px`**:

  | node | RS | px | dimensions | overflow |
  | --- | --- | --- | --- | --- |
  | Filter panel | RS-2 | 320×604 | fixed 320px wide, hug height | none |
  | Results grid | RS-1 | -×412 | fill width, 12px row gap | scroll-y |

  `node` is the plan's own name for the node; `RS` is the render state of the record's
  `## Design frames` row it is measured in; `px` is `<w>×<h>` with an integer or `-` per axis,
  `-` being a node with no fixed size on that axis.

  <!-- LOCKSTEP-END plan-table-columns -->

  `dimensions` stays **prose** — per-axis fixed/hug/fill, wrap behavior, overflow/truncation —
  which is what `320×604` cannot carry.

<!-- LOCKSTEP-BEGIN plan-table-rule -->
Every cell of both tables must be filled, and a row may not declare fewer cells than its header.
That is deliberate: an omission has to read as an **empty cell**, not as an absent thought. A
resolved component with no stated reason is the name-match resolution that ships the wrong
control; a node with no recorded dimensions is the eyeballed size that ships at 3× the design.
Whether a recorded value is the *design's* is the REVIEW session's call, which renders every
screen at the head and compares it with its frame.
<!-- LOCKSTEP-END plan-table-rule -->

**No token map table.** A Claude Design handoff carries CSS custom properties, and mapping them to
the repo's token roles is graded on the diff by
[`design-toolkit:design-faithful-reviewer`](../../agents/design-faithful-reviewer.md), not here.
A table nobody reads is a cell nobody fills — do not add one, and do not copy the figma-faithful
token table across: of the two families' plan steps, only the two tables above are held in
lockstep.

**Dispatch
[`design-toolkit:design-faithful-plan-reviewer`](../../agents/design-faithful-plan-reviewer.md) on
this artifact yourself**, before implementing, and act on its verdict: `block` → fix the table and
re-emit; `fix-and-go` / `pass` → proceed. On the lane the build prompt asks for a subagent read of the plan before UI
code but names no agent — this one is the natural pick; nothing else runs it for you.

## Implement path (the repo's FE app)

- **Mirror the nearest analog.** Find the closest existing screen/component in the FE app
  (the design-tokens extension file lists known-good analogs) and match its structure, file
  layout, and conventions before inventing anything. Read 2–3 neighbors first.
- **Reuse real components — never hand-roll a primitive that exists.** The repo's primitives
  package (its name, component inventory, and the location of the `cn()`/class-merge utility
  are declared in the design-tokens extension file) may live outside the FE app dir — import
  from the package as existing FE code already does. If a primitive is missing from the
  primitives package, prefer composing from existing ones; adding a new primitive is a last
  resort and must be called out.
- **Use the repo's tokens**, not the handoff's raw token values — map handoff CSS custom
  properties to the repo's global token roles (declared, with their source file, in the
  design-tokens extension file). Charts use the repo's established chart library; data uses
  the repo's established data-fetch pattern (both per the extension file or discovered from
  analogs).
- **Check a UI-library claim against the installed source before you write it.** Before you
  write a comment that claims a UI library does or does not do something ("the primitive has no
  size variant", "the dialog traps focus itself"), open the installed source of that library and
  check the claim. Resolve the import the way the repo resolves it (a workspace package, a path
  alias or `node_modules`), and open the compiled component and its theme or variant definitions
  — of the wrapper and of the base library it wraps. Cite the installed file in the comment when
  the claim is not obvious. Do not override a style, or add a named constant, for a value the
  installed library already applies: drop the override instead.
- Follow the repo's FE conventions and run its formatter (config `commands.<id>.format` — the sole key, else the key equal to the main checkout's directory name (also from a linked worktree))
  before committing.

## Live-render self-verify (auditable checklist — record the result)

Render the screen via the FE app's dev server and compare it against the contract's
`screenshots[]` entry for this screen. There is **no pixel-diff tool in-repo — do not invent
one**; the pass bar is **structured agent visual judgment** against an explicit checklist.
Record the checklist outcome in the commit body and the PR (a free-form "looks right" is not
acceptable — this is a sonnet-tier self-judgment and must be auditable):

- [ ] **Inventory** — every completeness-inventory row is present in the rendered screen (no silent drops).
- [ ] **Tokens** — colors/typography resolve to the repo's tokens (no stray handoff hex/oklch literals).
- [ ] **Layout** — container width, the row/col/grid structure, and spacing match the screenshot.
- [ ] **Responsive** — the contract's breakpoint behavior holds (e.g. ≤759px reflow, ≥44px tap targets).
- [ ] **Copy** — rendered strings match the copy index verbatim.
- [ ] **a11y** — landmarks/roles, focus order, focus-visible treatment, reduced-motion honored.
- [ ] **Reuse** — primitives come from the repo's primitives package; nothing existing was hand-rolled.

Any unchecked item is a faithfulness gap — fix it or record it as a known limitation; never
silently pass.

> **Wrapper-grant check (first run on a machine):** confirm the dispatched session can
> actually reach `DesignSync` (one successful `get_project` by id) before trusting the
> implementation — the agent wrapper grants tools via `tools: '*'`, which is the only thing
> surfacing DesignSync into the session. A silent grant failure looks like a
> `design-source-unreachable` fail-close.

## Output contract

Commit the change through dev-pipeline's `bot-commit.sh`, which owns the bot's git identity
(config `tracker.bot`) and commits as the repo default when no bot is configured. Toolkits never
hard-path into dev-pipeline's layout: resolve one install record (the project-scope record of this
worktree, else the one of the main checkout, else the newest user- or local-scope one), then find the
helper by name under its install path:

```bash
ROOT=$(git -C "<repo or worktree>" rev-parse --show-toplevel)
MAIN_ROOT=$(cd "$ROOT" && cd "$(git rev-parse --git-common-dir)/.." && pwd)
DEV_PIPELINE_ROOT=$(claude plugin list --json | jq -r --arg id dev-pipeline@second-shift \
    --arg root "$ROOT" --arg main "$MAIN_ROOT" \
    '[.[] | select(.id==$id)] as $records
     | def newest(f): $records | map(select(f)) | sort_by(.lastUpdated // "") | last;
       (newest(.scope=="project" and .projectPath==$root)
        // newest(.scope=="project" and .projectPath==$main)
        // newest(.scope=="user" or .scope=="local"))
     | .installPath // empty')
BOT_COMMIT_SH=$(find "$DEV_PIPELINE_ROOT" -name bot-commit.sh | head -1)
bash "$BOT_COMMIT_SH" -C "<repo or worktree>" \
    -m "feat(<fe-scope>): <screen> — faithful implementation of Claude Design handoff"
```

When dev-pipeline is not installed (no install path, or no `bot-commit.sh` under it), make a plain
`git commit` with the same message.

Then return:

```
{ "summary": "<one-line: screen, analog mirrored, self-verify result>",
  "committed": true,
  "changedFiles": ["<fe-app>/src/..."] }
```

If the design source is unreachable or exceeds a DesignSync limit, do **not** guess — return
`{ "summary": "<why>", "failClosed": { "reason": "<design-source-unreachable | project-type-mismatch | file-too-large | batch-overflow>" } }` (the four-member `FAIL_CLOSED` enum, `lib/contract-types.mjs`).

## Verification reality (interactive-only live e2e)

The full live run (fetch real handoff → implement → commit) needs an interactive DesignSync
session (auth is session-bound).
It is the operator-run demo, mirroring the README acceptance-demo framing. The offline-reproducible
substitute for the contract surface is `lib/extractor.test.mjs` plus the worked spec at
`../design-faithful-spec/examples/detail-spec.example.md`.

## Push the repo's design system (on request only)

When the operator asks to publish the repo's own design system — its tokens and a representative
component set — to a Claude Design design-system project, follow [`PUSH.md`](./PUSH.md). It builds
the card bytes with `tools/build-ds-files.mjs` and syncs them delta-only through `DesignSync`. It
is a separate job from implementing a screen: never run it as part of the sequence above.

Files in this skill

  • PUSH.md6.2 KB
  • README.md9.5 KB
  • SKILL.md10.3 KB
  • fixtures/component-previews.mjs11.6 KB
  • fixtures/design-system.mjs1.4 KB
  • fixtures/handoff.mjs5.1 KB
  • fixtures/hostile.mjs984 B
  • lib/component-previews.mjs9.5 KB
  • lib/contract-types.mjs5.3 KB
  • lib/css-tokens.mjs4.8 KB
  • lib/design-lib-selftest.sh1.9 KB
  • lib/emit-card.mjs4.5 KB
  • lib/emit-tokens.mjs5 KB
  • lib/emit.test.mjs8.3 KB
  • lib/extractor.mjs5.5 KB
  • lib/extractor.test.mjs9.5 KB
  • lib/html-markup.mjs5.7 KB
  • lib/read-plan.mjs3.7 KB
  • lib/sanitize.mjs1.7 KB
  • lib/sync-plan.mjs2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.