-
Notifications
You must be signed in to change notification settings - Fork 29
align skill helper script paths with scripts/ convention (#143) #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
operetz-rh
wants to merge
3
commits into
main
Choose a base branch
from
fix/issue-143-skill-script-paths
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,6 +14,13 @@ Identify product and version from user message. If unclear, ask. Look up lifecyc | |||||
|
|
||||||
| ## Prerequisites | ||||||
|
|
||||||
| **Step 0 — Resolve scripts directory.** Before anything else, locate the helper scripts. They are inside the skill's `scripts/` subfolder. Run: | ||||||
| ```bash | ||||||
| SCRIPTS_DIR="scripts" | ||||||
| test -f "$SCRIPTS_DIR/rh_lifecycle.py" || { echo "Error: Scripts directory not found at $SCRIPTS_DIR"; exit 1; } | ||||||
| ``` | ||||||
| Use `$SCRIPTS_DIR` in all subsequent script calls. | ||||||
|
|
||||||
| Python 3 — the script uses only the stdlib. | ||||||
|
|
||||||
| ## When to Use This Skill | ||||||
|
|
@@ -25,7 +32,7 @@ When the user asks about lifecycle status, support phases, or EOL dates for any | |||||
| 1. Identify product and version from the user message. | ||||||
| 2. Run the lifecycle script via Bash: | ||||||
| ``` | ||||||
| python rh-basic/skills/red-hat-product-lifecycle/scripts/rh_lifecycle.py "Product Name Version" | ||||||
| python scripts/rh_lifecycle.py "Product Name Version" | ||||||
| ``` | ||||||
| The script queries `https://access.redhat.com/product-life-cycles/api/v1/products` and returns JSON to stdout. | ||||||
| Errors are on stderr (JSON with `"error"` key); exit code 1 on failure. | ||||||
|
|
@@ -48,7 +55,7 @@ Dates are `YYYY-MM-DD`; `"N/A"` means no date; `"Ongoing"` means open-ended. | |||||
|
|
||||||
| ## Dependencies | ||||||
|
|
||||||
| Script: `rh-basic/skills/red-hat-product-lifecycle/scripts/rh_lifecycle.py` | ||||||
| Script: `scripts/rh_lifecycle.py` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Lifecycle Phase Reference | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ description: | | |||||||||||||
|
|
||||||||||||||
| NOT for remediation (use `/remediation`). | ||||||||||||||
|
|
||||||||||||||
| System-level: FIRST reply = pagination prompt (Step -1). Parsing: references/01-cve-response-parser.py. | ||||||||||||||
| System-level: FIRST reply = pagination prompt (Step -1). Parsing: scripts/01-cve-response-parser.py. | ||||||||||||||
| model: inherit | ||||||||||||||
| color: blue | ||||||||||||||
| license: Apache-2.0 | ||||||||||||||
|
|
@@ -28,6 +28,13 @@ When invoked by another skill (e.g. remediation), use the Skill tool—do NOT us | |||||||||||||
|
|
||||||||||||||
| ## Prerequisites | ||||||||||||||
|
|
||||||||||||||
| **Step 0 — Resolve scripts directory.** Before anything else, locate the helper scripts. They are inside the skill's `scripts/` subfolder. Run: | ||||||||||||||
| ```bash | ||||||||||||||
| SCRIPTS_DIR="scripts" | ||||||||||||||
| test -f "$SCRIPTS_DIR/01-cve-response-parser.py" || { echo "Error: Scripts directory not found at $SCRIPTS_DIR"; exit 1; } | ||||||||||||||
| ``` | ||||||||||||||
| Use `$SCRIPTS_DIR` in all subsequent script calls. | ||||||||||||||
|
|
||||||||||||||
| **Required MCP Servers**: `lightspeed-mcp` ([setup guide](https://console.redhat.com/)) | ||||||||||||||
|
|
||||||||||||||
| **Required MCP Tools**: | ||||||||||||||
|
|
@@ -322,7 +329,7 @@ Check if automated playbook or manual steps are available. | |||||||||||||
|
|
||||||||||||||
| | File | Use When | | ||||||||||||||
| |------|----------| | ||||||||||||||
| | [01-cve-response-parser.py](references/01-cve-response-parser.py) | Parse/filter MCP vulnerability responses | | ||||||||||||||
| | [01-cve-response-parser.py](scripts/01-cve-response-parser.py) | Parse/filter MCP vulnerability responses | | ||||||||||||||
| | [02-cve-parsing-guide.md](references/02-cve-parsing-guide.md) | Parser invocation, filter options | | ||||||||||||||
| | [03-output-templates.md](references/03-output-templates.md) | Report format | | ||||||||||||||
| | [04-examples.md](references/04-examples.md) | Query-type examples | | ||||||||||||||
|
|
@@ -336,9 +343,9 @@ Check if automated playbook or manual steps are available. | |||||||||||||
| **Do NOT generate inline Python** to aggregate multiple page files—the parser accepts multiple file paths and produces aggregated reports. | ||||||||||||||
|
|
||||||||||||||
| **Read** [references/02-cve-parsing-guide.md](references/02-cve-parsing-guide.md) for: | ||||||||||||||
| - Parser location: `references/01-cve-response-parser.py` | ||||||||||||||
| - Single page: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py <response.json>` | ||||||||||||||
| - Multiple pages: `python3 .../01-cve-response-parser.py page1.json page2.json page3.json ...` (merges, dedupes, aggregated report) | ||||||||||||||
| - Parser location: `scripts/01-cve-response-parser.py` | ||||||||||||||
| - Single page: `python3 scripts/01-cve-response-parser.py <response.json>` | ||||||||||||||
| - Multiple pages: `python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json ...` (merges, dedupes, aggregated report) | ||||||||||||||
|
Comment on lines
+346
to
+348
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| - Filter options: `FILTER_REMEDIATABLE=1`, `FILTER_IMPACT=Critical,Important` | ||||||||||||||
| - Report format: `OUTPUT=report`, `SYSTEM_NAME=hostname` for aggregated multi-page reports | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check how we did it in other skills. Example:
agentic-plugins/ocp-admin/skills/container-cve-validator/SKILL.md
Line 34 in c203bd0