Patent Figure Generator

Patentfig

by davila7 · MIT license · ★ 32,299 on GitHub · v1.0.0

Patentfig cover

Generate patent-office-compliant figures via the PatentFig AI API — patent line art from text (PNG or SVG), vectorize drawings to SVG/DXF/vector PDF, AI-upscale images, and convert to filing-ready TIFF/PDF/PNG. Use when the user asks…

---
name: patentfig
description: Generate patent-office-compliant figures via the PatentFig AI API — patent line art from text (PNG or SVG), vectorize drawings to SVG/DXF/vector PDF, AI-upscale images, and convert to filing-ready TIFF/PDF/PNG. Use when the user asks for patent drawings, patent figures, invention diagrams, USPTO/EPO-compliant line art, vectorizing a drawing for CAD, or preparing figures for a patent filing. Requires a PATENTFIG_API_KEY environment variable.
version: 1.0.0
author: TopLocalAI
license: MIT
tags: [Patent, Patent Drawings, Line Art, SVG, Vectorize, DXF, USPTO, Image Generation, API]
metadata:
  homepage: https://patentfig.ai
  docs: https://patentfig.ai/docs
---

# PatentFig AI API

Generate and convert patent figures through the PatentFig AI REST API.

- **Base URL**: `https://patentfig.ai/api/v1`
- **Auth**: `Authorization: Bearer $PATENTFIG_API_KEY`

Overview

Generate and convert patent figures through the PatentFig AI REST API.

Manual install (npx, ZIP)
Claude Codenpx skills add davila7/claude-code-templates --skill patentfig -g -a claude-code
Claude Code (degit)npx degit davila7/claude-code-templates/cli-tool/components/skills/creative-design/patentfig#main ~/.claude/skills/patentfig
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md4.7 KB
Read SKILL.md here
davila7/main1 file shown
SKILL.md
Show the full text93 lines

PatentFig AI API

Generate and convert patent figures through the PatentFig AI REST API.

  • Base URL: https://patentfig.ai/api/v1
  • Auth: Authorization: Bearer $PATENTFIG_API_KEY
  • All endpoints are synchronous and return JSON: { "success": true, "data": {...} } on success, { "success": false, "error": { "code", "message" } } on failure.
  • Generated files are returned as URLs on https://cdn.patentfig.ai — pass them to the user or feed them into follow-up calls.

Setup

The key comes from the PATENTFIG_API_KEY environment variable. Never hardcode it, print it, or write it into files or logs.

If the variable is not set, tell the user to create a key at https://patentfig.ai/settings/api-keys (requires a PatentFig AI account; keys start with pfig_) and export it:

export PATENTFIG_API_KEY="pfig_..."

Verify connectivity and credit balance (free call):

curl -s https://patentfig.ai/api/v1/credits \
  -H "Authorization: Bearer $PATENTFIG_API_KEY"
# → { "success": true, "data": { "balance": 500 } }

Generate a patent figure (10 credits)

POST /figures — the core endpoint. One prompt → one figure. Views, diagram type, and composition are all controlled through the prompt; for a multi-view set (front/side/top), make one call per view.

curl -s -X POST https://patentfig.ai/api/v1/figures \
  -H "Authorization: Bearer $PATENTFIG_API_KEY" \
  -H "Content-Type: application/json" \
  --max-time 300 \
  -d '{
    "prompt": "Exploded view of a wireless earbud charging case showing lid, hinge, charging coil, and battery",
    "output": "svg",
    "labeled": true
  }'
  • output: "png" (raster figure) or "svg" (stroke-based line art, CAD-friendly). Default "png".
  • labeled: true adds patent-style numeric reference callouts (100, 102, …).
  • referenceImageUrls: up to 4 public image URLs (sketch/photo/prior figure) used as the structural baseline.
  • Response data.url is the figure; with output: "svg" the full SVG source is also in data.svg.

Prompting tips: name the parts to draw (names tell the model WHAT to draw, not what to label); for flowcharts/block diagrams, name every node explicitly.

Convert an existing image

All three endpoints accept either JSON with imageUrl (public URL) or multipart/form-data with a file field (PNG/JPEG/WebP/TIFF, ≤10 MB).

