From dita-tools
Adds missing [role="_abstract"] attributes to AsciiDoc files via Ruby script for DITA short description support. Use when marking short descriptions or preparing files for DITA conversion.
npx claudepluginhub redhat-documentation/redhat-docs-agent-tools --plugin dita-toolsThis skill is limited to using the following tools:
Add missing `[role="_abstract"]` attributes to AsciiDoc files for DITA compatibility.
Rewrites short descriptions in AsciiDoc files for clarity, conciseness, and DITA compliance. Use when fixing abstracts, improving summaries, or enhancing short descriptions in topics.
Assesses CQA parameters P8-P11 for titles and short descriptions in Red Hat modular documentation, checking clarity, character limits, DITA conventions, and quality criteria.
Reviews AsciiDoc (.adoc) files for Red Hat modular documentation compliance: module types (concept, procedure, reference), assembly structure, anchor IDs with _{context}, context variables, and include directives.
Share bugs, ideas, or general feedback.
Add missing [role="_abstract"] attributes to AsciiDoc files for DITA compatibility.
This skill uses the short_description.rb Ruby script to find AsciiDoc files missing the [role="_abstract"] attribute and automatically adds it before the first paragraph after the document title.
The short description is the first paragraph and cannot be more than a single paragraph.
For a file like this:
:_mod-docs-content-type: CONCEPT
[id="about-optimization_{context}"]
= About optimization
As AI applications mature and new compression algorithms are published...
More content here...
The script adds the missing abstract role:
:_mod-docs-content-type: CONCEPT
[id="about-optimization_{context}"]
= About optimization
[role="_abstract"]
As AI applications mature and new compression algorithms are published...
More content here...
The [role="_abstract"] attribute marks a paragraph as the short description (<shortdesc>) element in DITA output. This is required by the AsciiDocDITA Vale rule ShortDescription.yml which warns:
Assign [role="_abstract"] to a paragraph to use it as
<shortdesc>in DITA.
When the user asks to add abstract role to files:
.adoc files in the target locationruby scripts/short_description.rb <file>
find <folder> -name "*.adoc" -exec ruby scripts/short_description.rb {} \;
:_mod-docs-content-type: ASSEMBLY are skipped (assemblies use a different structure):_mod-docs-content-type: SNIPPET are skipped[role="_abstract"] already exists, no changes are madeWhen an abstract is added:
<file>: Added [role="_abstract"] before line N
When no changes needed:
<file>: Abstract already exists
Or:
<file>: Assembly or snippet file (skipped)
Or:
<file>: No document title found
Or:
<file>: No paragraph found after title
The Ruby script is located at: scripts/short_description.rb
This skill addresses the warning from: .vale/styles/AsciiDocDITA/ShortDescription.yml