| name | slang-github |
| license | MIT |
| description | GitHub operations for the Slang compiler. Clone, branch, PR, issues, CI. |
| provides | ["repo.read","repo.write","repo.pr","issues.read","issues.write","ci.rerun"] |
| allowed-tools | Bash(git:*), Bash(gh:*), Read, Grep, Glob |
From project
Drawn from: repos/slang/CLAUDE.md (PR workflow), repos/slang/CONTRIBUTING.md (contribution process, fork model, code review, labeling).
Repository
Clone with tags
Tags are required for the build system. After cloning, add upstream and fetch tags:
git remote add upstream https://github.com/shader-slang/slang.git
git fetch --tags upstream
git push --tags origin
PR process
- Fork -> clone -> branch (
feature/description)
- Implement, test, format (
./extras/formatting.sh)
- Push to fork, create PR against
shader-slang/slang:master
- Label:
pr: non-breaking (default) or pr: breaking (ABI/language breaking)
- PR requires review approval + all CI workflows passing
- Squash merge -- rewrite final commit message to be descriptive
Autonomous PR creation: Create PRs without asking for confirmation. If tests pass and formatting is clean, open the PR immediately via gh pr create. Include: what changed, why, and test results in the PR body. Only stop and notify the user if CI fails after 2 rerun attempts.
gh pr create vs REST — decided by the PR's base repo. Normal PRs (base = shader-slang/slang, including a head branch on the slang-coworkers/slang fork) → use gh pr create; it routes via GraphQL/App token, which has write on shader-slang. Only a cross-fork PR whose base is a contributor's fork (e.g. zangold-nv/slang) must use REST — gh api -X POST repos/<owner>/slang/pulls -f head="slang-coworkers:<branch>" -f base="<their-branch>" … — because gh pr create (GraphQL) gets the App token there and 403s; REST /repos/* gets the nv-slang-bot user PAT that can open it.
During review, push follow-up commits (do not rebase after PR creation). Sync with upstream via merge:
git fetch upstream master
git merge upstream/master
git submodule update --recursive
Formatting bot: Comment /format on the PR to auto-fix formatting via bot PR. Comment /regenerate-toc for user-guide table of contents.
Conflict handling
On merge conflict:
- Identify conflicting files:
git diff --name-only --diff-filter=U
- For conflicts in generated files: take
ours where the file is regenerated by a build step
- For conflicts in source files: apply the change that is additive (preserves both sides) where possible
- If the correct resolution is ambiguous, stop and notify the user with the specific conflict
git fetch upstream master
git merge upstream/master
git submodule update --recursive
git add <resolved-files>
git merge --continue
CI
Runs on self-hosted GPU runners (Windows, Linux, macOS). Key commands:
gh run list --repo shader-slang/slang --workflow=ci.yml --limit 5
gh run view <id> --log-failed
gh run rerun <id> --failed
Issues
gh issue list --repo shader-slang/slang
gh issue view <number> --repo shader-slang/slang
gh issue create --repo shader-slang/slang --title "..." --body "..."
GitHub API rate limits
CMake configure fetches from GitHub REST API. If rate-limited, pass -DSLANG_GITHUB_TOKEN=<token> to cmake.