Analyzes a skill's full content -- SKILL.md and any sibling files in the same directory -- to find tools it references or requires, then compares against the skill's
frontmatter to find missing entries.
-
Parse argument: The argument is either a file path to a SKILL.md file, or a skill name/description. If no file path is provided, search for the skill using Glob — first in the current working directory (e.g.,
**/skills/**/<name>/SKILL.md
), then in
~/.claude/skills/**/<name>/SKILL.md
.
-
Read the skill file and separate the YAML frontmatter from the body content. Also read any other files in the same directory (sibling files referenced by or bundled with the skill).
-
Extract declared allowed-tools: Parse all entries under
in the frontmatter.
-
Scan all skill content (SKILL.md body + sibling files) for tool usage. Look for:
- Explicit tool names: e.g., , , , , , , , , , etc.
- Bash command patterns: e.g., , , , , , , , etc.
- For Bash commands found, the required allowed-tool format is (e.g., needs )
- For file tools with path patterns (Read, Write, Edit), note the paths referenced (e.g., needs )
- Skill invocations: e.g., , , . The required allowed-tool format is (e.g., needs )
-
Compare: For each tool detected in the body, check if it's covered by an entry in
. Rules:
- , , , , are available by default for files within the project directory. Only add these when the skill needs to access files outside the project (e.g., , ).
- commands always need explicit entries.
- A Bash pattern covers subcommands (e.g., covers ).
- Exact match counts as covered (e.g., matches ).
-
Update the skill file: For any missing tools found, add them to the
list in the skill's YAML frontmatter using the Edit tool. Then report what was added.
-
Validate: Re-read the updated file to confirm YAML frontmatter remains syntactically valid (proper indentation, no duplicate entries, correct list format).