dita-keywords
Generate subject keywords for DITA topics from their content and write them into the prolog, reusing the project's existing vocabulary and any governing subject scheme. Use when asked to add or generate keywords, tag topics for search/findability, or enrich metadata to signal related topics.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dita-keywords
- description
- Generate subject keywords for DITA topics from their content and write them into the prolog, reusing the project's existing vocabulary and any governing subject scheme. Use when asked to add or generate keywords, tag topics for search/findability, or enrich metadata to signal related topics.
03 SKILL.md 正文
Generate DITA keywords from content
Keywords live in a topic's <prolog><metadata><keywords><keyword> and drive search,
findability, and relatedness. Generating good ones is judgment — the tools handle the
writing: propose terms from the content, then write them with metadata_set
(field=keyword, mode=append, field-preserving). Don't hand-edit the prolog.
The judgment (what makes this a skill, not a one-off)
- Consistency over novelty. First learn the project's existing keyword
vocabulary (
xpath_query "//keyword"across topics). Reuse the canonical term — one spelling, not synonyms ("installation", never also "setup"/"set up"). Adding a near-duplicate is worse than adding nothing. - Respect governance. If a subject scheme governs keywords or
category, prefer its controlled values (list_subjects); don't invent ungoverned tokens. See [[dita-subject-schemes]]. - Grounded + right-sized. Only terms the content actually supports — ~3–7 meaningful subject terms per topic. Not a word cloud; not the obvious product name on every topic.
<keyword>vs<indexterm>.<keyword>is for metadata/search/relatedness (this skill).<indexterm>is for the generated back-of-book index (different intent) — both live under<keywords>; don't conflate them.
Process
- Survey the vocabulary —
keyword_auditreports the project's distinct keywords with frequencies, topics with none, and near-duplicate spellings (the drift to avoid);list_subjectsadds any scheme-governed terms. This is your controlled set. (xpath_query "//keyword"is the lower-level alternative.) - Read the topic(s) — title, shortdesc, body — and pick 3–7 grounded subject terms, preferring the existing/governed vocabulary; only coin a new term when the subject genuinely isn't covered.
- Write —
metadata_set field=keyword value=<term> mode=appendper term (append, so existing keywords are kept). Preview a project-wide pass withdryRunfirst. Topics only (.dita). - Per-file vs batch — polish one open topic, or sweep "topics with no keywords" across the project (mirror the metadata audit/normalize split).
Report
Per topic: the keywords added, which reused the existing/governed vocabulary vs were newly coined (and why), and any synonym/spelling drift you noticed in the existing set. Keywords are a relatedness signal — topics sharing keywords are candidate related links (feed the reltable / related-links workflow). For descriptions, pair with [[dita-shortdesc]]; to align existing metadata values use [[dita-metadata-normalize]]; for the prolog model and policy see [[dita-metadata]].
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.