Package com.tnsai.skills
Class SkillMdParser
java.lang.Object
com.tnsai.skills.SkillMdParser
Parses a Claude Code-compatible
SKILL.md document into a
Skill (TNS-289).
Format:
--- name: deploy description: Production deploy procedure ... when_to_use: ... allowed-tools: [bash, kubectl] disable-model-invocation: false user-invocable: true argument-hint: "<environment>" arguments: - environment paths: - "infra/**" --- # Deploy procedure Step-by-step body content here ...
The frontmatter delimiter is exactly three dashes (---) on
a line by itself. Anything between the opening and closing delimiter
is parsed as YAML; everything after is the markdown body.
Field names follow the agentskills.io convention of
kebab-case (allowed-tools, disable-model-invocation,
user-invocable, argument-hint); snake_case aliases
(when_to_use) are also accepted because Claude Code's docs
use both.
- Since:
- 0.10.0 (TNS-289)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Skillstatic SkillSame asparse(String, String)but reads the document from disk.
-
Method Details
-
parse
ParseSKILL.mdcontent into aSkill, defaulting thenametodefaultNamewhen the frontmatter does not declare one (e.g. when the directory name is the source of truth).- Throws:
IllegalArgumentException- if the document has no frontmatter or the frontmatter cannot be parsed as YAML or violates theSkillcontract
-
parse
Same asparse(String, String)but reads the document from disk. The file's parent directory name is used as the default skill name.
-