From 71dffecf347e06e993972f1827af4e7057f37dfd Mon Sep 17 00:00:00 2001 From: operetz Date: Tue, 21 Jul 2026 15:30:00 +0300 Subject: [PATCH 1/2] align skill helper script paths with scripts/ convention (#143) --- .../cluster-report/docs/multi-cluster-auth.md | 6 ++--- .../skills/red-hat-product-lifecycle/SKILL.md | 4 +-- rh-sre/skills/cve-impact/SKILL.md | 10 +++---- .../references/02-cve-parsing-guide.md | 26 +++++++++---------- .../references/flows/01-account-cves.md | 2 +- .../references/flows/02-system-all-cves.md | 2 +- .../flows/03-system-remediatable-cves.md | 2 +- .../01-cve-response-parser.py | 0 8 files changed, 26 insertions(+), 26 deletions(-) rename rh-sre/skills/cve-impact/{references => scripts}/01-cve-response-parser.py (100%) diff --git a/ocp-admin/skills/cluster-report/docs/multi-cluster-auth.md b/ocp-admin/skills/cluster-report/docs/multi-cluster-auth.md index 99d8f620..6c043d3a 100644 --- a/ocp-admin/skills/cluster-report/docs/multi-cluster-auth.md +++ b/ocp-admin/skills/cluster-report/docs/multi-cluster-auth.md @@ -40,10 +40,10 @@ If you're currently logged into all the clusters you would like to get a report ```bash # Step 1: Setup — applies RBAC to each cluster, extracts SA tokens -python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py setup --all-contexts +python3 scripts/build-kubeconfig.py setup --all-contexts # Step 2: Build — assembles a merged kubeconfig from the inventory -python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py \ +python3 scripts/build-kubeconfig.py \ build --clusters ~/.ocp-clusters/clusters.json --verify # Step 3: Use — export and run the skill @@ -105,7 +105,7 @@ Set permissions: `chmod 600 ~/.ocp-clusters/clusters.json` ### 4. Build Kubeconfig ```bash -python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py \ +python3 scripts/build-kubeconfig.py \ build --clusters ~/.ocp-clusters/clusters.json --output ~/.kube/cluster-report-kubeconfig ``` diff --git a/rh-basic/skills/red-hat-product-lifecycle/SKILL.md b/rh-basic/skills/red-hat-product-lifecycle/SKILL.md index c90052eb..27fbbeec 100644 --- a/rh-basic/skills/red-hat-product-lifecycle/SKILL.md +++ b/rh-basic/skills/red-hat-product-lifecycle/SKILL.md @@ -25,7 +25,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 +48,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` ## Lifecycle Phase Reference diff --git a/rh-sre/skills/cve-impact/SKILL.md b/rh-sre/skills/cve-impact/SKILL.md index ab192614..2a356569 100644 --- a/rh-sre/skills/cve-impact/SKILL.md +++ b/rh-sre/skills/cve-impact/SKILL.md @@ -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 @@ -321,7 +321,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 | @@ -335,9 +335,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 ` -- 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 ` +- Multiple pages: `python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json ...` (merges, dedupes, aggregated report) - Filter options: `FILTER_REMEDIATABLE=1`, `FILTER_IMPACT=Critical,Important` - Report format: `OUTPUT=report`, `SYSTEM_NAME=hostname` for aggregated multi-page reports diff --git a/rh-sre/skills/cve-impact/references/02-cve-parsing-guide.md b/rh-sre/skills/cve-impact/references/02-cve-parsing-guide.md index f4608f3b..89248d55 100644 --- a/rh-sre/skills/cve-impact/references/02-cve-parsing-guide.md +++ b/rh-sre/skills/cve-impact/references/02-cve-parsing-guide.md @@ -20,10 +20,10 @@ ## Parser Location ``` -rh-sre/skills/cve-impact/references/01-cve-response-parser.py +scripts/01-cve-response-parser.py ``` -From workspace root: `rh-sre/skills/cve-impact/references/01-cve-response-parser.py` +Skill-relative path: `scripts/01-cve-response-parser.py` ## How to Invoke @@ -32,13 +32,13 @@ From workspace root: `rh-sre/skills/cve-impact/references/01-cve-response-parser Save the MCP tool result to a file, then run: ```bash -python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py /path/to/response.json +python3 scripts/01-cve-response-parser.py /path/to/response.json ``` ### Option 2: stdin ```bash -python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py < /path/to/response.json +python3 scripts/01-cve-response-parser.py < /path/to/response.json ``` ### Option 3: From MCP tool result file @@ -46,7 +46,7 @@ python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py < /path/to When the MCP tool writes to a file (e.g. `tool-results/toolu_xxx.txt`): ```bash -python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py /path/to/tool-results/toolu_xxx.txt +python3 scripts/01-cve-response-parser.py /path/to/tool-results/toolu_xxx.txt ``` ### Option 4: Multiple page files (aggregated report) @@ -55,7 +55,7 @@ When you have multiple paginated responses (e.g. pages 1–5 from `vulnerability ```bash FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME=ip-172-31-32-201.eu-west-3.compute.internal \ - python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json + python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json ``` **Do NOT generate inline Python** to loop over page files—use the parser with multiple paths. @@ -75,28 +75,28 @@ FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME **Remediatable CVEs only:** ```bash -FILTER_REMEDIATABLE=1 python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json +FILTER_REMEDIATABLE=1 python3 scripts/01-cve-response-parser.py response.json ``` **Critical/Important only:** ```bash -FILTER_IMPACT=Critical,Important python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json +FILTER_IMPACT=Critical,Important python3 scripts/01-cve-response-parser.py response.json ``` **Remediatable + Critical/Important:** ```bash -FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json +FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important python3 scripts/01-cve-response-parser.py response.json ``` **Aggregated report from multiple pages:** ```bash FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME=ip-172-31-32-201.eu-west-3.compute.internal \ - python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json + python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json ``` **JSON output (for further processing):** ```bash -OUTPUT=json python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json +OUTPUT=json python3 scripts/01-cve-response-parser.py response.json ``` ## Response Structure (Lightspeed MCP) @@ -142,6 +142,6 @@ Key fields: 1. Call MCP tool (`vulnerability__get_system_cves` or `vulnerability__get_cves`) — one or more times (paginated) 2. Save each response to file (MCP may write to `tool-results/` or you save from result) 3. **Run parser** (required—do not use jq or inline Python): - - Single page: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py ` - - Multiple pages: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json ...` + - Single page: `python3 scripts/01-cve-response-parser.py ` + - Multiple pages: `python3 scripts/01-cve-response-parser.py page1.json page2.json ...` 4. Use parser output for summary tables and user-facing reports diff --git a/rh-sre/skills/cve-impact/references/flows/01-account-cves.md b/rh-sre/skills/cve-impact/references/flows/01-account-cves.md index d981a9e9..900f86df 100644 --- a/rh-sre/skills/cve-impact/references/flows/01-account-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/01-account-cves.md @@ -76,7 +76,7 @@ vulnerability__get_cves( ## Step 4: After Listing -- **Parse response** (if needed): Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response** (if needed): Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). - Sort by CVSS score (highest first) or by affected system count - Provide summary table: CVE ID, severity, affected systems count, remediation availability - Offer to analyze a specific CVE (see [SKILL.md](../SKILL.md) — Step 2: CVE Information Retrieval) diff --git a/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md b/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md index 6a819454..12d7029c 100644 --- a/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md @@ -84,6 +84,6 @@ while (strategy allows): ## Step 6: After Retrieval -- **Parse response**: Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). - Sort by CVSS score (highest first) - Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill) diff --git a/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md b/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md index a1351e79..fc19b187 100644 --- a/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md @@ -91,6 +91,6 @@ After filtering for remediatable, optionally filter by severity: ## Step 6: After Retrieval -- **Parse response**: Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). - Sort by CVSS score (highest first) - Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill) diff --git a/rh-sre/skills/cve-impact/references/01-cve-response-parser.py b/rh-sre/skills/cve-impact/scripts/01-cve-response-parser.py similarity index 100% rename from rh-sre/skills/cve-impact/references/01-cve-response-parser.py rename to rh-sre/skills/cve-impact/scripts/01-cve-response-parser.py From 2c1d912773d0c476c27ea4a8310ac89a4f9af66e Mon Sep 17 00:00:00 2001 From: operetz-rh Date: Sun, 26 Jul 2026 12:47:56 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Alejandro Villegas --- rh-sre/skills/cve-impact/references/flows/01-account-cves.md | 2 +- rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md | 2 +- .../cve-impact/references/flows/03-system-remediatable-cves.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rh-sre/skills/cve-impact/references/flows/01-account-cves.md b/rh-sre/skills/cve-impact/references/flows/01-account-cves.md index 900f86df..fb27d352 100644 --- a/rh-sre/skills/cve-impact/references/flows/01-account-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/01-account-cves.md @@ -76,7 +76,7 @@ vulnerability__get_cves( ## Step 4: After Listing -- **Parse response** (if needed): Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response** (if needed): Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md). - Sort by CVSS score (highest first) or by affected system count - Provide summary table: CVE ID, severity, affected systems count, remediation availability - Offer to analyze a specific CVE (see [SKILL.md](../SKILL.md) — Step 2: CVE Information Retrieval) diff --git a/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md b/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md index 12d7029c..832cfea7 100644 --- a/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/02-system-all-cves.md @@ -84,6 +84,6 @@ while (strategy allows): ## Step 6: After Retrieval -- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md). - Sort by CVSS score (highest first) - Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill) diff --git a/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md b/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md index fc19b187..0f805a53 100644 --- a/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md +++ b/rh-sre/skills/cve-impact/references/flows/03-system-remediatable-cves.md @@ -91,6 +91,6 @@ After filtering for remediatable, optionally filter by severity: ## Step 6: After Retrieval -- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md). +- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md). - Sort by CVSS score (highest first) - Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill)