modules/home/programs/cli-agents/shared/skills/github-code-search/SKILL.md
Search GitHub code using gh code-search command. Use when looking for reference implementations, code examples, or specific patterns across GitHub repositories. Particularly useful for Nix configurations, language-specific patterns, or learning how others solved similar problems.
npx skillsauth add not-matthias/dotfiles-nix github-code-searchInstall 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.
Search across GitHub's entire codebase using the gh code-search command. This is faster than browsing and helps you find real-world examples of how to structure code, configure tools, or solve problems.
gh CLI installed and authenticated (gh auth login)Use operators and filters to narrow results:
Basic syntax:
gh code-search [query] [flags]
Common operators:
language:nix - Search only in Nix fileslanguage:python - Search in Python filesrepo:owner/repo - Limit to specific repositoryfilename:flake.nix - Search only in files named flake.nixorg:nixos - Search within an organizationstars:>100 - Limit to popular repos (helps avoid noise)Combining operators:
gh code-search 'stdenv.mkDerivation' language:nix repo:nixos/nixpkgs stars:>50
Run the search and review results:
gh code-search 'search query' language:nix --limit 10
Flags:
--limit N - Show first N results (default 30, max 100)--json - Output as JSON for processing--match <field> - Match against: path, symbol, or content (default: content)Each result shows:
Click or copy the URL to examine the full context in your browser.
Search for how others define packages:
# Look for fetchFromGitHub usage
gh code-search 'fetchFromGitHub' language:nix stars:>50 --limit 10
# Find similar packages (e.g., Rust tools)
gh code-search 'rustPlatform.buildRustPackage' language:nix --limit 20
# Find AppImage packaging examples
gh code-search 'appimageTools' language:nix --limit 5
# Systemd service examples
gh code-search 'systemd.services' language:nix org:nixos --limit 10
# Home Manager module examples
gh code-search 'home.packages' language:nix stars:>100 --limit 15
# Browse flakes with specific input patterns
gh code-search 'inputs.nixpkgs' filename:flake.nix stars:>50 --limit 20
# Find flake outputs patterns
gh code-search 'outputs = {' filename:flake.nix --limit 10
# Python package examples
gh code-search 'def setup(' language:python filename:setup.py stars:>100
# Rust build patterns
gh code-search 'cargo.toml' language:toml stars:>50
# Shell script patterns
gh code-search '#!/bin/bash' language:shell --limit 10
Add negative filters to exclude test files or templates:
gh code-search 'pattern' language:nix -filename:test.nix
Find patterns within the NixOS organization (most authoritative):
gh code-search 'stdenv.mkDerivation' language:nix org:nixos --limit 50
Export to JSON and process locally:
gh code-search 'query' language:nix --json | jq '.[] | .url' > results.txt
Issue: Too many irrelevant results
stars:>100 to focus on popular, well-maintained repos. Add org:nixos for authoritative NixOS examples.Issue: Results seem outdated
Issue: Can't find specific syntax
stdenv.mkDerivation vs mkDerivation). Search for similar projects that use the same tool/library.stars:>50 helps surface well-maintained examplesfilename:flake.nix is faster than searching content for specific file typesgh code-search --help - Full command referencetools
Spawn the pi coding agent with a specific model/provider. Use when asked to run pi with a particular model, switch pi's model, use DeepSeek V4 Flash/Pro in pi, or look up pi's --model/--provider/--models CLI flags and thinking-level shorthand.
development
Navigate to directories using zoxide (frecency-based directory jumper). Use when the user says "go to", "navigate to", "cd to", "jump to" a project or directory by nickname/partial name (e.g. "go to my dotfiles", "jump to dot").
tools
Use when manipulating Zellij sessions, creating tabs or panes, sending commands to panes, capturing output, or looking up Zellij CLI commands for terminal multiplexer operations
development
Emulates not-matthias's technical blog writing style. Use when writing blog posts, technical articles, README content, or any long-form technical prose. Produces investigation-driven, first-person narratives with dry humor, practical code examples, and concrete takeaways.