Skip to content

🌱 Rhiza

Reusable Configuration Templates for Modern Python Projects

w:200

αΏ₯Ξ―ΞΆΞ± (ree-ZAH) β€” Ancient Greek for "root"


πŸ€” The Problem

Setting up a new Python project is time-consuming:

  • βš™οΈ Configuring CI/CD pipelines
  • πŸ§ͺ Setting up testing frameworks
  • πŸ“ Creating linting and formatting rules
  • πŸ“š Configuring documentation generation
  • πŸ”§ Establishing development workflows
  • 🐳 Setting up dev containers

Result: Hours of configuration before writing actual code


πŸ’‘ The Solution: Rhiza

A curated collection of battle-tested templates that:

βœ… Save time on project setup βœ… Enforce best practices βœ… Maintain consistency across projects βœ… Stay up-to-date automatically βœ… Support multiple Python versions (3.11-3.14)


✨ Key Features

### πŸš€ Automation - GitHub Actions workflows - Pre-commit hooks - Automated releases - Version bumping ### πŸ§ͺ Testing - pytest configuration - CI test matrix - Code coverage - Documentation tests
### πŸ“š Documentation - Docs site with MkDocs + zensical - API docs with mkdocstrings - Presentation slides with Marp - Interactive notebooks ### πŸ”§ Developer Experience - Dev containers - VS Code integration - GitHub Codespaces ready - SSH agent forwarding

πŸ“ Available Templates

🌱 Core Project Configuration

  • .gitignore β€” Python project defaults
  • .editorconfig β€” Consistent coding standards
  • ruff.toml β€” Linting and formatting
  • pytest.ini β€” Testing framework
  • Makefile β€” Common development tasks
  • CODE_OF_CONDUCT.md & CONTRIBUTING.md

πŸ“ Available Templates (cont.)

πŸ”§ Developer Experience

  • .devcontainer/ β€” VS Code dev containers
  • .pre-commit-config.yaml β€” Pre-commit hooks
  • docker/ β€” Dockerfile templates

πŸš€ CI/CD & Automation

  • .github/workflows/ β€” GitHub Actions
  • Automated testing & releases
  • Documentation generation
  • Security scanning (CodeQL, Scorecard)

🎯 Quick Start

1. Install the plugin (once)

/plugin marketplace add Jebel-Quant/rhiza-claude
/plugin install rhiza@rhiza-claude

2. Adopt, in two pull requests

/rhiza:init      # writes .rhiza/template.yml β€” the pointer. Merge it.
/rhiza:update    # the first sync: the workflows, the Makefile, the rest

/rhiza:init syncs nothing, so its PR looks almost empty β€” that is correct.


πŸ”„ Template Synchronization

Templates stay up-to-date with Rhiza's latest improvements:

Configuration: .rhiza/template.yml

repository: "Jebel-Quant/rhiza"
ref: "v1.5.1"

profiles:
  - github-project

exclude: |
  docs/development/DOCKER.md

A profile expands to its bundles; exclude opts out of individual files.


πŸ”„ Staying Current

Syncing is a local command, not a scheduled job β€” nothing needs a write-scoped token on a timer:

  • πŸ€– Renovate opens a PR when the template's ref has a newer release
  • πŸ”„ /rhiza:update applies it: fetch the bundles, three-way merge, open the PR
  • πŸ” Only template-owned paths are staged β€” .rhiza/template.lock is the list
  • 🎯 exclude patterns and local edits both survive
  • πŸ“‹ /rhiza:status --check reports drift without changing anything

πŸ› οΈ Makefile: Your Command Center

make install      # Setup project with uv
make test         # Run pytest test suite
make fmt          # Run pre-commit hooks
make book         # Build the companion book
make book         # Build companion book
make presentation # Generate slides from PRESENTATION.md
make marimo       # Launch Marimo notebook server

Note: Releasing is driven by the rhiza-claude /release command, which bumps the version, regenerates the changelog, and creates the tag.

