Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .claude/commands/pre-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Before running the checklist, run `git fetch origin`. If the current branch is behind `origin/master`, stop and rebase before proceeding.

Run the pre-commit checklist for this project:

1. Update `CHANGELOG.md` `[Unreleased]` section — add an entry under the appropriate subsection (Added / Changed / Fixed / Removed) describing the changes made, referencing the issue number.
2. Run `dotnet build --configuration Release` — must succeed.
3. Run `dotnet test --settings .runsettings` — all tests must pass.
4. Run `dotnet csharpier --check .` — must pass (run `dotnet csharpier .` to auto-fix).
5. If `coderabbit` CLI is installed, run `coderabbit review --type uncommitted --prompt-only`:
- If actionable/serious findings are reported, stop and address them before proposing the commit.
- If only nitpick-level findings, report them and continue to the commit proposal.
- If `coderabbit` is not installed, skip this step with a note.

Run steps 1–4, report the results clearly, then run step 5 (CodeRabbit review) if available, then propose a branch name and commit message for my approval using the format `type(scope): description (#issue)` (max 80 chars; types: `feat` `fix` `chore` `docs` `test` `refactor` `ci` `perf`). Do not create the branch or commit until I explicitly confirm.
109 changes: 109 additions & 0 deletions .claude/commands/pre-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Run the pre-release checklist for this project. Work through all three phases
in order, pausing for explicit confirmation at each decision point before
proceeding. Never create a branch, commit, tag, or push without approval.

---

## Phase 1 — Determine next release

1. Run `git status` and confirm the working tree is clean and on `master`.
If not, stop and report the problem.

2. Run `git tag --sort=-v:refname` to list existing tags. Identify the most
recent tag matching `v*.*.*-*` and extract its stadium codename.

3. Read the A–Z stadium table from `CHANGELOG.md` to find the next stadium:
- **No tags yet**: start at `A` (first stadium in the table).
- **Normal case**: use the stadium that follows the last used codename
alphabetically. If letters were skipped, pick the next after the
highest existing codename — do not backfill gaps.
- **Last codename is `Z`** (Zentralstadion): the list is finite. Stop and
refer to ADR 0012 for guidance on extending or revisiting the convention.

4. Read the `[Unreleased]` section of `CHANGELOG.md` and infer the version
bump using these rules (applied in order — first match wins):
- Any entry contains the word **BREAKING** (case-insensitive), a
`BREAKING CHANGE:` token in a commit footer, or a `!` suffix after
the commit type/scope (e.g. `feat!:` or `feat(scope)!:`) → **major** bump
- Any `### Added` subsection has entries → **minor** bump
- Otherwise (only `### Changed`, `### Fixed`, `### Removed`) → **patch** bump

5. Compute the next version by applying the bump to the current latest tag's
semver (e.g. `v2.1.0-dusseldorf` + minor → `2.2.0`).

6. Present a summary for confirmation before continuing:
- Last tag and stadium
- Next version and stadium codename
- Bump type and the reasoning (what triggered it)
- Proposed tag: `vX.Y.Z-{stadium}`
- Proposed branch: `release/vX.Y.Z-{stadium}`

**Wait for explicit approval before proceeding to Phase 2.**

---

## Phase 2 — Prepare release branch

1. Create branch `release/vX.Y.Z-{stadium}` from `master`.

2. Edit `CHANGELOG.md`:
- Replace `## [Unreleased]` with `## [X.Y.Z - StadiumName] - YYYY-MM-DD`
(use today's date; use the stadium's display name from the table, e.g.
"Bernabeu", "Centenario").
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- Consolidate duplicate subsection headings (e.g. two `### Added` blocks
should be merged into one).
- Add a new empty `## [Unreleased]` section at the top (above the new
versioned heading) with the standard subsections.
- Update the compare links at the bottom of the file:
- `[unreleased]` → `.../compare/vX.Y.Z-{stadium}...HEAD`
- Add `[X.Y.Z - StadiumName]` → `.../compare/v{prev-tag}...vX.Y.Z-{stadium}`

3. Show the full diff of `CHANGELOG.md` and propose this commit message:

```text
docs(changelog): prepare release notes for vX.Y.Z-{stadium} (#issue)
```

**Wait for explicit approval before committing.**

4. Run `/pre-commit`, manually skipping step 1 — do not re-run or re-attempt
the CHANGELOG update; it was already completed above. Open with: "Skip
step 1 — CHANGELOG was already updated as part of this release branch."
Proceed directly with steps 2–5.

5. Propose opening a PR from `release/vX.Y.Z-{stadium}` into `master`.
**Wait for explicit approval before opening.**

6. Open the PR with:
- Title: `docs(changelog): prepare release notes for vX.Y.Z-{stadium}`
- Body summarising what is included in this release.

---

## Phase 3 — Tag and release

1. Wait — do not proceed until the user confirms:
- CI is green
- The PR has been merged into `master`

2. Once confirmed, run:
```bash
git checkout master && git pull origin master
```
and show the resulting `git log --oneline -3`.

3. Propose the annotated tag:
```bash
git tag -a vX.Y.Z-{stadium} -m "Release X.Y.Z - StadiumName"
```

**Wait for explicit approval before creating the tag.**

4. Create the tag, then propose:
```bash
git push origin vX.Y.Z-{stadium}
```

**Wait for explicit approval before pushing.** Remind the user that pushing
the tag triggers the CD workflow which will build, publish the Docker image,
and create the GitHub Release.
8 changes: 0 additions & 8 deletions .claude/commands/precommit.md

This file was deleted.

2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

## Claude Code

- Run `/precommit` to execute the full pre-commit checklist for this project.
- Run `/pre-commit` to execute the full pre-commit checklist for this project.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/Dotnet.Samples.AspNetCore.WebApi/badge)](https://www.codefactor.io/repository/github/nanotaboada/Dotnet.Samples.AspNetCore.WebApi)
[![License: MIT](https://img.shields.io/badge/License-MIT-3DA639.svg)](https://opensource.org/licenses/MIT)
![Dependabot](https://img.shields.io/badge/Dependabot-contributing-025E8C?logo=dependabot&logoColor=white&labelColor=181818)
![GitHub Copilot](https://img.shields.io/badge/GitHub_Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
![Claude](https://img.shields.io/badge/Claude-Sonnet_4.6-D97757?logo=claude&logoColor=white&labelColor=181818)
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/nanotaboada/Dotnet.Samples.AspNetCore.WebApi?utm_source=oss&utm_medium=github&utm_campaign=nanotaboada%2FDotnet.Samples.AspNetCore.WebApi&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews&labelColor=181818)
![Copilot](https://img.shields.io/badge/Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
![Claude](https://img.shields.io/badge/Claude-contributing-D97757?logo=claude&logoColor=white&labelColor=181818)
![CodeRabbit](https://img.shields.io/badge/CodeRabbit-reviewing-FF570A?logo=coderabbit&logoColor=white&labelColor=181818)

Proof of Concept for a RESTful API built with .NET 10 (LTS) and ASP.NET Core. Manage football player data with SQLite, Entity Framework Core, Swagger documentation, and in-memory caching.

Expand Down
Loading