Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
c96712d
docs: add README, CONTRIBUTING, and CHANGELOG
AxaySharma Jun 13, 2026
391b49f
docs: reframe README as standalone open source tool, add GitHub URL s…
AxaySharma Jun 13, 2026
4bc141d
feat: add filesystem tools for agent (read, list, search, tree, detect)
AxaySharma Jun 13, 2026
de069d6
feat: add system prompt, optimizer meta-prompt, and prompt builder fu…
AxaySharma Jun 13, 2026
52732b3
feat: implement core agentic loop with tool use, GitHub URL support, …
AxaySharma Jun 13, 2026
4a0354f
feat: add CLI entry point with rich output, spinner, and verbose mode
AxaySharma Jun 13, 2026
196b5a0
test: add sample FastAPI project fixture for eval harness
AxaySharma Jun 13, 2026
e560d64
feat: add eval harness with 8 test cases, 4 metrics, and rich reporting
AxaySharma Jun 13, 2026
9ae0dec
feat: add prompt optimizer with iterative eval loop and before/after …
AxaySharma Jun 13, 2026
0ea4f56
feat: add eval and optimizer CLI entry points with rich output
AxaySharma Jun 13, 2026
997dafe
ci: add GitHub Actions workflow and unit tests for metrics
AxaySharma Jun 13, 2026
b11370e
Add CI badge to README
AxaySharma Jun 13, 2026
c9a87f2
fix: update model to anthropic/claude-3.5-haiku for OpenRouter compat…
AxaySharma Jun 13, 2026
b12bfaa
Merge branch 'dev' of https://github.com/AxaySharma/repo-explainer in…
AxaySharma Jun 13, 2026
73d8da6
docs: update README with honest API setup options, real results, and …
AxaySharma Jun 13, 2026
8cad311
Update Anthropic Base URL
AxaySharma Jun 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [dev, main]
pull_request:
branches: [main]

jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Check imports β€” agent
run: |
python -c "import agent.tools; print('βœ… agent.tools')"
python -c "import agent.prompts; print('βœ… agent.prompts')"
python -c "import agent.repo_explainer; print('βœ… agent.repo_explainer')"

- name: Check imports β€” evals
run: |
python -c "from evals.test_cases import TEST_CASES; print(f'βœ… {len(TEST_CASES)} test cases')"
python -c "from evals.metrics import compute_overall_score; print('βœ… evals.metrics')"
python -c "from evals.harness import run_evals; print('βœ… evals.harness')"

- name: Check imports β€” optimizer
run: |
python -c "from optimizer.optimizer import PromptOptimizer; print('βœ… optimizer')"

- name: Check CLI scripts
run: |
python scripts/run_agent.py --help
python scripts/run_evals.py --help
python scripts/run_optimizer.py --help

- name: Run unit tests
run: |
pytest tests/ -v --tb=short
continue-on-error: true
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Changelog

All notable changes to this project will be documented here.

Format follows [Keep a Changelog](https://keepachangelog.com/).

---

## [1.0.0] - 2026-06-13

### Added

#### Agent
- Core agentic loop in `agent/repo_explainer.py` using Anthropic Python SDK
- 5 filesystem tools: `read_file`, `list_directory`, `search_code`, `get_file_tree`, `detect_language_and_framework`
- Transparent GitHub URL support β€” clones to temp dir, cleans up automatically
- Path sandboxing to prevent traversal outside repo root
- `AgentResult` dataclass with answer, tools used, iterations, success, error

#### Prompts
- Detailed system prompt (600+ words) with mandatory exploration steps
- Optimizer meta-prompt for automated prompt improvement
- `build_user_prompt()` and `format_failed_cases()` helpers

#### Eval Harness
- 8 test cases covering architecture, framework, auth, database, endpoints, models, setup, and extensibility
- 4 weighted metrics: topic coverage (40%), hallucination penalty (30%), answer length (15%), groundedness (15%)
- Rich terminal output with color-coded pass/fail table
- JSON report auto-saved to `optimizer/results/` with timestamp

#### Optimizer
- Automated prompt tuning loop with N configurable iterations
- Keeps improved prompts, reverts regressions
- Saves best prompt to `agent/prompts_optimized.py`
- Full optimization report with before/after comparison table

#### CLI Scripts
- `scripts/run_agent.py` β€” ask any question about any repo with rich output and spinner
- `scripts/run_evals.py` β€” run full eval suite with optional custom prompt
- `scripts/run_optimizer.py` β€” run optimizer with dry-run mode and confirmation prompt

#### Infrastructure
- GitHub Actions CI workflow β€” runs on every push to `dev` and PR to `main`
- 25 unit tests for metrics module (all passing in 0.02s)
- Branch strategy: `dev` for development, `main` for stable releases
- `.env.example` with documented configuration options
- `CONTRIBUTING.md` with commit conventions and branch strategy
- Compatible with Anthropic API direct, OpenRouter, or any Claude-compatible gateway

### Results
- Baseline eval: **8/8 tests passing, average score 0.9917**
- Zero hallucinations across all baseline runs
- Perfect groundedness score (1.0000) β€” agent always reads code before answering
- Optimizer correctly identified baseline was already optimal and preserved the prompt

---

## [Unreleased]

### Potential Improvements
- Semantic search over code using embeddings for large repos
- Support for private GitHub repos via token auth
- Web UI for interactive Q&A sessions
- Expanded eval set for monorepos and polyglot projects

---
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing

## Branch Strategy

- `main` β€” stable, production-ready code only
- `dev` β€” active development

All changes go through `dev` first, then merge to `main` via PR.

## Commit Convention

We follow [Conventional Commits](https://www.conventionalcommits.org/):

| Prefix | Use for |
|--------|---------|
| `feat:` | New feature |
| `fix:` | Bug fix |
| `docs:` | Documentation only |
| `chore:` | Tooling, config, setup |
| `test:` | Adding or fixing tests |
| `refactor:` | Code restructure, no behavior change |

## Examples

```
feat: add search_code tool with pattern matching
fix: handle empty repo path gracefully
docs: update README with optimizer results
```
Loading
Loading