validate-ditamap
Skill2 starsChanged 6 months agoMITView on GitHub
Validates a DITA 1.3 map file against structural rules derived from the DITA 1.3 map DTD. Use this skill when you need to check topicref completeness (href or keyref required), key uniqueness, collection-type values, reltable structure, nesting depth, or broken reference patterns. Returns structured JSON with errors and warnings.
In this repository18 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- context-setupSkill
- dita-best-practicesSkill
- 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-dita-topicSkill
- visitor-extendSkill
- xslt-dita-helperSkill
The file
Files
Overview
Validates a DITA 1.3 <map> file and returns a JSON report listing errors and warnings.
Usage
# Validate a map file
python scripts/validate_ditamap.py path/to/map.ditamap
# Pipe XML directly (href resolution disabled in pipe mode)
cat map.ditamap | python scripts/validate_ditamap.py -
# Exit code: 0 = valid, 1 = invalidOutput schema
{
"is_valid": true,
"errors": [
{ "element": "string", "rule": "string", "message": "string", "line": 0 }
],
"warnings": [
{ "element": "string", "rule": "string", "message": "string", "line": 0 }
]
}Rules applied
See references/RULES.md for the full rule catalogue.
| Category | Key rules |
| Root | <map> required; @id recommended |
| topicrefs | href or keyref required on every <topicref> |
| Keys | keys values must be unique across the map |
| Collection-type | Must be unordered, sequence, choice, or family |
| Nesting | Warn if depth > 5 |
| Reltable | All <relrow> cells must match the number of <relcolspec> columns |
Common edge cases
- A
<topicref>with only@keysand nohref/keyref→ Warning (it's a valid key-only definition via<keydef>but unusual on plain<topicref>) <navref>does not requirehreforkeyref— not flagged- Nested maps (
<mapref>) are noted but not recursively validated in single-file mode
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.