Tip: Run make help to see all available targets


πŸ“Š Marimo Integration

Marimo β€” Modern interactive Python notebooks

make marimo  # Start notebook server

Features

  • πŸ”„ Reactive execution
  • 🐍 Pure Python (no JSON)
  • πŸ“¦ Self-contained dependencies
  • 🎨 Built-in visualizations
  • πŸ’» VS Code extension support

Notebooks stored in docs/notebooks/ with inline dependency management.


πŸš€ Release Workflow

Release (via rhiza-claude /release)

/release
# β†’ Derives the next version
# β†’ Bumps pyproject.toml
# β†’ Regenerates CHANGELOG.md
# β†’ Creates the git tag locally

Pushing the tag triggers the release workflow. Releasing is not a make target.

Check Status

make workflow-status
# β†’ Shows workflow run history
# β†’ Shows latest release details

Release Automation

βœ… Builds Python package βœ… Creates GitHub release βœ… Publishes to PyPI (if public) βœ… Publishes devcontainer image (optional)


🐳 Dev Container Features

What You Get

  • 🐍 Python 3.14 runtime
  • ⚑ UV package manager
  • πŸ”§ All project dependencies
  • πŸ§ͺ Pre-commit hooks
  • πŸ“Š Marimo integration
  • πŸ” SSH agent forwarding
  • πŸš€ Port 8080 forwarding

Usage

VS Code: Reopen in Container Codespaces: Create codespace on GitHub


πŸ”§ Customization

Your own targets, in local.mk

The Makefile is template-owned and -includes local.mk, which no sync touches. An explicit rule beats its %: catch-all, so shadowing extends a task:

# local.mk β€” committed
install: $(UVX)
    @sudo apt-get update && sudo apt-get install -y graphviz
    @$(UVX) $(RHIZA_TASK) install

train-model: ## Train the ML model
    @uv run python scripts/train.py

Settings go in pyproject.toml's [tool.rhiza-task] table.


🎨 Documentation Customization

The docs site (MkDocs + zensical)

Override anything from the base config in your own mkdocs.yml:

INHERIT: docs/mkdocs-base.yml

theme:
  logo: assets/my-logo.png

API pages come from mkdocstrings; extra packages go in the mkdocs-extra-packages setting.

Presentations (Marp)

Edit PRESENTATION.md and run:

make presentation      # Generate HTML
make presentation-pdf  # Generate PDF
make presentation-serve # Interactive preview


βš™οΈ Configuration Variables

Control Python versions via repository variables:

PYTHON_MAX_VERSION

  • Default: '3.14'
  • Tests on 3.11, 3.12, 3.13, 3.14
  • Set to '3.13' to exclude 3.14

PYTHON_DEFAULT_VERSION

  • Default: '3.14'
  • Used in release, pre-commit, book workflows
  • Set to '3.12' for compatibility

Set in: Repository Settings β†’ Secrets and variables β†’ Actions β†’ Variables


πŸ” Code Quality Tools

Pre-commit Hooks

  • βœ… YAML validation
  • βœ… TOML validation
  • βœ… Markdown formatting
  • βœ… Trailing whitespace
  • βœ… End-of-file fixes
  • βœ… GitHub workflow validation

Ruff

  • Fast Python linter
  • Replaces flake8, isort, pydocstyle
  • Auto-fixing capabilities
  • Extensive rule selection

πŸ§ͺ Testing Philosophy

What Gets Tested

  • πŸ“ README code blocks
  • πŸ”§ Shell scripts (bump, release)
  • 🎯 Makefile targets
  • πŸ“ Repository structure
  • πŸ“Š Marimo notebooks

Test Command

make test

Runs pytest with coverage reporting and HTML output.


🌐 CI/CD Workflows

