Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/davila7-patentfig/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -58% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -5% | 0% |
Generate and convert patent figures through the PatentFig AI REST API.
https://patentfig.ai/api/v1Authorization: Bearer $PATENTFIG_API_KEY{ "success": true, "data": {...} } on success, { "success": false, "error": { "code", "message" } } on failure.https://cdn.patentfig.ai — pass them to the user or feed them into follow-up calls.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:
bashexport PATENTFIG_API_KEY="pfig_..."
Verify connectivity and credit balance (free call):
bashcurl -s https://patentfig.ai/api/v1/credits \ -H "Authorization: Bearer $PATENTFIG_API_KEY" # → { "success": true, "data": { "balance": 500 } }
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.
bashcurl -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.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.
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:
bashcurl -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
429 back off (start at 5s) and retry.402 INSUFFICIENT_CREDITS, stop and tell the user to top up at https://patentfig.ai/pricing.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).GET /credits and confirm the balance covers it.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→pass | 12,050 | 6,366 | -47% | 1 | 1 | 0% | 1,464 | 2,528 | +73% | 0 | 0 | — |
case-04 | fail→pass | 11,616 | 9,274 | -20% | 1 | 1 | 0% | 2,090 | 3,310 | +58% | 0 | 0 | — |
case-14 | fail→pass | 12,990 | 4,444 | -66% | 1 | 1 | 0% | 2,444 | 2,223 | -9% | 0 | 0 | — |
case-01 | fail→pass | 32,676 | 6,687 | -80% | 1 | 1 | 0% | 6,197 | 2,616 | -58% | 0 | 0 | — |
case-02 | fail→pass | 11,868 | 4,127 | -65% | 1 | 1 | 0% | 2,167 | 2,067 | -5% | 0 | 0 | — |
case-05 | fail→pass | 9,346 | 2,983 | -68% | 1 | 1 | 0% | 1,854 | 1,886 | +2% | 0 | 0 | — |
case-06 | fail→pass | 16,772 | 5,256 | -69% | 1 | 1 | 0% | 3,604 | 2,332 | -35% | 0 | 0 | — |
case-07 | fail→pass | 7,949 | 4,390 | -45% | 1 | 1 | 0% | 1,629 | 2,156 | +32% | 0 | 0 | — |
case-08 | fail→pass | 13,789 | 3,923 | -72% | 1 | 1 | 0% | 2,344 | 2,134 | -9% | 0 | 0 | — |
case-09 | fail→pass | 9,884 | 3,779 | -62% | 1 | 1 | 0% | 1,766 | 1,982 | +12% | 0 | 0 | — |
case-10 | fail→pass | 11,415 | 3,361 | -71% | 1 | 1 | 0% | 2,120 | 1,923 | -9% | 0 | 0 | — |
case-11 | fail→pass | 12,801 | 7,562 | -41% | 1 | 1 | 0% | 2,451 | 2,684 | +10% | 0 | 0 | — |
case-12 | fail→pass | 10,267 | 3,814 | -63% | 1 | 1 | 0% | 1,954 | 1,934 | -1% | 0 | 0 | — |
case-13 | fail→pass | 10,530 | 6,360 | -40% | 1 | 1 | 0% | 1,726 | 2,441 | +41% | 0 | 0 | — |
case-15 | pass→pass | 12,470 | 6,472 | -48% | 1 | 1 | 0% | 2,107 | 2,503 | +19% | 0 | 0 | — |
case-16 | fail→pass | 6,182 | 2,797 | -55% | 1 | 1 | 0% | 1,044 | 1,675 | +60% | 0 | 0 | — |
case-17 | fail→pass | 9,178 | 3,454 | -62% | 1 | 1 | 0% | 1,885 | 1,953 | +4% | 0 | 0 | — |
case-18 | fail→pass | 9,624 | 5,411 | -44% | 1 | 1 | 0% | 1,867 | 2,256 | +21% | 0 | 0 | — |
case-19 | fail→pass | 9,518 | 6,492 | -32% | 1 | 1 | 0% | 1,773 | 2,612 | +47% | 0 | 0 | — |
case-20 | pass→pass | 8,028 | 5,817 | -28% | 1 | 1 | 0% | 1,522 | 2,359 | +55% | 0 | 0 | — |
case-21 | pass→fail | 16,560 | 15,000 | -9% | 1 | 1 | 0% | 3,133 | 4,326 | +38% | 0 | 0 | — |
case-22 | pass→pass | 13,734 | 11,748 | -14% | 1 | 1 | 0% | 2,477 | 3,297 | +33% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +77 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.