Skip to content

Commit 7d39cc2

Browse files
authored
Merge pull request #295 from nanotaboada/chore/rename-and-extend-slash-commands
chore(claude): rename and extend slash commands
2 parents 7559f8c + 7954615 commit 7d39cc2

File tree

8 files changed

+200
-10
lines changed

8 files changed

+200
-10
lines changed

.claude/commands/pre-commit.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Before running the checklist, run `git fetch origin`. If the current branch is behind `origin/master`, stop and rebase before proceeding.
2+
3+
Run the pre-commit checklist for this project:
4+
5+
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.
6+
2. Run `./mvnw clean install` — must succeed with no compilation warnings and all tests passing.
7+
3. Remind me to open `target/site/jacoco/index.html` to verify coverage after the build completes.
8+
4. If Docker is running, run `docker compose build` — must succeed with no
9+
errors. Skip this step with a note if Docker Desktop is not running.
10+
5. If `coderabbit` CLI is installed, run `coderabbit review --type uncommitted --prompt-only`:
11+
- If actionable/serious findings are reported, stop and address them before proposing the commit.
12+
- If only nitpick-level findings, report them and continue to the commit proposal.
13+
- If `coderabbit` is not installed, skip this step with a note.
14+
15+
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.

.claude/commands/pre-release.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Run the pre-release checklist for this project. Work through all three phases
2+
in order, pausing for explicit confirmation at each decision point before
3+
proceeding. Never create a branch, commit, tag, or push without approval.
4+
5+
---
6+
7+
## Phase 1 — Determine next release
8+
9+
1. Run `git status` and confirm the working tree is clean and on `master`.
10+
If not, stop and report the problem.
11+
12+
2. Run `git tag --sort=-v:refname` to list existing tags. Identify the most
13+
recent tag matching `v*.*.*-*` and extract its club codename.
14+
15+
3. Read the A–Z club table from `CHANGELOG.md` to find the next club:
16+
- **No tags yet**: start at `A` (first club in the table).
17+
- **Normal case**: use the club that follows the last used codename
18+
alphabetically. If letters were skipped, pick the next after the
19+
highest existing codename — do not backfill gaps.
20+
- **Last codename is `Z`** (Zenit): the list is finite. Stop and flag
21+
that the naming convention needs to be revisited before proceeding.
22+
23+
4. Read the `[Unreleased]` section of `CHANGELOG.md` and infer the version
24+
bump using these rules (applied in order — first match wins):
25+
- Any entry contains the word **BREAKING** (case-insensitive), a
26+
`BREAKING CHANGE:` token in a commit footer, or a `!` suffix after
27+
the commit type/scope (e.g. `feat!:` or `feat(scope)!:`) → **major** bump
28+
- Any `### Added` subsection has entries → **minor** bump
29+
- Otherwise (only `### Changed`, `### Fixed`, `### Removed`) → **patch** bump
30+
31+
5. Compute the next version by applying the bump to the current latest tag's
32+
semver (e.g. `v1.0.0-arsenal` + minor → `1.1.0`).
33+
34+
6. Present a summary for confirmation before continuing:
35+
- Last tag and club
36+
- Next version and club codename
37+
- Bump type and the reasoning (what triggered it)
38+
- Proposed tag: `vX.Y.Z-{club}`
39+
- Proposed branch: `release/vX.Y.Z-{club}`
40+
41+
**Wait for explicit approval before proceeding to Phase 2.**
42+
43+
---
44+
45+
## Phase 2 — Prepare release branch
46+
47+
1. Create branch `release/vX.Y.Z-{club}` from `master`.
48+
49+
2. Edit `CHANGELOG.md`:
50+
- Replace `## [Unreleased]` with `## [X.Y.Z - ClubName] - YYYY-MM-DD`
51+
(use today's date; use the club's display name from the table, e.g.
52+
"Barcelona", "Chelsea").
53+
- Consolidate duplicate subsection headings (e.g. two `### Added` blocks
54+
should be merged into one).
55+
- Add a new empty `## [Unreleased]` section at the top (above the new
56+
versioned heading) with the standard subsections.
57+
- Update the compare links at the bottom of the file:
58+
- `[unreleased]``.../compare/vX.Y.Z-{club}...HEAD`
59+
- Add `[X.Y.Z - ClubName]``.../compare/v{prev-tag}...vX.Y.Z-{club}`
60+
61+
3. Show the full diff of `CHANGELOG.md` and propose this commit message:
62+
63+
```text
64+
docs(changelog): prepare release notes for vX.Y.Z-{club} (#issue)
65+
```
66+
67+
**Wait for explicit approval before committing.**
68+
69+
4. Run `/pre-commit`, manually skipping step 1 — do not re-run or re-attempt
70+
the CHANGELOG update; it was already completed above. Open with: "Skip
71+
step 1 — CHANGELOG was already updated as part of this release branch."
72+
Proceed directly with steps 2–4.
73+
74+
5. Propose opening a PR from `release/vX.Y.Z-{club}` into `master`.
75+
**Wait for explicit approval before opening.**
76+
77+
6. Open the PR with:
78+
- Title: `docs(changelog): prepare release notes for vX.Y.Z-{club}`
79+
- Body summarising what is included in this release.
80+
81+
---
82+
83+
## Phase 3 — Tag and release
84+
85+
1. Wait — do not proceed until the user confirms:
86+
- CI is green
87+
- The PR has been merged into `master`
88+
89+
2. Once confirmed, run:
90+
```bash
91+
git checkout master && git pull origin master
92+
```
93+
and show the resulting `git log --oneline -3`.
94+
95+
3. Propose the annotated tag:
96+
```bash
97+
git tag -a vX.Y.Z-{club} -m "Release X.Y.Z - ClubName"
98+
```
99+
100+
**Wait for explicit approval before creating the tag.**
101+
102+
4. Create the tag, then propose:
103+
```bash
104+
git push origin vX.Y.Z-{club}
105+
```
106+
107+
**Wait for explicit approval before pushing.** Remind the user that pushing
108+
the tag triggers the CD workflow which will build, publish the Docker image,
109+
and create the GitHub Release.

