agentleFS
abhaylaabhayla/claude-best-practices/.claude/skills/github/SKILL.md

github

Skill9 starsChanged 7 months agoMITView on GitHub

Search GitHub repositories by stars/topic/language/owner, search code across GitHub by filename/extension/content, and deep-inspect repos to extract and analyze specific files. Use when searching or discovering repositories, code, or patterns on GitHub.

  • Deletes or force-pushes

166 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use taskflow-inbox-triage, BlueBubbles and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AtomicBot-aiSkill

    taskflow-inbox-triage

    Also in 6 projects that use this

  • jiulingyunSkill

    BlueBubbles

    为Clawdbot构建或更新BlueBubbles外部通道插件(扩展包,REST发送/探测,webhook入站)。

    Also in 20 projects that use this

  • hkyutongSkill

    node-connect

    Diagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps. Use when QR/setup code/manual connect fails, local Wi-Fi works but VPS/tailnet does not, or errors mention pairing required, unauthorized, bootstrap token invalid or expired, gateway.bind, gateway.remote.url, Tailscale, or plugins.entries.device-pair.config.publicUrl.

    Also in 18 projects that use this

  • molt-botSkill

    discord-e2e

    Test Discord with Convex-leased QA bots: check credentials without a Gateway, exercise owned messages, or prove OpenClaw replies, files, threads, reactions, streaming, and typing. Distinguish API and Gateway evidence from manual user interactions.

    Also in 10 projects that use this

  • molt-botSkill

    openclaw-repair-sweep

    Run scoped OpenClaw issue/PR repair campaigns: coordinate workers, prove root causes, and land or close verified work under the requested authority.

    Also in 10 projects that use this

  • clawdbotSkill

    openclaw-performance

    Performance work in OpenClaw: a slow or heavy flow (latency, CPU, memory, SQL, RPC, renders), writing or reviewing a perf PR, or adding a cache. Count the work, delete waste first, cache last.

    Also in 7 projects that use this

  • +2 more from molt-bot

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. 0 are common, 15 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 151 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify GitHub CLI auth before any operation:

    line 47
  2. Very specific:

    If this fails, tell the user to run gh auth login first and HARD-STOP — no mode can proceed without it.

    line 53
  3. Distinctive:

    Search GitHub repositories by keywords, stars, topics, language, owner, and more.

    line 62
  4. Distinctive:

    Only include flags the user specified — omit unset optional params.

    line 98
  5. Distinctive:

    Search for specific code, files, or patterns across all GitHub repositories.

    line 130
  6. Distinctive:

    If results seem incomplete, inform the user:

    line 194
  7. Distinctive:

    Only indexed files are searchable (very large or binary files are excluded)

    line 197
  8. Distinctive:

    After finding repositories via Mode 1 or Mode 2, inspect them to extract and analyze specific files.

    line 204
  9. Very specific:

    If no --files specified, auto-detect interesting files based on the search context:

    line 279
  10. Very specific:

    If user searched for skills → look for /SKILL.md

    line 280
  11. Very specific:

    If user searched for agents → look for /agents/*.md

    line 281
  12. Very specific:

    If user searched for CLAUDE.md → look for /CLAUDE.md

    line 282
  13. Distinctive:

    If user searched for code patterns → look for files matching the search language/extension

    line 283
  14. Distinctive:

    Rate limit awareness: If more than 30 files match, warn the user and ask to narrow the pattern.

    line 292
  15. Distinctive:

    Read matched files with the Read tool, then clean up:

    line 329
  16. Distinctive:

    Size guard: Before cloning, check repo size:

    line 336
  17. Distinctive:

    If >500000 KB (500 MB), warn the user and ask for confirmation before proceeding.

    line 340
  18. Distinctive:

    When the user wants to inspect multiple repos (e.g., "inspect the top 5 from my last search"):

    line 344
  19. Distinctive:

    Use the Agent tool to launch parallel subagents — one per repo

    line 346
  20. Distinctive:

    If the user requests >5 repos, confirm before launching parallel inspections.

    line 364
  21. Very specific:

    When --output <path> is specified, write the full results as a markdown file:

    line 381

“Common” is measured: kept by at least 6 in 10 of the 151 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Search & Discovery Skill

Request: $ARGUMENTS


Determine which mode to use based on the user's request, then follow that section.


Prerequisites

  • Tools/CLIs: gh (GitHub CLI) installed
  • Credentials/env: an authenticated gh session (gh auth login completed)
  • Services/network: reachable api.github.com
  • User inputs & decisions: which mode + target query/repo (parsed from the request); runtime-only confirmations that can't be front-loaded because they depend on probed data — multi-repo inspect >5 repos, deep-clone target >500 MB (CRITICAL RULES 7)

STEP 0: Preflight

Verify GitHub CLI auth before any operation:

gh auth status

If this fails, tell the user to run gh auth login first and HARD-STOP — no mode can proceed without it. No other prerequisite exists (no env vars, no input files); mode-specific runtime confirmations (bulk multi-repo, large deep-clone) are handled at their own step since they depend on data only known after the query runs.


MODE 1: SEARCH REPOS

Search GitHub repositories by keywords, stars, topics, language, owner, and more.

Argument Parsing

Extract from user's natural language or explicit flags:

ParamFlagDefaultDescription
query(positional)(required)Keywords or phrase to search
stars--stars(none)Star filter (e.g., ">50", "100..500")
language--language(none)Programming language filter
topic--topic(none)GitHub topic filter (comma-separated)
owner--owner(none)Filter by owner/org
sort--sortstarsSort by: stars, forks, updated, best-match
order--orderdescSort order: asc, desc
limit--limit20Max results (1-100)
created--created(none)Creation date filter (e.g., ">2024-01-01")
updated--updated(none)Last update filter
archived--archivedfalseInclude archived repos

Execution

gh search repos "<query>" \
  --stars "<stars>" \
  --language "<language>" \
  --topic "<topics>" \
  --owner "<owner>" \
  --sort "<sort>" \
  --order "<order>" \
  --limit <limit> \
  --archived=<archived> \
  --json fullName,description,stargazersCount,language,updatedAt,url,forksCount,license \
  --jq '.[] | {fullName, description, stars: .stargazersCount, language, updated: .updatedAt, url, forks: .forksCount, license: .license.key}'

Only include flags the user specified — omit unset optional params. Never pass empty values.

Output Format

## GitHub Repo Search: "<query>"
Filters: stars:<stars> | language:<language> | topic:<topic> | sort:<sort>
Results: N found

| # | Repository | ⭐ Stars | Language | Updated | Description |
|---|-----------|---------|----------|---------|-------------|
| 1 | owner/repo | 12.3K | Python | 2026-03-01 | Short description... |
| 2 | ... | ... | ... | ... | ... |

Use `/github inspect <repo>` to explore any repository.

Natural Language Examples

User SaysParsed As
"find top python repos for FastAPI testing"query="FastAPI testing", language=python, sort=stars
"search repos about claude code skills with 100+ stars"query="claude code skills", stars=">100", sort=stars
"github repos for rust error handling updated this year"query="rust error handling", updated=">2025-01-01", sort=stars
"find android compose libraries by google"query="android compose", owner=google, sort=stars
"search repos for machine learning in go"query="machine learning", language=go, sort=stars
"find react component libraries with 1000+ stars"query="react components", language=javascript, stars=">1000"

MODE 2: SEARCH CODE

Search for specific code, files, or patterns across all GitHub repositories.

Argument Parsing

Extract from user's natural language or explicit flags:

ParamFlagDefaultDescription
query(positional)(required)Code content to search for
filename--filename(none)Filter by filename (e.g., "SKILL.md", "CLAUDE.md")
extension--extension(none)Filter by file extension (e.g., "py", "rs", "md")
language--language(none)Filter by language (e.g., python, rust, markdown)
owner--owner(none)Filter by owner/org
repo--repo(none)Filter within specific repo(s)
path--path(none)Filter by file path (e.g., ".claude/skills/")
size--size(none)Filter by file size in bytes (e.g., ">1000")
limit--limit20Max results (1-100)

Execution

gh search code "<query>" \
  --filename "<filename>" \
  --extension "<extension>" \
  --language "<language>" \
  --owner "<owner>" \
  --repo "<repo>" \
  --limit <limit> \
  --json path,repository,url,textMatches \
  --jq '.[] | {path, repo: .repository.fullName, url, matches: [.textMatches[].fragment]}'

Only include flags the user specified — omit unset optional params. Never pass empty values.

Output Format

## GitHub Code Search: "<query>"
Filters: filename:<filename> | language:<language> | owner:<owner>
Results: N found

| # | Repository | File Path | Match Preview |
|---|-----------|-----------|---------------|
| 1 | owner/repo | .claude/skills/foo/SKILL.md | ...matching text fragment... |
| 2 | owner/repo2 | agents/bar.md | ...matching text fragment... |

Use `/github inspect <repo> --files "<path>"` to read full file contents.

Natural Language Examples

User SaysParsed As
"search github for SKILL.md files with allowed-tools"query="allowed-tools", filename="SKILL.md"
"find CLAUDE.md files in popular repos"query="CLAUDE.md", filename="CLAUDE.md"
"search for FastAPI dependency injection patterns in python"query="Depends FastAPI", language=python
"find rust error handling with thiserror crate"query="thiserror", language=rust, extension=rs
"search for android compose navigation code"query="NavHost composable", language=kotlin
"find go interfaces for database drivers"query="interface Driver", language=go
"search for Dockerfile best practices"query="HEALTHCHECK", filename="Dockerfile"
"find terraform modules for AWS Lambda"query="aws_lambda_function", extension=tf

Limitations

If results seem incomplete, inform the user:

  • GitHub code search uses a legacy engine via API — results may differ from github.com
  • Regex is not supported via the API
  • Only indexed files are searchable (very large or binary files are excluded)
  • Suggest running with gh search code "<query>" --web to open results in browser for full search capabilities

MODE 3: DEEP INSPECT

After finding repositories via Mode 1 or Mode 2, inspect them to extract and analyze specific files.

Argument Parsing

ParamFlagDefaultDescription
repo(positional)(required)Repository as owner/repo or full GitHub URL
depth--shallow / --deeptargetedInspection depth level
files--files(none)Specific files/patterns to fetch (targeted mode)
grep--grep(none)Search pattern for deep mode
glob--glob(none)File glob pattern for deep mode
branch--branchdefault branchBranch to inspect
output--output(none)Path to write results as markdown file

Input Normalization

Accept various repo formats:

  • owner/repo → use directly
  • https://github.com/owner/repo → extract owner/repo
  • https://github.com/owner/repo/tree/main/path → extract repo + path as --files hint

Depth Level: SHALLOW

Fetch repo metadata and README only. Fastest option.

# Metadata
gh api repos/OWNER/REPO --jq '{
  name: .full_name,
  description: .description,
  stars: .stargazers_count,
  forks: .forks_count,
  language: .language,
  license: .license.key,
  topics: .topics,
  created: .created_at,
  updated: .pushed_at,
  open_issues: .open_issues_count,
  default_branch: .default_branch,
  archived: .archived
}'

# README
gh api repos/OWNER/REPO/readme --jq '.content' | base64 -d

Output:

## Repo: owner/repo
⭐ 12.3K | 🍴 450 | Language: Python | License: MIT
Topics: claude-code, skills, ai-agents
Created: 2025-01-15 | Last push: 2026-03-10
Open issues: 23 | Archived: No

### README (truncated to first 100 lines)
[README content]

Depth Level: TARGETED (default)

Fetch specific files by path or pattern. Uses GitHub Contents API — no cloning required.

Step 1 — List repository tree:

gh api repos/OWNER/REPO/git/trees/BRANCH?recursive=1 \
  --jq '.tree[] | select(.type=="blob") | .path'

Step 2 — Match files against user's --files patterns:

Filter the tree listing using the user's patterns. Patterns support:

  • Exact paths: SKILL.md, .claude/settings.json
  • Wildcards: *.md, agents/*.md, **/*.py
  • Directory prefixes: .claude/skills/ (matches all files under it)

