Agent skill

Sketch From Image

by ghbalf in ghbalf/freecad-ai

Extract 2D geometry from an attached image and create a FreeCAD sketch from it.

LGPL-2.1Auto-check passed

Install Sketch From Image

skills CLI
$ npx skills add ghbalf/freecad-ai --skill sketch-from-image -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ghbalf/freecad-ai sketch-from-image --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ghbalf/freecad-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sketch-from-image .claude/skills/sketch-from-image && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sketch-from-image
GitHub stars
552
Token cost
~1.2k tokens
SKILL.md length
554 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
LGPL-2.1

At a glance

Extract 2D geometry from an attached image and create a FreeCAD sketch from it.

  • Works in 3 steps: Bounding size in mm — the real-world… → Plane — default XY if not specified.… → Body name — if the user wants the sketch…
  • SKILL.md covers When to use, Required user inputs (ask if…, Extraction procedure and Output, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Sketch From Image is an agent skill from ghbalf/freecad-ai. Extract 2D geometry from an attached image and create a FreeCAD sketch from it.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: AI-powered assistant workbench for FreeCAD — generate 3D models from natural language.

Example prompts

  • “/sketch-from-image”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Bounding size in mm — the real-world size the sketch should occupy.
  2. Plane — default XY if not specified. Accept XY, XZ, YZ.
  3. Body name — if the user wants the sketch on an existing body. Default

What it can do on your machine

Read from SKILL.md and the folder at commit 1e0f1ca. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sketch From Image loads about 1.2k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 554 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ghbalf/freecad-ai at commit 1e0f1ca, republished under its LGPL-2.1 licence (© ghbalf). 554 words, ~1,168 tokens.

Download SKILL.mdSave it as .claude/skills/sketch-from-image/SKILL.md (or your agent's skills folder).
name
sketch-from-image
description
Extract 2D geometry from an attached image and create a FreeCAD sketch from it.

Sketch from Image

Convert an image (drawing, sketch, reference photo, technical drawing) into a FreeCAD sketch by identifying its geometric shapes and creating a sketch with equivalent geometry.

When to use

  • User has attached an image and says "create a sketch from this", "trace this shape", "make a sketch of this", or similar.
  • User wants a starting point for CAD work from a visual reference.

Required user inputs (ask if missing)

  1. Bounding size in mm — the real-world size the sketch should occupy. Ask as: "What size (in mm) should this sketch be? Provide either the overall width or height." Example: "width 40mm" or "height 25mm".
  2. Plane — default XY if not specified. Accept XY, XZ, YZ.
  3. Body name — if the user wants the sketch on an existing body. Default: no body (standalone sketch).

Do NOT guess the size. Without a real dimension, the sketch is useless for CAD.

Extraction procedure

Look at the attached image (or the textual description if no image is present) and identify the 2D shapes. For each shape, record:

  • Shape type: rect, circle, polygon, or line
  • Position and size, scaled so that the overall bounding box matches the user-provided dimension (width OR height; preserve aspect ratio)
Scaling rule
  1. Measure the image's apparent bounding box in pixels (or relative units).
  2. Compute scale = user_dimension_mm / measured_dimension_pixels.
  3. Multiply every coordinate and radius by scale.
  4. Flip Y-axis if the source uses Y-down (SVG, screen pixels, most image formats). FreeCAD sketches use Y-up. Negate all Y coordinates after scaling.
  5. Translate so the sketch is centered around origin (or anchored at 0,0 — state which).
Shape JSON schema (internal — use this shape before calling the tool)
json
{
  "shapes": [
    {"type": "rect",    "x": 0, "y": 0, "width": 40, "height": 25},
    {"type": "circle",  "cx": 20, "cy": 12.5, "r": 3},
    {"type": "polygon", "points": [[0,0], [10,0], [5,8]]},
    {"type": "line",    "x1": 0, "y1": 0, "x2": 10, "y2": 10}
  ],
  "dimensions": [],
  "notes": "brief description of what was recognized"
}

The dimensions array is reserved for future use (auto-constraint from measured values in technical drawings). Leave it [] for now.

Output

After deriving the JSON, call create_sketch with the shapes. Do NOT add constraints — rectangles and circles are auto-constrained. Example:

create_sketch(
  plane="XY",
  geometries=[
    {"type": "rectangle", "x": 0, "y": 0, "width": 40, "height": 25},
    {"type": "circle", "cx": 20, "cy": 12.5, "radius": 3}
  ]
)

For line shapes, emit them as polygons with two points, since create_sketch groups connected line segments into a polygon.

Show full SKILL.md (217 more words)Show less

After creating the sketch

Briefly report:

  • Shapes created (count per type)
  • Final bounding size
  • Any shapes you couldn't confidently identify — list them so the user can clarify or re-attach a clearer image.

Do NOT pad, pocket, or otherwise extrude the sketch unless the user explicitly asks — this skill only produces the 2D profile.

Iterating on the sketch

If the user wants to adjust the sketch after initial creation, use edit_sketch.

For resizing, moving, or replacing geometry (most common), use clear_all=true and provide the complete updated geometry:

edit_sketch(sketch_name="MySketch", clear_all=true, add_geometries=[
    {"type": "rectangle", "x": 0, "y": 0, "width": 50, "height": 30},
    {"type": "circle", "cx": 6, "cy": 6, "radius": 3}
])

This clears all old geometry and constraints, then adds fresh geometry — no over-constraint issues. The sketch object, plane attachment, and body membership are preserved.

For adding new geometry to existing (e.g. "add a second hole"): edit_sketch(sketch_name, add_geometries=[...])

For changing dimensions (e.g. "make it 50mm wide"): use clear_all=true with updated geometry coordinates — dimensions are auto-constrained from the geometry. Do NOT manually add DistanceX/DistanceY/Radius constraints.

Limitations (mention if relevant)

  • Curves and splines are approximated as polygons; for complex curves the user should trace manually or use a dedicated tracing tool.
  • Dimension lines and annotations in the image are ignored in v1 (will be supported in a future version via the dimensions array).
  • Hidden lines, section lines, and construction lines are treated as regular geometry. If the image uses drafting conventions, warn the user.

© ghbalf, LGPL-2.1. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/sketch-from-image of ghbalf/freecad-ai.

Open the folder on GitHubat commit 1e0f1ca

Compare with similar skills

Sketch From Image next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sketch From Image compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sketch From Image this skillghbalf/freecad-ai552—~1.2kAutomated safety check: PassLGPL-2.1
Extractalirezarezvani/claude-skills28k—~1.4kAutomated safety check: PassMIT
Gh Attachsickn33/agentic-awesome-skills47k1 repos~1.6kAutomated safety check: PassMIT
Brand Extractnexu-io/open-design100k—~3.1kAutomated safety check: PassApache-2.0
Design Extractnexu-io/open-design100k—~549Automated safety check: PassApache-2.0
Gh Attachgithub/awesome-copilot40k—~529Automated safety check: PassMIT

Similar skills

  • Extract

    alirezarezvani/claude-skills

    Turn a proven pattern or debugging solution into a standalone reusable skill with SKILL.md, reference docs, and examples.

    28k GitHub stars~1.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Gh Attach

    sickn33/agentic-awesome-skills

    Upload and download GitHub user-attachments (screenshots, PDFs, zips, videos) from the terminal; use when asked to attach or embed a file in a PR, issue, or comment, or download an attachment URL.

    47k GitHub starsUsed in 1 repo~1.6k tokens
    Documents & OfficeAuto-check passed
  • Brand Extract

    nexu-io/open-design

    Extract a complete Brand Kit from a live website by driving the in-app browser.

    100k GitHub stars~3.1k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Design Extract

    nexu-io/open-design

    Extract design tokens (color / typography / spacing) from imported source code, screenshots, or Figma exports into the canonical token bag token-map consumes.

    100k GitHub stars~549 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Gh Attach

    github/awesome-copilot

    Official

    Uploads a local file (screenshot, image, PDF, zip, video) to GitHub user-attachments, downloads GitHub user-attachments, and embeds local files in a PR, issue, or comment.

    40k GitHub stars~529 tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • Sketch

    bergside/awesome-design-skills

    A friendly, hand-drawn sketch interface inspired by pencil illustrations on warm cream paper.

    3.1k GitHub starsUsed in 1 repo~933 tokens
    Frontend & DesignAuto-check passed

More from ghbalf/freecad-ai

All 9 skills in this repo
  • Skill Creator

    ghbalf/freecad-ai

    Create new FreeCAD AI skills, modify existing skills, and iteratively improve them.

    552 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Create Validation

    ghbalf/freecad-ai

    Generate a draft VALIDATION.md for a skill by analyzing its SKILL.md construction steps

    552 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Enclosure

    ghbalf/freecad-ai

    Generate a parametric electronics enclosure with a base and lid.

    552 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Fastener Hole

    ghbalf/freecad-ai

    Create standard fastener holes: clearance, counterbore, or countersink.

    552 GitHub stars~487 tokensUpdated today
    Auto-check passed
  • Gear

    ghbalf/freecad-ai

    Create an involute spur gear using FreeCAD's Part module. An agent skill from ghbalf/freecad-ai.

    552 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Lattice

    ghbalf/freecad-ai

    Generate a 3D lattice or infill pattern inside a bounding region.

    552 GitHub stars~483 tokensUpdated today
    Auto-check passed

Questions about Sketch From Image

What does Sketch From Image do?

Extract 2D geometry from an attached image and create a FreeCAD sketch from it. Sketch From Image is an agent skill from ghbalf/freecad-ai. Extract 2D geometry from an attached image and create a FreeCAD sketch from it.

How do I install Sketch From Image in Claude Code?

Run `npx skills add ghbalf/freecad-ai --skill sketch-from-image -a claude-code`. Or copy the skill folder (skills/sketch-from-image in ghbalf/freecad-ai) into .claude/skills/sketch-from-image in your project. Claude Code loads it when a task matches its description.

How do I install Sketch From Image in Codex?

Run `npx skills add ghbalf/freecad-ai --skill sketch-from-image -a codex`. Or copy the skill folder (skills/sketch-from-image in ghbalf/freecad-ai) into .agents/skills/sketch-from-image in your project. Codex loads it when a task matches its description.

Can I use Sketch From Image in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ghbalf/freecad-ai --skill sketch-from-image -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sketch-from-image, .gemini/skills/sketch-from-image, .github/skills/sketch-from-image and .opencode/skills/sketch-from-image in your project.

What does Sketch From Image need to run?

SKILL.md names no scripts, command-line tools or credentials: Sketch From Image is instructions for the agent only.

Does Sketch From Image access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sketch From Image safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sketch From Image use?

Sketch From Image is published under the LGPL-2.1 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sketch From Image use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sketch From Image?

Skills that share tags, products or a category with Sketch From Image: Extract (alirezarezvani/claude-skills, 28k stars), Gh Attach (sickn33/agentic-awesome-skills, 47k stars), Brand Extract (nexu-io/open-design, 100k stars) and Design Extract (nexu-io/open-design, 100k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sketch From Image?

ghbalf (a GitHub user) maintains it in ghbalf/freecad-ai, which has 552 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 10, 2026.

Source: ghbalf/freecad-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.