libredwg

libredwg is a skill for Claude Code, Codex from znlgis/opengis-skills. It costs 128 tokens per session (4,023 once invoked), scanned B, original, MIT.

A free, open-source C library for reading and writing DWG files, the binary drawing format used by AutoCAD. It also provides command-line tools and bindings for languages such as Python, Perl and Common Lisp.

In plain words
What is it for?
Use it to inspect drawing entities, convert DWG to DXF, create or rewrite supported DWG files, and extract drawing data in automated programs or command-line workflows. Newer DWG versions may have limited writing support.
Why use it?
It lets software work with DWG files without relying on a commercial CAD library. It can also convert DWG and DXF files and export drawing data to formats such as JSON, XML and SVG.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect drawing entities, convert DWG to DXF, create or rewrite supported DWG files, and extract drawing data in automated programs or command-line workflows. Newer DWG versions may have limited writing support.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/opengis-skills/libredwg
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add znlgis/opengis-skills --skill libredwg
Clone the repo
git clone --depth 1 https://github.com/znlgis/opengis-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for libredwg

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/opengis-skills/libredwg/github.svg)](https://agentmods.dev/skills/znlgis/opengis-skills/libredwg)
Your own site
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/libredwg"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/libredwg/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for libredwg

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/libredwg"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/libredwg.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,023 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 7 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 50
    Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
    Fix: Limit tool chaining depth and validate the output of each tool before passing it to the next. Require explicit user approval for multi-step chains.
  • high Tool Misuse · line 183
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 205
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • medium Privilege Escalation · line 39
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 40
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 50
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
  • medium Privilege Escalation · line 43
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00128 $0.04023
Opus 5.5 $0.00051 $0.01609
Sonnet 5.5 $0.00026 $0.00805
Haiku 4.5 $0.00013 $0.00402

Measured today against content hash ac500245f467, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

libredwg scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo make install

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

out = subprocess.check_output(["dwgread", "-O", "JSON", "input.dwg"])
cad/libredwg/SKILL.md · 283 lines

How it starts

The opening of the file, as written. The whole thing — 283 lines — stays where its author put it; the contents beside it link to each section on GitHub.

项目地址: https://github.com/LibreDWG/libredwg

官网: https://www.gnu.org/software/libredwg/

手册: https://www.gnu.org/software/libredwg/

许可证: GPL-3.0+

最新稳定版: 0.14(2026-06-27 发布,截至 2026-10,见 GitHub Releases)

概述

LibreDWG 解决 DWG 二进制格式的开源读写:

  • 读取版本:DWG R1.4 – R2018+(R13、R14、R2000、R2004、R2007、R2010、R2013、R2018)
  • 写入版本:稳定支持 R1.4 – R2004(R2007+ 写入仍试验性)
  • 读写:DWG ↔ DXF(ASCII/DXFB),并能转 JSON/minJSON/GeoJSON/SVG
  • 命令行工具:dwgread、dwgwrite、dwg2dxf、dxf2dwg、dwg2SVG、dwgrewrite
  • 绑定:C API、Python(LibreDWG 模块,SWIG 生成)、Common Lisp、Perl

与 ODA / Teigha 的差异:LibreDWG 完全开源(GPL),但版本兼容范围比商业库窄、高版本写入支持仍在完善。当前稳定版 0.14(2026-06-27),详见 GitHub Releases。


安装

# macOS(Homebrew,当前为 0.14)
brew install libredwg

# 源码构建(上游 README 流程;DWG 写入默认启用,需关闭时用 --disable-write)
git clone https://github.com/LibreDWG/libredwg
cd libredwg
./autogen.sh          # 从 git 检出源码时执行
./configure           # 可选:--disable-bindings / --disable-docs / --disable-shared
make
make check
sudo make install

Debian/Ubuntu 与 Fedora 官方仓库均未提供 LibreDWG 包(不存在 libredwg-dev/libredwg-tools),Linux 请按上述源码方式构建。


命令行工具

# DWG → DXF(ASCII)
dwg2dxf -y input.dwg                       # → input.dxf
dwg2dxf -y -m -b input.dwg                 # -b = 二进制 DXB(→ input.dxb),-m 只留最小头

# DXF → DWG
dxf2dwg -y input.dxf

# DWG → JSON / GeoJSON(dwgread 的 -O 支持 DXF、DXFB、JSON、minJSON、GeoJSON)
dwgread -O JSON    -o out.json    input.dwg
dwgread -O GeoJSON -o out.geojson input.dwg

# DWG → SVG(独立程序 dwg2SVG)
dwg2SVG input.dwg > out.svg

# 列出实体统计 / 排错
dwgread input.dwg | head -50

# 重写(修复或版本转换,--as rNNNN 指定目标版本)
dwgrewrite --as r2004 input.dwg out.dwg    # 写成 R2004

要点:

  • -y 免覆盖确认;-O 选输出格式,-o 指定输出文件(dwgread -o 的扩展名也能反推格式)
  • dwg2dxf -b 产出的是 DXB(二进制 DXF 的旧式载体,.dxb),不等于"二进制 DXF";需要普通 DXF 就去掉 -b
  • --as rNNNN 的可写版本:r1.4–r2004 可用,r2007/r2010/r2013/r2018 在用法说明里仍标为 Planned,写不出去
  • -v[0-9] 提高 verbosity;dwgread --version 可打印版本

Read the full file on GitHub · 283 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +30 lines · +78 tokens per session ac500245f467
  2. 12d ago Changed · -1 lines 04cec6b98fcf
  3. 13d ago Changed · +4 lines 35bbc363dbab
  4. 1mo ago Changed · +4 lines 140b97abdb9d
  5. 1mo ago Changed 5d9ddbff1bac
  6. 1mo ago Changed c19f5497085f
  7. 1mo ago First seen · 246 lines · 50 tokens per session scan B f695d7e63bad

Subscribe to this mod's changes

libredwg is a skill published in the GitHub repository znlgis/opengis-skills (75 stars, last pushed today), licensed MIT. It adds 128 tokens to every session and 4,023 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

synthetic-sciences/openscience · 76 tokens

python-repl

Interactive Python REPL automation with common helpers and best practices.

gptme/gptme · 15 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

solidworks-automation

An automation skill for SolidWorks, a computer-aided design program used to create 3D parts, assemblies, and engineering drawings. It covers verified CAD operations and marks less-tested operations for human review.

wzyn20051216/solidworks-automation-skill · 56 tokens

autocad-automation

An automation skill for AutoCAD, a computer-aided design program commonly used for 2D technical drawings. It works with drawing formats such as DWG and DXF and can use Windows automation or other supported scripting routes.

wzyn20051216/solidworks-automation-skill · 151 tokens

solidworks-fillet-chamfer-cnc

A SolidWorks skill for creating CNC parts with multiple rounded edges and chamfers, which are angled or softened edges used in manufacturing. It includes parameter checks, edge selection, and evidence after rebuilding the model.

wzyn20051216/solidworks-automation-skill · 107 tokens