If no --files specified, auto-detect interesting files based on the search context:

  • If user searched for skills → look for **/SKILL.md
  • If user searched for agents → look for **/agents/*.md
  • If user searched for CLAUDE.md → look for **/CLAUDE.md
  • If user searched for code patterns → look for files matching the search language/extension
  • Otherwise → show the tree listing and ask the user what to inspect

Step 3 — Fetch matched files:

# For each matched file
gh api repos/OWNER/REPO/contents/FILE_PATH?ref=BRANCH --jq '.content' | base64 -d

Rate limit awareness: If more than 30 files match, warn the user and ask to narrow the pattern. Fetch max 30 files per invocation to avoid hitting API rate limits.

Output:

## Inspecting: owner/repo (targeted)
Branch: main | Matched files: 5/342 total

### File: .claude/skills/implement/SKILL.md (2.1 KB)
[full file content]

### File: .claude/skills/fix-loop/SKILL.md (1.8 KB)
[full file content]

---
Inspected 5 files from owner/repo.

Depth Level: DEEP

Shallow clone the repo and run local search across all files.

# Clone with depth 1 (minimal history)
TMPDIR=$(mktemp -d)
gh repo clone OWNER/REPO "$TMPDIR/repo" -- --depth 1 --branch BRANCH 2>/dev/null

