Skip to content

Commit 4fae604

Browse files
committed
Update CLAUDE.md — distinguish internal vs cross-skill script calls
Skills calling their own co-located scripts should use relative paths (e.g., python3 scripts/foo.py) rather than ${CLAUDE_PLUGIN_ROOT}. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Aidan Reilly <[email protected]> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent dd9d80c commit 4fae604

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

CLAUDE.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,33 @@ Always use fully qualified `plugin:skill` names when referencing skills anywhere
2727
- `docs-tools:rh-ssg-formatting` (not `rh-ssg-formatting`)
2828
- `vale-tools:lint-with-vale` (not `vale`)
2929

30-
## Calling skills from commands and agents
30+
## Calling scripts from skills and commands
3131

32-
When a skill has a backing script (Python, Ruby, Bash), call it directly via `${CLAUDE_PLUGIN_ROOT}` — do NOT use `Skill:` invocations:
32+
### From within a skill (internal calls)
33+
34+
When a skill's own Markdown calls its co-located script, use a relative path from the skill directory:
35+
36+
```bash
37+
python3 scripts/git_pr_reader.py info <url> --json
38+
ruby scripts/callouts.rb "$file"
39+
bash scripts/find_includes.sh "$file"
40+
```
41+
42+
### From other commands and agents (cross-skill calls)
43+
44+
When a command or agent calls a script that belongs to a different skill, use `${CLAUDE_PLUGIN_ROOT}`:
3345

3446
```bash
35-
# Correct — direct script call
3647
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py info <url> --json
3748
ruby ${CLAUDE_PLUGIN_ROOT}/skills/dita-callouts/scripts/callouts.rb "$file"
3849
bash ${CLAUDE_PLUGIN_ROOT}/skills/dita-includes/scripts/find_includes.sh "$file"
3950
```
4051

41-
```
42-
# Wrong — Skill invocation for a scriptable operation
43-
Skill: docs-tools:git-pr-reader, args: "info <url> --json"
44-
```
52+
### Knowledge-only skills
4553

4654
Use `Skill:` pseudocode only for pure knowledge/checklist skills that have no backing script:
47-
```
55+
56+
```bash
4857
Skill: docs-tools:rh-ssg-formatting, args: "review path/to/file.adoc"
4958
```
5059

@@ -54,7 +63,8 @@ Do NOT use old slash-command syntax (e.g., `/jira-reader --issue PROJ-123`).
5463

5564
| Approach | When to use | Examples |
5665
|---|---|---|
57-
| `python3 ${CLAUDE_PLUGIN_ROOT}/...` | Running a script to fetch data, post comments, detect state | `git_pr_reader.py info`, `jira_reader.py`, `callouts.rb` |
66+
| `python3 scripts/...` | Calling a co-located script from within the same skill | `scripts/git_pr_reader.py`, `scripts/callouts.rb` |
67+
| `python3 ${CLAUDE_PLUGIN_ROOT}/...` | Cross-skill/command script calls | `git_pr_reader.py info`, `jira_reader.py`, `callouts.rb` |
5868
| `Skill: plugin:skill` | Loading full skill knowledge — rules, checklists, domain expertise the LLM applies | `rh-ssg-formatting`, `ibm-sg-punctuation`, review skills |
5969

6070
## Contributing rules

0 commit comments

Comments
 (0)