Vectorize (20 credits) — raster → SVG / DXF / vector PDF:

curl -s -X POST https://patentfig.ai/api/v1/vectorize \
  -H "Authorization: Bearer $PATENTFIG_API_KEY" \
  -H "Content-Type: application/json" \
  --max-time 300 \
  -d '{ "imageUrl": "https://example.com/drawing.png", "format": "dxf", "engine": "lineart" }'

engine: "lineart" (default) redraws as clean single-stroke patent line art — use for CAD/DXF. engine: "trace" reproduces the input pixels faithfully, preserving fills — use when output must match the original.

Enhance (20 credits) — AI super-resolution: POST /enhance with scale (2 or 4, controls pixels) and dpi (300 or 600, metadata stamp only).

Convert (20 credits) — filing-ready raster: POST /convert with format (png/tiff/pdf) and dpi (300 or 600).

Full parameter tables for every endpoint: see references/endpoints.md. Machine-readable spec: https://patentfig.ai/api/openapi.yaml

Operational rules

  • Set a client timeout of at least 300 seconds — generation and vectorization take from ~20s up to a few minutes.
  • Credits are charged only on success; retrying a failed call never double-bills.
  • Rate limit: 60 requests/minute per key. On 429 back off (start at 5s) and retry.
  • On 402 INSUFFICIENT_CREDITS, stop and tell the user to top up at https://patentfig.ai/pricing.
  • On 500 GENERATION_FAILED, one retry is reasonable; persistent failures usually mean the input doesn't suit the pipeline (e.g., a photo sent for line-art vectorization — suggest POST /figures with the photo as referenceImageUrls instead).
  • Before a batch of billable calls, check GET /credits and confirm the balance covers it.
1---
2name: patentfig
3description: Generate patent-office-compliant figures via the PatentFig AI API — patent line art from text (PNG or SVG), vectorize drawings to SVG/DXF/vector PDF, AI-upscale images, and convert to filing-ready TIFF/PDF/PNG. Use when the user asks for patent drawings, patent figures, invention diagrams, USPTO/EPO-compliant line art, vectorizing a drawing for CAD, or preparing figures for a patent filing. Requires a PATENTFIG_API_KEY environment variable.
4version: 1.0.0
5author: TopLocalAI
6license: MIT
7tags: [Patent, Patent Drawings, Line Art, SVG, Vectorize, DXF, USPTO, Image Generation, API]
8metadata:
9 homepage: https://patentfig.ai
10 docs: https://patentfig.ai/docs
11---
12 
13# PatentFig AI API
14 
15Generate and convert patent figures through the PatentFig AI REST API.
16 
17- **Base URL**: `https://patentfig.ai/api/v1`
18- **Auth**: `Authorization: Bearer $PATENTFIG_API_KEY`
19- **All endpoints are synchronous** and return JSON: `{ "success": true, "data": {...} }` on success, `{ "success": false, "error": { "code", "message" } }` on failure.
20- Generated files are returned as URLs on `https://cdn.patentfig.ai` — pass them to the user or feed them into follow-up calls.
21 
22## Setup
23 
24The key comes from the `PATENTFIG_API_KEY` environment variable. Never hardcode it, print it, or write it into files or logs.
25 
26If the variable is not set, tell the user to create a key at https://patentfig.ai/settings/api-keys (requires a PatentFig AI account; keys start with `pfig_`) and export it:
27 
28```bash
29export PATENTFIG_API_KEY="pfig_..."
30```
31 
32Verify connectivity and credit balance (free call):
33 
34```bash
35curl -s https://patentfig.ai/api/v1/credits \
36 -H "Authorization: Bearer $PATENTFIG_API_KEY"
37# → { "success": true, "data": { "balance": 500 } }
38```
39 
40## Generate a patent figure (10 credits)
41 
42`POST /figures` — the core endpoint. One prompt → one figure. Views, diagram type, and composition are all controlled through the prompt; for a multi-view set (front/side/top), make one call per view.
43 
44```bash
45curl -s -X POST https://patentfig.ai/api/v1/figures \
46 -H "Authorization: Bearer $PATENTFIG_API_KEY" \
47 -H "Content-Type: application/json" \
48 --max-time 300 \
49 -d '{
50 "prompt": "Exploded view of a wireless earbud charging case showing lid, hinge, charging coil, and battery",
51 "output": "svg",
52 "labeled": true
53 }'
54```
55 
56- `output`: `"png"` (raster figure) or `"svg"` (stroke-based line art, CAD-friendly). Default `"png"`.
57- `labeled: true` adds patent-style numeric reference callouts (100, 102, …).
58- `referenceImageUrls`: up to 4 public image URLs (sketch/photo/prior figure) used as the structural baseline.
59- Response `data.url` is the figure; with `output: "svg"` the full SVG source is also in `data.svg`.
60 
61Prompting tips: name the parts to draw (names tell the model WHAT to draw, not what to label); for flowcharts/block diagrams, name every node explicitly.
62 
63## Convert an existing image
64 
65All three endpoints accept either JSON with `imageUrl` (public URL) or `multipart/form-data` with a `file` field (PNG/JPEG/WebP/TIFF, ≤10 MB).
66 
67**Vectorize (20 credits)** — raster → SVG / DXF / vector PDF:
68 
69```bash
70curl -s -X POST https://patentfig.ai/api/v1/vectorize \
71 -H "Authorization: Bearer $PATENTFIG_API_KEY" \
72 -H "Content-Type: application/json" \
73 --max-time 300 \
74 -d '{ "imageUrl": "https://example.com/drawing.png", "format": "dxf", "engine": "lineart" }'
75```
76 
77`engine: "lineart"` (default) redraws as clean single-stroke patent line art — use for CAD/DXF. `engine: "trace"` reproduces the input pixels faithfully, preserving fills — use when output must match the original.
78 
79**Enhance (20 credits)** — AI super-resolution: `POST /enhance` with `scale` (2 or 4, controls pixels) and `dpi` (300 or 600, metadata stamp only).
80 
81**Convert (20 credits)** — filing-ready raster: `POST /convert` with `format` (`png`/`tiff`/`pdf`) and `dpi` (300 or 600).
82 
83Full parameter tables for every endpoint: see [references/endpoints.md](references/endpoints.md). Machine-readable spec: https://patentfig.ai/api/openapi.yaml
84 
85## Operational rules
86 
87- **Set a client timeout of at least 300 seconds** — generation and vectorization take from ~20s up to a few minutes.
88- Credits are charged **only on success**; retrying a failed call never double-bills.
89- Rate limit: 60 requests/minute per key. On `429` back off (start at 5s) and retry.
90- On `402 INSUFFICIENT_CREDITS`, stop and tell the user to top up at https://patentfig.ai/pricing.
91- On `500 GENERATION_FAILED`, one retry is reasonable; persistent failures usually mean the input doesn't suit the pipeline (e.g., a photo sent for line-art vectorization — suggest `POST /figures` with the photo as `referenceImageUrls` instead).
92- Before a batch of billable calls, check `GET /credits` and confirm the balance covers it.
93 
View all files on GitHub →

Details

Version
1.0.0
License
MIT
Stars on the repo
★ 32,299
Checked
Source
davila7/claude-code-templates ↗
Creator
davila7 · 212 listings
View creator

Similar skills