Then use Glob and Grep tools on $TMPDIR/repo/ to find files matching --glob and --grep patterns:

# Find files by glob
Glob: pattern="**/*.md" path="$TMPDIR/repo"

# Search content by grep
Grep: pattern="allowed-tools" path="$TMPDIR/repo" glob="*.md"

Read matched files with the Read tool, then clean up:

rm -rf "$TMPDIR"

Output: Same format as Targeted, but potentially more files since full repo is searchable.

Size guard: Before cloning, check repo size:

gh api repos/OWNER/REPO --jq '.size'

If >500000 KB (500 MB), warn the user and ask for confirmation before proceeding.

Multi-Repo Inspect

When the user wants to inspect multiple repos (e.g., "inspect the top 5 from my last search"):

  1. Use the Agent tool to launch parallel subagents — one per repo
  2. Each subagent runs the inspect workflow independently
  3. Aggregate results into a single comparison report:
## Multi-Repo Comparison: "claude code skills"
Inspected 5 repositories

| Repo | Stars | Files Found | Notable Patterns |
|------|-------|-------------|-----------------|
| owner/repo1 | 12.3K | 24 skills | Comprehensive, mode-based |
| owner/repo2 | 3.1K | 8 skills | Focused, minimal |
| ... | ... | ... | ... |

