Skip to content

Commit 022ac44

Browse files
authored
chore: add reviewfixer configs (#244)
## Add reviewfixer to devShell with dedicated nixpkgs pin Introduces `reviewfixer.yaml` at the repository root to configure reviewfixer to run against the Claude ACP adapter via `npx @agentclientprotocol/claude-agent-acp`. After a successful fixing turn, it automatically posts a `/coder-agents-review` comment to request re-review. Adds `reviewfixer` to the Nix devShell by building it from a separate `nixpkgs-reviewfixer` input pinned to `nixos-unstable`. This separate pin is necessary because `reviewfixer` requires Go >= 1.26.2, which is not yet available in the main `nixpkgs` pin. The separate input should be removed once the main pin includes Go >= 1.26.2. Note that running `nix flake update` without `--select` will silently collapse both pins to the same revision; use `nix flake update nixpkgs-reviewfixer` to update only that input. Upstream tests are skipped in the Nix build because they shell out to `git`, which is unavailable in the Nix build sandbox.
1 parent 432121f commit 022ac44

3 files changed

Lines changed: 96 additions & 1 deletion

File tree

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
# Separate nixpkgs pin used only to build reviewfixer. The main pin is
7+
# held back to avoid CI/formatter churn, but reviewfixer requires
8+
# Go >= 1.26.2. Remove `nixpkgs-reviewfixer` (and `pkgsReviewfixer`
9+
# below) once the main pin includes Go >= 1.26.2
10+
# (check: `nix eval nixpkgs#go.version`).
11+
#
12+
# Note: `nix flake update` (no `--select`) bumps both inputs to the
13+
# same rev, silently collapsing this version gap. Use
14+
# `nix flake update nixpkgs-reviewfixer` to update this input alone.
15+
nixpkgs-reviewfixer.url = "github:NixOS/nixpkgs/nixos-unstable";
616
flake-utils.url = "github:numtide/flake-utils";
717
treefmt-nix.url = "github:numtide/treefmt-nix";
818
};
919

10-
outputs = { self, nixpkgs, flake-utils, treefmt-nix, ... }:
20+
outputs = { self, nixpkgs, nixpkgs-reviewfixer, flake-utils, treefmt-nix, ... }:
1121
flake-utils.lib.eachDefaultSystem (system:
1222
let
1323
pkgs = import nixpkgs {
@@ -18,6 +28,33 @@
1828
];
1929
};
2030

31+
pkgsReviewfixer = import nixpkgs-reviewfixer { inherit system; };
32+
33+
reviewfixer = pkgsReviewfixer.buildGoModule rec {
34+
pname = "reviewfixer";
35+
version = "0.1.0-beta.0";
36+
37+
src = pkgsReviewfixer.fetchFromGitHub {
38+
owner = "ThomasK33";
39+
repo = "reviewfixer";
40+
rev = "v${version}";
41+
hash = "sha256-hrnSm7ttpyUAtkre9micI2n9smKgzX5AmUcj3bJQjbU=";
42+
};
43+
44+
vendorHash = "sha256-yIWbmHFxmOeXBm5TMRsupy33DC6VAUYvZNSz5wa1yxA=";
45+
46+
# Upstream tests shell out to `git`, which isn't available in the
47+
# Nix build sandbox. Skip the test phase here.
48+
doCheck = false;
49+
50+
meta = with pkgsReviewfixer.lib; {
51+
description = "Local harness for working through review feedback on Graphite-managed stacked PRs";
52+
homepage = "https://github.com/ThomasK33/reviewfixer";
53+
license = licenses.mit;
54+
mainProgram = "reviewfixer";
55+
};
56+
};
57+
2158
treefmt = treefmt-nix.lib.evalModule pkgs {
2259
projectRootFile = "flake.nix";
2360
programs = {
@@ -56,6 +93,7 @@
5693
websocat
5794
jq
5895
fzf
96+
reviewfixer
5997
# claude-code
6098
];
6199
in

reviewfixer.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/ThomasK33/reviewfixer/v0.1.0-beta.0/reviewfixer.schema.json
2+
# Config for running reviewfixer against the Claude ACP adapter.
3+
# reviewfixer automatically addresses PR review findings using an AI agent.
4+
#
5+
# Prerequisites:
6+
# - Use the project's Nix devShell (`nix develop` or `direnv allow`) which
7+
# already includes `reviewfixer`; this is the primary dev path here, or
8+
# - `reviewfixer` CLI installed (`go install github.com/ThomasK33/[email protected]`,
9+
# or download a binary from https://github.com/ThomasK33/reviewfixer/releases)
10+
# - `node` and `npm`/`npx` available on PATH (for the ACP adapter below)
11+
# - `ANTHROPIC_API_KEY` exported in the shell that launches reviewfixer
12+
#
13+
# Usage:
14+
# reviewfixer validate --config ./reviewfixer.yaml
15+
# reviewfixer --config ./reviewfixer.yaml
16+
# reviewfixer run --config ./reviewfixer.yaml
17+
#
18+
# If you install the adapter globally instead of using `npx`, you can replace:
19+
# command: npx
20+
# args: ["-y", "@agentclientprotocol/[email protected]"]
21+
# with:
22+
# command: claude-agent-acp
23+
24+
runtime:
25+
kind: acp
26+
compact_on_resume: true
27+
acp:
28+
command: npx
29+
args:
30+
- -y
31+
# Pinned to avoid pulling an unverified `latest` at invocation time;
32+
# bump deliberately after reviewing release notes.
33+
- "@agentclientprotocol/[email protected]"
34+
35+
review:
36+
request:
37+
# `/coder-agents-review` is consumed by the external coder-agents-review
38+
# bot (not by any workflow in this repository).
39+
- mode: comment
40+
comment: "/coder-agents-review"

0 commit comments

Comments
 (0)