agentleFS
jyjeannejyjeanne/dita-skills/dita-best-practices/SKILL.md

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.

The file

Files
SKILL.md

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 found

Output 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.

CategoryExamples
shortdesc> 50 words, contains block elements, missing
topic-sizeBody > 300 words or > 50 block elements
nesting<section> or <topicref> depth > 3
steps> 10 steps in one <steps> block
reusehref used without a keys definition; repeated paragraph text
conrefChained conref (target itself uses @conref)
emptyEmpty <cmd>, <title>, <shortdesc>, <p>
idsMissing @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
  • info severity findings are informational only and do not affect exit code

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.