Skip to content

chore: Claude-first setup#2783

Draft
mmagician wants to merge 20 commits intonextfrom
mmagician-claude-setup
Draft

chore: Claude-first setup#2783
mmagician wants to merge 20 commits intonextfrom
mmagician-claude-setup

Conversation

@mmagician
Copy link
Copy Markdown
Collaborator

@mmagician mmagician commented Apr 16, 2026

Desired workflow:

  1. Point Claude at an issue, ask it to create a PR to address it
  2. Plan
  3. Once plan is approved, Claude works on the implementation
  4. Before a commit, executes a hook to make lint
  5. Before push:
  • runs make test
  • runs two review agents; if any agent comes back with findings, main agent fixes these
  1. Before creating PR, ensures the PR is being created in --draft mode
  2. After PR is created, checks if CHANGELOG.md exists; if yes, proceeds; if not, determines whether it should add an entry or a no changelog label - the main agent takes care of this.
  3. PR author manually reviews the PR; if all looks good, he requests reviews from peers; else explains to Claude what should change and codifies this as skill/hook, so that next time Claude doesn't make the same mistake. As you can see from the commit history, I've had a few iterations on this, but at the end this resulting PR is basically one-shotted. We should aim at one-shoting 95% of our PRs (and 5% would result in skills/hooks being updated).
  4. Peers/code owners review the PR. As with the previous point, requested changes (patterns/standards/Miden-specific practices) should be codified.

The goal is to codify our shared knowledge into a set of actionable artifacts.

TODOs:

mmagician and others added 17 commits April 14, 2026 10:15
- Stop forcing reviewers to fabricate findings; nits/notes are advisory
- Require explicit APPROVE:/CLEAN: verdict (not just absence of BLOCK:)
- Use repo root in lint/test hooks so they work from subdirectories
- Add branch guards to rebase agent (skip protected branches)
- Pass --allowedTools to review agents for Bash/Read access
- Add per-project lessons link to CLAUDE.md
- Remove dangling .claude/skills symlink

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

fix: CI monitor needs --allowedTools and effort: medium to actually execute
@mmagician mmagician added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Apr 16, 2026
claude and others added 2 commits April 16, 2026 12:19
Adds a PostToolUse hook that fires after PR creation and spawns a
changelog-manager agent to classify the diff. The agent determines
whether a CHANGELOG.md entry or "no changelog" label is needed, and
feeds actionable instructions back to the main agent via exit code 2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mmagician mmagician added the pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority label Apr 16, 2026
* Improve Claude setup based on NTL battle-testing

Consolidated pre-push hook:
- Merged pre-push-test.sh into pre-push-review.sh (tests run first,
  then reviewers only if tests pass - saves reviewer tokens on broken code)
- Severity-based blocking: nits and notes don't block push, only
  Critical/Important/Warning findings do
- Proper diff base resolution: tries upstream, falls back to default
  branch via gh, then HEAD~1
- Handles reviewer crashes gracefully (empty/malformed output = block)
- Escape hatch: SKIP_PRE_PUSH=1

Input guards on all hooks:
- Each hook validates the command matches before acting (defense in depth
  against settings.json filter regressions)

Improved settings.json:
- Removed separate pre-push-test.sh entry (now in pre-push-review.sh)
- Added proper `if` filter on pre-pr-draft.sh (was firing on all Bash)
- Removed post-pr-create-ci-monitor.sh (superseded)

Lessons system:
- Added .claude/lessons.md for codifying review feedback
- Added .claude/commands/codify-lesson.md slash command
- Updated CLAUDE.md to reference in-repo lessons file instead of
  global ~/.claude path

Agent improvements:
- Code reviewer and security reviewer use gh-based default branch
  resolution instead of hardcoded branch names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review: remove guards, split hooks, drop lessons

- Remove input guards from all hooks (boilerplate, unclear value)
- Restore pre-push-test.sh as separate hook (keep tests and reviews
  conceptually separate per review feedback)
- Remove lessons.md and codify-lesson.md (use SKILLS.md instead)
- Revert CLAUDE.md lessons reference
- Keep: severity-based blocking, diff base resolution, crash handling,
  proper if filters, agent branch resolution via gh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Adding new lines at the end of the file

* Removing unecessary code from post-pr-create-changelog.sh

* removing code from pre-pr-draft.sh

* remove escape hatch from pre-pr-draft.sh

* simplifying pre-pr-draft.sh

* removing escape hatch and default org repo from pre-push-review.sh

---------

Co-authored-by: Claude (Opus) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants