Skip to content

Commit fc092b2

Browse files
Merge pull request #88 from sei-protocol/docs/agent-skills-registry-and-templates
feat(docs): Agent Skills registry and Templates gallery (rebuild of #36)
2 parents b8f23a2 + 239721b commit fc092b2

25 files changed

Lines changed: 3485 additions & 9 deletions

File tree

‎.github/workflows/link-check.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,11 @@ jobs:
2828
run: mint --version && test -f docs.json
2929

3030
- name: Check for broken links
31+
# Parses every .md/.mdx as MDX — including the generated skills under
32+
# .mintlify/skills/, which the Mintlify platform also MDX-parses at deploy
33+
# time. Keeping them in this check surfaces an unparsable generated skill
34+
# here (with file:line) instead of as an opaque deployment failure. Skills
35+
# must therefore stay MDX-clean: no HTML comments, no bare < > or { }
36+
# outside code spans (the GENERATED marker lives inside the frontmatter
37+
# as YAML comments for this reason).
3138
run: mint broken-links

‎.github/workflows/sync-skills.yml‎

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Sync agent skills from sei-skill
2+
3+
# The installable agent skills at .mintlify/skills/<name>/SKILL.md are GENERATED
4+
# from the canonical sei-skill repo (github.com/sei-protocol/sei-skill) by
5+
# scripts/build-mintlify-skills.mjs — they are never hand-authored here. This
6+
# workflow regenerates them and opens a PR for review (generation is LLM-assisted
7+
# and non-deterministic, so a human reviews before merge).
8+
#
9+
# Triggers:
10+
# - workflow_dispatch (manual; optionally pass a sei-skill ref)
11+
# - repository_dispatch (sei-skill's release workflow sends type: sei-skill-release
12+
# with client_payload.ref = the released tag/sha)
13+
#
14+
# Requires repo secret ANTHROPIC_API_KEY and repo variable ANTHROPIC_MODEL (a
15+
# current model ID).
16+
17+
on:
18+
workflow_dispatch:
19+
inputs:
20+
ref:
21+
description: 'sei-skill ref to generate from'
22+
required: false
23+
default: 'main'
24+
repository_dispatch:
25+
types: [sei-skill-release]
26+
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
31+
defaults:
32+
run:
33+
shell: bash
34+
35+
jobs:
36+
sync:
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 20
39+
steps:
40+
- name: Checkout docs
41+
uses: actions/checkout@v4
42+
43+
- name: Checkout sei-skill (canonical source)
44+
uses: actions/checkout@v4
45+
with:
46+
repository: sei-protocol/sei-skill
47+
ref: ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
48+
path: .sei-skill-src
49+
50+
- name: Set up Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: '20'
54+
55+
- name: Install generator dependency
56+
run: npm install --no-save @anthropic-ai/sdk@0.129.0
57+
58+
- name: Record sei-skill revision
59+
id: src
60+
run: echo "ref=$(git -C .sei-skill-src rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
61+
62+
- name: Regenerate skills from sei-skill
63+
env:
64+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
65+
ANTHROPIC_MODEL: ${{ vars.ANTHROPIC_MODEL }}
66+
SEI_SKILL_DIR: ${{ github.workspace }}/.sei-skill-src/skill
67+
SEI_SKILL_REF: ${{ steps.src.outputs.ref }}
68+
run: node scripts/build-mintlify-skills.mjs --write
69+
70+
- name: Clean up source + build dirs
71+
run: rm -rf .sei-skill-src dist
72+
73+
# PRs opened with GITHUB_TOKEN don't trigger other workflows, so the sync PR
74+
# never runs validate-docs.yml or link-check.yml. Run their skill checks here.
75+
- name: Validate regenerated skills
76+
run: |
77+
node scripts/check-skills.mjs
78+
npx --yes mint@4.2.952 broken-links
79+
80+
- name: Open PR if skills changed
81+
env:
82+
GH_TOKEN: ${{ github.token }}
83+
run: |
84+
set -euo pipefail
85+
# Stage first: `git diff --quiet` ignores untracked files, so a brand-new
86+
# skill (or a first run into an empty .mintlify/skills/) would be missed.
87+
git add .mintlify/skills
88+
if git diff --cached --quiet; then
89+
echo 'No skill changes; nothing to do.'
90+
exit 0
91+
fi
92+
BRANCH="chore/sync-skills-${{ steps.src.outputs.ref }}"
93+
# A reviewer may have pushed fixups to an open sync PR for this ref;
94+
# a force-push would silently discard them.
95+
if [[ -n "$(gh pr list --head "$BRANCH" --state open --json number --jq '.[].number')" ]]; then
96+
echo "An open PR already syncs sei-skill@${{ steps.src.outputs.ref }}; leaving it untouched."
97+
exit 0
98+
fi
99+
git config user.name 'github-actions[bot]'
100+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
101+
git checkout -b "$BRANCH"
102+
git commit -m "chore(skills): regenerate from sei-skill@${{ steps.src.outputs.ref }}"
103+
# Overwrites a leftover branch from a closed sync PR for the same ref.
104+
git push -f origin "$BRANCH"
105+
new_pr=$(gh pr create \
106+
--title "chore(skills): regenerate from sei-skill@${{ steps.src.outputs.ref }}" \
107+
--body "Automated regeneration of \`.mintlify/skills/\` from [sei-protocol/sei-skill](https://github.com/sei-protocol/sei-skill)@${{ steps.src.outputs.ref }} via \`scripts/build-mintlify-skills.mjs\`. These are generated artifacts — review for quality before merge.")
108+
# Close open sync PRs for older refs, so two PRs never rewrite the same skills.
109+
# Their branches stay, so a reviewer's fixups there can still be ported.
110+
gh pr list --state open --limit 100 --json number,headRefName |
111+
jq -r --arg branch "$BRANCH" '.[] | select((.headRefName | startswith("chore/sync-skills-")) and .headRefName != $branch) | .number' |
112+
while read -r number; do
113+
gh pr close "$number" --comment "Superseded by $new_pr, which syncs sei-skill@${{ steps.src.outputs.ref }}. This branch is kept, so any fixups here can be ported."
114+
done

‎.github/workflows/validate-docs.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- name: Validate docs.json is valid JSON
1818
run: jq empty docs.json
1919

20+
- name: Enforce generated-only agent skills
21+
run: node scripts/check-skills.mjs
22+
2023
- name: Validate snippet theme defaults
2124
run: node scripts/check-snippet-theme-default.mjs
2225

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.DS_Store
22
node_modules/
3-
.mintlify/
3+
# Mintlify uses .mintlify/ as a local build cache, but .mintlify/skills/ holds
4+
# the hosted agent skills (SKILL.md) that must ship — keep that subtree tracked.
5+
.mintlify/*
6+
!.mintlify/skills/
47
.next/
58
.vercel/
69
dist/

‎.mintignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ STYLE_GUIDE.md
99
# Draft content
1010
drafts/
1111
*.draft.mdx
12+
13+
# Local output of scripts/build-mintlify-skills.mjs (gitignored)
14+
dist/

0 commit comments

Comments
 (0)