a-safe-pulse: Command for Gemini CLI

.gemini/commands/media/sketch-to-code.toml

sketch-to-code is a command for Gemini CLI from bybren-llc/a-safe-pulse. It costs 0 tokens per session (650 once invoked), scanned A, a copy of sketch-to-code, MIT.

A visual-to-code command that turns sketches, wireframes, screenshots, and diagrams into working interface code.

In plain words
What is it for?
It helps create HTML/CSS or TypeScript interface components from UI designs, flowcharts, and architecture diagrams.
Why use it?
It removes the need to manually translate a visual layout into components, page structure, and styling.

Command for Gemini CLI

Written for Gemini CLI: installed under .gemini/.

This is bybren-llc/a-safe-pulse's own configuration. It tells Gemini CLI how to work on a-safe-pulse itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything a-safe-pulse configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bybren-llc/a-safe-pulse. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bybren-llc/a-safe-pulse/dev/.gemini/commands/media/sketch-to-code.toml
Clone the repo
git clone --depth 1 https://github.com/bybren-llc/a-safe-pulse

Made for: Gemini CLI.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sketch-to-code

README.md
[![agentmods](https://agentmods.dev/badge/commands/bybren-llc/a-safe-pulse/sketch-to-code.svg)](https://agentmods.dev/commands/bybren-llc/a-safe-pulse/sketch-to-code)
Your own site
<a href="https://agentmods.dev/commands/bybren-llc/a-safe-pulse/sketch-to-code"><img src="https://agentmods.dev/badge/commands/bybren-llc/a-safe-pulse/sketch-to-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00650
Opus 5 $0.00000 $0.00325
Sonnet 5 $0.00000 $0.00130
Haiku 4.5 $0.00000 $0.00065

Measured 3d ago against content hash 45595b3ebefa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

sketch-to-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to sketch-to-code — 16 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.gemini/commands/media/sketch-to-code.toml · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

description = "Generate code from UI sketches, wireframes, or mockups"

prompt = """

Sketch to Code Command

Transform hand-drawn sketches, wireframes, or UI mockups into functional code using Gemini's multimodal vision.

Input: {{args}}

Supported Input Types

  • Hand-drawn sketches (paper, whiteboard photos)
  • Digital wireframes
  • UI mockups (Figma screenshots, etc.)
  • Flowcharts and diagrams
  • Architecture diagrams

Workflow

1. Analyze the Visual Input

Read and understand the sketch/mockup:

!{ls -la {{args}} 2>/dev/null || echo "File not found"}

Identify:

  • UI components (buttons, inputs, cards, navigation)
  • Layout structure (grid, flex, sections)
  • Visual hierarchy
  • Interactive elements
  • Data flow (if flowchart)

2. Determine Output Framework

Ask user or detect from project context:

  • HTML/CSS (vanilla)
  • TypeScript (Node.js backend)

Check project for existing framework:

!{cat package.json 2>/dev/null | grep -E '"express"|"typescript"' | head -3 || echo "No package.json found"}

3. Generate Code

Based on sketch analysis, generate:

Component Structure:

ComponentName/
├── index.tsx        # Main component
├── styles.css       # Styles (if not Tailwind)
└── types.ts         # TypeScript interfaces

Code Output:

  • Semantic HTML structure
  • Responsive layout (mobile-first)
  • Accessibility attributes (ARIA)
  • Placeholder content matching sketch
  • Interactive states (hover, focus, active)

4. Output Location

Save generated code to appropriate location:

!{ls -d src/components 2>/dev/null || ls -d components 2>/dev/null || echo "./"}

Usage Examples

# From hand-drawn sketch
/media:sketch-to-code ./whiteboard-photo.jpg

# From Figma screenshot
/media:sketch-to-code ~/Downloads/figma-export.png

# From wireframe with framework hint
/media:sketch-to-code ./wireframe.png --typescript

# From architecture diagram
/media:sketch-to-code ./system-diagram.png --mermaid

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 111 lines · 0 tokens per session scan A 45595b3ebefa

Subscribe to this mod's changes

sketch-to-code is a command published in the GitHub repository bybren-llc/a-safe-pulse (9 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 650 tokens. A static security scan graded it A with 0 findings. It is 92% identical to sketch-to-code, differing in 16 lines, and is treated as a copy.