Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Switch red-hat-product-lifecycle skill to API-based script#1

Merged
r2dedios merged 4 commits into
RHEcosystemAppEng:mainfrom
javierpena:lifecycle-script
Jun 30, 2026
Merged

Switch red-hat-product-lifecycle skill to API-based script#1
r2dedios merged 4 commits into
RHEcosystemAppEng:mainfrom
javierpena:lifecycle-script

Conversation

@javierpena

Copy link
Copy Markdown
Contributor

Summary

Replace WebFetch scraping with a stdlib Python script that queries the official Red Hat lifecycle API directly, returning structured JSON for reliable parsing across all products and versions.

Pack(s) affected

  • ocp-admin
  • rh-ai-engineer
  • rh-automation
  • rh-basic
  • rh-developer
  • rh-sre
  • rh-virt
  • Other / repo-wide

Change type

  • New skill
  • New agent
  • New pack
  • Update existing skill / agent
  • MCP server config (mcps.json)
  • Docs / README
  • CI / tooling
  • Federation (external pack)

Contribution method

  • Created/imported with /agentic-contribution-skill
  • Manual contribution (validated with make validate + make validate-skill-design-changed)

AGENTS.md compliance

  • Agents orchestrate skills; no direct MCP/tool calls in agents
  • Skills are single-purpose task executors
  • Skills encapsulate all tool access (MCP tools invoked only inside skills)
  • Document consultation: file is read with the Read tool, then declared to the user
  • No credentials hardcoded; env vars used via ${VAR} references
  • Human-in-the-loop confirmation added for any destructive or critical operations

Validation

  • make validate passes locally
  • New/changed skills have valid YAML frontmatter (name, description)
  • New/changed agents have valid YAML frontmatter (name, description)

Replace WebFetch scraping with a stdlib Python script that queries the
official Red Hat lifecycle API directly, returning structured JSON for
reliable parsing across all products and versions.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@javierpena

Copy link
Copy Markdown
Contributor Author

Comes from RHEcosystemAppEng/agentic-plugins#127, see comments there for before/after comparison.

@r2dedios r2dedios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the catalog files descriptions are wrong (YAML / JSON).:
https://github.com/javierpena/agentic-collections-skills/blob/b55fe2208bef2febc8393716bb75e5468ec7a340/rh-basic/.catalog/collection.yaml#L26

This skill doesn't failback with WebFetch, it uses a python script

Just a few minor observations. Good job!

model: inherit
color: cyan
allowed-tools:
allowed-tools: Bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash is not a valid MCP tool.

Check this example:

allowed-tools: list_versions create_cluster cluster_info set_cluster_vips set_host_role cluster_iso_download_url install_cluster cluster_credentials_download_url cluster_logs_download_url list_static_network_config generate_nmstate_yaml validate_nmstate_yaml alter_static_network_config_nmstate_for_host

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. From Claude's point of view, Bash is a built-in tool, so that is why it was added. I'll remove it.

3. Return current phase, key dates, and action recommendation.
2. Run the lifecycle script via Bash:
```
python scripts/rh_lifecycle.py "Product Name Version"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, Claude runs commands from the repo root folder, not from the running skill folder..

Check this example:

python3 ocp-admin/scripts/cluster-report/assemble.py --aggregate < /tmp/cluster-report-manifest.json

I propose to change it by:

python rh-basic/skills/red-hat-product-lifecycle/scripts/rh_lifecycle.py "Product Name Version"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks!

@r2dedios r2dedios added the enhancement New feature or request label Jun 30, 2026
@javierpena

Copy link
Copy Markdown
Contributor Author

the catalog files descriptions are wrong (YAML / JSON).: https://github.com/javierpena/agentic-collections-skills/blob/b55fe2208bef2febc8393716bb75e5468ec7a340/rh-basic/.catalog/collection.yaml#L26

This skill doesn't failback with WebFetch, it uses a python script

Should I implement the WebFetch failback in the skill? If the API is down, any web page using it will also be down.

@r2dedios

Copy link
Copy Markdown
Collaborator

the catalog files descriptions are wrong (YAML / JSON).: https://github.com/javierpena/agentic-collections-skills/blob/b55fe2208bef2febc8393716bb75e5468ec7a340/rh-basic/.catalog/collection.yaml#L26
This skill doesn't failback with WebFetch, it uses a python script

Should I implement the WebFetch failback in the skill? If the API is down, any web page using it will also be down.

I don't think that's necessary, Just update the description of the catalog collection so it matches with the skills and scripts behavior. Only documentation changes, not functional

Previously all skills fetched information directly using WebFetch, but
the updated red-hat-product-lifecycle skill uses the API.
@javierpena

Copy link
Copy Markdown
Contributor Author

the catalog files descriptions are wrong (YAML / JSON).: https://github.com/javierpena/agentic-collections-skills/blob/b55fe2208bef2febc8393716bb75e5468ec7a340/rh-basic/.catalog/collection.yaml#L26
This skill doesn't failback with WebFetch, it uses a python script

Should I implement the WebFetch failback in the skill? If the API is down, any web page using it will also be down.

I don't think that's necessary, Just update the description of the catalog collection so it matches with the skills and scripts behavior. Only documentation changes, not functional

Ack, I just did that with the latest commit.

@r2dedios r2dedios left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one more step.. We need to update the JSON version of the collection.yaml file.

Collection compliance failed:
  • rh-basic: .catalog/collection.json content differs from collection.yaml (run diff or regenerate JSON to inspect)
  • rh-basic: regenerate mirror with: uv run python scripts/catalog_yaml_to_json.py --pack rh-basic

@javierpena

@javierpena

Copy link
Copy Markdown
Contributor Author

Done! I had to take the script from the previous repo, btw.

@r2dedios

Copy link
Copy Markdown
Collaborator

Done! I had to take the script from the previous repo, btw.

Good catch! We will check this missing script

@r2dedios r2dedios merged commit c0d89fe into RHEcosystemAppEng:main Jun 30, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants