diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 63e844f..190e0cc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,7 +13,6 @@ ## Checklist - [ ] Added entry to the correct `skills/*.json` category file (see [CONTRIBUTING.md](../CONTRIBUTING.md#categories)) -- [ ] Ran `make build` and committed the updated `skillshare-hub.json` - [ ] `name` is lowercase with hyphens only - [ ] `description` is a clear one-liner - [ ] `source` repo is publicly accessible and contains a valid `SKILL.md` diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 67480b0..e4c712e 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -8,7 +8,7 @@ on: - '.github/workflows/validate-pr.yml' permissions: - contents: read + contents: write pull-requests: write jobs: @@ -16,16 +16,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - name: Build hub.json from skills/ run: ./scripts/build.sh - - name: Check hub.json is up to date + - name: Auto-commit hub.json if changed run: | if ! git diff --quiet skillshare-hub.json; then - echo "::error::skillshare-hub.json is out of date. Run 'make build' and commit the result." - git diff skillshare-hub.json - exit 1 + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add skillshare-hub.json + git commit -m "chore: auto-build skillshare-hub.json [skip ci]" + git push fi - name: Validate hub.json @@ -37,6 +41,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + ref: ${{ github.head_ref }} fetch-depth: 0 - name: Install skillshare diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e396ae8..60fb1cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,27 +7,25 @@ Thanks for sharing your skill with the community! 1. Fork this repo 2. Find the right category file in `skills/` (see [Categories](#categories) below) 3. Add your skill entry to the JSON array in that file -4. Run `make build` to regenerate `skillshare-hub.json` -5. Commit **both** the `skills/*.json` change and `skillshare-hub.json` -6. Open a Pull Request -7. CI will validate and audit your entry automatically -8. A maintainer will review and merge +4. Commit and open a Pull Request +5. CI will auto-build `skillshare-hub.json`, validate, and audit your entry +6. A maintainer will review and merge -> **Important**: Do not edit `skillshare-hub.json` directly — it is generated from `skills/*.json` by `make build`. CI will reject PRs where the hub file is out of sync. +> **Note**: Do not edit `skillshare-hub.json` directly — it is auto-generated by CI from `skills/*.json`. ## Categories | File | Description | |------|-------------| -| `skills/skill.json` | Hub meta-skills (skillshare, skill-creator, find-skills, template-skill) | +| `skills/antfu.json` | Skills from `antfu/skills` | | `skills/anthropic.json` | Skills from `anthropics/skills` | -| `skills/marketing.json` | Skills from `coreyhaines31/marketingskills` | -| `skills/workflow.json` | Skills from `obra/superpowers` and `obra/episodic-memory` | +| `skills/coreyhaines31.json` | Skills from `coreyhaines31/marketingskills` | +| `skills/superpowers.json` | Skills from `obra/superpowers` | | `skills/expo.json` | Skills from `expo/skills` | | `skills/vercel.json` | Skills from `vercel-labs/*` and `vercel/*` | | `skills/community.json` | Everything else — independent authors and orgs | -> **Not sure where to put your skill?** Just add it to `skills/community.json`. Maintainers will move it if needed. +When 3 or more skills share the same org/author, they get their own file (e.g. `skills/antfu.json`). Otherwise, add to `skills/community.json`. Maintainers will split out new files as needed. ## Skill Entry Format diff --git a/scripts/validate.sh b/scripts/validate.sh index 035f098..8f92308 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -31,8 +31,8 @@ if [ -n "$dupes" ]; then fi echo "OK: no duplicate names" -# Check no duplicate sources -dupe_sources=$(jq -r '[.skills[].source] | group_by(.) | map(select(length > 1)) | flatten | unique | .[]' "$HUB_FILE") +# Check no duplicate sources (source + skill combo) +dupe_sources=$(jq -r '[.skills[] | (.source + if .skill then "/" + .skill else "" end)] | group_by(.) | map(select(length > 1)) | flatten | unique | .[]' "$HUB_FILE") if [ -n "$dupe_sources" ]; then echo "ERROR: Duplicate skill sources: $dupe_sources" exit 1