Alison Aquinas logoAlison's LLM Plugins

raw-document

Included in plugindoc-skillsView on GitHub ↗

Files

SKILL.mdagentsassetsreferencesscripts

Install

Install the containing plugin
/plugin install doc-skills@llm-skills
Invoke this skill after installation
/doc-skills:raw-document
Download raw-document-skill.zip
This skill is bundled inside doc-skills. Install the plugin once, then Claude Code can use any of its included skills. Browse the full plugin repository at github.com/alisonaquinas/llm-doc-skills.

SKILL.md


name: raw-document description: "Last-resort skill for working directly with raw OOXML (Office Open XML) or ODF (OpenDocument Format) document structure. Use ONLY when the higher-level skills ($docx-custom, $pptx-custom, $xlsx-custom, $office-custom) have failed, are not applicable, or when the task explicitly requires schema-level, package-level, or cross-format work: validating against XSD/RELAX NG schemas, recovering malformed archives, researching the format specification, mapping elements between OOXML and ODF, or authoring tooling that operates below the library API layer. Do NOT use for ordinary document creation, editing, or extraction — prefer $docx-custom, $pptx-custom, or $xlsx-custom first."

Raw Document Structure

Last resort. Before loading this skill, confirm that none of these cover the task:

  • Ordinary .docx work → $docx-custom
  • Ordinary .pptx work → $pptx-custom
  • Ordinary .xlsx work → $xlsx-custom
  • Unpack / repack / validate OOXML → $office-custom

Load this skill when the task requires direct work at the package or XML level that the higher-level skills cannot reach: schema validation, format recovery, specification research, cross-format element mapping, or building tools that parse raw parts.

Intent Router

TaskLoad
Understand OOXML package / ZIP layoutreferences/ooxml/03-package-structure.md
Understand ODF package / ZIP layoutreferences/odf/03-package-structure.md
Look up OOXML XML namespacesreferences/ooxml/04-xml-namespaces.md
Look up ODF XML namespacesreferences/odf/04-xml-namespaces.md
WordprocessingML element referencereferences/ooxml/05-wordprocessingml.md
SpreadsheetML element referencereferences/ooxml/06-spreadsheetml.md
PresentationML element referencereferences/ooxml/07-presentationml.md
DrawingML shapes / charts / imagesreferences/ooxml/08-drawingml.md
OOXML styles and themesreferences/ooxml/09-styles-themes.md
OPC content types and relationshipsreferences/ooxml/10-relationships-content-types.md
ODF text document elementsreferences/odf/05-text-documents.md
ODF spreadsheet elementsreferences/odf/06-spreadsheets.md
ODF presentation elementsreferences/odf/07-presentations.md
ODF drawing and graphicsreferences/odf/08-drawing-graphics.md
ODF styles and formattingreferences/odf/09-styles-formatting.md
ODF metadatareferences/odf/10-metadata.md
ODF security and digital signaturesreferences/odf/11-security-signatures.md
Compare OOXML vs ODF side-by-sidereferences/interop/01-comparison.md
Convert between OOXML and ODFreferences/interop/02-conversion.md
Map elements OOXML ↔ ODFreferences/interop/03-feature-mapping.md
OOXML tooling (python-docx, openpyxl, etc.)references/ooxml/12-tooling.md
ODF tooling (odfpy, odfdo, etc.)references/odf/13-tooling.md
Schema file locationsreferences/schemas-README.md

When to Use This Skill

Appropriate uses

  • Schema validation — validating a document part against XSD or RELAX NG schemas in assets/schemas/
  • Format recovery — fixing a malformed or truncated archive where a library cannot open the file at all
  • Specification research — answering questions about the ECMA-376 / ISO 29500 or OASIS ODF specification at element or attribute level
  • Interoperability work — mapping features across OOXML and ODF, diagnosing round-trip conversion losses
  • Tooling development — writing parsers, validators, or transformers that operate on raw ZIP parts rather than through a document library
  • Edge-case debugging — when a library produces structurally valid but semantically wrong output and the cause must be traced in raw XML

Inappropriate uses (use the other skills instead)

TaskUse instead
Create or edit a Word document$docx-custom
Create or edit a PowerPoint deck$pptx-custom
Create or edit an Excel workbook$xlsx-custom
Unpack / repack / validate OOXML via scripts$office-custom

OOXML Quick Reference

Package Structure (.docx / .xlsx / .pptx)

All OOXML files are ZIP archives (OPC packages).

document.docx
├── [Content_Types].xml          ← MIME type for every part
├── _rels/.rels                  ← top-level relationships
├── word/
│   ├── document.xml             ← main body (w: namespace)
│   ├── styles.xml
│   ├── settings.xml
│   ├── numbering.xml
│   ├── theme/theme1.xml
│   ├── media/                   ← embedded images
│   └── _rels/document.xml.rels  ← part relationships
└── docProps/
    ├── app.xml
    └── core.xml

Full layout reference → references/ooxml/03-package-structure.md

Key OOXML Namespaces

PrefixURIUsed for
w:http://schemas.openxmlformats.org/wordprocessingml/2006/mainWord parts
x: (or s:)http://schemas.openxmlformats.org/spreadsheetml/2006/mainExcel parts
p:http://schemas.openxmlformats.org/presentationml/2006/mainPowerPoint parts
a:http://schemas.openxmlformats.org/drawingml/2006/mainDrawingML
r:http://schemas.openxmlformats.org/officeDocument/2006/relationshipsRelationship references
mc:http://schemas.openxmlformats.org/markup-compatibility/2006Markup Compatibility

Full namespace reference → references/ooxml/04-xml-namespaces.md

