go-samples-gin-restful: Command for Claude Code

.claude/commands/pre-commit.md

pre-commit is a command for Claude Code from nanotaboada/go-samples-gin-restful. It costs 0 tokens per session (750 once invoked), scanned A, original, MIT.

A pre-commit checklist for a Go project that checks the branch, updates the unreleased changelog, formats code, and tidies dependencies.

In plain words
What is it for?
Use it before committing feature or bug work to compare with the remote master branch, update CHANGELOG.md, run Go formatting, and review go.mod or go.sum changes.
Why use it?
It catches branch, formatting, changelog, and dependency issues before changes are committed. It also flags unexpected edits caused by dependency cleanup.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is nanotaboada/go-samples-gin-restful's own configuration. It tells Claude Code how to work on go-samples-gin-restful itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything go-samples-gin-restful configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nanotaboada/go-samples-gin-restful. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nanotaboada/go-samples-gin-restful/master/.claude/commands/pre-commit.md
Clone the repo
git clone --depth 1 https://github.com/nanotaboada/go-samples-gin-restful

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pre-commit

README.md
[![agentmods](https://agentmods.dev/badge/commands/nanotaboada/go-samples-gin-restful/pre-commit/github.svg)](https://agentmods.dev/commands/nanotaboada/go-samples-gin-restful/pre-commit)
Your own site
<a href="https://agentmods.dev/commands/nanotaboada/go-samples-gin-restful/pre-commit"><img src="https://agentmods.dev/badge/commands/nanotaboada/go-samples-gin-restful/pre-commit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pre-commit

Your own site · 80×15
<a href="https://agentmods.dev/commands/nanotaboada/go-samples-gin-restful/pre-commit"><img src="https://agentmods.dev/badge/commands/nanotaboada/go-samples-gin-restful/pre-commit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 750 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00750
Opus 5.5 $0.00000 $0.00300
Sonnet 5.5 $0.00000 $0.00150
Haiku 4.5 $0.00000 $0.00075

Measured 2mo ago against content hash cc664a57749e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pre-commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/pre-commit.md · 35 lines

What it actually says

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 — read the current CHANGELOG.md, inspect git diff to understand what changed, then write the appropriate entry under the correct subsection (Added / Changed / Fixed / Removed), referencing the issue number. If the [Unreleased] section already contains an entry that covers these changes (e.g. added during release branch preparation via /pre-release), skip this step. Also skip this step for tooling/maintenance changes with no backing GitHub issue — feature and bug work should already have an issue per this project's SDD workflow, so this exception does not apply to them.

  2. Run go fmt ./...

  3. Note whether go.mod/go.sum already have uncommitted changes before running go mod tidy (git diff --stat -- go.mod go.sum). Run go mod tidy, then compare again — if tidy introduced additional changes beyond that baseline, stop and report it — propose committing the tidy result first and wait for my explicit confirmation before doing so.

  4. Run go vet ./... — must pass.

  5. Run go build -v ./... — must succeed.

  6. Ask me: were any Swagger annotations modified? If yes, run swag init.

  7. Run go test -v ./... -coverpkg=github.com/nanotaboada/go-samples-gin-restful/service,github.com/nanotaboada/go-samples-gin-restful/controller,github.com/nanotaboada/go-samples-gin-restful/route -covermode=atomic -coverprofile=coverage.out — all tests must pass, target 80%+ coverage for service, controller, route packages.

  8. If Docker is running, run docker compose build — must succeed with no errors. Skip this step with a note if Docker Desktop is not running.

  9. If coderabbit CLI is installed and coderabbit review --help reports --agent support, run coderabbit review --type uncommitted --agent:

    • 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, or the installed version does not support --agent, skip this step with a note.

Run step 1 (CHANGELOG update), then run steps 2–3 sequentially (stop at step 3 if go.mod or go.sum changed), then ask about step 6 and run swag init first if needed, then run steps 4, 5, and 7 in parallel, run step 8 (docker build), then run step 9 (CodeRabbit review) if available, report the results clearly, 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) with the required Co-Authored-By: Claude Sonnet 5 <[email protected]> line. Do not create the branch or commit until I explicitly confirm.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 35 lines · 0 tokens per session scan A cc664a57749e

Subscribe to this mod's changes

pre-commit is a command published in the GitHub repository nanotaboada/go-samples-gin-restful (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 750 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

pre-commit compared with commands from other repositories

pre-commit next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pre-commitnanotaboada/go-samples-gin-restfulCommand23d agoMITA0Claude Code
resolve-conflictsai-sdlc-framework/ai-sdlcCommand434yesterdayApache-2.0A79Claude Code
code-reviewGoldziher/ai-rulezCommand167yesterdayMITA11Claude Code
releaseexistential-birds/beagleCommand851mo agoApache-2.0A12Claude Code
releaseGoldziher/ai-rulezCommand167yesterdayMITA4Claude Code
shipGoldziher/ai-rulezCommand167yesterdayMITA4Claude Code
release-tagexistential-birds/beagleCommand851mo agoApache-2.0A11Claude Code