feat(examples/actors/code_review.yaml): add a new code review tool (#458)
CI / lint (push) Successful in 20s
CI / quality (push) Successful in 30s
CI / typecheck (push) Successful in 43s
CI / security (push) Successful in 44s
CI / build (push) Successful in 24s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m30s
CI / integration_tests (push) Successful in 3m49s
CI / docker (push) Successful in 1m6s
CI / coverage (push) Successful in 7m23s
CI / e2e_tests (push) Failing after 14m42s
CI / benchmark-publish (push) Failing after 19m42s

## Summary

Add a `code_review.yaml` actor example that uses Claude Opus 4 with file and git tools to perform automated code reviews against the project's review playbook.

### Changes
- **New file**: `examples/actors/code_review.yaml` — LLM actor configured with `files/read_file`, `files/list_directory`, and `builtin/git-*` tools, with a system prompt that reads `docs/development/review-playbook.md` and diffs against `master`
- **Updated**: `features/actor_examples.feature` — bumped example count from 7 to 8 and added `code_review.yaml` to the file listing assertion

### Verification
- `nox -e lint` — passed
- `nox -e typecheck` — 0 errors
- `nox -e format -- --check` — all files formatted
- `nox -s unit_tests -- features/actor_examples.feature` — 25 scenarios passed

### Rebase Notes
- Rebased onto current master (`4d3499dc`)
- Squashed 2 commits into 1 (eliminated 3 merge commits)
- Resolved conflict in `actor_examples.feature`: master added `strategy_with_subplan.yaml` (count 7), our branch adds `code_review.yaml` (count now 8)

Reviewed-on: #458
Reviewed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com>
Co-authored-by: Brent Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent Edwards <brent.edwards@cleverthis.com>
This commit was merged in pull request #458.
This commit is contained in:
2026-03-19 22:42:15 +00:00
committed by Forgejo
parent 202c9bfe75
commit 714d799ae9
2 changed files with 48 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
# LLM Actor - Code Review
# Runs a multi-step code review.
name: local/code-review
type: llm
description: Runs a code review and merges to make the best possible.
version: "0.0"
# LLM model form is Claude Opus 4
model: claude-opus-4-20250514
system_prompt: |
You are a code reviewer.
Use the tool `files/read_file` to read the instructions at `docs/development/review-playbook.md`.
Then use the tool `builtin/git-diff` to compare the current state of this code base against
the `master` branch of the code base.
Use your deep knowledge of testing, test flaws, performance, bug detection, and
security issues to find any possible problems in the code.
Create a report that summarizes all found problems.
tools:
- files/read_file
- files/list_directory
- builtin/git-status
- builtin/git-diff
- builtin/git-log
- builtin/git-blame
# Context settings
context_view: executor
memory:
enabled: true
max_messages: 30
max_tokens: 6000
context:
max_context_tokens: 16000
# Environment variables
env_vars:
WORK_DIR: ${HOME}
LOG_LEVEL: info