Skip to content

Commit 3a9eeeb

Browse files
committed
Updated CLAUDE.md and README.md
1 parent ab663f9 commit 3a9eeeb

15 files changed

Lines changed: 68 additions & 19 deletions

File tree

.claude/CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This directory contains all Claude Code configuration for **this Copier template
2222
│ └── *.sh ← individual hook scripts
2323
├── commands/ ← slash command prompt files
2424
│ └── *.md ← one file per slash command
25+
├── skills/ ← Agent skills (TDD workflow, test planner, test quality reviewer, …)
2526
└── rules/ ← AI coding rules
2627
├── README.md ← rule developer guide (structure, priority, dual-hierarchy)
2728
├── common/ ← language-agnostic rules
@@ -57,7 +58,7 @@ for the full developer guide.
5758
| `pre-bash-git-push-reminder.sh` | PreToolUse | Bash | Warn to run `just review` before push |
5859
| `pre-bash-commit-quality.sh` | PreToolUse | Bash | Scan staged `.py` files for secrets/debug markers |
5960
| `pre-bash-coverage-gate.sh` | PreToolUse | Bash | Warn before `git commit` if coverage below threshold |
60-
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/pyright config edits |
61+
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/basedpyright config edits |
6162
| `pre-protect-uv-lock.sh` | PreToolUse | Write\|Edit | Block direct edits to `uv.lock` |
6263
| `pre-write-src-require-test.sh` | PreToolUse | Write\|Edit | Block if the matching test file does not exist (strict TDD) |
6364
| `pre-write-src-test-reminder.sh` | PreToolUse | Write\|Edit | Warn if test file missing for new source module (optional alternative to strict TDD) |

.claude/commands/standards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the "am I ready to merge?" command. It runs all checks and aggregates re
66

77
1. **Static analysis**`just lint` + `just type`
88
- ruff: all configured rules (E, F, I, UP, B, SIM, C4, RUF, D, C90, PERF)
9-
- basedpyright: strict type checking
9+
- basedpyright: `standard` mode type checking
1010

1111
2. **Docstring coverage**`just docs-check`
1212
- All public symbols have Google-style docstrings

.claude/hooks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ exit 0
271271
| `pre-bash-git-push-reminder.sh` | PreToolUse | Bash | Warn to run `just review` before push |
272272
| `pre-bash-commit-quality.sh` | PreToolUse | Bash | Secret/debug scan before `git commit` |
273273
| `pre-bash-coverage-gate.sh` | PreToolUse | Bash | Warn before `git commit` if coverage below threshold |
274-
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/pyright config edits |
274+
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/basedpyright config edits |
275275
| `pre-protect-uv-lock.sh` | PreToolUse | Write\|Edit | Block direct edits to `uv.lock` |
276276
| `pre-write-src-require-test.sh` | PreToolUse | Write\|Edit | Block if `tests/<pkg>/test_<module>.py` missing for top-level `src/<pkg>/<module>.py` (strict TDD) |
277277
| `pre-write-src-test-reminder.sh` | (optional) | Write\|Edit | Non-blocking alternative to `pre-write-src-require-test.sh`**do not register both** |

.github/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ before pushing a tag.
7777
- Run `just ci` before pushing — CI must pass locally before merging.
7878
- After changing a workflow, check that the `sync-skip-if-exists.yml` does not need to be
7979
updated (it reads `copier.yml` `_skip_if_exists`).
80-
- When bumping GitHub Actions versions (e.g. `actions/checkout@v4`), also update the
80+
- When bumping GitHub Actions versions (e.g. `actions/checkout@v6`), also update the
8181
corresponding actions in `template/.github/workflows/` so generated projects stay current.

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ destination folder.
2222
│ └── … # pyproject.toml.jinja, justfile.jinja, CLAUDE.md.jinja, …
2323
├── tests/ # pytest tests that render the template and assert output
2424
│ ├── test_template.py # Main integration suite — copier copy + assertions
25+
│ ├── test_root_template_sync.py # Tests for check_root_template_sync.py
2526
│ └── test_repo_file_freshness.py # Unit tests for repo_file_freshness.py script
2627
├── scripts/ # Automation scripts for CI or local tasks
2728
│ ├── repo_file_freshness.py # Git-based freshness dashboard (→ docs/ + assets/)
2829
│ ├── bump_version.py # PEP 440 version bumper (patch/minor/major)
30+
│ ├── check_root_template_sync.py # Root ↔ template parity (workflows, settings, recipes)
2931
│ ├── sync_skip_if_exists.py # Sync copier.yml _skip_if_exists with template paths
3032
│ └── update_files.sh # Batch file update helper
3133
├── .claude/ # Claude Code hooks, commands, and rules for THIS meta-repo

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Prerequisites:
4040
- 🐍 Python 3.11+
4141
- 🌱 Git
4242
- 🧩 `copier`
43+
- 🪝 `just` (task runner — used throughout this repo and generated projects)
4344

