Package com.tnsai.skills
Class SkillSubstitution
java.lang.Object
com.tnsai.skills.SkillSubstitution
Placeholder substitution for skill bodies and frontmatter strings
(TNS-289). Mirrors the Claude Code substitution semantics so
SKILL.md authored elsewhere works unchanged here.
Placeholders
| Placeholder | Resolves to |
|---|---|
$ARGUMENTS | All positional arguments space-joined |
$0, $1, ... | The Nth positional argument (0-indexed); empty string if absent |
${VAR} | Named environment from the supplied env map; empty string if absent |
Escaping
Two consecutive dollar signs ($$) emit a single literal
dollar sign and skip substitution at that position. This is the
same escape Bash and most shells use.
Substitution is single-pass and left-to-right; the result of one substitution is not re-substituted. This keeps behaviour predictable — placeholders that happen to evaluate to other placeholder syntax stay literal in the output.
- Since:
- 0.10.0 (TNS-289)
-
Method Summary
-
Method Details
-
apply
Substitute placeholders intemplateusingargumentsfor$ARGUMENTS/$Nandenvfor named${VAR}values. Both maps may be empty; absent placeholders resolve to empty strings rather than throwing — skills are frequently invoked with optional arguments and a missing one shouldn't fail the whole invocation.
-