# Slang Github

> GitHub operations for the Slang compiler. Clone, branch, PR, issues, CI.

- Skill: `shader-slang/slang-github` (Agent Skill)
- Install (CLI): `npx skillmds@latest add shader-slang/slang-github`
- Raw SKILL.md: https://api.skillmd.com/api/skills/shader-slang/slang-github/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: shader-slang (https://skillmd.com/u/shader-slang)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/shader-slang/slang-github

---


## 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/<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:

```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 <resolved-files>
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 <id> --log-failed
gh run rerun <id> --failed
```

## Issues

```bash
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.

