skills/tier-x-experimental/patent-figure/SKILL.md
Generate and iteratively refine USPTO-style patent figure drawings from provisional patent application markdown files, using nano-banana for v1 generation and targeted single-fix edits for v2+ iteration.
npx skillsauth add pbc-os/agent-skills-public patent-figureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates formal USPTO-style patent figure drawings from provisional patent application .md files, then iteratively refines them using targeted single-fix edits.
nano-banana skill installed (uses its generate_image.py and edit_image.py scripts)GEMINI_API_KEY accessible as an env var (see secrets-manager skill for how to wire this from your secret store)pip3 install google-genai python-dotenv if not already installedv1 — fresh generation (no seed image):
Use generate_image.py with the full structured prompt (5 sections, see below).
v2+ — targeted iteration (previous image as seed):
Use edit_image.py with the previous version as seed + the same structured prompt + a "ONE FIX NEEDED" section.
Never use the Mermaid diagram as a seed. Mermaid diagrams use different internal labels than what the patent figure needs. The model will follow the Mermaid labels and override your prompt.
From the provisional .md file, extract:
Brief Description — find ## BRIEF DESCRIPTION OF THE DRAWINGS and copy the line for the specific figure verbatim (e.g., **FIG. 1** — System architecture overview: ...)
Verify figure number — before generating anything, cross-check the figure number against the Brief Description. Users sometimes describe a figure by its content rather than its actual number (e.g., asking for "FIG. 2 — the trust tier diagram" when FIG. 2 is actually the signal pipeline and FIG. 3 is the tier diagram). Always generate the figure that matches the spec for that number, and note any discrepancy to the user.
Reference numerals — scan the ## DETAILED DESCRIPTION section for every component with a parenthetical number (e.g., Discovery Engine (210)). Build an exact table: 210 = DISCOVERY ENGINE. These must match what will appear in the figure exactly — this table is the single most important section of your prompt and prevents the model from hallucinating component labels. If the provisional has no parenthetical numerals yet, assign them yourself starting from the 100-series for top-level components, 200-series for platform internals, 300-series for external components.
Figure structure — read the Mermaid and ASCII diagrams in ## FIGURES for the target figure to understand the spatial layout (which components are inside which parent, left-to-right order, hierarchy).
Identify layout risks before building the prompt — scan for these known hard cases and plan mitigations upfront (see details in references/prompt_engineering.md):
Read references/prompt_engineering.md for the complete prompt template and reference numeral extraction tips.
Every prompt (v1 and v2+) contains these 5 sections in order:
[1] USPTO STYLE RULES BLOCK
[2] BRIEF DESCRIPTION (verbatim from spec)
[3] REFERENCE NUMERAL TABLE (exact labels, do not change any)
[4] DIRECTED CONNECTION LIST (plain bullets — no A1/A2 codes)
[5] LAYOUT INSTRUCTIONS
[+ ONE FIX NEEDED (v2+ only)]
Read references/prompt_engineering.md for the full template for each section. The most common mistakes to avoid:
# Ensure GEMINI_API_KEY is set in your environment (see secrets-manager skill for setup).
python3 ~/.claude/skills/nano-banana/scripts/generate_image.py \
"$PROMPT" \
--output ~/Downloads \
--filename "PATENT-FIG{N}-V1-{FIGURE-NAME}.jpg" \
--aspect-ratio "4:3" \
--model "gemini-3-pro-image-preview"
Use 4:3 aspect ratio for system architecture / flowchart figures. Use 3:4 for tall sequential figures (e.g., sequence diagrams).
After generating, read the image and check against this checklist:
SHEET N OF N in top-right cornerFIG. N caption centered at bottomRead references/assessment_checklist.md for common failure modes and how to describe fixes precisely.
Fix one issue per iteration. Add a THE ONE FIX NEEDED section at the end of the prompt:
THE ONE FIX NEEDED:
[Describe exactly what is wrong and exactly what it should look like instead.
Include spatial context: which box is the origin, which box is the destination,
what direction the arrow should travel, which boundary it should stay within.]
Do not change anything else. Every other component label, reference numeral,
layout, and arrow must remain exactly as it appears in the input image.
Then call edit_image.py with the previous version as --images input.
Repeat until all checklist items pass. Typically takes 3–7 iterations for a complex system architecture figure.
Save final figure to ~/Downloads/PATENT-FIG{N}-FINAL-{FIGURE-NAME}.jpg and embed it in the provisional .md file:

*FIG. N: [Brief description with reference numerals]*
Use a relative path (not a raw GitHub URL) so pandoc can embed it when converting to .docx.
references/prompt_engineering.md — complete prompt template with all 5 sections filled in, plus tips for extracting reference numeralsreferences/assessment_checklist.md — common failure modes and how to write precise fix descriptionsdata-ai
Weekly revenue / sales forecasting for small businesses with multiple locations or product lines. Blends recent trend + seasonal baseline + YoY growth with per-entity holiday multipliers and week-of-month adjustments. Ships autoresearch-compatible eval and parameters so you can tune it on your own historical data.
data-ai
Analyze email, calendar, and file patterns to discover repeatable workflows that AI agents can automate.
testing
Automated daily digest for small business owners. Combines email triage, calendar agenda, open tasks, and business KPIs into a single morning briefing. Composable — works with whatever data sources are available. Urgent emails require body inspection and explicit escalation signals — never classified from sender/timing metadata alone.
testing
Convert a planning doc or spec into a phase-based task structure for autonomous multi-session execution. Asks whether the agent should run in orchestrator mode (self-verifies and continues across phase boundaries) or phase-checkpoint mode (stops at each phase for human verification), then generates the right claude-prompt.md and claude-task.json. Built on the patterns from Anthropic's effective-harnesses-for-long-running-agents engineering blog.