
repoflow
io.github.LolPanda2004/repoflow
Learn an open-source Python repo before you contribute: map, rules, safe tests, teaching cards.
Documentation
RepoFlow Lite
Learn an open-source Python codebase before you touch it.
An MCP server that helps you understand a repo, follow its contribution rules, run its tests safely, and learn from real bugs.
Real run on more-itertools/more-itertools @ aa99776, output trimmed. Regenerate with scripts/make_demo_gif.py.
Quickstart Β· Features Β· How it works Β· Contributing Β· Roadmap
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 (recommended, for sandboxed test runs)
- An MCP client, for example Claude Code
Install
git clone https://github.com/LolPanda2004/repoflow.git
cd repoflow
pip install -e ".[dev]"
Register with Claude Code
claude mcp add repoflow -- repoflow
Then open Claude Code and run /mcp to check that repoflow is connected.
Register with other MCP clients
For clients that support the mcpServers format, add this entry to their MCP configuration:
{
"mcpServers": {
"repoflow": {
"command": "repoflow",
"args": [],
"env": {
"REPOFLOW_SANDBOX": "docker"
}
}
}
}
On Windows, replace repoflow with the absolute path to repoflow.exe (use \\ to escape backslashes in JSON). Find it with (Get-Command repoflow).Source.
REPOFLOW_SANDBOX is optional: docker (default) enables Docker sandboxing, local runs without Docker isolation, and off disables repository code execution.
Try it
Start with a small Python repo:
> 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
ββββββββββββββββ
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
- Teach, don't submit. The goal is a better contributor, not more PRs.
- Evidence over guesses. A finding needs a failing test, a tool result, or a reproducible run.
- Respect the project. Its rules come first, including any rules about AI.
- 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.
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
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:
python -c "import sys; sys.path.insert(0, 'src'); import repoflow.server"
Contributing
Contributions are welcome, from typo fixes to new tools.
- Read CONTRIBUTING.md.
- Look for issues labeled
good first issueorhelp wanted. - Comment on the issue before you start, so work isn't duplicated.
- Keep PRs small, add tests, and make sure
python -m pytest -qpasses. - If you used AI tools, say so in the PR description.
Questions and ideas go in GitHub Discussions.
Contributors
Thank you to everyone who has helped make RepoFlow better! Everyone with a merged PR shows up below. It updates by itself after every merge.
Code of Conduct
This project follows the Contributor Covenant. See CODE_OF_CONDUCT.md.
Security
Please don't report security problems in public issues. See SECURITY.md.
Roadmap
- Repo understanding: map, hotspots, architecture
- Contribution playbook and AI-policy checks
- Tests, static analysis and flaky-test detection in Docker
- 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.
License
A separate hosted, paid version of RepoFlow also exists.
repoflow-mcppip install repoflow-mcp