repo-analyzer
Analyze GitHub repositories for structure, documentation, dependencies, and contribution patterns. Use for codebase understanding and health assessment.
What this skill does
# Repository Analyzer Skill
## Purpose
Single responsibility: Analyze GitHub repository structure, documentation quality, and contribution patterns for codebase understanding. (BP-4)
## Grounding Checkpoint (Archetype 1 Mitigation)
Before executing, VERIFY:
- [ ] gh CLI is installed and authenticated
- [ ] Repository URL or local clone exists
- [ ] Access permissions verified (public or authenticated)
- [ ] Analysis scope defined (structure, docs, deps, or all)
**DO NOT analyze without confirming repository access.**
## Uncertainty Escalation (Archetype 2 Mitigation)
ASK USER instead of guessing when:
- Multiple repositories to analyze - which first?
- Private repo requires different auth
- Analysis depth unclear (quick vs deep)
- Specific aspects to focus on
**NEVER scrape repository data without user intent.**
## Context Scope (Archetype 3 Mitigation)
| Context Type | Included | Excluded |
|--------------|----------|----------|
| RELEVANT | Repo structure, README, package files | Source code details |
| PERIPHERAL | Contribution stats, issue patterns | PR content |
| DISTRACTOR | Fork network | Unrelated repos |
## Workflow Steps
### Step 1: Verify Access (Grounding)
```bash
# Check gh CLI
gh --version
# Verify authentication
gh auth status
# Check repo access
gh repo view <owner>/<repo> --json name,description,visibility
```
### Step 2: Analyze Structure
```bash
# Repository overview
gh repo view <owner>/<repo> --json name,description,defaultBranch,languages,topics
# Directory structure
gh api repos/<owner>/<repo>/contents | jq '.[].name'
# Key files present
for file in README.md LICENSE CONTRIBUTING.md .github/workflows; do
gh api repos/<owner>/<repo>/contents/$file 2>/dev/null && echo "✅ $file" || echo "❌ $file missing"
done
```
### Step 3: Documentation Analysis
```bash
# README content and quality
gh api repos/<owner>/<repo>/readme | jq -r '.content' | base64 -d | head -100
# Check for docs directory
gh api repos/<owner>/<repo>/contents/docs 2>/dev/null | jq '.[].name'
# Contributing guide
gh api repos/<owner>/<repo>/contents/CONTRIBUTING.md 2>/dev/null
```
### Step 4: Dependency Analysis
```bash
# Package files
gh api repos/<owner>/<repo>/contents/package.json 2>/dev/null | jq -r '.content' | base64 -d | jq '.dependencies'
gh api repos/<owner>/<repo>/contents/requirements.txt 2>/dev/null | jq -r '.content' | base64 -d
gh api repos/<owner>/<repo>/contents/go.mod 2>/dev/null
# Dependency graph (if available)
gh api repos/<owner>/<repo>/dependency-graph/sbom 2>/dev/null | head -50
```
### Step 5: Contribution Analysis
```bash
# Contributors
gh api repos/<owner>/<repo>/contributors --jq '.[0:10] | .[] | "\(.login): \(.contributions) commits"'
# Recent activity
gh api repos/<owner>/<repo>/commits --jq '.[0:5] | .[] | "\(.commit.author.date): \(.commit.message | split("\n")[0])"'
# Issue/PR stats
gh api repos/<owner>/<repo> --jq '{issues: .open_issues_count, forks: .forks_count, stars: .stargazers_count}'
```
## Recovery Protocol (Archetype 4 Mitigation)
On error:
1. **PAUSE** - Note what data was collected
2. **DIAGNOSE** - Check error type:
- `404` → Check repo name, visibility
- `401` → Re-authenticate with gh auth login
- `403` → Check rate limits or permissions
- `API error` → Fall back to local clone analysis
3. **ADAPT** - Use alternative data sources
4. **RETRY** - With different approach (max 3 attempts)
5. **ESCALATE** - Report partial analysis
## Checkpoint Support
State saved to: `.aiwg/working/checkpoints/repo-analyzer/`
```
checkpoints/repo-analyzer/
├── structure.json # Directory structure
├── documentation.json # Docs assessment
├── dependencies.json # Dependency analysis
├── contributions.json # Contributor stats
└── health_report.md # Overall health
```
## Output Format
```markdown
# Repository Analysis: <owner>/<repo>
## Overview
- **Name**: repository-name
- **Description**: Short description
- **Language**: TypeScript (85%), JavaScript (15%)
- **Stars**: 1,234 | Forks: 156 | Issues: 23
## Structure Assessment
- [x] README.md (comprehensive)
- [x] LICENSE (MIT)
- [ ] CONTRIBUTING.md (missing)
- [x] .github/workflows (3 workflows)
## Documentation Quality: 7/10
- Clear installation instructions
- API documentation present
- Missing: troubleshooting guide
## Dependency Health
- Total: 45 dependencies
- Outdated: 8
- Vulnerabilities: 0
## Activity Level: Active
- Last commit: 2 days ago
- Contributors: 12
- Monthly commits: ~45
## Recommendations
1. Add CONTRIBUTING.md guide
2. Update 8 outdated dependencies
3. Add troubleshooting section to docs
```
## Common Analysis Queries
| Query | Purpose |
|-------|---------|
| `gh repo view` | Basic info |
| `gh api /repos/{}/languages` | Language breakdown |
| `gh api /repos/{}/contributors` | Contributor list |
| `gh api /repos/{}/commits` | Recent commits |
| `gh api /repos/{}/releases` | Release history |
| `gh api /repos/{}/pulls` | Open PRs |
## References
- GitHub CLI: https://cli.github.com/
- GitHub API: https://docs.github.com/en/rest
- REF-001: Production-Grade Agentic Workflows (BP-4)
- REF-002: LLM Failure Modes (Archetype 1 grounding)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.