4445
> [!WARNING]
4546
> Generate from **trusted templates**: when a template uses Copier `tasks`, they run with the
@@ -141,18 +142,26 @@ Other useful commands:
141142
- 🧹 **`just fix`**: auto-fix lint issues
142143
-**`just fmt`**: format code
143144
- 🔍 **`just lint`**: lint check
144-
- 🧠 **`just type`**: type check (strict mode)
145+
- 🧠 **`just type`**: type check (basedpyright **standard** mode)
146+
- 📜 **`just docs-check`**: Google-style docstrings (ruff `D` only)
147+
-**`just review`**: `fix``lint``type``docs-check`
145148
- 🧪 **`just test`**: run template integration tests (renders the template and asserts output)
146149
- 📊 **`just coverage`**: run tests with coverage report
147150
-**`just test-parallel`**: run tests in parallel (faster)
151+
- 🔁 **`just precommit`**: run pre-commit on all files
152+
- 🩺 **`just doctor`**: print toolchain and project versions
153+
- 🔗 **`just sync-check`**: validate root/template sync policy (`scripts/check_root_template_sync.py`)
154+
- 🧱 **`just static_check`**: `fix` + `lint` + `type` + `docs-check` (no tests)
155+
-**`just ci-check`**: read-only full gate (matches GitHub Actions lint + tests + security steps)
148156

149157
### Testing this template
150158

151-
The test suite (`tests/test_template.py`) uses pytest to:
159+
The test suite (`tests/test_template.py`, `tests/test_root_template_sync.py`, `tests/test_repo_file_freshness.py`) uses pytest to:
152160
- Render the template with various configurations
153161
- Validate generated project structure
154162
- Check that generated projects have valid Python syntax
155163
- Verify CI/CD workflow files are valid YAML
164+
- Enforce root/template sync policy (`check_root_template_sync.py`)
156165
- Test all combinations of optional features (docs, NumPy, pandas)
157166

158167
## Releasing this template 🏷️

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "python_project_template"
3-
version = "0.0.7"
3+
version = "0.0.8"
44
description = "Copier template repository for generating uv-first Python projects."
55
readme = "README.md"
66
requires-python = ">=3.11"

scripts/CLAUDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,23 @@ intent of this script: no Google docstrings required, and `print()` is allowed f
7373

7474
---
7575

76+
### `check_root_template_sync.py`
77+
78+
Validates that root and `template/` stay aligned on configured paths (for example GitHub
79+
Actions pins, shared recipes, and other policy maps).
80+
81+
**Invocation:** `just sync-check``uv run python scripts/check_root_template_sync.py`
82+
83+
**What it does:**
84+
- Loads JSON policy maps under the repo (workflow action versions, justfile parity rules, etc.).
85+
- Compares root files to their `template/` counterparts and fails with a diff on drift.
86+
87+
**Used by:** `.github/workflows/lint.yml` (meta-repo CI) and `just ci-check` / `just sync-check`.
88+
89+
**Tested by:** `tests/test_root_template_sync.py`
90+
91+
---
92+
7693
### `sync_skip_if_exists.py`
7794

7895
Synchronises the `_skip_if_exists` list in `copier.yml` with the actual template file paths

template/.claude/commands/standards.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the "am I ready to merge?" command. It runs all checks and aggregates re
66

77
1. **Static analysis** — `just lint` + `just type`
88
- ruff: all configured rules (E, F, I, UP, B, SIM, C4, RUF, D, TCH, PGH, PT, ARG, C90, PERF)
9-
- basedpyright: strict type checking
9+
- basedpyright: `standard` mode type checking
1010

1111
2. **Docstring coverage** — `just docs-check`
1212
- All public symbols in `src/{{ package_name }}/` have Google-style docstrings

template/.claude/hooks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ exit 0
213213
| `pre-bash-block-no-verify.sh` | PreToolUse | Bash | Block `git --no-verify` |
214214
| `pre-bash-git-push-reminder.sh` | PreToolUse | Bash | Warn to review before push |
215215
| `pre-bash-commit-quality.sh` | PreToolUse | Bash | Secret/debug scan before commit |
216-
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/pyright config |
216+
| `pre-config-protection.sh` | PreToolUse | Write\|Edit\|MultiEdit | Block weakening ruff/basedpyright config |
217217
| `pre-protect-uv-lock.sh` | PreToolUse | Write\|Edit | Block direct edits to `uv.lock` |
218218
| `pre-write-src-require-test.sh` | PreToolUse | Write\|Edit | Block if `tests/<pkg>/test_<module>.py` missing for top-level `src/<pkg>/<module>.py` (strict TDD) |
219219
| `pre-bash-coverage-gate.sh` | PreToolUse | Bash | Warn before `git commit` if coverage below threshold |

0 commit comments

Comments
 (0)