Skip to main content

Repo Doctor

PyPI version CI Python versions License: MIT

Turn any repository into an open-source-ready, professional repo in one command.

Repo Doctor scans your Git repository, scores it against 17 open-source best-practice rules, and auto-generates any missing files including README, LICENSE, CI workflow, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY policy, and .gitignore, without ever touching your source code.

Demo

repo-doctor demo

Install

# From PyPI (recommended)
pipx install repo-doctor

# Or with uv
uv tool install repo-doctor
Development install (from source)
pipx install git+https://github.com/JaaasperLiu/repo-doctor.git
# or
uv tool install git+https://github.com/JaaasperLiu/repo-doctor.git

Quickstart

# Scan a repo and get a health score + report
repo-doctor scan /path/to/repo

# Preview what would be fixed (no files written)
repo-doctor fix --dry-run /path/to/repo

# Fix issues automatically
repo-doctor fix --yes /path/to/repo

# Generate a config file
repo-doctor init

What it checks

17 rules across 6 categories:

Category Rules Auto-fixable
Basics README present, README has key sections, LICENSE present 2 of 3
Community CONTRIBUTING, CODE_OF_CONDUCT, SECURITY policy 3 of 3
Build CI pipeline, test command, linter configured 1 of 3
Hygiene .gitignore present, .gitignore coverage, no venv/caches, repo size 2 of 4
Security No secret files (.env, .pem, id_rsa), no high-entropy strings 0 of 2
Reproducibility Lockfile present, dependencies pinned 0 of 2

Each rule produces a pass/fail, a severity (error/warn/info), and a weight toward the 0-100 score. Grade thresholds: A (90+), B (75+), C (55+), D (<55).

Rule reference

Rule ID Description Severity Weight Auto-fix
readme_exists README file present error 15 Yes
readme_sections README has Install + Usage sections warn 5 —
license_exists LICENSE file present error 12 Yes
contributing_exists CONTRIBUTING guide present warn 6 Yes
code_of_conduct_exists CODE_OF_CONDUCT present warn 5 Yes
security_policy SECURITY policy present warn 5 Yes
ci_workflow CI/CD pipeline exists error 10 Yes
test_command Test command discoverable warn 5 —
lint_config Linter configured info 3 —
gitignore_exists .gitignore present error 8 Yes
gitignore_coverage .gitignore covers common junk warn 4 Yes
no_venv_committed No venv/node_modules committed error 5 —
repo_size Reasonable repo size (<100 MB) info 3 —
no_secrets No .env/.pem/id_rsa files committed error 8 —
no_high_entropy No high-entropy strings (potential secrets) info 3 —
lockfile_exists Lockfile present for detected stack warn 5 —
pinned_deps Dependencies have version constraints info 3 —

Use --only and --skip with these IDs:

repo-doctor scan --only readme_exists --only license_exists
repo-doctor scan --skip lint_config --skip pinned_deps

How fixes work

Repo Doctor is safe by default:

  1. Scans and identifies failing auto-fixable rules
  2. Builds a ChangePlan (list of files to create or patch)
  3. Shows a rich diff preview of every file
  4. Only writes files after you confirm (or use --yes)
  5. Re-scans and shows the score improvement

Guarantees:

  • Never deletes files
  • Never modifies your source code
  • Only generates meta-files (README, LICENSE, CI, etc.)
  • Templates are stack-aware — a Python repo gets pytest in CI, a Node repo gets npm test

Detected stacks

Repo Doctor auto-detects your project type and tailors templates accordingly:

Stack Detected by
Python pyproject.toml, setup.py, requirements.txt, Pipfile
Node package.json, package-lock.json, yarn.lock
Rust Cargo.toml
Go go.mod
Swift Package.swift, *.xcodeproj, *.swift

CLI Reference

repo-doctor scan [PATH]     Scan and produce a health report
repo-doctor fix [PATH]      Auto-generate missing files
repo-doctor init [PATH]     Create a .repo-doctor.yml config

Key flags

Flag Description
--dry-run Preview changes without writing files
--yes, -y Apply changes without confirmation
--strict Exit with code 1 if any warnings/errors
--format Output format: md, json, or both (default)
--only RULE Only run specific rule(s)
--skip RULE Skip specific rule(s)
--license License type: mit (default) or apache-2.0
--output-dir, -o Output directory for reports (default: repo root)

Output files

After scanning, Repo Doctor writes:

  • repo-doctor.report.md — Human-readable report
  • repo-doctor.report.json — Machine-readable report (for CI)
  • repo-doctor.changes.md — Summary of applied/planned changes

Use --output-dir to keep your repo clean:

repo-doctor scan --output-dir .repo-doctor

Config

If .repo-doctor.yml exists in your repo root, Repo Doctor loads it automatically. CLI flags override config values.

Create one with repo-doctor init, or write it manually:

project_name: my-project
license: mit
ci: github-actions
readme: standard
output_dir: .repo-doctor
skip:
  - lint_config
  - pinned_deps

Use in CI (GitHub Action)

Add Repo Doctor to your GitHub Actions workflow:

- name: Repo Doctor
  uses: JaaasperLiu/repo-doctor/action@v0
  with:
    strict: true  # fail the build if issues are found

The action posts the full report to the GitHub Actions summary and exports score and grade as outputs:

- name: Repo Doctor
  id: doctor
  uses: JaaasperLiu/repo-doctor/action@v0

- name: Check score
  run: echo "Score is ${{ steps.doctor.outputs.score }}"

Action inputs

Input Default Description
path . Path to scan
strict false Fail if warnings/errors found
skip Comma-separated rule IDs to skip
only Comma-separated rule IDs to run
format both Report format

Development

git clone https://github.com/JaaasperLiu/repo-doctor.git
cd repo-doctor
uv sync --dev
uv run pytest -x -v        # run tests (79 tests)
uv run ruff check src/     # run linter
uv run repo-doctor scan .  # scan itself (scores 100/100)

Contributing

See CONTRIBUTING.md for guidelines, including how to add new rules.

License

MIT

Metadata

Release files for repo-doctor 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repo-doctor 0.1.1
File Size Uploaded
repo_doctor-0.1.1.tar.gz 660.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repo-doctor 0.1.1
File Interpreter ABI Platform
repo_doctor-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 691.5 kB

Release files / repo_doctor-0.1.1.tar.gz

Download URL repo_doctor-0.1.1.tar.gz
Size 660.0 kB
Tags Source
SHA-256 checksum
How to use checksums
962a4accc5addbf9d757b8c4803c418f46062b46ce2dbd80eb302c1f3b7e1456
BLAKE2b-256 checksum
How to use checksums
d8b6f874aac75c8f4a10cc931b99249bb506f9d3de731b35f050e2d56384cad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Release files / repo_doctor-0.1.1-py3-none-any.whl

Download URL repo_doctor-0.1.1-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e2d8fc6d526a05ec52970d1904818a71f9880ef049349ab93f4bb5d8dcf53d8
BLAKE2b-256 checksum
How to use checksums
7c63ceb80c114ef04dfd1cbb026ee0541cf2c4119b18e161d658dd28ad33cec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page