See all →
SkillPatent Claims Drafterwanshuiyin/Auto-claude-code-research-in-sleep · by wanshuiyinDescribe your invention in plain words and get back a numbered set of formal patent claims — the legal wording that defines exactly what you own.★ 16.5k GitHub starsSkillPatent Novelty Checkerwanshuiyin/Auto-claude-code-research-in-sleep · by wanshuiyinDescribe your invention in everyday words and get back a clear read on whether it's new and original enough to patent, plus where it might hit trouble.★ 16.5k GitHub starsAgentPatent Landscape Intelligencealirezarezvani/claude-skills · by alirezarezvaniPatent prior-art + landscape intelligence persona. Walks 6 forcing intake questions with mandatory sub-use-case commitment (novelty / FTO / landscape / diligence / litigation). Refuses to start without a sub-use-case picked. Refuses generic "patent help" requests. Searches Google Patents + Espacenet + USPTO + optional Lens.org sequentially at 1 q/sec. Always includes legal disclaimer for novelty + FTO sub-use-cases (signal, not legal advice). Family-resolves duplicates across jurisdictions. Outputs 8-section .docx with verdict + audit log.★ 26.3k GitHub starsSkillPatent Prior-Art Analyzeralirezarezvani/claude-skills · by alirezarezvaniPatent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search / freedom-to-operate / competitive landscape / acquisition diligence / litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.★ 26.3k GitHub starsSkillPatent Application Generatorwanshuiyin/Auto-claude-code-research-in-sleep · by wanshuiyinDescribe your invention in plain words and get back a complete first-draft patent application — claims, full description, and abstract — ready to hand to a patent attorney.★ 16.5k GitHub starsSkillPatent Filing Preparationwanshuiyin/Auto-claude-code-research-in-sleep · by wanshuiyinDescribe your invention in plain words and get back a formal write-up that lays out the problem it solves, how it works, and which parts are worth protecting.★ 16.5k GitHub stars

More from davila7

Skill2D Game Developmentdavila7/claude-code-templates · by davila72D game development principles. Sprites, tilemaps, physics, camera.★ 32.3k GitHub starsSkill3D Game Development Principlesdavila7/claude-code-templates · by davila73D game development principles. Rendering, shaders, physics, cameras.★ 32.3k GitHub starsSkill3D Web Experience Builderdavila7/claude-code-templates · by davila7Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.★ 32.3k GitHub starsSkillSplit Test Setupdavila7/claude-code-templates · by davila7When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," or "hypothesis." For tracking implementation, see analytics-tracking.★ 32.3k GitHub starsAgentResearch Literature Synthesizerdavila7/claude-code-templates · by davila7Academic research synthesis specialist. Use PROACTIVELY for comprehensive research on academic topics, literature reviews, technical investigations, and well-cited analysis combining multiple sources. <example>Context: A podcast episode needs a segment grounded in peer-reviewed evidence with formal citations. user: "Research the current state of transformer efficiency techniques for the episode, with proper academic citations." assistant: "I'll use the academic-research-synthesizer agent to search arXiv and Semantic Scholar, extract full-text findings via WebFetch, and produce a cited literature synthesis with confidence levels." <commentary>Use academic-research-synthesizer (not comprehensive-researcher) when the episode segment needs peer-reviewed sourcing, formal citation format, and explicit confidence tagging rather than general-purpose multi-source coverage.</commentary></example> <example>Context: The episode-orchestrator has routed a "literature review" request for a technical deep-dive segment. user: "Summarize the research landscape on federated learning privacy guarantees." assistant: "I'll invoke academic-research-synthesizer to systematically search academic sources, note peer-review status per source, and synthesize consensus vs. open debates."</example>★ 32.3k GitHub starsAgentAcademic Research Specialistdavila7/claude-code-templates · by davila7Academic research specialist for scholarly sources, peer-reviewed papers, and academic literature. Use PROACTIVELY for research paper analysis, literature reviews, citation tracking, and academic methodology evaluation. <example>Context: The research-orchestrator has kicked off Phase 4 parallel research on 'efficacy of intermittent fasting' and needs peer-reviewed evidence. user: "Find the academic evidence on intermittent fasting outcomes." assistant: "I'll use the academic-researcher agent to search Semantic Scholar, PubMed, and OpenAlex for peer-reviewed studies and write structured findings to academic-research.md." <commentary>The request is specifically for scholarly/peer-reviewed evidence rather than general web coverage or code, so academic-researcher (not web-researcher or technical-researcher) is the right specialist.</commentary></example> <example>Context: The user wants a literature review comparing methodologies across studies on a topic. user: "Can you review the literature on transformer model interpretability and identify research gaps?" assistant: "Let me invoke the academic-researcher agent to pull foundational and recent papers, extract methodologies, and surface open research gaps." <commentary>Literature review, methodology extraction, and research-gap identification are core academic-researcher capabilities, distinct from technical-researcher's focus on code repositories and implementations.</commentary></example>★ 32.3k GitHub stars