Skip to content

Commit e4c59e3

Browse files
committed
Import Apex skills
1 parent 217cb8e commit e4c59e3

37 files changed

Lines changed: 27580 additions & 6 deletions
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: import-external-skills
2+
3+
# Manually-dispatched workflow that refreshes the federated portion of the
4+
# catalog. It reads `catalog/sources.yml`, shallow-clones each declared
5+
# source, vendors the named skills into `skills/<name>/`, updates
6+
# `.claude-plugin/marketplace.json`, regenerates the Cursor manifest, and
7+
# opens a pull request with the result. Every imported skill goes through
8+
# the same `validate` checks as in-repo skills before it lands on `main`.
9+
#
10+
# See `catalog/README.md` for the federation design.
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
dry_run:
16+
description: "Resolve sources and print planned changes without committing."
17+
required: false
18+
type: boolean
19+
default: false
20+
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
25+
concurrency:
26+
group: import-external-skills
27+
cancel-in-progress: false
28+
29+
jobs:
30+
import:
31+
name: Import external skills
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Check out repository
35+
uses: actions/checkout@v4
36+
37+
- name: Set up uv
38+
uses: astral-sh/setup-uv@v7
39+
40+
- name: Configure git for sparse-checkout
41+
run: |
42+
git --version
43+
git config --global init.defaultBranch main
44+
45+
- name: Import skills declared in catalog/sources.yml
46+
id: import
47+
run: |
48+
if [ "${{ inputs.dry_run }}" = "true" ]; then
49+
uv run scripts/import_external_skills.py --dry-run
50+
else
51+
uv run scripts/import_external_skills.py
52+
fi
53+
54+
- name: Regenerate Cursor plugin manifest
55+
if: ${{ inputs.dry_run != true }}
56+
run: uv run scripts/generate_cursor_plugin.py
57+
58+
- name: Validate skills and manifests
59+
if: ${{ inputs.dry_run != true }}
60+
run: ./scripts/check.sh
61+
62+
- name: Detect changes
63+
if: ${{ inputs.dry_run != true }}
64+
id: changes
65+
run: |
66+
if [ -z "$(git status --porcelain)" ]; then
67+
echo "changed=false" >> "$GITHUB_OUTPUT"
68+
echo "No changes to import. Skipping PR."
69+
else
70+
echo "changed=true" >> "$GITHUB_OUTPUT"
71+
git status --short
72+
fi
73+
74+
# Use the GitHub-maintained action to push to a dedicated branch and
75+
# open a PR. PRs (rather than direct commits to main) keep imported
76+
# changes reviewable and let the standard `validate` workflow gate
77+
# them.
78+
- name: Open pull request with imported skills
79+
if: ${{ inputs.dry_run != true && steps.changes.outputs.changed == 'true' }}
80+
uses: peter-evans/create-pull-request@v7
81+
with:
82+
branch: bot/import-external-skills
83+
delete-branch: true
84+
commit-message: "chore(catalog): refresh federated skills from catalog/sources.yml"
85+
title: "Refresh federated skills"
86+
body: |
87+
Automated import driven by `catalog/sources.yml`.
88+
89+
See `catalog/README.md` for the federation design. Each vendored
90+
skill includes a `.federated.json` marker recording the source
91+
repo, pinned ref, and resolved commit at import time.
92+
93+
Triggered by @${{ github.actor }} via the `import-external-skills`
94+
workflow ([run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})).
95+
labels: |
96+
catalog
97+
automated
98+
add-paths: |
99+
catalog/**
100+
skills/**
101+
.claude-plugin/**
102+
.cursor-plugin/**

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Best for cross-cutting skills that do not have a natural product home.
3333
Best for skills that should ship and version with a product (HIP, MIGraphX, Ryzen AI, Lemonade, etc.).
3434

3535
1. Add the skill folder to your product repository; a common location is `.agents/skills/<skill-name>/`.
36-
2. Open a pull request here that adds an entry to `catalog/` pointing at the skill's location and pinning a tag.
37-
3. CI will validate the linked skill against the same rules as in-repo skills, and the central plugin manifests will surface it through one install.
36+
2. Open a pull request here that adds (or extends) an entry in [`catalog/sources.yml`](catalog/README.md) — the master list — naming your repo, a pinned ref, the sub-path that holds skill folders, and your skill's folder name.
37+
3. Once the catalog change merges, dispatch the **Import external skills** workflow from the Actions tab. It shallow-clones your repo at the pinned ref, vendors the skill into `skills/<name>/`, updates `.claude-plugin/marketplace.json`, and opens a follow-up pull request. Validation then runs against the same rules as in-repo skills before merge.
3838

3939
## Is this task a good fit for a skill?
4040

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,22 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the step-by-step contribution flow fo
142142
### Repository layout
143143

144144
```
145-
skills/ # Skills authored in this repository
146-
catalog/ # Manifest pointers to skills that live in product repositories
145+
skills/ # All skills the agent can load (in-repo + vendored copies of federated)
146+
catalog/ # Master list of external skill sources (catalog/sources.yml)
147147
.cursor-plugin/ # Cursor plugin manifest
148148
.claude-plugin/ # Claude Code marketplace manifest
149-
.github/workflows/ # CI for validating skills and manifests
150-
scripts/ # Tooling for publishing and regenerating manifests
149+
.github/workflows/ # CI for validating skills and the `import-external-skills` workflow
150+
scripts/ # Tooling for publishing, regenerating manifests, and importing
151151
```
152152

153+
In-repo skills are authored directly under `skills/`. Federated skills are
154+
declared in [`catalog/sources.yml`](catalog/README.md) and vendored into
155+
`skills/` by the manually-dispatched `import-external-skills` workflow,
156+
which opens a pull request with the imported copies. Each vendored skill
157+
carries a `.federated.json` marker that records the upstream repo and
158+
pinned commit, so the importer can refresh or remove it without disturbing
159+
in-repo skills.
160+
153161
## Manual Installation
154162

155163
AMD Skills are compatible with Cursor, Claude Code, OpenAI Codex, and Gemini CLI. The general flow:

0 commit comments

Comments
 (0)