← ScoptureCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
Update to Scopture
Snapshot Sep 30, 2026 · 23:10 UTC · version 1.1.0
Collection source: not recorded for this historical snapshot.
First saved snapshot
No earlier snapshot is available to establish a change.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"name": "duc",
"description": "Use this skill whenever a DUC drawing (`.duc` file) needs to be read, written, searched, created, inspected, or manipulated programmatically with the Python `ducpy` library. This includes constructing elements, styles, layers, blocks, and states with fluent builders; querying the relational schema through `DucSQL`; streaming external-file or version payloads; and validating coordinate placement or drawing relationships.",
"included_files": [],
"skill_md_contents": "---\nname: duc\ndescription: \"Use this skill whenever a DUC drawing (`.duc` file) needs to be read, written, searched, created, inspected, or manipulated programmatically with the Python `ducpy` library. This includes constructing elements, styles, layers, blocks, and states with fluent builders; querying the relational schema through `DucSQL`; streaming external-file or version payloads; and validating coordinate placement or drawing relationships.\"\n---\n\n# DUC Core Canvas Library Skill\n\nThe `ducpy` Python library provides a fast, developer-friendly interface to read, write, search, and manipulate `.duc` project-state files. Under the hood, a current `.duc` file is a **gzip-compressed SQLite database**.\n\nThis skill deliberately stays compact. Detailed API signatures and examples belong in the versioned documentation routes below, where they can remain synchronized with the implementation.\n\n---\n\n## `llms.txt` Documentation Routes & Source-of-Truth\n\n`llms.txt` serves as a structured map to direct agents to the most relevant documentation pages. Agents must retrieve relevant linked pages for RAG rather than relying solely on the index file.\n\n### Recommended Source Routing\n\n- **Orchestrator**: `https://duc.ducflair.com/llms.txt`\n - Use for: `.duc` concepts, element categories, coordinate placement, document structure, serialization, state and revision concepts, SQL schema guidance, and deciding which library is required.\n- **Generator, Inspector, and Critic**: `https://ducflair.github.io/duc/reference/python/llms.txt`\n - Use for: actual builder methods, method chaining order, parsing and serialization contracts, mutation functions, element classes, model-element code, and runnable examples.\n - Use the maintained `ducpy` examples at `https://ducflair.github.io/duc/reference/python/examples.html` as task scaffolds for element creation, mutation, external files, SQL, serialization, and parsing. Adapt the closest example only after confirming it matches the installed version.\n - *Crucial for preventing invalid method calls, incorrect builder stages, and stale argument or return-value assumptions.*\n\n### Documentation Search\n\nWhen the relevant documentation page is unknown, search the docs with a GET request:\n\n```bash\ncurl -sG 'https://duc.ducflair.com/api/search' --data-urlencode 'query=<search terms>'\n```\n\nThe endpoint returns a JSON array of matching pages and snippets with their `url`. Use it to identify the most relevant result, then open and read that page for the full context; do not treat the search snippet as the complete documentation.\n\n**Direct Markdown Output**:\n```bash\n# Fetch clean markdown directly example:\ncurl -s 'https://duc.ducflair.com/docs/concepts/architecture'\n```\n\n### Source-of-Truth Hierarchy\n\nAgents must adhere strictly to this priority order:\n\n1. **Runtime introspection of the installed `ducpy` package**\n2. **Documentation matching the installed `ducpy` version**\n3. **`ducpy` `llms.txt` and linked API pages** (`https://ducflair.github.io/duc/reference/python/llms.txt`)\n4. **General DUC documentation** (`https://duc.ducflair.com/llms.txt`)\n5. **Existing examples**\n\n> [!IMPORTANT]\n> **Runtime Introspection & Verification Rule**\n> Runtime introspection remains #1 because remote documentation can describe a different release from the installed package.\n> **Rule**: *Never invent a `ducpy` method, parameter, return type, schema column, or builder stage. Retrieve the version-matched reference before generating implementation code.*\n\n---\n\n## Key Design & Code Standards\n\n* **Coordinate System & Units**: `x` and `y` are the element's top-left canvas position. Positive X extends rightward and positive Y extends downward. Linear, arrow, and freedraw points are local to that element origin. Angles are radians, and coordinates and dimensions use the element's declared scope.\n* **Current File I/O Contract**: `parse_duc()` accepts a filesystem path and returns recursively wrapped `DucData` dictionaries with flattened snake_case fields. `serialize_duc()` writes a `.duc` file and returns its path; it does not return drawing bytes.\n* **In-Place Mutation**: Use `duc.mutate_element()` for builder-created `ElementWrapper` or dataclass objects. Parsed `DucData` elements are dictionaries and should be edited through their existing fields. Never destroy and recreate an element merely to update it, because doing so can lose IDs, memberships, bindings, and other relationships.\n* **Binding Preservation**: Preserve existing element IDs, `bound_elements`, group/region/block memberships, `frame_id`, `layer_id`, and instance relationships during edits.\n* **Strict Builder Methods**: Methods are stage-specific. Confirm the active builder class and installed-version signature before invocation.\n* **Styling Elements (Default Fill & Stroke)**: When generating 2D CAD elements, always explicitly define styles with a default fill (background) or stroke; do not assume they are applied automatically. Refer to [Styling Elements](https://duc.ducflair.com/docs/guidelines/styling-elements) for constructing ordered `backgrounds` and `strokes` arrays using `duc.create_simple_styles`.\n* **No Duplicated API Reference**: Do not add volatile builder examples, serialization snippets, or schema catalogs to this skill. Improve the corresponding Duc documentation instead so `llms.txt` remains the maintained source.\n\n---\n\n## Additional Adapter References\n\nThe general DUC and `ducpy` routes above remain the primary sources. Use these versioned adapter references when a task targets another DUC interface:\n\n- **SQL schema**: `https://ducflair.github.io/duc/reference/sql/`\n- **Rust (`duc`)**: `https://ducflair.github.io/duc/reference/rust/duc/`\n- **TypeScript / JavaScript (`ducjs`)**: `https://ducflair.github.io/duc/reference/typescript/`\n- **PDF (`ducpdf`)**: `https://ducflair.github.io/duc/reference/pdf/`\n- **SVG (`ducsvg`)**: `https://ducflair.github.io/duc/reference/svg`\n"
}SHA-256: d6978f675f66ea4ff400cce03cb1bbab95c896f694e7bf4f7d0dfe488b291f53