.claude/commands/precommit.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
target
55
.gitignore
66
azure-pipelines.yml
7+
CHANGELOG.md
8+
.claude/
9+
CLAUDE.md
10+
.coderabbit.yaml
711
CODE_OF_CONDUCT.md
812
codecov.yml
913
CONTRIBUTING.md
1014
LICENSE
1115
mvnw
1216
mvnw.cmd
17+
.sonarcloud.properties

.sonarcloud.properties

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# =============================================================================
2+
# SonarCloud Automatic Analysis configuration
3+
# https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/automatic-analysis/
4+
#
5+
# SonarCloud's automatic analysis (GitHub App, no CI workflow) reads THIS file.
6+
# Wildcard patterns are NOT supported here, so all exclusion paths must be
7+
# listed explicitly.
8+
# =============================================================================
9+
10+
sonar.projectKey=nanotaboada_java.samples.spring.boot
11+
sonar.organization=nanotaboada
12+
sonar.projectName=java.samples.spring.boot
13+
14+
sonar.sources=src/main/java/
15+
sonar.tests=src/test/java/
16+
sonar.java.binaries=target/classes/
17+
sonar.sourceEncoding=UTF-8
18+
19+
# =============================================================================
20+
# Global exclusions
21+
# Models and converters are infrastructure/boilerplate; excluded from analysis.
22+
# =============================================================================
23+
24+
sonar.exclusions=\
25+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/Player.java,\
26+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/PlayerDTO.java,\
27+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/converters/IsoDateConverter.java,\
28+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/Application.java
29+
30+
# =============================================================================
31+
# Coverage exclusions
32+
# Mirrors codecov.yml ignore list — focus on controllers/, services/,
33+
# repositories/
34+
# =============================================================================
35+
36+
sonar.coverage.exclusions=\
37+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/controllers/PlayersControllerTests.java,\
38+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/PlayerDTOFakes.java,\
39+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/PlayerFakes.java,\
40+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/repositories/PlayersRepositoryTests.java,\
41+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/services/PlayersServiceTests.java,\
42+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/Player.java,\
43+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/PlayerDTO.java,\
44+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/converters/IsoDateConverter.java,\
45+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/Application.java
46+
47+
# =============================================================================
48+
# Duplicate code (CPD) exclusions
49+
# Automatic analysis does not support wildcard patterns, so each file is
50+
# listed explicitly.
51+
#
52+
# Player.java and PlayerDTO.java — entity and DTO mirror each other by design.
53+
# Test fakes — PlayerFakes and PlayerDTOFakes are intentionally parallel.
54+
# =============================================================================
55+
56+
sonar.cpd.exclusions=\
57+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/Player.java,\
58+
src/main/java/ar/com/nanotaboada/java/samples/spring/boot/models/PlayerDTO.java,\
59+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/PlayerFakes.java,\
60+
src/test/java/ar/com/nanotaboada/java/samples/spring/boot/test/PlayerDTOFakes.java

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ Release names follow the **historic football clubs** naming convention (A–Z):
4040

4141
## [Unreleased]
4242

43+
### Added
44+
45+
- `.sonarcloud.properties`: SonarCloud Automatic Analysis configuration —
46+
sources, tests, coverage exclusions aligned with `codecov.yml` (#293)
47+
- `.dockerignore`: added `.claude/`, `CLAUDE.md`, `.coderabbit.yaml`,
48+
`.sonarcloud.properties`, `CHANGELOG.md`, `README.md` (#293)
49+
4350
---
4451

4552
## [1.0.0 - Arsenal] - 2026-03-29

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
## Claude Code
66

7-
- Run `/precommit` to execute the full pre-commit checklist for this project.
7+
- Run `/pre-commit` to execute the full pre-commit checklist for this project.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
[![CodeFactor](https://www.codefactor.io/repository/github/nanotaboada/java.samples.spring.boot/badge)](https://www.codefactor.io/repository/github/nanotaboada/java.samples.spring.boot)
88
[![License: MIT](https://img.shields.io/badge/License-MIT-3DA639.svg)](https://opensource.org/licenses/MIT)
99
![Dependabot](https://img.shields.io/badge/Dependabot-contributing-025E8C?logo=dependabot&logoColor=white&labelColor=181818)
10-
![GitHub Copilot](https://img.shields.io/badge/GitHub_Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
11-
![Claude](https://img.shields.io/badge/Claude-Sonnet_4.6-D97757?logo=claude&logoColor=white&labelColor=181818)
10+
![Copilot](https://img.shields.io/badge/Copilot-contributing-8662C5?logo=githubcopilot&logoColor=white&labelColor=181818)
11+
![Claude](https://img.shields.io/badge/Claude-contributing-D97757?logo=claude&logoColor=white&labelColor=181818)
12+
![CodeRabbit](https://img.shields.io/badge/CodeRabbit-reviewing-FF570A?logo=coderabbit&logoColor=white&labelColor=181818)
1213

1314
Proof of Concept for a RESTful Web Service built with **Spring Boot 4** targeting **JDK 25 (LTS)**. This project demonstrates best practices for building a layered, testable, and maintainable API implementing CRUD operations for a Players resource (Argentina 2022 FIFA World Cup squad).
1415

0 commit comments

Comments
 (0)