Skip to content

Commit 05043df

Browse files
committed
Add CodeRabbit finish workflow
1 parent 1297a75 commit 05043df

2 files changed

Lines changed: 59 additions & 1 deletion

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Finish a task by running local gates, CodeRabbit review, a fix-review loop, and PR preparation.
3+
---
4+
5+
// turbo-all
6+
7+
Use this workflow before final completion of code-changing tasks, and when the user asks to finish, ship, run CodeRabbit, start a review loop, or make a PR.
8+
9+
1. Inspect the current branch and dirty tree:
10+
git status --short --branch
11+
12+
2. Keep all work on the current branch unless the user explicitly approves creating or switching branches. If the current branch is main or master and a PR is required, pause for branch approval before committing. Never stash. Do not discard unrelated edits.
13+
14+
3. Identify the files owned by the current task. If unrelated dirty edits exist, exclude them from staging, commits, and review scope. If the task changes cannot be isolated cleanly, ask before continuing.
15+
16+
4. Run the relevant local gates for the changed surface:
17+
just verify-specs
18+
just verify-agents
19+
pnpm smoke
20+
pnpm -r build
21+
cargo check -p <crate> --all-targets
22+
23+
5. If contracts changed, run:
24+
cargo run -p actant-contracts -- check-compat
25+
cargo run -p actant-contracts -- codegen-ts
26+
27+
6. If code changed and graphify-out/graph.json exists, run:
28+
graphify update .
29+
30+
7. Verify CodeRabbit is installed and authenticated:
31+
coderabbit --version
32+
coderabbit auth status --agent
33+
34+
8. Run CodeRabbit with repository guidance only after the user has asked for this finish/review/PR workflow. If the task-owned files can be committed without including unrelated dirty edits, commit those files by explicit path first, then review the committed diff:
35+
coderabbit review --agent -c AGENTS.md -t committed
36+
37+
If the task-owned files must remain uncommitted, use uncommitted mode with explicit scoping so unrelated dirty edits are not reviewed:
38+
coderabbit review --agent -c AGENTS.md -t uncommitted
39+
40+
If the worktree has no uncommitted changes and the branch has local commits to review, also use:
41+
coderabbit review --agent -c AGENTS.md -t committed
42+
43+
When using uncommitted mode in a dirty worktree, add CodeRabbit scoping flags such as:
44+
coderabbit review --agent -c AGENTS.md -t uncommitted --dir .codex
45+
46+
9. Parse CodeRabbit NDJSON findings by severity. Fix every actionable issue in the current branch, then rerun the relevant local gates.
47+
48+
10. Repeat the CodeRabbit review and fix cycle until CodeRabbit raises 0 actionable issues, or until the remaining issues are non-actionable and the user agrees to carry them.
49+
50+
11. Stage files by explicit path, commit the finished work, and prepare a PR summary with:
51+
- What changed
52+
- Local gates run
53+
- CodeRabbit review result
54+
55+
12. Pause for explicit approval before pushing or opening the PR. After approval, push the current branch and create the PR with gh.

.codex/hooks/actantdb-context.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PY
5151

5252
case "$event" in
5353
session-start)
54-
extra="Project skills live in .agent/skills: actantdb-codegen, actantdb-graphify, actantdb-verify, and dashboard. Workflows live in .agent/workflows. Git hooks live in .githooks and should be active through core.hooksPath=.githooks."
54+
extra="Project skills live in .agent/skills: actantdb-codegen, actantdb-graphify, actantdb-verify, and dashboard. Workflows live in .agent/workflows. Use .agent/workflows/finish-with-coderabbit.md before final completion of code-changing goals, and whenever the user asks to finish, ship, review with CodeRabbit, or make a PR. Git hooks live in .githooks and should be active through core.hooksPath=.githooks."
5555
if [ -f graphify-out/graph.json ]; then
5656
extra="$extra For codebase questions, run graphify query, graphify path, or graphify explain before broad source search."
5757
fi
@@ -73,6 +73,9 @@ case "$event" in
7373
*verify*|*test*|*green*|*ci*|*smoke*)
7474
context="Use ActantDB verification gates: just verify-specs, just verify-agents, crate-specific cargo test -p <crate>, pnpm -r build/test, and pnpm smoke. Avoid local cargo test --workspace."
7575
;;
76+
*ready\ to\ finish*|*ready\ to\ ship*|*ship\ it*|*ship\ this*|*make\ pr*|*open\ pr*|*create\ pr*|*close\ pr*|*pull\ request*|*coderabbit*|*code\ rabbit*|*review\ loop*|*finalize*|*complete\ task*|*task\ complete*|*task\ is\ complete*|*goal\ complete*|*goal\ is\ complete*|*all\ done*|*mark\ as\ done*|*work\ is\ done*|*changes\ are\ done*)
77+
context="Use .agent/workflows/finish-with-coderabbit.md before final completion. Run local gates, run CodeRabbit review with AGENTS.md context, fix every actionable issue, repeat until clean, then pause for approval before push or PR creation."
78+
;;
7679
esac
7780
emit_context "$context"
7881
;;

0 commit comments

Comments
 (0)