Repository avatar
Developer Tools
v0.2.0
active

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.

CI PyPI Python License: MIT PRs welcome

Terminal demo: RepoFlow Lite maps more-itertools, ranks hotspots, reads its contribution playbook (AI policy: banned), runs 772 tests in Docker, and turns a pyflakes hit into a teaching card.

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

AreaWhat you getTools
πŸ—ΊοΈ UnderstandRepo map, architecture overview, hotspots (files that change often)analyze_repo, get_architecture, find_hotspots
πŸ“œ Contribution policyThe project's playbook: CONTRIBUTING, security policy, AI-use policy, CLA/DCO, CI, templatesget_contribution_playbook, check_ai_policy, get_contribution_steps, check_pr_readiness
πŸ§ͺ DiscoverSet up the environment, run tests, run static analysis, detect flaky testssetup_environment, run_tests, run_static_analysis, detect_flaky_tests
πŸ“¦ SandboxTests run inside Docker, so a repo's code doesn't run directly on your machinesandbox_status
πŸŽ“ TeachRecord findings, turn them into teaching cards, export a reportrecord_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

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/):

ModuleJob
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.pyMCP 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.

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.

  1. Read CONTRIBUTING.md.
  2. Look for issues labeled good first issue or help wanted.
  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.

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.

RepoFlow contributors

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

MIT

A separate hosted, paid version of RepoFlow also exists.


Built for people who want to contribute well, and for the projects that receive it.
PYPI
repoflow-mcp
Install Command
pip install repoflow-mcp