RepoFlow Lite
<!-- mcp-name: io.github.LolPanda2004/repoflow -->
<div align="center">
# RepoFlow Lite
**Learn an open-source Python codebase before you touch it.**
An [MCP](https://modelcontextprotocol.io) server that helps you understand a repo, follow its contribution rules, run its tests safely, and learn from real bugs.
[](https://github.com/LolPanda2004/repoflow/actions)
[](https://pypi.org/project/repoflow-mcp/)
[](#requirements)
[](LICENSE)
[](CONTRIBUTING.md)
[Quickstart](#quickstart) Β· [Features](#features) Β· [How it works](#how-it-works) Β· [Contributing](#contributing) Β· [Roadmap](#roadmap)
</div>
---
## Why RepoFlow?
Maintainers are flooded with low-effort, AI-generated pull requests. New contributors often want to help, but don't know where to start or what the project expects.
RepoFlow Lite takes a **"learn first"** approach:
- **Understand** the code before changing it.
- **Respect** each project's rules (CONTRIBUTING, AI policy, CLA/DCO, CI).
- **Find real problems with evidence**: failing tests, static-analysis hits, flaky tests.
- **Teach**: every finding becomes a plain-language teaching card.
RepoFlow Lite does **not** open issues or pull requests for you. It helps you learn enough to make a good contribution yourself.
## Features
| Area | What you get | Tools |
|---|---|---|
| πΊοΈ **Understand** | Repo map, architecture overview, hotspots (files that change often) | `analyze_repo`, `get_architecture`, `find_hotspots` |
| π **Contribution policy** | The project's playbook: CONTRIBUTING, security policy, AI-use policy, CLA/DCO, CI, templates | `get_contribution_playbook`, `check_ai_policy`, `get_contribution_steps`, `check_pr_readiness` |
| π§ͺ **Discover** | Set up the environment, run tests, run static analysis, detect flaky tests | `setup_environment`, `run_tests`, `run_static_analysis`, `detect_flaky_tests` |
| π¦ **Sandbox** | Tests run inside Docker, so a repo's code doesn't run directly on your machine | `sandbox_status` |
| π **Teach** | Record findings, turn them into teaching cards, export a report | `record_finding`, `update_finding`, `list_findings`, `get_finding`, `explain_finding`, `export_report` |
Plus three JSON resources: `repo://{owner}/{name}/map` (repo map), `playbook://{owner}/{name}` (contribution playbook) and `findings://{owner}/{name}` (recorded findings).
## Quickstart
### Requirements
- Python **3.11+**
- [Docker Desktop](https://www.docker.com/products/docker-desktop/) (recommended, for sandboxed test runs)
- An MCP client, for example [Claude Code](https://claude.com/claude-code)
### Install
```bash
git clone https://github.com/LolPanda2004/repoflow.git
cd repoflow
pip install -e ".[dev]"
```
### Register with Claude Code
```bash
claude mcp add repoflow -- repoflow
```
Then open Claude Code and run `/mcp` to check that `repoflow` is connected.
### Try it
Start with a small Python repo:
```text
> Use repoflow to analyze owner/small-repo and explain its architecture.
> What does this project expect from contributors? Check its AI policy.
> Run its tests in the sandbox and explain any failure as a teaching card.
```
## How it works
```text
ββββββββββββββββ
you ββββΆ β MCP client β (e.g. Claude Code)
ββββββββ¬ββββββββ
β stdio
ββββββββΌββββββββ
β RepoFlow β
ββββββββ¬ββββββββ
ββββββββββββ¬ββββ΄βββββββ¬βββββββββββ¬ββββββββββ
βΌ βΌ βΌ βΌ βΌ
understand policy discover sandbox teach
(map, (rules, (tests, (Docker) (cards,
hotspots) AI use) static) report)
```
Project layout (`src/repoflow/`):
| Module | Job |
|---|---|
| `core/` | Config, GitHub client (read-only), models, process runner, local store, workspace |
| `understand/` | Repo map, hotspots, architecture |
| `policy/` | Contribution playbook, AI policy, readiness checks |
| `discover/` | Environment setup, tests, static analysis, flaky tests |
| `sandbox/` | Docker runner |
| `teach/` | Findings, teaching cards, reports, prompts |
| `server.py` | MCP server entry point; registers each module's tools |
### Design principles
1. **Teach, don't submit.** The goal is a better contributor, not more PRs.
2. **Evidence over guesses.** A finding needs a failing test, a tool result, or a reproducible run.
3. **Respect the project.** Its rules come first, including any rules about AI.
4. **Safe by default.** Repo code runs in Docker. GitHub access is read-only.
## Guards (optional)
RepoFlow Lite never writes to GitHub. Your AI assistant might still try to, through its shell. `repoflow guards` adds Claude Code deny rules for direct GitHub writes (`gh pr create`, `gh api`, `git push` and similar), so those need a human.
```bash
repoflow guards install # adds the rules to ~/.claude/settings.json
repoflow guards install --project # or to ./.claude/settings.json
repoflow guards status # shows which rules are present
repoflow guards remove # takes them out again
```
`install` shows a diff and asks before writing (`--yes` skips the prompt). It keeps your other settings, backs up the old file, and refuses to touch a file that is not valid JSON.
## Development
```bash
pip install -e ".[dev]"
python -m pytest -q # full suite; some tests need Docker running
python -m pytest -q tests/test_policy.py # run one file
ruff check . && ruff format . # lint and format
```
Import check:
```bash
python -c "import sys; sys.path.insert(0, 'src'); import repoflow.server"
```
## Contributing
Contributions are welcome, from typo fixes to new tools.
1. Read [CONTRIBUTING.md](CONTRIBUTING.md).
2. Look for issues labeled [`good first issue`](https://github.com/LolPanda2004/repoflow/labels/good%20first%20issue) or [`help wanted`](https://github.com/LolPanda2004/repoflow/labels/help%20wanted).
3. Comment on the issue before you start, so work isn't duplicated.
4. Keep PRs small, add tests, and make sure `python -m pytest -q` passes.
5. If you used AI tools, say so in the PR description.
Questions and ideas go in [GitHub Discussions](https://github.com/LolPanda2004/repoflow/discussions).
### Code of Conduct
This project follows the [Contributor Covenant](https://www.contributor-covenant.org/). See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
### Security
Please don't report security problems in public issues. See [SECURITY.md](SECURITY.md).
## Roadmap
- [x] Repo understanding: map, hotspots, architecture
- [x] Contribution playbook and AI-policy checks
- [x] Tests, static analysis and flaky-test detection in Docker
- [x] Teaching cards and reports
- [ ] One "environment ready" check shared by all modules
- [ ] Better isolation for local (non-Docker) mode
- [ ] More teaching-card templates and beginner-friendly wording
- [ ] Support for more project layouts (monorepos, tox/nox-based setups)
Have an idea? [Open a discussion](https://github.com/LolPanda2004/repoflow/discussions).
## License
[MIT](LICENSE)
A separate hosted, paid version of RepoFlow also exists.
---
<div align="center">
Built for people who want to contribute well, and for the projects that receive it.
</div>
TDQS
Scored across 18 tools
The surface is split into clearly staged layers (analysis: analyze_repo/find_hotspots/get_architecture; execution: setup_environment/run_tests/run_static_analysis/detect_flaky_tests; ledger: record/update/get/explain/export; contribution: playbook/ai-policy/steps/pr-readiness), and descriptions spell out ordering and prerequisites. The only real overlaps are check_ai_policy being a subset of get_contribution_playbook and get_contribution_steps being derived from the playbook, but the descriptions explain the distinction (classification verdict vs. checklist) well enough.
18 of 19 names follow a clean snake_case verb_noun pattern (list_findings, run_tests, record_finding, check_pr_readiness). The single deviation is sandbox_status, which is a noun phrase rather than verb_noun, plus a few multi-word verbs (get_contribution_playbook) that are long but predictable.
18 tools is on the heavy side but each maps to a distinct stage of a genuinely multi-phase workflow (analysis, environment, test execution, triage, evidence ledger, contribution compliance), so nothing feels padded. A couple of consolidation candidates exist (analyze_repo vs find_hotspots vs get_architecture, playbook vs ai-policy), keeping it just below a clean scope.
Coverage runs the full loop: clone/map, environment setup, test and static analysis, flake triage, evidence-stamped findings with CRUD, teaching cards, export, and a whole contribution-readiness pipeline including AI policy and DCO/changelog checks. Minor gaps are no delete_finding and a status-only filter on list_findings, but agents can work around both via update_finding.