### Detailed Results
[Per-repo output as above]

If the user requests >5 repos, confirm before launching parallel inspections.

Natural Language Examples

User SaysParsed As
"inspect anthropics/skills"repo=anthropics/skills, depth=targeted, auto-detect files
"read all SKILL.md files from owner/repo"repo=owner/repo, depth=targeted, files="**/SKILL.md"
"deep inspect this repo for python patterns"repo=..., depth=deep, glob="**/*.py"
"show me the README of owner/repo"repo=owner/repo, depth=shallow
"inspect the top 3 repos from my last search"multi-repo, depth=targeted
"clone owner/repo and search for error handling"repo=owner/repo, depth=deep, grep="error handling"
"look at the kotlin files in owner/repo"repo=owner/repo, depth=targeted, files="**/*.kt"
"what's in the .claude directory of owner/repo"repo=owner/repo, depth=targeted, files=".claude/**"

File Export

When --output <path> is specified, write the full results as a markdown file:

Write: file_path="<path>" content="<formatted results>"

Report: Results written to <path>


CRITICAL RULES

  1. No hardcoded content types — This skill searches for ANY content on GitHub. Never assume the user is searching for skills, agents, or Claude-specific files. Parse their actual query.
  2. Rate limit awareness — GitHub API has rate limits (5000 requests/hour authenticated, 60/hour unauthenticated). If gh api returns 403/rate-limit errors, report to the user and suggest gh auth login or waiting.
  3. Auth check first — Before any operation, verify gh auth status. If unauthenticated, tell the user to run gh auth login.
  4. No credential exposure — Never log or display tokens, API keys, or auth headers.
  5. Respect --limit — Never fetch more results than requested. Default 20 for search, max 100. Max 30 files for targeted inspect.
  6. Clean up deep clones — Always remove temp directories after deep inspect completes, even on errors.
  7. Confirm before bulk operations — If multi-repo inspect would hit >5 repos or deep inspect targets a repo >500 MB, confirm with the user first.
  8. Preserve search context — When the user says "inspect the top 3" or "look at the first one", reference results from the most recent Mode 1/Mode 2 output in this session.
  9. Omit unused flags — Only include gh CLI flags the user specified. Never pass empty values — this causes search errors.
  10. Suggest next steps — After Mode 1/2 results, suggest /github inspect <repo>. After Mode 3, suggest what the user can do with the extracted content.

QUICK REFERENCE

User SaysMode
"search github repos for..." / "find top repos..." / "github repos about..."Mode 1: Search Repos
"search github code for..." / "find files containing..." / "search for SKILL.md files"Mode 2: Search Code
"inspect owner/repo" / "read files from..." / "clone and search..." / "show me the README"Mode 3: Deep Inspect
"inspect the top N from my search" / "compare these repos"Mode 3: Multi-Repo Inspect

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.