dita-fix-validation
Validate DITA topics/maps against their DOCTYPEs and fix every validation error with minimal edits, re-validating until clean. Use when asked to fix DITA validation errors, make topics valid, or clean up a map before a build.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dita-fix-validation
- description
- Validate DITA topics/maps against their DOCTYPEs and fix every validation error with minimal edits, re-validating until clean. Use when asked to fix DITA validation errors, make topics valid, or clean up a map before a build.
03 SKILL.md 正文
Fix DITA Validation Errors
Validate the requested DITA files and repair them until they are clean.
Inputs
If the user named specific files or a map, work on those. Given a map,
also process every topic it references (xpath on @href attributes).
If a catalog file exists (catalog.xml, catalog-dita.xml, or named by
the user), pass it to every validation call.
Process
- For each file, run
xml_validatewithdtd: true(andcatalogwhen available). Collect thefile:line:col: severity: messageissues. - Fix errors one file at a time with
edit, smallest change that satisfies the DTD:- Misplaced/unknown elements: prefer renaming to the closest valid
DITA element over deleting content. Common cases:
<p>inside<ul>needs<li>, steps belong in<step><cmd>, inline content directly in<section>needs a wrapper. - Missing required elements (e.g.
<title>): add a sensible one derived from context, marked clearly if you had to guess. - Broken IDs/references: fix the reference if the target exists; otherwise report it rather than inventing targets.
- Misplaced/unknown elements: prefer renaming to the closest valid
DITA element over deleting content. Common cases:
- Re-validate after each file. Repeat until every file passes or only unfixable issues remain.
- Never change the meaning of the content. If a fix would require rewriting prose or you cannot determine intent, leave the error and list it in the report.
Report
End with: files fixed (with the error count before/after), errors that
remain and why, and whether a dita_build is now worth running.
04 同仓库更多 Skills
valid-skill
A valid test skill for unit testing.
wrong-name
Name does not match directory.
missing-description
暂无简介
hidden-skill
A skill hidden from model invocation.
dita-subject-schemes
Author or repair a DITA subjectScheme that governs conditional-processing attribute values (@platform, @audience, @product, @props, @otherprops), then validate content against it. Use when introducing controlled values, governing conditional content, or when validate_conditions reports controlled-value violations.
dita-shortdesc
Write SEO-friendly DITA shortdescs and abstracts — a standalone one-sentence summary that doubles as the link preview and the HTML meta description. Use when asked to add or improve a topic's description/abstract, write shortdescs, fill missing ones, or make descriptions SEO-friendly.