githublisted
Install: claude install-skill Domek-Labs/stagecrew
# github — git / gh interaction conventions
**Type:** reference / convention
Shared conventions for every stagecrew stage that touches git or GitHub (Implementer, Closer, `/init-agents`). Keeps commit attribution clean and drift-free.
## 1. Writes: prefer `gh` / the API when `.git` is read-only
In a constrained container the local `.git` can be read-only (no `git push`), and tooling like `python3` may be missing.
- **Normal environment:** plain `git` — `git commit`, `git push -u origin <branch>`.
- **Read-only `.git`:** do **not** fight the local push. Use `gh` / the GitHub REST API for the write:
- Commit + push via the Contents API (`gh api --method PUT repos/<slug>/contents/<path>` with base64 content + `branch`), or `gh api` GraphQL `createCommitOnBranch` for multi-file commits.
- Open the PR with `gh pr create` (or `gh api repos/<slug>/pulls`).
- Detect the case first: if `git push` fails with a read-only / permission error, switch to the `gh` path rather than retrying.
## 2. Commit author identity — from AGENTS.md `commit_identity`
The author identity is **not** ambient. It comes from the AGENTS.md `work-issue:` `commit_identity` block (`name` + `email`).
- When `commit_identity` is set, run **before every commit**:
```bash
git config user.name "<commit_identity.name>"
git config user.email "<commit_identity.email>"
```
- When it is absent, fall back to the ambient `git config` (no change).
- **Never** author a loop commit under a company or shared e