--- 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 - **URL:** https://github.com/shader-slang/slang - **Clone:** `git clone --recursive --tags https://github.com/shader-slang/slang.git` - **Discussions:** https://github.com/shader-slang/slang/discussions - **Discord:** https://khr.io/slangdiscord ## Clone with tags Tags are required for the build system. After cloning, add upstream and fetch tags: ```bash git remote add upstream https://github.com/shader-slang/slang.git git fetch --tags upstream git push --tags origin ``` ## PR process 1. Fork -> clone -> branch (`feature/description`) 2. Implement, test, format (`./extras/formatting.sh`) 3. Push to fork, create PR against `shader-slang/slang:master` 4. Label: `pr: non-breaking` (default) or `pr: breaking` (ABI/language breaking) 5. PR requires review approval + all CI workflows passing 6. 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//slang/pulls -f head="slang-coworkers:" -f base="" …` — 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: ```bash 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: 1. Identify conflicting files: `git diff --name-only --diff-filter=U` 2. For conflicts in generated files: take `ours` where the file is regenerated by a build step 3. For conflicts in source files: apply the change that is additive (preserves both sides) where possible 4. If the correct resolution is ambiguous, stop and notify the user with the specific conflict ```bash git fetch upstream master git merge upstream/master git submodule update --recursive # resolve conflicts, then: git add git merge --continue ``` ## CI Runs on self-hosted GPU runners (Windows, Linux, macOS). Key commands: ```bash gh run list --repo shader-slang/slang --workflow=ci.yml --limit 5 gh run view --log-failed gh run rerun --failed ``` ## Issues ```bash gh issue list --repo shader-slang/slang gh issue view --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=` to cmake. ## More Slang skills Specialized skills live in [shader-slang/slang-skills](https://github.com/shader-slang/slang-skills) (needs `gh` CLI ≥ 2.90). Browse with `gh skill search slang --owner shader-slang`, preview with `gh skill preview shader-slang/slang-skills `, install with `gh skill install shader-slang/slang-skills `; an installed skill is available immediately as `/skill-name` and persists across sessions.