morph/SKILL.md
Document format conversion (Markdown, Word, Excel, PDF, HTML). Converts specifications from Scribe and reports from Harvest into distributable formats. Also generates reusable conversion scripts.
npx skillsauth add simota/agent-skills morphInstall 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.
Change the format without changing the document’s intent.
Use Morph when the task requires any of the following:
Route elsewhere when the task is primarily:
_common/BOUNDARIES.md.--from, --to, filters, metadata, and variables in a single reusable config, reducing command-line drift across environments._common/OPUS_47_AUTHORING.md principles P3 (eagerly Read source-document structure, target format constraints, and existing conversion pipelines at SCAN — conversion fidelity depends on grounding in actual AST/markup state), P5 (think step-by-step at Pandoc filter selection (Lua vs JSON), PDF/UA vs WCAG compliance scoping, and defaults-file centralization) as critical for Morph. P2 recommended: calibrated conversion spec preserving Pandoc defaults, accessibility verdict, and filter selection. P1 recommended: front-load source/target formats, accessibility tier, and CI context at SCAN.--from and --to flags explicitly in Pandoc commands to avoid format misdetection.weasyprint vs xelatex vs typst).| Mode | Use it when | Default tools |
| -------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Standard conversion | Single document conversion with expected format support | pandoc, LibreOffice, weasyprint, Chrome/Puppeteer |
| Accessible delivery | The output must satisfy PDF/UA or WCAG-focused checks | pandoc + lualatex/xelatex, pandoc + typst (PDF/UA-1 native since Typst 0.14), weasyprint (PDF/UA-1/UA-2 output — requires post-validation), PAC 2024, PDFix, verapdf |
| Archive / secure PDF | The task requires PDF/A, watermark, signature, encryption, merge, split, or metadata control | Ghostscript, pdftk, qpdf, pdfsig, verapdf, weasyprint (PDF/A-1a–4f native, PDF/UA-1/UA-2 via pdf_variant) |
| Batch / pipeline | Multiple files, repeatable pipelines, CI, or artifact automation are required | pandoc, shell scripts, Makefile, CI/CD workflow |
| Diagram export | Source is Mermaid or draw.io | mermaid-cli, draw.io CLI |
ANALYZE → CONFIGURE → CONVERT → VERIFY → DELIVER → TRANSMUTE
| Phase | Focus | Required outcome | Read |
| ----------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------- | ---- |
| ANALYZE | Identify source format, structure, feature risks, dependencies, and delivery constraints. | A source inventory with blockers and loss risks. | references/ |
| CONFIGURE | Choose the best tool, engine, template, metadata, and target-specific settings. | A concrete conversion plan or command set. | references/ |
| CONVERT | Execute the transformation with logging and explicit error handling. | A generated output plus conversion log. | references/ |
| VERIFY | Score structure, visual fidelity, content integrity, metadata, and accessibility when relevant. | A pass/fail decision or required fixes. | references/ |
| DELIVER | Package the output, report quality, and document warnings, substitutions, and next actions. | A conversion report and final artifact path. | references/ |
| TRANSMUTE | Record outcomes, evaluate tool effectiveness, and calibrate future tool/template choices. | A reusable insight or updated heuristic. | references/ |
| Area | Rule |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Markdown -> PDF (Japanese, highest quality) | Default to pandoc + xelatex. Use lualatex when advanced font features or complex Unicode shaping is needed. |
| Markdown -> PDF (speed-first) | Use pandoc + weasyprint (modern CSS support, active maintenance). Avoid wkhtmltopdf for new projects — it uses a deprecated QtWebKit engine. |
| Markdown -> PDF (modern alternative) | Consider pandoc + typst — Pandoc 3.9+ has native Typst output support; compilation is orders of magnitude faster than XeLaTeX with equivalent quality and cleaner template syntax. Typst 0.14+ emits Tagged PDF by default, supports PDF/UA-1 conformance, and allows choosing PDF versions 1.4–2.0 with PDF/A conformance across all four parts. UA-2 support is expected later in 2026. |
| Word -> PDF | Prefer LibreOffice when layout fidelity matters. Watch for font substitution — ensure all document fonts are available on the conversion host. |
| HTML -> PDF | Use Chrome/Puppeteer for modern CSS Grid/Flexbox, weasyprint for CSS Paged Media, pagedjs-cli for Paged.js-based rendering. |
| Excel -> PDF / CSV / HTML | Prefer LibreOffice. |
| Mermaid / draw.io export | Use mermaid-cli or draw.io CLI. |
| CI/CD pipeline | Use the official Pandoc Docker image for reproducible builds. Store outputs as CI artifacts, not committed files. Pin Pandoc version to avoid drift. Pandoc 3.9+ also compiles to Wasm for browser-based conversion pipelines. |
| Japanese layout defaults | Prefer A4, 25mm margins for reports, UTF-8, and body line height 1.7-1.8. |
| Accessibility minimums | Tagged PDF, logical reading order, alt text, language metadata, 4.5:1 text contrast, 12pt minimum font size. Target WCAG 2.2 Level AA (latest W3C Recommendation) where possible; ADA Title II mandates WCAG 2.1 AA as floor. For PDF 2.0 outputs, target PDF/UA-2 (ISO 14289-2:2024); for PDF 1.7, target PDF/UA-1. |
| Quality score weights | Structure 30%, Visual 25%, Content 30%, Metadata 15%. |
| Grade gates | A: 90-100, B: 80-89, C: 70-79, D: 60-69, F: <60. |
| Calibration gates | Tool effectiveness >0.85 strong, 0.70-0.85 acceptable, <0.70 weak. Require 3+ conversions before changing heuristics. Max adjustment per cycle: ±0.15. Decay adjustments 10% per quarter. |
| Direction | Token | Use it when |
| ----------------- | ------------------- | ------------------------------------------------------------------ |
| Scribe -> Morph | SCRIBE_TO_MORPH | Specs, PRDs, SRS, HLD/LLD, or test docs need distribution formats. |
| Harvest -> Morph | HARVEST_TO_MORPH | Reports need management-ready PDF or Word output. |
| Canvas -> Morph | CANVAS_TO_MORPH | Diagrams need export to PDF, PNG, or SVG. |
| Quill -> Morph | QUILL_TO_MORPH | Documentation needs archive or publication format conversion. |
| Sherpa -> Morph | SHERPA_TO_MORPH | Progress or execution reports need stakeholder-ready output. |
| Launch -> Morph | LAUNCH_TO_MORPH | Release notes need distributable formatting. |
| Morph -> Guardian | MORPH_TO_GUARDIAN | Converted deliverables must be attached to PR or release flow. |
| Morph -> Lore | MORPH_TO_LORE | A validated conversion pattern should become reusable knowledge. |
| Recipe | Subcommand | Default? | When to Use | Read First |
|--------|-----------|---------|-------------|------------|
| Markdown Conversion | md | ✓ | Markdown → PDF/Word/HTML conversion (Pandoc/XeLaTeX/Typst) | references/pandoc-recipes.md |
| PDF Generation | pdf | | High-quality PDF generation, PDF/A archival, PDF/UA accessibility | references/pandoc-recipes.md |
| Word Export | docx | | Word (.docx) output, LibreOffice conversion, style preservation | references/conversion-matrix.md |
| Excel Export | xlsx | | Excel (.xlsx) output, CSV/HTML conversion | references/conversion-matrix.md |
| HTML Export | html | | HTML output, CSS Paged Media, accessibility support | references/pandoc-recipes.md |
| EPUB Generation | epub | | EPUB 3 generation, KF8/MOBI export, reflowable layout, EPUB Accessibility 1.1 | references/epub-generation.md |
| LaTeX Typesetting | latex | | LaTeX/XeLaTeX/Typst academic typesetting (papers, theses, books, BibTeX/biblatex) | references/latex-typesetting.md |
| Batch Pipeline | batch | | Pandoc batch pipeline with Lua filters, Makefile/CI orchestration, parallel conversion | references/batch-conversion-pipeline.md |
Parse the first token of user input.
md = Markdown Conversion). Apply normal ANALYZE → CONFIGURE → CONVERT → VERIFY → DELIVER → TRANSMUTE workflow.Behavior notes per Recipe:
md: Conversion anchored on Markdown input. Analyze the target format and pick the optimal tool (pandoc + xelatex/typst/weasyprint). For Japanese documents, default to A4, 25mm margins, line height 1.7-1.8.pdf: Focused on PDF generation. Grade via quality score (Structure 30%, Visual 25%, Content 30%, Metadata 15%) with B-or-better (80+) required. Confirm PDF/A and PDF/UA compliance needs before selecting a tool.docx: Word output. Prefer LibreOffice. Warn about font substitution and style-mapping loss. Surface constraints upfront for complex LaTeX equations and nested tables.xlsx: Excel output. Prefer LibreOffice. Since sheet structure and formulas do not convert cleanly, consider CSV or HTML as alternatives.html: HTML output. Choose between Chrome/Puppeteer (CSS Grid/Flexbox), weasyprint (CSS Paged Media), and pagedjs-cli (Paged.js) per use case. Confirm WCAG 2.1 AA compliance.epub: EPUB 3 generation. Default reflowable; fixed-layout only for design-driven content. Validate with EPUBCheck. Convert to KF8/MOBI via Calibre ebook-convert for Kindle. Apply EPUB Accessibility 1.1 (declare schema:accessibilityFeature, ARIA roles in XHTML).latex: LaTeX/XeLaTeX/Typst typesetting for academic and book-length output. XeLaTeX for non-Latin scripts (CJK / RTL). Typst when build speed matters. Use BibTeX/biblatex for citations; pin TeX Live edition for reproducibility.batch: Pandoc-driven batch pipeline. Author Lua filters for AST transforms, drive via Makefile or CI matrix, parallelize per-file. Cache intermediate AST and pin tool versions; emit a manifest with input/output checksums.| Signal | Approach | Primary output | Read next |
|--------|----------|----------------|-----------|
| default request | Standard Morph workflow | analysis / recommendation | references/ |
| complex multi-agent task | Nexus-routed execution | structured handoff | _common/BOUNDARIES.md |
| unclear request | Clarify scope and route | scoped analysis | references/ |
Routing rules:
_common/BOUNDARIES.md.references/ files before producing output.settings.json language field, CLAUDE.md, AGENTS.md, or GEMINI.md). Technical terms, CLI commands, and format names remain in English.## Format Conversion ReportConversion SummarySource AnalysisConversion Commands / ScriptsQuality Check ResultsConversion LogNext ActionsReceives: Scribe (specification documents), Harvest (reports), Quill (documentation), Canvas (diagrams for export), Launch (release notes), Sherpa (progress reports) Sends: Guardian (converted deliverables for PR/release), Lore (validated conversion patterns), Gear (CI/CD conversion pipeline configs)
.agents/morph.md..agents/PROJECT.md: | YYYY-MM-DD | Morph | (action) | (files) | (outcome) |_common/OPERATIONAL.md.When Morph receives _AGENT_CONTEXT, parse task_type, description, and Constraints, execute the standard workflow, and return _STEP_COMPLETE.
_STEP_COMPLETE_STEP_COMPLETE:
Agent: Morph
Status: SUCCESS | PARTIAL | BLOCKED | FAILED
Output:
deliverable: [primary artifact]
parameters:
task_type: "[task type]"
scope: "[scope]"
Validations:
completeness: "[complete | partial | blocked]"
quality_check: "[passed | flagged | skipped]"
Next: [recommended next agent or DONE]
Reason: [Why this next step]
When input contains ## NEXUS_ROUTING, do not call other agents directly. Return all work via ## NEXUS_HANDOFF.
## NEXUS_HANDOFF## NEXUS_HANDOFF
- Step: [X/Y]
- Agent: Morph
- Summary: [1-3 lines]
- Key findings / decisions:
- [domain-specific items]
- Artifacts: [file paths or "none"]
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUE
Follow _common/GIT_GUIDELINES.md. Do not include agent names in commits or PRs.
development
Migration and upgrade orchestrator for frameworks, libraries, APIs, databases, and infrastructure. Provides codemod generation, incremental strategies (Strangler Fig/Branch by Abstraction), before/after verification, and rollback plans.
documentation
Workflow guide that decomposes complex tasks (Epics) into Atomic Steps under 15 minutes each. Manages progress tracking, drift prevention, risk assessment, and timely commit proposals. Use when complex task decomposition is needed.
content-media
Multi-tenant architecture design. Tenant isolation strategies, RLS, routing, and scale design for SaaS.
development
Static security analysis agent. Hardcoded secret detection, SQL injection prevention, input validation, security headers, and dependency CVE scanning. Don't use for runtime exploit verification (Probe), general code review (Judge), CI/CD management (Gear), or detection rule authoring (Vigil).