From dita-tools
Adds/updates :_mod-docs-content-type: attributes in AsciiDoc files by detecting CONCEPT/PROCEDURE/ASSEMBLY/SNIPPET/REFERENCE from filename, folder, content. Prepares for DITA/Red Hat docs.
npx claudepluginhub redhat-documentation/redhat-docs-agent-tools --plugin dita-toolsThis skill is limited to using the following tools:
Add or update `:_mod-docs-content-type:` attributes in AsciiDoc files for DITA compatibility and Red Hat modular documentation compliance.
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.
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.
Assesses CQA P2-P7 modularization in Red Hat AsciiDoc docs: assembly structure without rendered text between includes, module prefixes, templates, required elements, nesting depth.
Share bugs, ideas, or general feedback.
Add or update :_mod-docs-content-type: attributes in AsciiDoc files for DITA compatibility and Red Hat modular documentation compliance.
This skill uses the content_type.rb Ruby script to:
:_mod-docs-content-type: <TYPE> if missing:_module-type: attributes to the new format| Type | Description |
|---|---|
CONCEPT | Explains what something is |
PROCEDURE | Step-by-step instructions |
ASSEMBLY | Combines modules into a topic |
SNIPPET | Reusable content fragments |
REFERENCE | Lookup information (tables, options) |
For a file like this:
[id="about-optimization_{context}"]
= About optimization
As AI applications mature and new compression algorithms are published...
The script adds the content type attribute:
:_mod-docs-content-type: CONCEPT
[id="about-optimization_{context}"]
= About optimization
As AI applications mature and new compression algorithms are published...
The script uses multiple signals to determine content type (in priority order):
If :_mod-docs-content-type: already exists, the file is skipped.
If :_module-type: exists, it is renamed to :_mod-docs-content-type:.
| Prefix | Content Type |
|---|---|
assembly_ or assembly- | ASSEMBLY |
con_ or con- | CONCEPT |
proc_ or proc- | PROCEDURE |
ref_ or ref- | REFERENCE |
snip_ or snip- | SNIPPET |
| Folder Pattern | Content Type |
|---|---|
assemblies/ | ASSEMBLY |
concepts/ | CONCEPT |
procedures/ | PROCEDURE |
references/ | REFERENCE |
snippets/ | SNIPPET |
| Pattern | Content Type |
|---|---|
.Procedure block title | PROCEDURE |
| Numbered list after title | PROCEDURE |
| Table with header row | REFERENCE |
include:: directives | ASSEMBLY |
When the user asks to add content type attributes:
.adoc files in the target locationruby scripts/content_type.rb <file>
find <folder> -name "*.adoc" -exec ruby scripts/content_type.rb {} \;
Preview changes without modifying files:
ruby scripts/content_type.rb <file.adoc> --dry-run
When content type is added:
<file>: Added :_mod-docs-content-type: CONCEPT
When legacy attribute is updated:
<file>: Updated :_module-type: to :_mod-docs-content-type: PROCEDURE
When no changes needed:
<file>: Already has :_mod-docs-content-type: CONCEPT
When type cannot be determined:
<file>: Unable to determine content type (use --type to specify)
Usage: ruby content_type.rb <file.adoc> [options]
Options:
-o FILE Write output to FILE (default: overwrite input)
--dry-run Show what would be changed without modifying files
--type TYPE Force a specific content type (CONCEPT, PROCEDURE, REFERENCE, ASSEMBLY, SNIPPET)
--help Show this help message
The Ruby script is located at: scripts/content_type.rb
:_mod-docs-content-type: is required by Red Hat modular documentation standards