A layered system for analyzing GitHub profiles and recommending portfolio improvements. Core logic is deterministic; AI is used only for explanation and conversation.
┌─────────────────────────────────────────────────────────────────┐
│ Layer 1 — Agent (Voiceflow / LLM) │
│ Conversation, user input, tool calls, result explanation │
└────────────────────────────┬────────────────────────────────────┘
│ HTTP / tool calls
┌────────────────────────────▼────────────────────────────────────┐
│ Layer 2 — Backend API (FastAPI) │
│ Request validation, orchestration, response shaping │
└────────────────────────────┬────────────────────────────────────┘
│
┌────────────────────┼────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌────────────────┐ ┌──────────────────────┐
│ Layer 3 │ │ Contracts │ │ Layer 4 │
│ Scoring │ │ (Pydantic) │ │ Data (GitHub API) │
│ Engine │ │ Input/Output │ │ Repo fetch, no writes │
└───────────────┘ └────────────────┘ └──────────────────────┘
| Module | Path | Responsibility |
|---|---|---|
| api | src/api/ |
FastAPI app, routes, dependency injection |
| contracts | src/contracts/ |
Pydantic models for request/response |
| scoring | src/scoring/ |
Deterministic scoring, classification, issues, suggestions |
| data | src/data/ |
GitHub API client, repo metadata fetching |
Rules:
- API depends on contracts + scoring + data.
- Scoring depends only on contracts (repo DTOs).
- Data returns only contract/DTO types; no scoring logic.
- Agent sends
ScanRequest(username, review_mode, scan_scope). - API validates, calls Data layer → fetch repos from GitHub.
- API passes repo list to Scoring engine → scores, classifications, issues, suggestions.
- API builds
ScanResponseand returns to agent. - Agent explains results to user (no destructive actions).
- Read-only: No GitHub write operations.
- No destructive actions in Phase 1.
- Future phases: preview-first, explicit confirmation for archive/rename/edit.
{
"github_username": "string",
"review_mode": "portfolio | cleanup",
"scan_scope": "public | all"
}{
"summary": {
"total_repos": "number",
"showcase_ready": "number",
"needs_cleanup": "number",
"archive_candidates": "number"
},
"top_issues": ["string", "..."],
"repos": [
{
"name": "string",
"score": "number",
"classification": "showcase | cleanup | archive",
"issues": ["string"],
"suggestions": ["string"]
}
],
"recommended_next_step": "string"
}- Backend: FastAPI, Pydantic
- Data: GitHub REST API (httpx), optional env token
- Scoring: Pure Python, no ML models
- Agent: External (Voiceflow/LLM); integrates via API
- Contracts — Input/Output and repo DTOs.
- Data — GitHub client, fetch repos (read-only).
- Scoring — Score, classify, issues, suggestions.
- API — Wire routes and dependencies.
- Agent — Document integration and example tool call.