Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ jobs:
run: mint --version && test -f docs.json

- name: Check for broken links
# Parses every .md/.mdx as MDX — including the generated skills under
# .mintlify/skills/, which the Mintlify platform also MDX-parses at deploy
# time. Keeping them in this check surfaces an unparseable generated skill
# here (with file:line) instead of as an opaque deployment failure. Skills
# must therefore stay MDX-clean: no HTML comments, no bare < > or { }
# outside code spans (the GENERATED marker lives inside the frontmatter
# as YAML comments for this reason).
run: mint broken-links
92 changes: 92 additions & 0 deletions .github/workflows/sync-skills.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Sync agent skills from sei-skill

# The installable agent skills at .mintlify/skills/<name>/SKILL.md are GENERATED
# from the canonical sei-skill repo (github.com/sei-protocol/sei-skill) by
# scripts/build-mintlify-skills.mjs — they are never hand-authored here. This
# workflow regenerates them and opens a PR for review (generation is LLM-assisted
# and non-deterministic, so a human reviews before merge).
#
# Triggers:
# - workflow_dispatch (manual; optionally pass a sei-skill ref)
# - repository_dispatch (sei-skill's release workflow sends type: sei-skill-release
# with client_payload.ref = the released tag/sha)
#
# Requires repo secret: ANTHROPIC_API_KEY

on:
workflow_dispatch:
inputs:
ref:
description: 'sei-skill ref to generate from'
required: false
default: 'main'
repository_dispatch:
types: [sei-skill-release]

permissions:
contents: write
pull-requests: write

defaults:
run:
shell: bash

jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout docs
uses: actions/checkout@v4

- name: Checkout sei-skill (canonical source)
uses: actions/checkout@v4
with:
repository: sei-protocol/sei-skill
ref: ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
path: .sei-skill-src

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install generator dependency
run: npm install --no-save @anthropic-ai/sdk

- name: Record sei-skill revision
id: src
run: echo "ref=$(git -C .sei-skill-src rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Regenerate skills from sei-skill
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
SEI_SKILL_DIR: ${{ github.workspace }}/.sei-skill-src/skill
SEI_SKILL_REF: ${{ steps.src.outputs.ref }}
run: node scripts/build-mintlify-skills.mjs --write

- name: Clean up source + build dirs
run: rm -rf .sei-skill-src dist

- name: Open PR if skills changed
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
# Stage first: `git diff --quiet` ignores untracked files, so a brand-new
# skill (or a first run into an empty .mintlify/skills/) would be missed.
git add .mintlify/skills
if git diff --cached --quiet; then
echo 'No skill changes; nothing to do.'
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sync succeeds without generation

Medium Severity

The sync job always runs build-mintlify-skills.mjs --write, but that script only writes .mintlify/skills/ when ANTHROPIC_API_KEY is set. Without the secret, generation is skipped, git diff --cached is empty, and the workflow exits 0 as if nothing were wrong.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 03db520. Configure here.

fi
BRANCH="chore/sync-skills-${{ steps.src.outputs.ref }}"
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git checkout -b "$BRANCH"
git commit -m "chore(skills): regenerate from sei-skill@${{ steps.src.outputs.ref }}"
git push -f origin "$BRANCH"
gh pr create \
--title "chore(skills): regenerate from sei-skill@${{ steps.src.outputs.ref }}" \
--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." \
|| echo 'PR already exists for this branch; pushed update.'
22 changes: 22 additions & 0 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ jobs:
- name: Validate docs.json is valid JSON
run: jq empty docs.json

- name: Enforce generated-only agent skills
run: |
set -euo pipefail
# .mintlify/skills/ is GENERATED from sei-protocol/sei-skill by
# scripts/build-mintlify-skills.mjs (see .github/workflows/sync-skills.yml).
# Hand-authored skill content is not allowed in this repo — every
# SKILL.md must carry the generation marker.
shopt -s nullglob
bad=0
count=0
for f in .mintlify/skills/*/SKILL.md; do
count=$((count+1))
if ! grep -q 'GENERATED FROM sei-protocol/sei-skill' "$f"; then
echo "::error file=$f::Missing 'GENERATED FROM sei-protocol/sei-skill' marker — edit the source in sei-skill and regenerate; do not hand-author skills here."
bad=$((bad+1))
fi
done
if [[ "$bad" -gt 0 ]]; then
exit 1
fi
echo "All ${count} skill(s) carry the generated-from-sei-skill marker."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI allows zero skills

Medium Severity

The new “generated-only agent skills” step only checks markers on files that exist. With nullglob, an empty or missing .mintlify/skills/*/SKILL.md set leaves count at 0 and the job still exits successfully, so the registry can ship with no installable skills.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 03db520. Configure here.


- name: Verify all referenced pages exist
run: |
set -euo pipefail
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
node_modules/
.mintlify/
# Mintlify uses .mintlify/ as a local build cache, but .mintlify/skills/ holds
# the hosted agent skills (SKILL.md) that must ship — keep that subtree tracked.
.mintlify/*
!.mintlify/skills/
.next/
.vercel/
dist/
Expand Down
Loading
Loading