Skip to content

feat(agent-catalog): add create-agent-catalog-source skill - #2975

Merged
google-oss-prow[bot] merged 4 commits into
kubeflow:mainfrom
lugi0:feat/create-agent-catalog-source-skill
Jul 20, 2026
Merged

feat(agent-catalog): add create-agent-catalog-source skill#2975
google-oss-prow[bot] merged 4 commits into
kubeflow:mainfrom
lugi0:feat/create-agent-catalog-source-skill

Conversation

@lugi0

@lugi0 lugi0 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a Claude Code skill (/create-agent-catalog-source) that scans repositories for agent templates and generates a custom agent catalog source YAML compatible with the catalog service's yamlAgentCatalog consumer.

What the skill does:

  1. Accepts a local path, GitHub URL, or uses the current directory
  2. Discovers agents via three strategies: agent.yaml convention scan, YAML heuristic scan, and Markdown analysis
  3. Presents discovered agents for user confirmation with interactive editing
  4. Generates a complete catalog.yaml with all required fields (name, displayName, description, framework, labels, logo, env, templates, etc.)
  5. Produces deployment artifacts: sources config snippet and an OpenShift deploy script

Files added:

  • .agents/skills/create-agent-catalog-source/SKILL.md — full skill definition with 6-step workflow
  • .agents/skills/create-agent-catalog-source/scripts/agent_yaml_to_json.py — helper script for deterministic YAML-to-JSON conversion (used for the templates field)
  • .agents/skills/create-agent-catalog-source/scripts/test_agent_yaml_to_json.py — pytest tests for the helper script (8 tests)

Also:

  • Adds an "Available Skills" section to AGENTS.md documenting all 5 skills (4 existing + 1 new) so contributors and agents can discover them

How Has This Been Tested?

  • python3 -m pytest .agents/skills/create-agent-catalog-source/scripts/test_agent_yaml_to_json.py -v — 8/8 tests pass
  • The skill was developed and validated end-to-end against a test repository containing agents in all three discovery formats (convention, YAML heuristic, Markdown-only), producing a valid
    catalog consumed by the catalog service

Merge criteria:

  • The commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages
  • Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.

Add a Claude Code skill that scans repositories for agent templates
(agent.yaml files, YAML heuristics, and Markdown analysis) and generates
a custom agent catalog source YAML compatible with the catalog service.

Includes:
- SKILL.md with full 6-step workflow
- Helper script (agent_yaml_to_json.py) for deterministic YAML-to-JSON
- Pytest tests for the helper script
- Documents all available skills in AGENTS.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: lugi0 <lgiorgi@redhat.com>
@google-oss-prow
google-oss-prow Bot requested review from chambridge and fege July 17, 2026 15:03
Comment thread .agents/skills/create-agent-catalog-source/scripts/agent_yaml_to_json.py Outdated
Comment thread AGENTS.md
Comment thread .agents/skills/create-agent-catalog-source/SKILL.md Outdated
lugi0 and others added 2 commits July 17, 2026 17:40
…rsion

The project already requires yq (./bin/yq). Use it directly in the skill
instead of shipping a separate Python script and its tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: lugi0 <lgiorgi@redhat.com>
Replace RHOAI, OpenShift, and oc references with generic upstream
terminology (agents catalog, Kubernetes, kubectl).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: lugi0 <lgiorgi@redhat.com>
@lugi0
lugi0 requested review from Al-Pragliola and pboyd July 17, 2026 15:50

@Al-Pragliola Al-Pragliola left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@jonburdo jonburdo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

A couple nits

| `labels` | From agent.yaml `labels` field. Default `[]`. **Always include this field.** |
| `logo` | From agent.yaml `logo` field. Default `""`. **Always include this field.** |
| `env` | Transform from `{required: [...], optional: [...]}` to flat list: each required var gets `{name: X, required: true}`, each optional var gets `{name: X, required: false}`. For markdown-inferred agents, use env vars extracted from the README. Default `[]`. **Always include this field.** |
| `templates` | Use `./bin/yq` to convert agent.yaml to a compact JSON string. The result becomes a single template entry: `{name: "agent.yaml", content: "<json>"}`. **For convention-discovered agents** (agent.yaml already on disk): run `./bin/yq <agent-dir>/agent.yaml -o json -I 0` and capture stdout. **For heuristic/markdown-discovered agents** (no agent.yaml on disk): write the generated agent.yaml content (confirmed by the user in Step 3c) to a temporary file (`TMPFILE=$(mktemp /tmp/agent-yaml-XXXXXX.yaml)`), run `./bin/yq "$TMPFILE" -o json -I 0`, capture stdout, then clean up (`rm "$TMPFILE"`). **Always include this field.** |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One thing to double-check (from cursor): if the user edits fields in Step 4, should templates[].content be regenerated from that final metadata, or stay as the original/on-disk agent.yaml? Maybe worth spelling out so agents don't guess - especially for heuristic/markdown agents where the template is generated.

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.

Done, now the template gets updated to the last metadata available and the user is asked if they want to update the source agent.yaml file as well

```bash
test -d <original-cwd>/.agent-catalog
```
If `.agent-catalog/` already exists, ask the user whether to overwrite or choose a different output path using `AskUserQuestion`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This lets the user pick a custom output path, but Steps 5–6 still hardcode .agent-catalog/

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.

Good catch, done and abstracted in <output-dir>

@pboyd

pboyd commented Jul 17, 2026

Copy link
Copy Markdown
Member

/lgtm too. Thanks, @lugi0

- Use <output-dir> variable throughout Steps 5-6 instead of hardcoding
  .agent-catalog/, honoring the user's choice from Step 1
- Clarify that templates[].content always reflects the final confirmed
  metadata, not the original on-disk agent.yaml; if a convention agent's
  fields were edited, ask the user whether to update the source file

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: lugi0 <lgiorgi@redhat.com>
@google-oss-prow google-oss-prow Bot removed the lgtm label Jul 20, 2026
@Al-Pragliola

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@google-oss-prow google-oss-prow Bot added the lgtm label Jul 20, 2026
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Al-Pragliola

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit 732c6ff into kubeflow:main Jul 20, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants