# GitHub Access Patterns for Application Materials

Updated: 2026-08-01

## Private Repo Access Workflow
When a user mentions a project they want cited in an application:
1. Check if the repo is public via `curl https://api.github.com/repos/USER/REPO`.
2. If 404, it is private or non-existent. Do not guess its contents.
3. Ask the user for a GitHub PAT (classic: `repo` scope; fine-grained: `Contents: Read` + `Metadata: Read`).
4. Once authenticated, read the README, stack, and key files to reference accurately.
5. If the user declines to provide a token, ask them to paste a short summary of the project so you can still cite it.

## Moonshot Application Pattern
When a user wants to apply to a role in a completely different discipline (e.g., web dev → HPC datacenter engineering):
- Deliver an honest fit assessment FIRST before writing any materials.
- If they still want to proceed, pivot the pitch toward transferable adjacent skills (homelab infrastructure, AI integrations, systems thinking).
- Do not pretend the web-dev stack is directly relevant to infrastructure roles.
- Flag the "excitement trap" — applying to a famous company for the brand rather than the role fit.

## Portfolio Scanning Workflow
When a user says "scan my GitHub" or "look at my projects" to build application context:

1. **List all repos** (public + private) via authenticated API:
   ```
   curl -s -H "Authorization: token $GH_TOKEN" \
     "https://api.github.com/user/repos?per_page=100&sort=updated"
   ```
   - Parse fields: `name`, `private`, `description`, `language`, `updated_at`
   - Repeat with `&page=N` until empty (GitHub paginates at 100)

2. **Categorize by interest level**
   - High: repos with descriptions, recent updates, languages matching user's stated stack
   - Medium: private repos (ask user if worth checking) or repos with no description
   - Low: very old school/exercise repos

3. **Read READMEs of top candidates**
   - Raw README: `https://raw.githubusercontent.com/USER/REPO/main/README.md`
   - If 404, try `/master/` instead of `/main/`
   - Key files to also check: `requirements.txt`, `package.json`, `composer.json` for stack confirmation

4. **Build a project narrative**
   - Identify progression: simple HTML/JS → PHP/Laravel → Angular → AI/ML projects
   - Note real client work separately from school projects
   - Flag any 24/7 running services, production deployments, or actual user-facing sites

5. **Update user memory**
   - Store a compact summary of notable repos and their tech stacks
   - Include private repos if they gave access — these are often the most impressive
   - Note any that are explicitly for a client (shows real-world delivery)

6. **Pitfall: token scope**
   - Fine-grained PAT needs `Contents: Read` + `Metadata: Read`
   - Classic PAT needs `repo` scope for private repos
   - The `/user/repos` endpoint requires authentication; without it, only public repos from `/users/USER/repos`
