chore: add dev loop hook scripts and remove completed design TODOs#44
chore: add dev loop hook scripts and remove completed design TODOs#44koenighotze wants to merge 15 commits into
Conversation
…ion header Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three Claude Code hooks enforce the branch→TDD→verify→PR→review loop: - scripts/hooks/guard-branch.sh blocks edits on main/master - scripts/hooks/test-on-edit.sh runs make test after every .go edit - scripts/hooks/loop-reminder.sh injects next-step context at turn end Remove the six design/TODO_*.md files that were already merged as PRs #36–#41. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ +0.00% coverage variation (-1.00%) |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (7c79a9f) 183 180 98.36% Head commit (9c91aa0) 183 (+0) 180 (+0) 98.36% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#44) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds local Claude Code hook scripts to encourage a branch→test→verify→PR→review development loop, cleans up shipped design TODO docs, and adjusts local tooling/CI configuration accordingly.
Changes:
- Add three hook scripts under
scripts/hooks/(branch guard, test-on-edit, loop reminder). - Remove completed
design/TODO_*.mddocuments that are already delivered via prior PRs. - Tweak local Make targets and refine CI workflow Go version wiring + govulncheck invocation.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/hooks/test-on-edit.sh | New PostToolUse hook to run make test after .go edits |
| scripts/hooks/loop-reminder.sh | New Stop hook to inject “next step” reminders into context |
| scripts/hooks/guard-branch.sh | New PreToolUse hook to block edits on main/master |
| Makefile | Rename some targets to *.local and add local tooling install bits |
| design/TODO_07_Remove_dead_test_fixture.md | Removed completed design TODO doc |
| design/TODO_06_Drop_log_Default.md | Removed completed design TODO doc |
| design/TODO_05_Fix_repositoy_typo.md | Removed completed design TODO doc |
| design/TODO_03_Use_io_Reader_in_config.md | Removed completed design TODO doc |
| design/TODO_02_Remove_panic_for_expected_failures.md | Removed completed design TODO doc |
| design/TODO_01_Fix_secret_error_message.md | Removed completed design TODO doc |
| CLAUDE.md | Minor header text cleanup |
| .gitignore | Ignore .commit_msg_tmp |
| .github/workflows/build.yml | Centralize Go version and switch security scan to govulncheck action |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- .claude/commands/watch-pr.md: slash command that waits for CI checks, reads Copilot/reviewer feedback, fixes warranted issues, and re-pushes until the PR is green and review-addressed - loop-reminder.sh: adds PR-open state — when CI/review is pending the hook now reminds to run /watch-pr instead of going silent - guard-branch.sh + loop-reminder.sh: scope branch guard to main only (drop master check per project convention) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- guard-branch.sh: add exit 0 so allow path never exits non-zero; fix comment - test-on-edit.sh: set -o pipefail preserves make exit code; guard cd against empty TOPLEVEL - Makefile: add lint, install.tools, deps.vulncheck aliases for backwards compat - .claude/commands/ship.md: new /ship command for full commit→PR→CI→review loop Dismissed: master branch suggestions (deliberate choice), brew guard (.local suffix signals macOS-only), duplicate setup-go in CI (needed by make get.dependencies). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- test-on-edit.sh: cd with || exit guard (SC2164)
- loop-reminder.sh: use grep -c instead of grep|wc -l (SC2126); quote @{u}.. refspec (SC1083)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add blank lines around fenced code blocks (MD031) and before list items (MD032) in ship.md and watch-pr.md to satisfy Codacy static analysis. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the stop hook kept injecting /watch-pr on every turn even after CI was fully green. Now it only fires if CI has failing, pending, or action-required checks — stays silent once the PR is ready to merge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@copilot resolve the merge conflicts in this pull request |
Resolved the merge conflict in |
- guard-branch.sh: add early exit when not in a git repo; extend branch check to cover both main and master - test-on-edit.sh: add errexit + nounset to complement existing pipefail; use explicit exit 1 when cd fails - loop-reminder.sh: extend branch check to cover master and interpolate the actual branch name into the reminder message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot review follow-upCommit 28c552e fixes:
Three findings are intentionally left open:
|
…hook With set -o errexit active, a failing jq call (invalid stdin) or git rev-parse (outside a repo) would terminate the hook immediately instead of falling through to the existing guards. Add || exit 0 so failures produce a clean no-op rather than an unexpected abort. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
scripts/hooks/that enforce the branch→TDD→verify→PR→review development loopdesign/TODO_*.mdfiles that were already shipped as PRs fix: include secret path in error message #36–refactor: drop redundant log.Default() calls #41Hook scripts
guard-branch.shPreToolUseon Edit/Writemainormastertest-on-edit.shPostToolUseon Edit/Writemake testafter every.gofile editloop-reminder.shStopThe hooks are wired via
.claude/settings.local.json(not committed — local override per developer).Test plan
main, attempt a file edit — hook should block with "Create a feature branch first".gofile — hook should runmake testautomatically🤖 Generated with Claude Code