Install
$ agentstack add skill-abhatt-rh-redhat-docs-agent-tools-dita-document-id ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Document ID generation skill
Generate and insert missing document IDs (anchor IDs) for AsciiDoc document titles.
Overview
This skill uses the document_id.rb Ruby script to find AsciiDoc files with missing IDs on their document titles (level 0 headings) and automatically generates appropriate IDs following AsciiDoc conventions.
What it does
For a file like this:
:_mod-docs-content-type: PROCEDURE
= Installing the application server
This procedure explains...
The script adds the missing ID:
:_mod-docs-content-type: PROCEDURE
[id="installing-the-application-server_{context}"]
= Installing the application server
This procedure explains...
ID generation rules
The generated ID follows AsciiDoc conventions:
- Converts title to lowercase
- Removes inline formatting (
*bold*,_italic_, etc.) - Removes inline macros and attribute references
- Replaces spaces and special characters with hyphens
- Removes leading/trailing hyphens
- Collapses multiple consecutive hyphens
- Appends
_{context}suffix (configurable)
Examples
| Title | Generated ID | |-------|--------------| | Installing the server | installing-the-server_{context} | | *Server* configuration options | server-configuration-options_{context} | | Using GPUs (NVIDIA CUDA) | using-gpus-nvidia-cuda_{context} |
Usage
When the user asks to add document IDs:
- Identify the target folder or file containing AsciiDoc content
- Find all
.adocfiles in the target location - Run the Ruby script against each file:
``bash ruby ${CLAUDE_SKILL_DIR}/scripts/document_id.rb ``
- Report which files were updated and what IDs were generated
Dry run mode
To preview changes without modifying files:
ruby ${CLAUDE_SKILL_DIR}/scripts/document_id.rb --dry-run
Without {context} suffix
For files that don't use the context variable:
ruby ${CLAUDE_SKILL_DIR}/scripts/document_id.rb --no-context
Output to different file
ruby ${CLAUDE_SKILL_DIR}/scripts/document_id.rb -o
Example invocations
- "Add document IDs to modules/getting_started/"
- "Generate missing IDs in the assemblies folder"
- "Fix missing anchors in all AsciiDoc files"
- "Add an ID to modules/deploying-with-podman.adoc"
- "Preview ID changes in modules/ --dry-run"
Behavior notes
- Skips files with existing IDs: If an ID is already assigned before the title, no changes are made
- Skips snippet files: Files marked as
:_mod-docs-content-type: SNIPPETare handled appropriately - Skips code blocks and comments: The script properly handles files with code blocks and comments before the title
- Handles conditional titles: Titles wrapped in
ifdef::directives are detected correctly - Assembly IDs never include
_{context}: Files marked as:_mod-docs-content-type: ASSEMBLYautomatically generate IDs without the_{context}suffix. Only modules (CONCEPT, PROCEDURE, REFERENCE) use the_{context}suffix.
Output format
When an ID is added:
: Added ID [id="generated-id_{context}"]
Title: Original Title Text
When no changes needed:
: ID already assigned
Or:
: No document title found
Extension location
The Ruby script is located at: ${CLAUDE_SKILL_DIR}/scripts/document_id.rb
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: abhatt-rh
- Source: abhatt-rh/redhat-docs-agent-tools
- License: Apache-2.0
- Homepage: https://redhat-documentation.github.io/redhat-docs-agent-tools/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.