Skip to content

feat(agents): add gofmt and generated-file hooks, two skills, two reviewers - #202

Merged
omattsson merged 1 commit into
mainfrom
chore/claude-automations
Nov 21, 2026
Merged

omattsson merged 1 commit into
mainfrom
chore/claude-automations

Conversation

@omattsson

Copy link
Copy Markdown
Owner

Summary

Claude Code automations for this repo, from a setup review. No Go code changes.

  • Hooks (.claude/hooks/, wired in .claude/settings.json)
    • gofmt-on-edit.sh (PostToolUse, Edit|Write): runs gofmt -w on the edited .go file. Never blocks.
    • protect-generated.sh (PreToolUse, Edit|Write): blocks hand edits to cli/test/contract/testdata/swagger.json, cli/go.sum, cli/dist/* and cli/bin/*, and names the command to use instead.
  • Skills (user-only)
    • new-command: the "Adding a New Command" checklist from CLAUDE.md as a repeatable flow.
    • refresh-contract: runs refresh-swagger.sh, summarizes route and field changes, runs the contract tests, updates pkg/types and api-reference.md.
  • Agents
    • cli-compat-reviewer: reviews only the scripting contract (stdout/stderr in machine modes, exit codes, JSON fields, yaml inline tags, plugin env, agent_guide.md).
    • security-reviewer: reviews credential, token, TLS and server-text handling.
  • docs/claude/structure.md lists the new skills and hooks.

Notes

  • The hook scripts need jq; gofmt-on-edit.sh also needs gofmt.
  • The hooks block only Edit and Write. refresh-swagger.sh, go mod and make build still work.

Testing

  • Ran both hook scripts by hand: protect-generated.sh exits 2 for swagger.json and 0 for cli/cmd/root.go; gofmt-on-edit.sh reformatted a badly formatted file.
  • .claude/settings.json parses as valid JSON.
  • The skills and agents have not been run in a Claude session yet.

🤖 Generated with Claude Code

…iewers

- hooks: gofmt-on-edit formats edited .go files; protect-generated blocks
  hand edits to swagger.json, go.sum, cli/dist and cli/bin
- skills: new-command scaffolds a command with its tests and docs;
  refresh-contract refreshes the vendored swagger and runs the contract tests
- agents: cli-compat-reviewer checks the scripting contract;
  security-reviewer checks credential, token and TLS handling
- docs/claude/structure.md lists the new skills and hooks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@omattsson
omattsson merged commit 67fae4a into main Nov 21, 2026
8 checks passed
@omattsson
omattsson deleted the chore/claude-automations branch November 21, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant