Skip to content

dita-tools

v0.0.12

AsciiDoc cleanup, validation, and rewriting tools for DITA conversion preparation.

Tip

Always run Claude Code from a terminal in the root of the documentation repository you are working on. The dita-tools command operates on the current working directory, reading local files, checking git branches, and writing output relative to the repo root.

Warning

Always validate your reworked content with the AsciiDocDITA Vale style (vale --config=.vale.ini --glob='*.adoc') before submitting a PR/MR for merge. The /dita-rework command runs Vale checks during the workflow, but you must confirm that no new issues have been introduced and all reported issues are resolved before merging.

Prerequisites

Install

/plugin install dita-tools@redhat-docs-agent-tools

Update

/plugin marketplace update redhat-docs-agent-tools

Commands

dita-rework

/dita-tools:dita-rework <file.adoc|assembly.adoc> [--rewrite [--no-commit] [--dry-run] [--branch <name>]] [--review]

Run the DITA rework workflow to prepare AsciiDoc files for DITA conversion

Skills

Skill Description
dita-add-shortdesc-abstract Add missing [role="_abstract"] attribute to AsciiDoc files for DITA short description support. Use this skill when asked to add abstract role attributes, mark short descriptions, or prepare files for DITA conversion.
dita-asciidoc-rewrite Refactor AsciiDoc files for DITA conversion compatibility using LLM-guided analysis. Use this skill to fix Vale issues, prepare files for DITA conversion, or comprehensively rewrite AsciiDoc modules and assemblies following Red Hat modular documentation standards.
dita-block-title Fix unsupported block titles for DITA compatibility. Block titles are only valid for examples, figures (images), and tables. Use this skill when asked to fix block titles, remediate BlockTitle warnings, or prepare files for DITA conversion.
dita-callouts Transform callouts in AsciiDoc source blocks to prepare for DITA conversion. Use this skill when asked to transform, convert, or fix callouts in AsciiDoc files or folders.
dita-check-asciidoctor Run asciidoctor to check AsciiDoc files for syntax errors. Outputs timestamped build log to /tmp. Reports warnings and errors, then reviews source to suggest fixes for common issues like unclosed conditionals, admonitions, and code blocks.
dita-content-type Add or update :_mod-docs-content-type: attribute in AsciiDoc files. Detects content type (CONCEPT, PROCEDURE, ASSEMBLY, SNIPPET) from file structure and adds the attribute if missing. Use this skill when asked to add content types, fix module types, or prepare files for DITA conversion.
dita-document-id Generate and insert missing document IDs for AsciiDoc titles. Use this skill when asked to add IDs, fix missing anchors, or prepare files for DITA conversion.
dita-entity-reference Replace HTML character entity references with Unicode equivalents for DITA compatibility. Use this skill when asked to fix entity references, replace HTML entities, or prepare files for DITA conversion.
dita-includes List all AsciiDoc files referenced via include directives, recursively traversing child includes. Use this skill when asked to find includes, list dependencies, or analyze AsciiDoc file structure.
dita-line-break Remove hard line breaks from AsciiDoc files for DITA compatibility. Use this skill when asked to fix line breaks, remove forced breaks, or prepare files for DITA conversion.
dita-reduce-asciidoc Reduce AsciiDoc files by expanding all include directives into a single flattened document using asciidoctor-reducer. Use this skill when asked to reduce, flatten, resolve, or normalize AsciiDoc assemblies.
dita-related-links Fix Additional resources sections by removing or relocating non-link content for DITA compatibility. Use this skill when asked to fix additional resources, clean up related links, or prepare files for DITA conversion.
dita-rework-assembly Extract inline content from AsciiDoc assembly files into separate modules. Use when refactoring assemblies to follow Red Hat modular documentation standards — moving introductory preambles, inline procedures, inline concepts, admonitions, or any other content into reusable modules.
dita-rewrite-shortdesc Rewrite or improve short descriptions in AsciiDoc files for better clarity and DITA compliance. Use this skill when asked to fix short descriptions, improve abstracts, rewrite summaries, or make short descriptions more effective.
dita-task-contents Add missing .Procedure block title to procedure modules for DITA compatibility. Use this skill when asked to fix procedure titles, add .Procedure markers, or prepare procedure files for DITA conversion.
dita-task-step Fix list continuations in procedure steps for DITA compatibility. Use this skill when asked to fix task steps, add list continuations, or prepare procedure files for DITA conversion.
dita-task-title Remove unsupported block titles from procedure modules for DITA compatibility. Use this skill when asked to fix task titles, remove unsupported titles, or prepare procedure files for DITA conversion.
dita-validate-asciidoc Validate AsciiDoc files for DITA conversion readiness by running Vale linting with AsciiDocDITA rules. Reports warnings and errors in a markdown table format. Use this skill when asked to validate, check, or assess AsciiDoc files before DITA conversion.