Skip to content

Commit dc481cd

Browse files
authored
Merge pull request #5 from supabase-community/add-agents-md
chore: sync vendored skills from agent-skills releases
2 parents 0b848b5 + 77294de commit dc481cd

4 files changed

Lines changed: 135 additions & 1 deletion

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Sync agent-skills release
2+
3+
on:
4+
repository_dispatch:
5+
types:
6+
- agent_skills_release_published
7+
workflow_dispatch:
8+
inputs:
9+
release_tag:
10+
description: Release tag from supabase/agent-skills (for example, v0.1.0)
11+
required: true
12+
release_version:
13+
description: Optional semver corresponding to the release tag
14+
required: false
15+
commit_sha:
16+
description: Optional source commit SHA for metadata
17+
required: false
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
sync:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Check out repository
29+
uses: actions/checkout@v4
30+
31+
- name: Resolve release metadata
32+
id: release
33+
shell: bash
34+
run: |
35+
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
36+
echo "tag=${{ github.event.client_payload.release_tag }}" >> "$GITHUB_OUTPUT"
37+
echo "version=${{ github.event.client_payload.release_version }}" >> "$GITHUB_OUTPUT"
38+
echo "sha=${{ github.event.client_payload.commit_sha }}" >> "$GITHUB_OUTPUT"
39+
else
40+
echo "tag=${{ inputs.release_tag }}" >> "$GITHUB_OUTPUT"
41+
echo "version=${{ inputs.release_version }}" >> "$GITHUB_OUTPUT"
42+
echo "sha=${{ inputs.commit_sha }}" >> "$GITHUB_OUTPUT"
43+
fi
44+
45+
- name: Download skill release assets
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
mkdir -p /tmp/agent-skills-release
50+
gh release download "${{ steps.release.outputs.tag }}" \
51+
--repo supabase/agent-skills \
52+
--dir /tmp/agent-skills-release \
53+
--pattern "supabase.tar.gz" \
54+
--pattern "supabase-postgres-best-practices.tar.gz"
55+
56+
- name: Replace vendored skills
57+
run: |
58+
rm -rf skills/supabase skills/supabase-postgres-best-practices
59+
mkdir -p skills/supabase skills/supabase-postgres-best-practices
60+
61+
tar -xzf /tmp/agent-skills-release/supabase.tar.gz -C skills/supabase
62+
tar -xzf /tmp/agent-skills-release/supabase-postgres-best-practices.tar.gz -C skills/supabase-postgres-best-practices
63+
64+
- name: Update upstream metadata
65+
shell: bash
66+
run: |
67+
SYNCED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
68+
cat > skills/.upstream.json <<EOF
69+
{
70+
"source_repo": "supabase/agent-skills",
71+
"source_release": "${{ steps.release.outputs.tag }}",
72+
"source_version": "${{ steps.release.outputs.version }}",
73+
"source_commit": "${{ steps.release.outputs.sha }}",
74+
"synced_at": "${SYNCED_AT}",
75+
"managed_paths": [
76+
"skills/supabase",
77+
"skills/supabase-postgres-best-practices"
78+
],
79+
"assets": [
80+
"supabase.tar.gz",
81+
"supabase-postgres-best-practices.tar.gz"
82+
]
83+
}
84+
EOF
85+
86+
- name: Create pull request
87+
uses: peter-evans/create-pull-request@v7
88+
with:
89+
branch: chore/sync-agent-skills-${{ steps.release.outputs.tag }}
90+
delete-branch: true
91+
commit-message: chore: sync skills from agent-skills ${{ steps.release.outputs.tag }}
92+
title: chore: sync skills from agent-skills ${{ steps.release.outputs.tag }}
93+
body: |
94+
## Summary
95+
- sync vendored skills from `supabase/agent-skills`
96+
- update `skills/.upstream.json` with the source release metadata
97+
98+
## Source
99+
- release tag: `${{ steps.release.outputs.tag }}`
100+
- version: `${{ steps.release.outputs.version }}`
101+
- commit: `${{ steps.release.outputs.sha }}`
102+
103+
## Notes
104+
- generated by the `sync-agent-skills` workflow
105+

AGENTS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,13 @@ When adding a new vendor plugin:
8080

8181
## Syncing Skills
8282

83-
The shipped skills in `skills/` are intended to be real vendored files. If they are updated from another upstream authoring repo, sync them into this repo as normal files and review the diff here before release.
83+
The shipped skills in `skills/` are intended to be real vendored files.
84+
85+
- The source of truth for skill content is `supabase/agent-skills`.
86+
- This repo consumes release assets from `supabase/agent-skills`, not a submodule or symlink.
87+
- The sync workflow expects the upstream release to publish:
88+
- `supabase.tar.gz`
89+
- `supabase-postgres-best-practices.tar.gz`
90+
- Synced provenance is tracked in `skills/.upstream.json`.
91+
92+
If skills are updated upstream, use the sync workflow or the repository dispatch event to vendor them into this repo as normal files and review the resulting PR here before merge.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ supabase-plugin/
1616
│ └── marketplace.json
1717
├── .mcp.json
1818
├── AGENTS.md
19+
├── CLAUDE.md
1920
├── README.md
21+
├── .github/workflows/
22+
│ └── sync-agent-skills.yml
2023
└── skills/
24+
├── .upstream.json
2125
├── supabase/
2226
└── supabase-postgres-best-practices/
2327
```
@@ -49,3 +53,4 @@ Then use `/reload-plugins` after edits and verify the namespaced skills:
4953

5054
## Notes
5155
- The root `skills/` directory must contain real files. Do not switch it back to a symlink or submodule-backed path.
56+
- Vendored skills are synced from `supabase/agent-skills` release assets through `.github/workflows/sync-agent-skills.yml`.

skills/.upstream.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"source_repo": "supabase/agent-skills",
3+
"source_release": null,
4+
"source_version": null,
5+
"source_commit": null,
6+
"synced_at": null,
7+
"managed_paths": [
8+
"skills/supabase",
9+
"skills/supabase-postgres-best-practices"
10+
],
11+
"assets": [
12+
"supabase.tar.gz",
13+
"supabase-postgres-best-practices.tar.gz"
14+
]
15+
}

0 commit comments

Comments
 (0)