Skip to content

feat: add skills.json generation for MCP consumption#72

Open
jpuzz0 wants to merge 1 commit into
patternfly:mainfrom
jpuzz0:feat/generate-skills-json
Open

feat: add skills.json generation for MCP consumption#72
jpuzz0 wants to merge 1 commit into
patternfly:mainfrom
jpuzz0:feat/generate-skills-json

Conversation

@jpuzz0
Copy link
Copy Markdown
Collaborator

@jpuzz0 jpuzz0 commented May 6, 2026

Summary

  • Adds scripts/generate-skills-json.sh — walks all plugins/*/skills/*/SKILL.md files, extracts frontmatter and content, outputs dist/skills.json
  • Updates CI workflow to regenerate dist/skills.json on every push to main when plugins/** changes
  • Commits the initial dist/skills.json (28 skills)

The PatternFly MCP server fetches this file at runtime to serve ai-helpers skills via its tool and resource APIs. No bundled copy, no manual sync — CI keeps it current, the MCP server reads it directly from GitHub.

Ref: PF-4034

Summary by CodeRabbit

  • Chores
    • Added automated skills catalog generation, producing a machine-readable skills index with metadata and timestamps
    • Updated release automation to include the generated skills index alongside documentation updates and commit them as part of the build artifacts

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8e5adb12-4407-4a16-bbf9-30439a4c88cc

📥 Commits

Reviewing files that changed from the base of the PR and between cec2eed and 0f52de1.

⛔ Files ignored due to path filters (1)
  • dist/skills.json is excluded by !**/dist/**
📒 Files selected for processing (2)
  • .github/workflows/update-plugins-md.yml
  • scripts/generate-skills-json.sh

📝 Walkthrough

Walkthrough

Workflow renamed to "Update generated files" and extended to run a new script that scans plugin SKILL.md files and emits a timestamped dist/skills.json; the workflow now stages and commits that file alongside PLUGINS.md and README.md when changes are detected.

Changes

Skills Index Generation

Layer / File(s) Summary
Workflow updates
.github/workflows/update-plugins-md.yml
Workflow name changed to "Update generated files"; invokes scripts/generate-skills-json.sh; includes dist/skills.json in change detection and git commit.
Core Script Implementation
scripts/generate-skills-json.sh
New Bash script (strict mode) that discovers plugins/*/skills/*/SKILL.md, extracts frontmatter name/description, reads content, builds dist/skills.json with version, UTC generated timestamp, meta.source, and patches meta.totalSkills.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • nicolethoen
  • cdcabrera
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a skills.json generation feature for MCP consumption, which is confirmed by the raw summary and PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jpuzz0 jpuzz0 requested review from a team and dlabaj and removed request for a team May 6, 2026 16:21
@cdcabrera cdcabrera self-requested a review May 7, 2026 17:56
Copy link
Copy Markdown
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

I had claude help me take a look - so i notes a few observations it made.

Comment thread scripts/generate-skills-json.sh Outdated
value=$(echo "$frontmatter" | grep "^${field}:" | sed "s/^${field}: *//")

if [ "$value" = ">-" ] || [ "$value" = ">" ] || [ "$value" = "|" ] || [ "$value" = "|-" ]; then
value=$(echo "$frontmatter" | sed -n "/^${field}:/,/^[a-zA-Z_-]*:\|^---$/{ /^${field}:/d; /^[a-zA-Z_-]*:/d; /^---$/d; p; }" | sed 's/^ *//' | tr '\n' ' ' | sed 's/ *$//')
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.

Claude took a look at these regex with me - so take the feedback with a grain of salt.

value=$(echo "$frontmatter" | sed -n "/^${field}:/,/^[a-zA-Z_-]*:\|^---$/{ ... }" ...)

  • Regex /^[a-zA-Z_-]*:/ for next field won't match disable-model-invocation: (has hyphen mid-word)
  • Won't handle nested YAML (lists, objects)
  • Won't escape quotes in multiline strings → breaks JSON

Example failure:

description: >-
    Text with "quotes" and
    multi-line content
    next-field: value  # would be captured as part of description

Recommendation:

Use yq (YAML processor) instead of sed:

get_frontmatter_field() {
   local file="$1" field="$2"
   yq eval ".${field}" <(sed -n '/^---$/,/^---$/p' "$file") | tr -d '\n'
 } 

Or validate output JSON with jq and fail loudly if malformed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

looked into this — the - at the end of [a-zA-Z_-] is a literal hyphen so it does match names like disable-model-invocation. and jq --arg handles the JSON escaping for us. same regex pattern from generate-plugins-md.sh that's been working across 28+ skills so i think we're good here. adding yq would be a new CI dependency for something that isn't breaking in practice

Add a bash script that generates dist/skills.json from all SKILL.md files
across plugins. The MCP server fetches this at runtime to serve skills
via its tool and resource APIs.

CI workflow updated to regenerate on every push to main when plugins change.

Ref: PF-4034
@jpuzz0 jpuzz0 force-pushed the feat/generate-skills-json branch from 13d04aa to 0f52de1 Compare May 13, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants