{"id":"6638fa65-548e-46bf-9dd5-f053bfcc5d48","slug":"patent-writer","kind":"skill","name":"patent-writer","summary":"","owner":"e5dese","repoUrl":"https://github.com/e5dese/patent-writer","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":2,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-07-28T13:26:30.000Z","addedAt":"2026-10-21T23:35:05.427Z","logoUrl":"https://avatars.githubusercontent.com/u/142803601?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["writing"],"tags":[],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T21:31:29.790Z","sample":false,"url":"https://conduits.dev/tools/patent-writer","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# patent-writer\n\nAn Agent Skill that turns a STEM technical scheme (paper draft, outline, or spoken idea) into a complete set of Chinese invention patent application documents: a formally-styled specification (`.md` + `.docx`), claims, and a method flowchart figure (`.pptx`).\n\n面向理工科技术方案（论文草稿、大纲或口述思路）的专利撰写 Agent Skill，一站式产出符合中国发明专利申请规范的说明书正文（`.md` + `.docx`）、权利要求书，以及方法流程图附图（`.pptx`）。\n\nBuilt for the [Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) standard — compatible with Claude Code, Comate, and other tools that support the `SKILL.md` format.\n\n## Why this exists\n\nWriting a patent specification from a technical paper is repetitive and format-heavy: strict prose style, no Markdown, formulas standalone with symbol explanations, a fixed set of section headers, and a mandatory closing disclaimer sentence. On top of that, embedding formulas into Word/PowerPoint reliably (without character overlap, truncated superscripts, or mismatched font sizes) turns out to be surprisingly fiddly.\n\nThis skill encodes both the writing conventions and the formula-rendering pitfalls we hit while iterating on a real filing, so future runs don't have to rediscover them.\n\n## What it produces\n\n```\nTechnical scheme (paper / outline / verbal description)\n    ├─ Specification body (.md)              — formal Chinese prose, six mandatory sections\n    ├─ Specification (.docx)                  — same content, laid out with editable\n    │                                            Word formula objects + rendered formula images\n    ├─ Claims (independent + dependent)       — filtered against a 5-point checklist so\n    │                                            dependent claims aren't padded with low-value items\n    └─ Method flowchart (.pptx)               — nested step boxes, formulas as images,\n                                                 same visual scale as the .docx\n```\n\n## Structure\n\n```\npatent-writer/\n├── SKILL.md                       # entry point: workflow, conventions, troubleshooting table\n├── references/\n│   ├── style-guide.md              # specification prose rules + a \"no fabricated content\" policy\n│   └── claims-guide.md             # dependent-claim filtering checklist\n├── scripts/\n│   ├── render_formulas.py          # batch-renders LaTeX/mathtext formulas to transparent PNGs\n│   ├── omml_builder.py             # builds native, editable Word formula objects (OMML)\n│   ├── fill_docx.py                # lays out the .md body into a styled .docx\n│   └── draw_pptx.py                # generates the nested-box method flowchart\n└── assets/\n    └── example_flow_config.json    # sample flowchart config\n```\n\n## Install\n\n**Claude Code** (personal skill):\n```bash\ncp -r patent-writer ~/.claude/skills/patent-writer\n```\n\n**Comate** (personal skill):\n```bash\ncp -r patent-writer ~/.comate/skills/patent-writer\n```\n\nEither location works — the `SKILL.md` frontmatter (`name` + `description`) is what the agent reads to decide when to trigger the skill; nothing else is tool-specific.\n\n## Dependencies\n\nThe scripts are plain Python and need:\n\n```bash\npip install python-docx python-pptx matplotlib Pillow\n```\n\n## Usage\n\nOnce installed, just ask your agent naturally:\n\n> \"Help me turn this paper into a patent specification.\"\n> \"Draft the claims for this method.\"\n> \"Draw the flowchart figure for this patent.\"\n\nThe agent will read `SKILL.md`, follow the three-stage workflow (spec body → formatted `.docx` → flowchart `.pptx`), and pull in `references/` for the writing rules and `scripts/` for formula rendering as needed. You don't need to call the scripts directly — the skill instructs the agent to invoke them with the right arguments — but they're also usable standalone if you want to run the pipeline manually.\n\n### Recommended model\n\nThis entire workflow — drafting the specification prose, spotting the fabricated-content issues, debugging the OMML formula rendering, and iterating on the flowchart layout — was developed and validated with **Claude Sonnet 4.5**. Long-form Chinese legal-document prose and multi-step visual layout debugging (formula overlap, superscript structure, image scaling) benefit from a strong reasoning model; lighter models are more likely to skip steps in the troubleshooting table or reintroduce issues that were already fixed (e.g. re-embedding a precomposed accented character instead of using the `m_acc()` helper). If you're running this skill with a different model, pay extra attention to the checklists in `references/style-guide.md` and the troubleshooting table in `SKILL.md`.\n\n整个工作流——包括说明书正文撰写、发现无中生有的内容问题、调试 OMML 公式渲染、迭代流程图排版——都是在 **Claude Sonnet 4.5** 协作下开发和验证的。长篇中文法律文书写作与多步骤的可视化排版调试（公式重叠、上标结构、图片缩放）比较依赖模型的推理能力；能力较弱的模型更容易跳过排查表里的步骤，或者重新引入已经修复过的问题（例如重新塞入预组合重音字符，而不是使用 `m_acc()` 工具函数）。如果你用其他模型运行这个 skill，建议格外留意 `references/style-guide.md` 里的检查清单和 `SKILL.md` 里的常见问题排查表。\n\n## What makes the formula handling non-trivial\n\nA few things that don't work the way you'd expect, all captured in `SKILL.md`'s troubleshooting table:\n\n- **Complex formulas as Word objects break silently.** Hand-building OMML for nested superscripts (e.g. `e^{Λk/(M-1)}`) produces formula objects that render with empty superscripts in Word. The fix used here: render those as images instead, and reserve native OMML objects for simple inline symbols (`ε_u`, `w_ij`).\n- **Precomposed accented Unicode characters overlap adjacent text.** Characters like `X̂` or `Ã` collide visually with a following parenthesis under Cambria Math. Fixed by decomposing them into proper OMML `<m:acc>` accent structures instead of embedding the precomposed glyph.\n- **Formula image scale isn't just \"pick a number.\"** Getting formula images to look proportionate to body text requires converting pixel size → physical inches via the render DPI, then applying a scale factor tuned per target font size (docx vs. pptx use different scales).\n\n## Content integrity guardrails\n\n`references/style-guide.md` also encodes a \"no fabricated content\" rule: no invented experimental numbers, no citing specific theoretical tools (e.g. a particular differential-privacy variant) unless the scheme actually derives them, and no claiming \"rigorous formal proof\" without the accompanying proof steps. These are easy mistakes to make when adapting from a paper's discussion section, and they're the kind of thing that unravels under scrutiny — so the skill flags them explicitly.\n\n## Scope\n\nCurrently tuned for **Chinese invention patent specifications** in STEM fields (the writing conventions, section structure, and mandatory closing sentence are specific to Chinese patent examination practice). The symbol-recognition regex in `fill_docx.py` defaults to a vocabulary common in differential-privacy / graph-neural-network papers — extending it for other subfields (documented inline) is a one-line change.\n\n## Acknowledgment\n\nThis skill's `SKILL.md`, reference documents, and scripts were drafted with the assistance of an AI coding agent (Kiro/Comate), based on lessons learned from iterating on a real patent filing. All content has been reviewed and validated against real usage, but as with any AI-assisted work, please review the writing-style rules and generated output for your own filing before relying on them as-is.\n\n本项目的 `SKILL.md`、参考文档与脚本在编写过程中借助了 AI 编程智能体（Kiro/Comate）的协助，内容基于一次真实专利撰写过程中积累的经验。所有内容均经过实际使用验证，但如同所有 AI 辅助产出一样，建议你在正式提交前自行核对文风规则与生成结果。\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE) for the full text.\n"}