Repository navigation
ci: add sync-skills workflow - #1806
Conversation
Signed-off-by: oliver könig <okoenig@nvidia.com>
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — the file is a minimal, well-patterned delegation to a versioned reusable workflow with no P0/P1 issues. The only finding is a P2 suggestion to add a concurrency group to avoid potential push conflicts on rapid successive pushes. All other aspects of the file are consistent with the repo's established workflow conventions. No files require special attention; the single changed file is straightforward. Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub (main branch)
participant Caller as sync-skills.yml
participant Template as _sync_skills.yml@v0.91.0
participant Repo as Repository (main)
GH->>Caller: push to main (skills/** or AGENTS.md changed) OR workflow_dispatch
Caller->>Template: uses reusable workflow, secrets: PAT
Template->>Repo: ln -s skills/ .claude/skills
Template->>Repo: ln -s skills/ .agents/skills
Template->>Repo: ln -s AGENTS.md CLAUDE.md (if exists)
Template->>Repo: git commit and push symlinks back to main
Reviews (3): Last reviewed commit: "Merge branch 'main' into ko3n1g/ci/sync-..." | Re-trigger Greptile |
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add .claude/skills .agents/skills CLAUDE.md |
There was a problem hiding this comment.
git add CLAUDE.md fails when AGENTS.md is absent
The preceding step guards symlink creation with [ -f AGENTS.md ] && … || true, so when the workflow is triggered by a skills/** change only (and AGENTS.md has never been committed to the repo), CLAUDE.md is never created. The unconditional git add CLAUDE.md then exits with fatal: pathspec 'CLAUDE.md' did not match any files, aborting the whole step before the skills symlinks are committed.
| git add .claude/skills .agents/skills CLAUDE.md | |
| git add .claude/skills .agents/skills | |
| [ -f CLAUDE.md ] && git add CLAUDE.md || true |
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.PAT }} | ||
| ref: ${{ github.head_ref || github.ref_name }} |
There was a problem hiding this comment.
github.head_ref is always empty for these event types
github.head_ref is only populated for pull_request events. For both push and workflow_dispatch (the only triggers here), it is always an empty string, so the || github.ref_name fallback is unconditional. The github.head_ref reference is dead code in this context and may confuse future readers.
| ref: ${{ github.head_ref || github.ref_name }} | |
| ref: ${{ github.ref_name }} |
Signed-off-by: oliver könig <okoenig@nvidia.com>
Summary
This PR adds
.github/workflows/sync-skills.yml, which keeps agent-tool directories in sync whenever theskills/directory orAGENTS.mdchanges onmain.What the workflow does:
mainwhenskills/**orAGENTS.mdis modified (also available viaworkflow_dispatch)skills/→.claude/skillsand.agents/skillsso both Claude Code and the Agents framework discover the same skill guidesAGENTS.md→CLAUDE.mdso Claude Code picks up the project's agent instructions automaticallyBackground
There is no common standard for markdown file discovery across agent frameworks — each tool looks in a different place. This PR addresses that gap by coupling the generic
AGENTS.md/skills/layout with a sync job that runs on push tomain, so every agent runtime finds the files it expects without per-framework duplication.