agents/skills/nix-github-rate-limit/SKILL.md
Prevents and handles GitHub API rate limits during Nix commands. Use when running nix flake, nix run, nix build, nix shell, or comma against GitHub-backed inputs.
npx skillsauth add ryoppippi/dotfiles nix-github-rate-limitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill before running Nix commands that may fetch GitHub-backed flakes or packages, especially nix flake update, nix run github:..., nix run nixpkgs#..., nix build, nix shell, and comma.
Prefer ephemeral token injection from GitHub CLI. Do not write GitHub tokens to nix.conf, repository files, skill files, shell config, or command arguments.
Use command substitution inside NIX_CONFIG for a single command when gh is already authenticated. Shell history records the literal command substitution, not the expanded token:
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix flake update
If ghtkn is configured and a short-lived GitHub App user token is preferred:
env NIX_CONFIG="access-tokens = github.com=$(ghtkn get)" nix flake update
If GITHUB_TOKEN is already present in the environment, bridge it into Nix's documented access-tokens setting without exposing the token value in the command text:
env NIX_CONFIG="access-tokens = github.com=$GITHUB_TOKEN" nix flake update
Do not create GITHUB_TOKEN by pasting a raw token into the terminal or an agent tool call.
For this dotfiles repo:
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix run .#build
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix run .#switch
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix run .#update
For missing tool execution:
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix run nixpkgs#<package> -- <args>
env NIX_CONFIG="access-tokens = github.com=$(gh auth token)" nix shell nixpkgs#<package> --command <command>
If the command is a Nix command that may touch GitHub, check whether gh is available and authenticated:
command -q gh; and gh auth status
If GITHUB_TOKEN is already set, run the Nix command with NIX_CONFIG="access-tokens = github.com=$GITHUB_TOKEN".
If gh is authenticated, run the Nix command with NIX_CONFIG="access-tokens = github.com=$(gh auth token)".
If ghtkn is configured and the user prefers short-lived GitHub App tokens, use NIX_CONFIG="access-tokens = github.com=$(ghtkn get)".
If no safe token source is available, run the command normally unless the user explicitly wants to authenticate first.
If a GitHub API rate limit error appears, retry once with the safest available NIX_CONFIG wrapper.
$(gh auth token) or $(ghtkn get) inside the command the user runs.$GITHUB_TOKEN; do not assign the raw value in the command.env NIX_CONFIG="access-tokens = github.com=ghp_..." ....--access-tokens "github.com=$(gh auth token)" because command arguments can be exposed via process listings.~/.config/nix/nix.conf, /etc/nix/nix.conf, repository files, or dotfiles by default.NIX_CONFIG keeps the token out of the command arguments, but environment variables can still be visible to sufficiently privileged local processes. Prefer it only for short-lived commands.GITHUB_TOKEN is already provided by CI or a controlled environment, Nix may use it, but do not create or persist it just for local interactive use.tools
Resolves missing CLI tools. Use when a command is unavailable, a shell reports command not found, or a tool must be run without installing it globally.
development
Guides t-wada Red-Green-Refactor TDD. Use when implementing features, fixing bugs, or refactoring logic with strict test-first development.
documentation
Guides agent-skill creation and updates following Anthropic's SKILL.md best practices. Use when adding or editing skills under `agents/skills/`, writing SKILL.md frontmatter, references, or skill routing.
tools
Reviews React Server/Client Component boundaries against Next.js and React docs. Use when auditing `'use client'` placement or splitting components for proper RSC behaviour.