| name | code-explorer |
| description | Search and analyze code repositories on GitHub and Hugging Face (Models, Datasets, Spaces). This skill should be used when exploring open-source projects, finding implementation references, discovering ML models/datasets, or analyzing how others have solved similar problems. |
Code Explorer
Overview
To search and analyze code repositories across GitHub and Hugging Face platforms, use this skill. It enables discovering implementation patterns, finding relevant ML models/datasets, and exploring demo applications (Spaces) for learning and reference.
Supported Platforms
| Platform | Search Targets | Tool |
|---|
| GitHub | Repositories, Code | gh CLI |
| Hugging Face | Models, Datasets, Spaces | uvx hf CLI + huggingface_hub API |
검색 품질 원칙 (필수)
1. 현재 날짜 확인
date +%Y-%m-%d
아래 예시의 연도는 참고용. 실제 검색 시 현재 연도 사용.
2. Long-tail Keywords 적용
예시의 Short-tail을 그대로 쓰지 말고 확장:
| 예시 (참고용) | 실제 검색 (Long-tail) |
|---|
"object detection" | "open vocabulary object detection pytorch inference {현재연도}" |
"gradio demo" | "gradio image segmentation interactive demo huggingface" |
"qwen vl" | "qwen2-vl vision language model zero-shot example code" |
3. Multi-Query 적용
한 번에 찾기 어려우면 2-3개 관점으로 검색:
gh search repos "qwen2-vl" --sort stars
gh search repos "vision language open vocabulary detection" --sort stars
gh search repos "vl model gradio demo inference" --sort stars
4. 필터 활용
gh search repos "keyword" stars:>50 pushed:>{현재연도-1}-01-01 --language python
5. 검색 전 체크리스트
Workflow Decision Tree
User wants to explore code/resources
|
+-- Looking for code implementations?
| +-- Use GitHub search
| +-- scripts/search_github.py (or gh CLI directly)
| +-- Analyze repo structure, README, key files
|
+-- Looking for ML resources?
+-- Use Hugging Face search
+-- scripts/search_huggingface.py (search via API)
+-- uvx hf download (download files)
Scripts
Always run scripts with --help first to see usage. These scripts handle common search workflows reliably.
Available Scripts
scripts/search_github.py - GitHub repository search using gh CLI
scripts/search_huggingface.py - Hugging Face search (models, datasets, spaces)
Quick Examples
python scripts/search_github.py "object detection" --limit 10 --help
python scripts/search_huggingface.py "qwen vl" --type models --help
GitHub Search
Using gh CLI Directly
gh search repos "open vocabulary detection" --sort stars --limit 10
gh search repos "gradio app" --language python --limit 5
gh repo view owner/repo
gh search code "Qwen2VL" --extension py
Repository Analysis
To analyze a found repository:
- Review README.md for usage instructions
- Identify main entry points (app.py, main.py, inference.py)
- Check dependencies (requirements.txt, pyproject.toml)
- Study implementation patterns in source files
Hugging Face Search
Search (via script or Python API)
python scripts/search_huggingface.py "object detection" --type models --limit 10
python scripts/search_huggingface.py "coco" --type datasets --limit 5
python scripts/search_huggingface.py "gradio demo" --type spaces --limit 10
python scripts/search_huggingface.py "qwen vl" --type all
Download (via uvx hf)
uvx hf download <space_id> --repo-type space --include "*.py" --local-dir /tmp/<space_name>
uvx hf download <repo_id> --include "*.json" --local-dir /tmp/<model_name>
uvx hf download <repo_id> --local-dir ./my-model
Note: Always use --local-dir /tmp/ for temporary code analysis to avoid cluttering the project.
Common Search Patterns
python scripts/search_huggingface.py "open vocabulary detection" --type models
python scripts/search_huggingface.py "qwen2 vl" --type models
python scripts/search_huggingface.py "grounding dino" --type models
python scripts/search_huggingface.py "object detection demo" --type spaces
python scripts/search_huggingface.py "gradio image" --type spaces
Analyzing a Space
To understand how a Space is implemented:
- Find the space:
python scripts/search_huggingface.py "keyword" --type spaces
- Download source:
uvx hf download <space_id> --repo-type space --include "*.py" --include "requirements.txt" --local-dir /tmp/<space_name>
- Or view online:
https://huggingface.co/spaces/{space_id}/tree/main
- Focus on
app.py for main logic
- Check
requirements.txt for dependencies
Example Use Cases
Find Qwen3-VL Open Vocab Detection Code
gh search repos "qwen vl object detection" --sort stars
gh search code "Qwen2VL" --extension py
python scripts/search_huggingface.py "qwen2-vl" --type models
python scripts/search_huggingface.py "qwen vl" --type spaces
Find Gradio Demo Patterns
python scripts/search_huggingface.py "gradio object detection" --type spaces
uvx hf download username/space-name --repo-type space --include "*.py" --local-dir /tmp/space-name
Find Pre-trained Detection Models
python scripts/search_huggingface.py "object-detection" --type models --limit 20
python scripts/search_huggingface.py "grounding-dino" --type models
python scripts/search_huggingface.py "yolo-world" --type models
Resources
scripts/
search_github.py - GitHub repository search wrapper
search_huggingface.py - Hugging Face Hub search wrapper
references/
github_api.md - GitHub CLI detailed reference
huggingface_api.md - Hugging Face Hub API and CLI reference
Tips
- Start broad, then narrow: Begin with general keywords, then add filters
- Check stars/likes: Higher counts often indicate quality
- Review recent activity: Recently updated repos are better maintained
- Use --help first: Scripts have detailed usage information
- Download selectively: Use
uvx hf download --include to download only needed files
- Always cite sources: Include repository URLs, Space links, or model IDs you referenced