dita-keys
Manage a DITA key space — replace hardcoded strings with keyrefs (keyify), define/rename/merge/inline keys, and resolve a key's value. Use when asked to keyify product names or other repeated literals, clean up duplicate or stale key definitions, or rename/retire a key across a project.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dita-keys
- description
- Manage a DITA key space — replace hardcoded strings with keyrefs (keyify), define/rename/merge/inline keys, and resolve a key's value. Use when asked to keyify product names or other repeated literals, clean up duplicate or stale key definitions, or rename/retire a key across a project.
03 SKILL.md 正文
Manage the DITA key space
Keys centralize values (product names, versions, URLs) and link targets so they
change in one place. The tools: keyify, list_keys, resolve_key,
create_keydef, rename_key, merge_keydefs, inline_key.
Keyify — the judgment call
keyify replaces a hardcoded literal with <… keyref="key"/>. What to keyify is
a judgment, not a sweep:
- Do keyify the literal in running prose, titles, and shortdescs.
- Do not keyify inside
<codeblock>,<cmdname>,<filepath>,<userinput>, shell commands, or example output — those are literal by design; replacing them breaks copy-paste. - A version/URL/extension is usually a key (
product-version,download-url,project-extension); a one-off proper noun usually is not. - Confirm the key exists first with
list_keys; if it doesn't,create_keydefit (a text key holds its value in<keyword>).
For a repetitive keyify across many files, drive it in code mode, applying the same "prose yes / code no" rule per occurrence.
Process
- Survey with
list_keys— the defined keys, their values, and which are undefined (dangling keyref) or unused. Fix typo'd keyrefs against the real key. - Resolve a value with
resolve_key <key>(respects key-space precedence: first definition in the map closure wins). - Keyify the safe occurrences (above); leave code/paths.
- Tidy:
merge_keydefs <root-map>removes shadowed duplicate keydefs (the same key defined twice in the closure — the loser is dead weight that drifts stale).rename_key <old> <new>renames a key and every keyref/conkeyref in one reference-safe pass.inline_key <key>is the escape hatch — replace keyrefs with the resolved literal when a key is no longer wanted.
- Preview destructive ops with their dry-run, then apply.
Report
The keys touched (defined/renamed/merged/inlined), the occurrences keyified vs deliberately skipped (and why — code/paths), and any dangling keyrefs fixed. Link [[dita-conref-reuse]] for content (not value) reuse.
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.