Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.35 KB

File metadata and controls

63 lines (46 loc) · 2.35 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this repo is

Two things:

  1. template-repo/ — boilerplate pushed to GitHub as a template repository (targets Python projects)
  2. create-repo.sh — script that spins up new repos from that template via the gh CLI

Prerequisites

  • gh CLI installed and authenticated (gh auth login)
  • jq installed

Using the script

# Basic usage
./create-repo.sh <repo-name> [options]

# Dry-run (preview without touching GitHub)
./create-repo.sh experiment-xyz --dry-run

# With all options
./create-repo.sh ml-pipeline \
  --org my-org \
  --template template-repo \
  --description "Some service" \
  --topics ml,python,internal \
  --private          # or --public
  --no-protect       # skip branch protection

Environment variables as defaults: GITHUB_ORG, GITHUB_TEMPLATE_REPO.

What the script does (in order)

  1. Creates repo from template via gh repo create --template
  2. Applies branch protection on main: requires PRs, 1 approval, CODEOWNER review, stale review dismissal, conversation resolution, and CI jobs named "Lint" and "Tests" to pass
  3. Enables Dependabot vulnerability alerts + automated security fixes
  4. Patches repo settings: squash+rebase merges only, auto-delete branches, no wiki/projects
  5. Adds comma-separated topics if --topics was passed
  6. Creates custom issue labels (replaces GitHub defaults)

Template repo structure

The template targets Python projects. The CI workflow (ci.yml) runs:

  • Lint job: ruff, black --check, isort --check-only
  • Tests job: pytest --cov=src (needs lint to pass first)
  • Security scan job: Trivy FS scan for HIGH/CRITICAL findings

Branch protection references the job names Lint and Tests as required status checks — if you rename those jobs in ci.yml, update the protection payload in create-repo.sh:149 accordingly.

Key customisation points

What Where
Required CI job names for branch protection create-repo.sh lines 148–150
Default issue labels create-repo.sh setup_labels() function
CODEOWNERS team template-repo/.github/CODEOWNERS
Dependabot ecosystems/schedule template-repo/.github/dependabot.yml
Python version / linters template-repo/.github/workflows/ci.yml