Skip to content

Commit c71d0c4

Browse files
xuyushun441-sysos-zhuangclaude
authored
ci(skills): gate PRs on skill-docs being generated from SKILL.md frontmatter (#1844)
Adds a `Check Skill Docs` job to ci.yml, gated (via paths-filter) on changes to `skills/**`, `content/docs/guides/skills.mdx`, or the generator script. It runs `pnpm --filter @objectstack/spec check:skill-docs`, which fails if the README index or guide tables/cards drift from each SKILL.md frontmatter — closing the loop so the catalog can never silently go stale again. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7a103d4 commit c71d0c4

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

.changeset/ci-check-skill-docs.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
---
3+
4+
ci: add a `Check Skill Docs` job that runs `check:skill-docs` on PRs touching
5+
`skills/**`, the skills guide, or the generator — failing if the generated
6+
README/guide listings drift from the `SKILL.md` frontmatter. CI-only, no
7+
package change.

.github/workflows/ci.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
outputs:
1818
docs: ${{ steps.changes.outputs.docs }}
1919
core: ${{ steps.changes.outputs.core }}
20+
skilldocs: ${{ steps.changes.outputs.skilldocs }}
2021
steps:
2122
- name: Checkout repository
2223
uses: actions/checkout@v6
23-
24+
2425
- uses: dorny/paths-filter@v4
2526
id: changes
2627
with:
@@ -30,6 +31,11 @@ jobs:
3031
- 'content/**'
3132
- 'pnpm-lock.yaml'
3233
- '.github/workflows/ci.yml'
34+
skilldocs:
35+
- 'skills/**'
36+
- 'content/docs/guides/skills.mdx'
37+
- 'packages/spec/scripts/build-skill-docs.ts'
38+
- '.github/workflows/ci.yml'
3339
core:
3440
- 'packages/**'
3541
- 'examples/**'
@@ -224,3 +230,42 @@ jobs:
224230

225231
- name: Build Docs
226232
run: pnpm --filter @objectstack/docs build
233+
234+
check-skill-docs:
235+
name: Check Skill Docs
236+
needs: filter
237+
if: needs.filter.outputs.skilldocs == 'true'
238+
runs-on: ubuntu-latest
239+
permissions:
240+
contents: read
241+
242+
steps:
243+
- name: Checkout repository
244+
uses: actions/checkout@v6
245+
246+
- name: Setup Node.js
247+
uses: actions/setup-node@v6
248+
with:
249+
node-version: '20'
250+
251+
- name: Enable Corepack
252+
run: corepack enable
253+
254+
- name: Get pnpm store directory
255+
shell: bash
256+
run: |
257+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
258+
259+
- name: Setup pnpm cache
260+
uses: actions/cache@v5
261+
with:
262+
path: ${{ env.STORE_PATH }}
263+
key: ${{ runner.os }}-pnpm-store-v3-${{ hashFiles('**/pnpm-lock.yaml') }}
264+
restore-keys: |
265+
${{ runner.os }}-pnpm-store-v3-
266+
267+
- name: Install dependencies
268+
run: pnpm install --frozen-lockfile
269+
270+
- name: Check skill docs are generated from SKILL.md frontmatter
271+
run: pnpm --filter @objectstack/spec check:skill-docs

0 commit comments

Comments
 (0)