Conformance: Strict vs Transitional

AspectTransitionalStrict
Real-world filesNear-universalRare
VML supportYesNo
Deprecated attributesAllowedDisallowed
Schema locationassets/schemas/ooxml/ (XSD), assets/schemas/ooxml/relaxng/transitional/ (RNC)assets/schemas/ooxml/strict/, assets/schemas/ooxml/relaxng/strict/

ODF Quick Reference

Package Structure (.odt / .ods / .odp)

document.odt
├── mimetype                     ← first file; uncompressed; signals ODF type
├── META-INF/manifest.xml        ← lists every file in package
├── content.xml                  ← document content (text:, table:, draw:)
├── styles.xml                   ← named styles and page layouts
├── meta.xml                     ← document metadata (dc:, meta:)
├── settings.xml                 ← application-specific settings
└── Pictures/                    ← embedded images

Full layout reference → references/odf/03-package-structure.md

Key ODF Namespaces

PrefixURIUsed for
office:urn:oasis:names:tc:opendocument:xmlns:office:1.0Root elements
text:urn:oasis:names:tc:opendocument:xmlns:text:1.0Text content
table:urn:oasis:names:tc:opendocument:xmlns:table:1.0Tables / spreadsheets
draw:urn:oasis:names:tc:opendocument:xmlns:drawing:1.0Shapes / graphics
style:urn:oasis:names:tc:opendocument:xmlns:style:1.0Style definitions
fo:urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0Formatting properties
svg:urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0SVG geometry

Full namespace reference → references/odf/04-xml-namespaces.md


Schema Assets

All schemas are in assets/schemas/. Do not fetch them from the network — load from the local copies.

ODF Schemas (RELAX NG)

PathVersionDescription
assets/schemas/odf/v1.3-os/OpenDocument-v1.3-schema.rngODF 1.3Main document schema
assets/schemas/odf/v1.3-os/OpenDocument-v1.3-manifest-schema.rngODF 1.3Package manifest
assets/schemas/odf/v1.3-os/OpenDocument-v1.3-dsig-schema.rngODF 1.3Digital signatures
assets/schemas/odf/v1.4-os/OpenDocument-v1.4-schema.rngODF 1.4Main document schema
assets/schemas/odf/v1.4-os/OpenDocument-v1.4-manifest-schema.rngODF 1.4Package manifest
assets/schemas/odf/v1.4-os/OpenDocument-v1.4-dsig-schema.rngODF 1.4Digital signatures

OOXML XSD Schemas (Transitional, normative per ISO/IEC 29500)

PathDescription
assets/schemas/ooxml/wml/wml.xsdWordprocessingML
assets/schemas/ooxml/sml/sml.xsdSpreadsheetML
assets/schemas/ooxml/pml/pml.xsdPresentationML
assets/schemas/ooxml/dml/dml-main.xsdDrawingML core
assets/schemas/ooxml/dml/dml-chart.xsdCharts
assets/schemas/ooxml/shared/Shared types, math, bibliography, properties
assets/schemas/ooxml/opc/Open Packaging Conventions
assets/schemas/ooxml/vml/VML (Transitional only)
assets/schemas/ooxml/strict/Strict conformance class XSDs

OOXML RELAX NG Schemas (normative per ECMA-376)

PathDescription
assets/schemas/ooxml/relaxng/transitional/92 .rnc files — Transitional
assets/schemas/ooxml/relaxng/strict/86 .rnc files — Strict
assets/schemas/ooxml/relaxng/opc/5 .rnc files — OPC

Full schema inventory → references/schemas-README.md


Common Raw Operations

Inspect a document's XML parts

# List all parts
unzip -l document.docx

# Inspect a specific part
unzip -p document.docx word/document.xml | xmllint --format -

# Inspect content types
unzip -p document.docx "[Content_Types].xml" | xmllint --format -

Validate against XSD

# Validate WordprocessingML document part
xmllint --schema assets/schemas/ooxml/wml/wml.xsd word/document.xml --noout

# Validate ODF content
xmllint --schema assets/schemas/odf/v1.3-os/OpenDocument-v1.3-schema.rng \
  content.xml --noout --relaxng

Validate with Python (xmlschema)

import xmlschema
import zipfile

schema = xmlschema.XMLSchema("assets/schemas/ooxml/wml/wml.xsd")

with zipfile.ZipFile("document.docx") as z:
    with z.open("word/document.xml") as f:
        errors = list(schema.iter_errors(f))
        for err in errors:
            print(err)

Unpack and repack manually

# Unpack (use office-custom scripts if available)
mkdir unpacked && cd unpacked && unzip ../document.docx

# Repack preserving OOXML requirements (mimetype must be first and uncompressed for ODF)
cd unpacked
zip -r ../output.docx . -x "*.DS_Store"

# For ODF: mimetype must be first and stored (not compressed)
zip -r0 ../output.odt mimetype
zip -r ../output.odt . -x mimetype -x "*.DS_Store"

Relationship to Other Skills

  • $office-custom — provides unpack.py, pack.py, validate.py, and soffice.py scripts that handle the raw ZIP round-trip workflow for OOXML. Start there for OOXML unpack/repack tasks.
  • $docx-custom — XML editing patterns, tracked changes, comments, and images in Word documents. Use raw-document only when docx-custom's XML Reference section is insufficient.
  • $pptx-custom — presentation structure. Refer to references/ooxml/07-presentationml.md here for element-level detail not in the pptx-custom skill.
  • $xlsx-custom — workbook structure. Refer to references/ooxml/06-spreadsheetml.md here for element-level detail not in the xlsx-custom skill.
← Back to marketplace