10 Automated Workflows

  1. CI β€” Test matrix across Python versions
  2. PRE-COMMIT β€” Validate code quality
  3. DEPTRY β€” Check dependency usage
  4. BOOK β€” Build documentation
  5. MARIMO β€” Validate notebooks
  6. DOCKER β€” Build and publish images
  7. DEVCONTAINER β€” Validate dev environment
  8. RELEASE β€” Automated releases
  9. SYNC β€” Template synchronization
  10. RHIZA β€” Self-injection test

πŸ“¦ Package Publishing

PyPI Publication

Automatic if configured as Trusted Publisher:

  1. Register package on PyPI
  2. Add GitHub Actions as trusted publisher
  3. Release workflow publishes automatically

Private Packages

Add to pyproject.toml:

classifiers = [
    "Private :: Do Not Upload",
]


🎯 Real-World Usage

Perfect For:

  • πŸ†• New Python projects
  • πŸ”„ Standardizing existing projects
  • πŸ‘₯ Team templates
  • πŸ“š Educational projects
  • 🏒 Corporate standards

Not Ideal For:

  • ❌ Non-Python projects
  • ❌ Projects requiring exotic configurations
  • ❌ One-off scripts

πŸ—οΈ Architecture Decisions

Why Makefile?

  • βœ… Universal (no language-specific tools)
  • βœ… Self-documenting
  • βœ… Easy to extend
  • βœ… Works everywhere

Why UV?

  • ⚑ 10-100x faster than pip
  • πŸ“¦ Handles entire Python ecosystem
  • πŸ”’ Lock files for reproducibility
  • 🎯 Single tool for everything

🀝 Contributing

How to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create feature branch
  3. ✍️ Make your changes
  4. βœ… Run make test and make fmt
  5. πŸ“€ Submit pull request

What to Contribute

  • πŸ†• New templates
  • πŸ› Bug fixes
  • πŸ“š Documentation improvements
  • πŸ’‘ Feature suggestions

πŸ“ˆ Project Stats

  • 🐍 Python Versions: 3.11, 3.12, 3.13, 3.14
  • πŸ“„ License: MIT
  • 🏷️ Current Version: 0.3.0
  • πŸ”§ Templates: 20+ configuration files
  • πŸ€– Workflows: 10 GitHub Actions
  • ⭐ Badge: Created with Rhiza


πŸ™ Acknowledgments

Built With

  • GitHub Actions β€” CI/CD automation
  • UV β€” Fast Python package management
  • Ruff β€” Fast Python linting
  • Pytest β€” Testing framework
  • Marimo β€” Interactive notebooks
  • Marp β€” This presentation!
  • MkDocs + zensical β€” The docs site
  • mkdocstrings β€” API documentation

πŸ’‘ Getting Started Today

Three Simple Steps

  1. Install: /plugin install rhiza@rhiza-claude in Claude Code
  2. Point: /rhiza:init writes .rhiza/template.yml β€” review and merge
  3. Sync: /rhiza:update brings the template content in

Or Explore First

# Open in Codespaces
# β†’ Click "Create codespace on main"

# Or clone locally
git clone https://github.com/jebel-quant/rhiza.git
cd rhiza
make install
make test

πŸŽ‰ Thank You!

Questions?

Rhiza β€” Your foundation for modern Python projects

From the Greek αΏ₯Ξ―ΞΆΞ± (root) β€” because every great project needs strong roots


πŸ“‹ Quick Reference Card

# Setup (in Claude Code)
# /rhiza:init                  # become rhiza-managed
# /rhiza:update                # sync the template content

# Development
make install                   # Install dependencies
make test                      # Run tests
make fmt                       # Format & lint

# Documentation
make book                      # Companion book
make book                      # Companion book
make presentation              # Generate slides

# Release (driven by the rhiza-claude /release command)
make workflow-status          # Show recent runs for the release workflow

# Notebooks
make marimo                    # Interactive notebooks

Ready to Root Your Project?

Get Started: github.com/jebel-quant/rhiza

w:300