dita-best-practices
Skill2 starsChanged 6 months agoMITView on GitHub
Analyzes a DITA topic or map file for quality and maintainability issues beyond basic DTD validity. Use this skill after validate-dita-topic or validate-ditamap when you want to check shortdesc length, topic size, step count, nesting depth, conref chain problems, keyref-vs-href balance, duplicate content, and empty elements. Returns structured JSON with categorized findings.
In this repository18 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- context-setupSkill
- ditaval-helperSkill
- error-handlingSkill
- generate-bookmapSkill
- generate-ditamapSkill
- generate-dita-topicSkill
- generate-keyrefsSkill
- keyspace-debugSkill
- map-resolveSkill
- pdf-to-ditaSkill
- refactor-dita-contentSkill
- review-dita-guideSkill
- validate-bookmapSkill
- validate-ditamapSkill
- validate-dita-topicSkill
- visitor-extendSkill
- xslt-dita-helperSkill
The file
Files
Overview
Runs best-practice checks on a DITA file (topic or map) and returns a JSON report.
Usage
# Auto-detect file type
python scripts/best_practices.py path/to/topic.dita
# Pipe XML
cat topic.dita | python scripts/best_practices.py -
# Exit code: 0 = no errors (warnings may still be present), 1 = errors foundOutput schema
{
"file_type": "concept | task | reference | troubleshooting | map | bookmap | unknown",
"findings": [
{
"severity": "error | warning | info",
"category": "string",
"element": "string",
"message": "string"
}
]
}Checks performed
See references/RULES.md for the full catalogue.
| Category | Examples |
shortdesc | > 50 words, contains block elements, missing |
topic-size | Body > 300 words or > 50 block elements |
nesting | <section> or <topicref> depth > 3 |
steps | > 10 steps in one <steps> block |
reuse | href used without a keys definition; repeated paragraph text |
conref | Chained conref (target itself uses @conref) |
empty | Empty <cmd>, <title>, <shortdesc>, <p> |
ids | Missing @id on reusable elements (<section>, <fig>, <table>) |
Common edge cases
- Chained conref detection requires both files to be on disk; in pipe mode it reports only format warnings
- "Repeated paragraph text" comparison is fuzzy (Jaccard similarity > 0.85); tune threshold in the script if needed
infoseverity findings are informational only and do not affect exit code
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

