Skip to content

Commit dd9d80c

Browse files
authored
Merge pull request #39 from redhat-documentation/merge-git-review-api-into-git-pr-reader
Merge git_review_api.py into git-pr-reader skill
2 parents d980e65 + c7e7b5a commit dd9d80c

14 files changed

Lines changed: 1821 additions & 1805 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"name": "docs-tools",
1515
"source": "./plugins/docs-tools",
1616
"description": "Documentation review, writing, and workflow tools for Red Hat AsciiDoc and Markdown documentation.",
17-
"version": "0.0.8"
17+
"version": "0.0.10"
1818
},
1919
{
2020
"name": "vale-tools",

CLAUDE.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,36 @@ 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-
In agent files, use the `Skill:` pseudocode format for invocation examples:
30+
## Calling skills from commands and agents
31+
32+
When a skill has a backing script (Python, Ruby, Bash), call it directly via `${CLAUDE_PLUGIN_ROOT}` — do NOT use `Skill:` invocations:
33+
34+
```bash
35+
# Correct — direct script call
36+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py info <url> --json
37+
ruby ${CLAUDE_PLUGIN_ROOT}/skills/dita-callouts/scripts/callouts.rb "$file"
38+
bash ${CLAUDE_PLUGIN_ROOT}/skills/dita-includes/scripts/find_includes.sh "$file"
39+
```
40+
3141
```
32-
Skill: docs-tools:jira-reader, args: "PROJ-123"
42+
# Wrong — Skill invocation for a scriptable operation
43+
Skill: docs-tools:git-pr-reader, args: "info <url> --json"
44+
```
45+
46+
Use `Skill:` pseudocode only for pure knowledge/checklist skills that have no backing script:
47+
```
48+
Skill: docs-tools:rh-ssg-formatting, args: "review path/to/file.adoc"
3349
```
3450

3551
Do NOT use old slash-command syntax (e.g., `/jira-reader --issue PROJ-123`).
3652

53+
### When to use each approach
54+
55+
| Approach | When to use | Examples |
56+
|---|---|---|
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` |
58+
| `Skill: plugin:skill` | Loading full skill knowledge — rules, checklists, domain expertise the LLM applies | `rh-ssg-formatting`, `ibm-sg-punctuation`, review skills |
59+
3760
## Contributing rules
3861

3962
- Use kebab-case for plugin and command names

plugins/docs-tools/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs-tools",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "Documentation review, writing, and workflow tools for Red Hat AsciiDoc and Markdown documentation.",
55
"author": {
66
"name": "Red Hat Documentation Team",

plugins/docs-tools/agents/docs-planner.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -580,40 +580,40 @@ Read style guide files directly from the local docs-guidelines directory (set `D
580580
- LLM-optimized summaries: `llms.txt` files in each directory
581581

582582
### Querying JIRA
583-
Invoke the `docs-tools:jira-reader` skill to query JIRA issues.
583+
Use the jira-reader script to query JIRA issues.
584584

585585
**Fetch issue details:**
586-
```
587-
Skill: docs-tools:jira-reader, args: "PROJ-123"
586+
```bash
587+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --issue PROJ-123
588588
```
589589

590590
**Fetch issue with comments:**
591-
```
592-
Skill: docs-tools:jira-reader, args: "PROJ-123 --include-comments"
591+
```bash
592+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --issue PROJ-123 --include-comments
593593
```
594594

595595
**Search issues by JQL:**
596-
```
597-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND fixVersion=1.0.0'"
596+
```bash
597+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND fixVersion=1.0.0'
598598
```
599599

600600
**Search with full details:**
601-
```
602-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND labels=docs-needed' --fetch-details"
601+
```bash
602+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND labels=docs-needed' --fetch-details
603603
```
604604

605605
### Reviewing GitHub/GitLab PRs
606-
Use the `git_review_api.py` script to extract code changes from PRs/MRs.
606+
Use the git PR reader script to extract code changes from PRs/MRs.
607607

608-
```bash
608+
```
609609
# View PR/MR details as JSON
610-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py info <pr-url> --json
610+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py info <pr-url> --json
611611
612612
# List changed files with stats
613-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py files <pr-url> --json
613+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py files <pr-url> --json
614614
615615
# View PR/MR diff
616-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py diff <pr-url>
616+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py diff <pr-url>
617617
```
618618

619619
Requires tokens in `~/.env`:
@@ -622,18 +622,18 @@ Requires tokens in `~/.env`:
622622

623623
### Reading Red Hat documentation with redhat-docs-toc
624624

625-
Research existing Red Hat documentation to understand patterns and gaps. Use the `docs-tools:redhat-docs-toc` skill to extract article URLs from documentation TOC pages:
625+
Research existing Red Hat documentation to understand patterns and gaps. Extract article URLs from documentation TOC pages:
626626

627-
```
628-
Skill: docs-tools:redhat-docs-toc, args: "https://docs.redhat.com/en/documentation/product/version/html/guide/index"
627+
```bash
628+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/redhat-docs-toc/scripts/toc_extractor.py --url "https://docs.redhat.com/en/documentation/product/version/html/guide/index"
629629
```
630630

631631
### Extracting article content with article-extractor
632632

633-
Download and analyze existing Red Hat documentation for planning. Use the `docs-tools:article-extractor` skill to extract article content as markdown:
633+
Download and analyze existing Red Hat documentation for planning. Extract article content as markdown:
634634

635-
```
636-
Skill: docs-tools:article-extractor, args: "https://docs.redhat.com/..."
635+
```bash
636+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/article-extractor/scripts/article_extractor.py --url "https://docs.redhat.com/..."
637637
```
638638

639639
Use these skills to:

plugins/docs-tools/agents/requirements-analyst.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ Gather information from multiple sources. **Record all URLs and file paths as yo
127127

128128
**From JIRA:**
129129

130-
Use the `docs-tools:jira-reader` skill to fetch issue details. Invoke using the Skill tool:
131-
```
132-
Skill: docs-tools:jira-reader, args: "PROJECT-123"
133-
Skill: docs-tools:jira-reader, args: "--jql 'project = PROJECT AND fixVersion = X.Y.Z'"
134-
Skill: docs-tools:jira-reader, args: "--jql 'project = PROJECT AND labels = docs-needed'"
130+
Use the jira-reader script to fetch issue details:
131+
```bash
132+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --issue PROJECT-123
133+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project = PROJECT AND fixVersion = X.Y.Z'
134+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project = PROJECT AND labels = docs-needed'
135135
```
136136
- Record JIRA URLs for each relevant ticket (e.g., `https://redhat.atlassian.net/browse/PROJECT-123`)
137137
- Note specific sections referenced (e.g., "AC-1", "Documentation Considerations")
@@ -141,7 +141,7 @@ Skill: docs-tools:jira-reader, args: "--jql 'project = PROJECT AND labels = docs
141141
After fetching the primary ticket with jira-reader, run the ticket graph traversal to gather bounded context (1 level deep) from the ticket's relationships:
142142

143143
```bash
144-
python ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --graph ${TICKET}
144+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --graph ${TICKET}
145145
```
146146

147147
The `--graph` flag discovers custom field IDs, fetches the parent, children, siblings, issue links, and web/remote links, then classifies URLs by type. It uses `JIRA_AUTH_TOKEN` and `JIRA_EMAIL` from the environment (with `~/.env` fallback) and `JIRA_URL` (default: `https://redhat.atlassian.net`).
@@ -424,46 +424,46 @@ If a traversal step failed due to a permission error (e.g., 403 on parent), note
424424

425425
### Querying JIRA with jira-reader
426426

427-
Use the Skill tool to invoke the `docs-tools:jira-reader` skill. Do not call `jira_reader.py` directly.
427+
Use the jira-reader script directly:
428428

429429
**Fetch a single issue:**
430-
```
431-
Skill: docs-tools:jira-reader, args: "PROJ-123"
430+
```bash
431+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --issue PROJ-123
432432
```
433433

434434
**Fetch issue with comments:**
435-
```
436-
Skill: docs-tools:jira-reader, args: "PROJ-123 --include-comments"
435+
```bash
436+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --issue PROJ-123 --include-comments
437437
```
438438

439439
**Search issues by JQL (fast summary mode):**
440-
```
441-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND fixVersion=1.0.0'"
442-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND labels=docs-needed AND status=Done'"
443-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND updated >= -2w'"
440+
```bash
441+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND fixVersion=1.0.0'
442+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND labels=docs-needed AND status=Done'
443+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND updated >= -2w'
444444
```
445445

446446
**Search with full details (slower):**
447-
```
448-
Skill: docs-tools:jira-reader, args: "--jql 'project=PROJ AND fixVersion=1.0.0' --fetch-details"
447+
```bash
448+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/jira-reader/scripts/jira_reader.py --jql 'project=PROJ AND fixVersion=1.0.0' --fetch-details
449449
```
450450

451-
### Querying GitHub/GitLab with git_review_api.py
451+
### Querying GitHub/GitLab PRs
452452

453-
Use the unified Python script for both GitHub PRs and GitLab MRs:
453+
Use the git PR reader script for both GitHub PRs and GitLab MRs:
454454

455-
```bash
455+
```
456456
# View PR/MR details as JSON
457-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py info <pr-url> --json
457+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py info <pr-url> --json
458458
459459
# List changed files with stats
460-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py files <pr-url> --json
460+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py files <pr-url> --json
461461
462462
# View PR/MR diff
463-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py diff <pr-url>
463+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py diff <pr-url>
464464
465465
# Get review comments
466-
python ${CLAUDE_PLUGIN_ROOT}/commands/scripts/git_review_api.py comments <pr-url> --json
466+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-pr-reader/scripts/git_pr_reader.py comments <pr-url> --json
467467
```
468468

469469
Requires tokens in `~/.env`:
@@ -472,18 +472,18 @@ Requires tokens in `~/.env`:
472472

473473
### Reading Red Hat documentation with redhat-docs-toc
474474

475-
Extract article URLs from Red Hat documentation TOC pages for research. Use the `docs-tools:redhat-docs-toc` skill:
475+
Extract article URLs from Red Hat documentation TOC pages for research:
476476

477-
```
478-
Skill: docs-tools:redhat-docs-toc, args: "https://docs.redhat.com/en/documentation/product/version/html/guide/index"
477+
```bash
478+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/redhat-docs-toc/scripts/toc_extractor.py --url "https://docs.redhat.com/en/documentation/product/version/html/guide/index"
479479
```
480480

481481
### Extracting article content with article-extractor
482482

483-
Download and extract content from Red Hat documentation pages. Use the `docs-tools:article-extractor` skill:
483+
Download and extract content from Red Hat documentation pages:
484484

485-
```
486-
Skill: docs-tools:article-extractor, args: "https://docs.redhat.com/..."
485+
```bash
486+
python3 ${CLAUDE_PLUGIN_ROOT}/skills/article-extractor/scripts/article_extractor.py --url "https://docs.redhat.com/..."
487487
```
488488

489489
## Key principles

0 commit comments

Comments
 (0)