agentleFS
jyjeannejyjeanne/dita-skills/xslt-dita-helper/SKILL.md

xslt-dita-helper

Skill2 starsChanged 6 months agoMITView on GitHub

Provides XSLT and XPath assistance for DITA 1.3 transformations, including DITA-OT plugin development. Use this skill when you need XPath expressions for DITA element selection, XSLT template match patterns using DITA class attributes, transformation override guidance for DITA-OT, or help with specialization class attribute values.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Import xsl/dita2htmlImpl.xsl in your stylesheet

    line 57
  2. Very specific:

    Write a higher-priority template: <xsl:template match="..." priority="10">

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Generates and validates XSLT patterns for DITA content transformation.

Key principle: always match by @class, not by element name

DITA elements carry a @class attribute encoding the specialization hierarchy. Matching by element name breaks with specializations; matching by @class is robust.

<!-- ✅ Robust — works for all specializations of task/taskbody -->
<xsl:template match="*[contains(@class, ' task/taskbody ')]">
  <div class="taskbody"><xsl:apply-templates/></div>
</xsl:template>

<!-- ❌ Fragile — breaks if a specialization renames the element -->
<xsl:template match="taskbody">
  <div class="taskbody"><xsl:apply-templates/></div>
</xsl:template>

Class attribute reference

See references/CLASS-ATTRIBUTES.md for the full table.

Quick reference for common elements:

Element@class token to match
Any topictopic/topic
conceptconcept/concept
tasktask/task
taskbodytask/taskbody
step / cmdtask/step / task/cmd
referencereference/reference
refbodyreference/refbody
refsynreference/refsyn
properties tablereference/properties
troubleshootingtroubleshooting/troubleshooting
troubleSolutiontroubleshooting/troubleSolution
map / topicrefmap/map / map/topicref

XSLT patterns reference

See assets/xslt-patterns.xsl for ready-to-use templates.

DITA-OT plugin override guidance

To override a built-in DITA-OT template in a plugin:

  1. Set plugin.xml to declare a xsl/xslhtml extension point
  2. Import xsl/dita2htmlImpl.xsl in your stylesheet
  3. Write a higher-priority template: <xsl:template match="..." priority="10">

See references/DITA-OT-PLUGIN.md for full plugin scaffolding steps.

Common edge cases

  • contains(@class, ' task/cmd ') — note the surrounding spaces in the string literal; they are required to avoid partial matches
  • Processing instruction <?dita-ot ...?> nodes: use processing-instruction('dita-ot') in your XPath
  • @outputclass is the DITA hook for custom CSS classes — pass it through with <xsl:attribute name="class" select="@outputclass"/>

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.