github-code-search
Skill47 starsChanged 4 months agoMITView on GitHub
Use when you need real-world implementation examples or cross-repository context — search GitHub's global code index with the built-in MCP tools and reuse the results as grounded context.
In this repository111 other files it gives its agents.
- AGENTS.mdAGENTS.md
- COPILOT-INSTRUCTIONS.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- ai-visibilitySkill
- content-strategySkill
- seoSkill
- actions-debuggingSkill
- agentic-engineeringSkill
- autopilot-patternsSkill
- background-agentSkill
- context-primeSkill
- copilot-memorySkill
- cross-session-memorySkill
- ecosystem-intakeSkill
- fleet-parallelSkill
- github-codespaces-efficiencySkill
- github-issue-triageSkill
- github-pr-workflowSkill
- ide-switchingSkill
- knowledge-curatorSkill
- mcp-builderSkill
- mcp-ecosystemSkill
- multi-model-strategySkill
- plan-mode-masterySkill
- scope-guardSkill
- session-managementSkill
- stack-detectorSkill
- sub-agent-sandboxingSkill
- task-intake-routerSkill
- team-plannerSkill
- token-cost-optimizerSkill
- api-and-interface-designSkill
- code-reviewSkill
- context-engineeringSkill
- cpp-debuggingSkill
- deprecation-and-migrationSkill
- diagnoseSkill
- fix-build-errorsSkill
- fix-github-issueSkill
- implementSkill
- improve-codebase-architectureSkill
- nestjs-prismaSkill
- nextjs-prismaSkill
- performance-optimizationSkill
- pr-multi-perspective-reviewSkill
- prototypeSkill
- react-vitestSkill
- receiving-code-reviewSkill
- refactor-cleanSkill
- reviewSkill
- skill-creatorSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- zoom-outSkill
- add-to-changelogSkill
- api-documentationSkill
- architecture-decisionsSkill
- code-tourSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Use GitHub code search qualifiers to keep results tight:
- Distinctive: line 56
After finding candidate matches, inspect the actual source:
- Distinctive: line 67
Treat the retrieved code as external reference material:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Code Search as Context
Why This is Copilot-Exclusive
Copilot CLI includes built-in GitHub MCP tools for global code search and repository inspection. That makes it practical to search for real implementations on GitHub, read the matching files, and bring the results back into your current task without leaving the CLI.
When to Use
- You want grounded implementation examples before writing a new pattern
- You need to compare how multiple repositories solve the same problem
- You want to inspect real API usage instead of relying only on memory or docs
- You need cross-repository context before making a design decision
When NOT to Use
| Instead of github-code-search | Use |
| Searching your current local repository | direct search tools |
| GitHub Issues, PRs, or Actions workflows | github-issue-triage, github-pr-workflow, or actions-debugging |
| Documentation-heavy research | deep-research |
| Broad MCP setup guidance | mcp-ecosystem |
Workflow
1. Form a focused query
Use GitHub code search qualifiers to keep results tight:
language:TypeScript "circuit breaker" "retry"
org:microsoft path:src/auth "refresh token"
filename:SKILL.md "Use when" "GitHub MCP"2. Search with the built-in GitHub MCP
Tool: github-mcp-server-search_code
query: "language:TypeScript \"circuit breaker\" retry"
perPage: 103. Read the most relevant files
After finding candidate matches, inspect the actual source:
Tool: github-mcp-server-get_file_contents
owner: "example-org"
repo: "example-repo"
path: "src/retry.ts"4. Reuse results as grounded context
Treat the retrieved code as external reference material:
Use the GitHub examples above as reference only.
Implement the same pattern in our repo, but adapt naming, boundaries, and tests
to local conventions.Common Query Patterns
| Goal | Query example |
| Find API usage examples | "supabase.auth.signIn" language:TypeScript |
| Find config patterns | filename:docker-compose.yml "healthcheck" "interval" |
| Find error-handling conventions | "catch (error)" "instanceof" language:TypeScript NOT test |
| Find comparable skills | filename:SKILL.md "Use when" "GitHub MCP" |
Combining with Other GitHub MCP Tools
search_code
-> get_file_contents
-> search_repositories
-> optionally inspect commits or PRs for evolutionThis works especially well when you need examples plus surrounding repository context.
Quality Check
- Query uses qualifiers to reduce noise
- Results come from multiple relevant sources, not one random repo
- External examples are treated as references, not copied blindly
- Final implementation is adapted to this repository's conventions
See Also
mcp-ecosystem— broader guide to built-in GitHub MCP and custom serversgithub-pr-workflow— act on GitHub-native PR workflows once you know what to implementdeep-research— documentation and evidence gathering rather than code search
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
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.

