Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_doctor-0.1.1.tar.gz (660.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_doctor-0.1.1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file repo_doctor-0.1.1.tar.gz.

File metadata

  • Download URL: repo_doctor-0.1.1.tar.gz
  • Upload date:
  • Size: 660.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for repo_doctor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 962a4accc5addbf9d757b8c4803c418f46062b46ce2dbd80eb302c1f3b7e1456
MD5 e90acf4b58dab12c3c0ad0401fe3b863
BLAKE2b-256 d8b6f874aac75c8f4a10cc931b99249bb506f9d3de731b35f050e2d56384cad8

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_doctor-0.1.1.tar.gz:

Publisher: publish.yml on JaaasperLiu/repo-doctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repo_doctor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: repo_doctor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for repo_doctor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2d8fc6d526a05ec52970d1904818a71f9880ef049349ab93f4bb5d8dcf53d8
MD5 1fd168a372c3b77d06878614a1b70ee6
BLAKE2b-256 7c63ceb80c114ef04dfd1cbb026ee0541cf2c4119b18e161d658dd28ad33cec3

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_doctor-0.1.1-py3-none-any.whl:

Publisher: publish.yml on JaaasperLiu/repo-doctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page