Skip to content

chore: agentic standards#519

Open
tarrencev wants to merge 3 commits intomainfrom
chore/agentic-standards-2026-02-06
Open

chore: agentic standards#519
tarrencev wants to merge 3 commits intomainfrom
chore/agentic-standards-2026-02-06

Conversation

@tarrencev
Copy link
Contributor

@tarrencev tarrencev commented Feb 6, 2026

This PR standardizes agent/dev tooling:

  • Add AGENTS.md as canonical agent instructions (CLAUDE.md symlinks to it).
  • Add .agents as source of truth + .claude/.cursor compat symlinks.
  • Install create-pr + create-a-plan skills from cartridge-gg/agents.
  • Add bin/setup-githooks + .githooks/pre-commit (fast local mirror of CI checks).
  • Add/refresh Claude Code Review workflow (includes id-token: write for OIDC).

Summary by CodeRabbit

  • New Features

    • Added "Create a Plan" skill to produce detailed, verifiable implementation plans.
    • Added "Create PR" skill with PR creation/update, CI polling, triage, and PR-body update utilities.
    • Introduced an automated code-review workflow triggered on pull requests.
  • Chores

    • Enhanced pre-commit validation and switched to a POSIX hook runner.
    • Added Git hooks setup helper and additional developer/agent documentation.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds agent skill specifications for planning and PR workflows, several shell utilities for PR polling/triage/body updates, git hook setup and installer, a Claude-based GitHub Actions review workflow, and consolidated agent documentation files. Outputs include writing plans to PLAN.md and PR body updates.

Changes

Cohort / File(s) Summary
Agent Skill Specs
.agents/skills/create-a-plan/SKILL.md, .agents/skills/create-pr/SKILL.md
New Markdown skill specs: create-a-plan (multi‑phase interview → writes PLAN.md) and create-pr (end‑to‑end PR workflow guidance).
PR Automation Scripts
.agents/skills/create-pr/scripts/poll-pr.sh, .agents/skills/create-pr/scripts/pr-body-update.sh, .agents/skills/create-pr/scripts/triage-pr.sh
Adds Bash scripts to poll PR checks/comments, update PR body via GraphQL, and produce compact PR triage summaries; rely on gh and support CLI args and env overrides.
Editor/Tooling Skill Pointers
.claude/skills, .cursor/skills
Small pointer files referencing ../.agents/skills for editor/tool integrations.
Git Hook & Setup
.githooks/pre-commit, .husky/pre-commit, bin/setup-githooks
Introduces a staged-file pre-commit hook performing format/lint/test/build for Node files, switches Husky hook to delegate to .githooks/pre-commit, and adds a setup script to configure Git hooksPath.
GitHub Actions Workflow
.github/workflows/claude-code-review.yml
New workflow to run an automated Claude code review on PR events using anthropics/claude-code-action@v1 with configured permissions and secrets.
Agent Documentation
AGENTS.md, CLAUDE.legacy.md, CLAUDE.md
Adds/migrates agent and Claude documentation, including operational guidance and legacy notes.

Sequence Diagram(s)

sequenceDiagram
  participant Agent
  participant Local as "Local Scripts\n(`gh`, bash)"
  participant GitHub
  participant CI as "CI / Checks"
  participant Repo as "Repository\n(PLAN.md / PR)"

  Agent->>Local: start create-pr or create-a-plan flow
  Local->>GitHub: create/update PR (GraphQL / gh)
  GitHub->>CI: trigger checks
  CI-->>GitHub: report status
  Local->>GitHub: poll checks/comments (poll-pr.sh)
  GitHub-->>Local: checks, comments, reviews
  alt failing or changed
    Local->>Agent: triage summary (triage-pr.sh)
    Agent->>Local: apply fixes or update PR body
    Local->>GitHub: push commits / update PR body (pr-body-update.sh)
  end
  Agent->>Repo: write PLAN.md or finalize PR
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through files both new and bright,

Plans in ink and PRs to write,
Scripts that poll and hooks that sing,
Agents guide the merge and spring,
A rabbit cheers the repo's flight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the key changes (AGENTS.md, .agents directory, skills, githooks, workflow) but does not follow the provided template structure with required sections like issue closure, checklist, or self-review. Follow the repository's PR description template by including sections for issue closure, checklist completion, and self-review confirmation to ensure consistency with project standards.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: agentic standards' is concise and clearly summarizes the main change: standardizing agent/dev tooling and adding agent-related repository standards.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/agentic-standards-2026-02-06

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In @.agents/skills/create-a-plan/SKILL.md:
- Line 35: Update the SKILL.md entry for the tools AskUserQuestion and
request_user_input to include explicit external-doc links and/or a brief mapping
to Claude and Codex function-calling: reference the Claude function-calling docs
(link to Claude API function-calling page) for AskUserQuestion and the
Codex/request_user_input API or SDK docs (link to relevant OpenAI or Codex
function-calling docs) for request_user_input, and add a one-sentence note
describing how each tool maps to the respective platform’s function-calling
signature/usage (e.g., parameters, expected return shape, authentication) so
readers can find and implement the external tool integrations.

In @.agents/skills/create-pr/scripts/poll-pr.sh:
- Around line 126-138: Reset the per-iteration check state before calling gh: at
the start of each loop iteration clear or initialize checks_counts and the
derived variables (total, pending, failed, success) to safe defaults (e.g.,
empty or 0) so they cannot carry over stale values when gh pr checks fails or
returns nothing; then run gh pr checks and populate them (the existing read -r
total pending failed success from checks_counts) and ensure the exit-when-green
logic references these freshly-initialized variables (symbols: checks_counts,
total, pending, failed, success, gh pr checks, and the exit-when-green check) so
a failed/empty gh call won’t produce a false green exit.
- Around line 128-129: The jq filter currently computing failed checks uses
select(.conclusion != null and .conclusion != "SUCCESS"), which treats NEUTRAL
and SKIPPED as failures; update that expression (the line with
(map(select(.conclusion != null and .conclusion != "SUCCESS")) | length)) to
instead explicitly count only real failures (for example use select(.conclusion
== "FAILURE" or .conclusion == "TIMED_OUT" or .conclusion == "ACTION_REQUIRED"
or .conclusion == "CANCELLED") or conversely exclude benign conclusions with
select(.conclusion != null and (.conclusion != "SUCCESS" and .conclusion !=
"NEUTRAL" and .conclusion != "SKIPPED"))), so NEUTRAL and SKIPPED are not
considered failed.

In @.agents/skills/create-pr/scripts/pr-body-update.sh:
- Around line 93-96: The exact byte comparison between "$updated_body" and
"$(cat "$body_file")" can yield false negatives because GitHub normalizes
Markdown (CRLF → LF, trailing newlines); update the check in pr-body-update.sh
to normalize both sides before comparing — for example, normalize line endings
(strip \r), collapse trailing newlines/spaces, and compare the trimmed results
of updated_body and body_file variables (or remove the verification step
entirely and trust the API response) so the check uses a lenient equality
instead of raw byte-for-byte comparison.
- Around line 16-39: The flag parsing loop can crash with "unbound variable"
when a flag like --file is the last arg; update the --file, --pr, and --repo
cases in the while/case block to explicitly validate that a value exists before
reading $2 (e.g., check that $# -ge 2 or that ${2-} is non-empty), and if
missing call usage and exit with error; ensure you apply the same guard logic to
the --file, --pr and --repo branches so no missing-value leads to set -u
failures.

In @.agents/skills/create-pr/SKILL.md:
- Around line 76-79: Replace the non-standard `wt remove --yes --force` call
with the correct Git worktree removal flow: after detecting a worktree via `[
"$(git rev-parse --git-common-dir)" != "$(git rev-parse --git-dir)" ]`, use the
`request_user_input` tool to ask the user for confirmation and the target
worktree path, then run `git worktree remove --force <worktree-path>` (or
compute the path from `git rev-parse --git-common-dir`/other repo metadata) and
finally run `git checkout main && git pull`; if a custom `wt` helper was
intended, document and implement `wt` first and reference it from the SKILL text
instead of the invalid command.

In @.githooks/pre-commit:
- Around line 20-24: The pre-commit block uses "git diff --quiet" which flags
any unstaged working-tree changes and thus falsely reports "Pre-commit modified
files" even though the hook commands (format:check, lint:check, biome ci) are
read-only; fix by either removing this entire diff-check block or change it to
only inspect staged changes by replacing the global check with a staged-only
check (use the cached/staged diff variant) so it only fails when the hook itself
or staged files changed; alternatively, if you want an autofix flow, run the
fixer variants (e.g., format and lint without :check), then re-stage affected
files with git add before re-running the staged diff check.
🧹 Nitpick comments (10)
bin/setup-githooks (1)

7-13: Consider verifying .githooks exists in the fallback branch.

If .husky doesn't exist, the script unconditionally sets core.hooksPath to .githooks without checking that directory exists. This could silently misconfigure Git hooks if neither directory is present.

Proposed fix
 if [[ -d .husky ]]; then
   git config core.hooksPath .husky
   echo "Configured git hooksPath to .husky"
-else
+elif [[ -d .githooks ]]; then
   git config core.hooksPath .githooks
   echo "Configured git hooksPath to .githooks"
+else
+  echo "Warning: neither .husky nor .githooks directory found" >&2
+  exit 1
 fi
AGENTS.md (2)

24-88: Duplicated guidance between top-level section and legacy block.

Lines 1–20 (concise guide) and lines 30–88 (legacy block) cover the same commands, style rules, and workflows almost verbatim. Over time one side will drift out of sync with the other. Consider either removing the legacy block entirely now that the top-level section is canonical, or adding a note that the legacy block is frozen/deprecated and should not be the source of truth.


99-99: Long single-line command is hard to read and maintain.

Consider breaking this across multiple lines with \ continuations for readability, especially since this is documentation meant to be copy-pasted.

📝 Suggested formatting
-npm_config_cache=/tmp/npm-cache npx -y skills add https://github.com/cartridge-gg/agents   --skill create-pr create-a-plan   --agent claude-code cursor   -y
+npm_config_cache=/tmp/npm-cache npx -y skills add \
+  https://github.com/cartridge-gg/agents \
+  --skill create-pr create-a-plan \
+  --agent claude-code cursor \
+  -y
.github/workflows/claude-code-review.yml (2)

3-5: Workflow will trigger on draft PRs, consuming API credits unnecessarily.

The opened and synchronize events fire for draft PRs too. Consider adding a condition to skip drafts so Claude reviews aren't wasted on WIP pushes.

💡 Proposed fix
   claude-code-review:
     runs-on: ubuntu-latest
+    if: github.event.pull_request.draft == false
 
     steps:

7-12: id-token: write is a powerful permission — document its purpose.

Per the PR objectives this is for OIDC, but a brief inline comment would help future maintainers understand why this non-obvious permission is required, especially since nothing else in this workflow file visibly uses it.

.githooks/pre-commit (2)

14-18: Running full test suite and full build on every commit is very heavy for a pre-commit hook.

bun run test and bun run build can take minutes in a monorepo. This will discourage frequent, small commits. Consider moving the heavier checks (test, build) to a pre-push hook and keeping only the fast lint/format checks here.

Based on learnings: "Prefer check-only commands in CI (format:check, lint:check) and keep local hooks aligned."


10-12: NODE_FILES assignment is unused; the grep runs against the same $STAGED_FILES.

NODE_FILES on Line 11 is just a copy of STAGED_FILES and is never referenced again after the echo pipe on Line 12. You can simplify by piping STAGED_FILES directly.

♻️ Suggested simplification
-# Node (.)
-NODE_FILES="$STAGED_FILES"
-if echo "$NODE_FILES" | grep -qE '\.(ts|tsx|js|jsx|json|css|scss|yml|yaml)$|^package\.json$|^pnpm-lock\.yaml$|^bun\.lockb?$|^biome\.json$|^tsconfig\..*\.json$'; then
+# Node (.)
+if echo "$STAGED_FILES" | grep -qE '\.(ts|tsx|js|jsx|json|css|scss|yml|yaml)$|^package\.json$|^pnpm-lock\.yaml$|^bun\.lockb?$|^biome\.json$|^tsconfig\..*\.json$'; then
.agents/skills/create-pr/scripts/poll-pr.sh (1)

126-132: Two separate gh pr checks calls per iteration can be consolidated into one.

Lines 126–132 and 140–149 both call gh pr checks with similar JSON queries. This doubles API calls and can hit rate limits under tight polling intervals. Fetch once, then derive both the summary counts and the failed-checks list from the same result.

Also applies to: 140-149

.agents/skills/create-pr/scripts/triage-pr.sh (1)

1-112: Substantial duplication with poll-pr.sh.

The auto-detection logic (lines 37–53), jq queries for checks/comments/reviews, and output formatting are nearly identical between this script and poll-pr.sh. Consider extracting the shared logic (arg parsing, PR/repo detection, jq query fragments) into a common _lib.sh that both scripts source. This would reduce the maintenance surface for the jq expressions in particular.

.agents/skills/create-a-plan/SKILL.md (1)

24-24: Consider safeguarding against overwriting unrelated plans.

The instruction to update an existing PLAN.md without confirmation could lead to accidentally overwriting a plan for a different feature. Consider adding a step to verify that the existing plan is related to the current task before updating.

💡 Suggested enhancement
-2. Confirm you will produce `PLAN.md` as the output in the repo root. If `PLAN.md` already exists, update it rather than creating a new file.
+2. Confirm you will produce `PLAN.md` as the output in the repo root. If `PLAN.md` already exists, verify it relates to the current task before updating, or propose creating a feature-specific plan file if the existing plan is unrelated.


### Phase 2: Deep Interview

Use the `AskUserQuestion` (Claude) and/or `request_user_input` (Codex) tools in rounds. Ask 1-3 questions per round. Each round should go deeper and avoid repeating what is already known.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for AskUserQuestion and request_user_input usage in the codebase

echo "Searching for AskUserQuestion usage..."
rg -n "AskUserQuestion" --type md

echo -e "\nSearching for request_user_input usage..."
rg -n "request_user_input" --type md

echo -e "\nSearching for other interactive tool references..."
rg -nP "(ask.*user|user.*input|request.*input)" --type md -i | head -30

echo -e "\nSearching for tool definitions or documentation..."
rg -n "tool" .agents/skills/create-a-plan/SKILL.md -A 2 -B 2

Repository: dojoengine/dojo.js

Length of output: 496


🏁 Script executed:

cat -n .agents/skills/create-a-plan/SKILL.md

Repository: dojoengine/dojo.js

Length of output: 8664


Document the external tool references with links to their APIs.

The tools AskUserQuestion (Claude) and request_user_input (Codex) mentioned on line 35 lack supporting documentation in the repository. For clarity and maintainability, add links to the external API documentation for these tools or explain how they map to Claude and Codex function-calling capabilities.

🤖 Prompt for AI Agents
In @.agents/skills/create-a-plan/SKILL.md at line 35, Update the SKILL.md entry
for the tools AskUserQuestion and request_user_input to include explicit
external-doc links and/or a brief mapping to Claude and Codex function-calling:
reference the Claude function-calling docs (link to Claude API function-calling
page) for AskUserQuestion and the Codex/request_user_input API or SDK docs (link
to relevant OpenAI or Codex function-calling docs) for request_user_input, and
add a one-sentence note describing how each tool maps to the respective
platform’s function-calling signature/usage (e.g., parameters, expected return
shape, authentication) so readers can find and implement the external tool
integrations.

Comment on lines +126 to +138
checks_counts=$(gh pr checks "$pr" --repo "$repo" --json status,conclusion --jq '
[length,
(map(select(.status != "COMPLETED")) | length),
(map(select(.conclusion != null and .conclusion != "SUCCESS")) | length),
(map(select(.conclusion == "SUCCESS")) | length)
] | @tsv
' 2>/dev/null || true)
if [[ -n "$checks_counts" ]]; then
IFS=$'\t' read -r total pending failed success <<< "$checks_counts"
echo "Checks: total=$total pending=$pending failed=$failed success=$success"
else
echo "Checks: unavailable"
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Stale pending/failed/total variables can trigger a false "green" exit.

pending, failed, total, and success are set only inside the if [[ -n "$checks_counts" ]] branch (Line 134). If the gh pr checks call fails or returns empty in a subsequent iteration, the variables retain their values from the previous iteration. The exit-when-green check on Line 216 then uses stale data, potentially exiting early when checks are actually unavailable.

Reset these variables at the top of each loop iteration:

🐛 Proposed fix
 for i in $(seq 1 "$iterations"); do
   now=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
   echo "[$now] Poll $i/$iterations"
   changed=0
+  total="" pending="" failed="" success=""
 
   checks_counts=$(gh pr checks "$pr" --repo "$repo" --json status,conclusion --jq '

Also applies to: 215-220

🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/poll-pr.sh around lines 126 - 138, Reset
the per-iteration check state before calling gh: at the start of each loop
iteration clear or initialize checks_counts and the derived variables (total,
pending, failed, success) to safe defaults (e.g., empty or 0) so they cannot
carry over stale values when gh pr checks fails or returns nothing; then run gh
pr checks and populate them (the existing read -r total pending failed success
from checks_counts) and ensure the exit-when-green logic references these
freshly-initialized variables (symbols: checks_counts, total, pending, failed,
success, gh pr checks, and the exit-when-green check) so a failed/empty gh call
won’t produce a false green exit.

Comment on lines +128 to +129
(map(select(.status != "COMPLETED")) | length),
(map(select(.conclusion != null and .conclusion != "SUCCESS")) | length),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Checks with NEUTRAL or SKIPPED conclusions are counted as "failed".

The jq filter select(.conclusion != null and .conclusion != "SUCCESS") will include NEUTRAL, SKIPPED, CANCELLED, etc. in the failed count. Depending on the use case, this may overcount failures. Consider excluding benign conclusions:

-     (map(select(.conclusion != null and .conclusion != "SUCCESS")) | length),
+     (map(select(.conclusion != null and .conclusion != "SUCCESS" and .conclusion != "NEUTRAL" and .conclusion != "SKIPPED")) | length),
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/poll-pr.sh around lines 128 - 129, The jq
filter currently computing failed checks uses select(.conclusion != null and
.conclusion != "SUCCESS"), which treats NEUTRAL and SKIPPED as failures; update
that expression (the line with (map(select(.conclusion != null and .conclusion
!= "SUCCESS")) | length)) to instead explicitly count only real failures (for
example use select(.conclusion == "FAILURE" or .conclusion == "TIMED_OUT" or
.conclusion == "ACTION_REQUIRED" or .conclusion == "CANCELLED") or conversely
exclude benign conclusions with select(.conclusion != null and (.conclusion !=
"SUCCESS" and .conclusion != "NEUTRAL" and .conclusion != "SKIPPED"))), so
NEUTRAL and SKIPPED are not considered failed.

Comment on lines +16 to +39
while [[ $# -gt 0 ]]; do
case "$1" in
--file)
body_file="$2"
shift 2
;;
--pr)
pr="$2"
shift 2
;;
--repo)
repo="$2"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "Unknown arg: $1" >&2
usage >&2
exit 1
;;
esac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing-value argument will produce a confusing error.

If a flag like --file is passed as the last argument without a value, $2 is unbound and set -u fires with a cryptic "unbound variable" message. Guard with an explicit check.

🛡️ Proposed fix (example for --file; apply similarly to --pr and --repo)
     --file)
+      [[ $# -ge 2 ]] || { echo "--file requires an argument" >&2; exit 1; }
       body_file="$2"
       shift 2
       ;;
     --pr)
+      [[ $# -ge 2 ]] || { echo "--pr requires an argument" >&2; exit 1; }
       pr="$2"
       shift 2
       ;;
     --repo)
+      [[ $# -ge 2 ]] || { echo "--repo requires an argument" >&2; exit 1; }
       repo="$2"
       shift 2
       ;;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
while [[ $# -gt 0 ]]; do
case "$1" in
--file)
body_file="$2"
shift 2
;;
--pr)
pr="$2"
shift 2
;;
--repo)
repo="$2"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "Unknown arg: $1" >&2
usage >&2
exit 1
;;
esac
while [[ $# -gt 0 ]]; do
case "$1" in
--file)
[[ $# -ge 2 ]] || { echo "--file requires an argument" >&2; exit 1; }
body_file="$2"
shift 2
;;
--pr)
[[ $# -ge 2 ]] || { echo "--pr requires an argument" >&2; exit 1; }
pr="$2"
shift 2
;;
--repo)
[[ $# -ge 2 ]] || { echo "--repo requires an argument" >&2; exit 1; }
repo="$2"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "Unknown arg: $1" >&2
usage >&2
exit 1
;;
esac
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/pr-body-update.sh around lines 16 - 39, The
flag parsing loop can crash with "unbound variable" when a flag like --file is
the last arg; update the --file, --pr, and --repo cases in the while/case block
to explicitly validate that a value exists before reading $2 (e.g., check that
$# -ge 2 or that ${2-} is non-empty), and if missing call usage and exit with
error; ensure you apply the same guard logic to the --file, --pr and --repo
branches so no missing-value leads to set -u failures.

Comment on lines +93 to +96
if [[ "$updated_body" != "$(cat "$body_file")" ]]; then
echo "PR body mismatch after update." >&2
exit 1
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Body comparison may produce false negatives due to GitHub normalization.

GitHub can normalize Markdown bodies (e.g., trailing newlines, CRLF → LF). A byte-for-byte != comparison against the local file could report a mismatch even when the update succeeded. Consider a more lenient check (e.g., compare a trimmed/normalized version), or simply trust the mutation's success and drop the verification step.

🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/pr-body-update.sh around lines 93 - 96, The
exact byte comparison between "$updated_body" and "$(cat "$body_file")" can
yield false negatives because GitHub normalizes Markdown (CRLF → LF, trailing
newlines); update the check in pr-body-update.sh to normalize both sides before
comparing — for example, normalize line endings (strip \r), collapse trailing
newlines/spaces, and compare the trimmed results of updated_body and body_file
variables (or remove the verification step entirely and trust the API response)
so the check uses a lenient equality instead of raw byte-for-byte comparison.

Comment on lines +76 to +79
16. After successful merge, check if we're in a git worktree:
- Run: `[ "$(git rev-parse --git-common-dir)" != "$(git rev-parse --git-dir)" ]`
- **If in a worktree**: Use the ask user question tool (`request_user_input`) to ask if they want to clean up the worktree. If yes, run `wt remove --yes --force` to remove the worktree and local branch, then switch back to the main worktree.
- **If not in a worktree**: Just switch back to main with `git checkout main && git pull`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Search for 'wt' script or executable in common locations and throughout the repo
echo "=== Searching for 'wt' as a file ==="
fd -t f 'wt' --hidden 2>/dev/null | head -20

echo -e "\n=== Searching for 'wt' in bin, scripts, .agents directories ==="
find bin/ scripts/ .agents/ -type f -name 'wt' 2>/dev/null

echo -e "\n=== Searching for 'wt remove' references in the codebase ==="
rg 'wt\s+remove' -t md -t sh -t js -t ts --hidden 2>/dev/null

echo -e "\n=== Searching for 'wt' as a command/alias definition ==="
rg '(alias|function)\s+wt\b' --hidden 2>/dev/null | head -10

echo -e "\n=== Check the SKILL.md file context ==="
cat -n .agents/skills/create-pr/SKILL.md | sed -n '70,85p'

Repository: dojoengine/dojo.js

Length of output: 1530


🏁 Script executed:

# Check package.json for scripts that might define 'wt'
echo "=== Checking package.json for 'wt' related scripts ==="
find . -name "package.json" -type f 2>/dev/null | head -5 | while read f; do
  echo "File: $f"
  rg 'wt' "$f" 2>/dev/null || echo "No 'wt' found"
done

echo -e "\n=== Searching entire codebase for 'git worktree remove' ==="
rg 'git\s+worktree\s+remove' --hidden 2>/dev/null

echo -e "\n=== Check if 'wt' might be a shorthand or tool name ==="
rg '"wt"' --hidden 2>/dev/null | head -10

Repository: dojoengine/dojo.js

Length of output: 475


wt remove --yes --force is not a standard git command and is not defined in this repository.

The instruction at line 78 references a non-existent command that will fail when executed. Replace it with the standard git command: git worktree remove --force <worktree-path>. If a custom wt tool should be used instead, it needs to be defined and documented in the repository first.

🤖 Prompt for AI Agents
In @.agents/skills/create-pr/SKILL.md around lines 76 - 79, Replace the
non-standard `wt remove --yes --force` call with the correct Git worktree
removal flow: after detecting a worktree via `[ "$(git rev-parse
--git-common-dir)" != "$(git rev-parse --git-dir)" ]`, use the
`request_user_input` tool to ask the user for confirmation and the target
worktree path, then run `git worktree remove --force <worktree-path>` (or
compute the path from `git rev-parse --git-common-dir`/other repo metadata) and
finally run `git checkout main && git pull`; if a custom `wt` helper was
intended, document and implement `wt` first and reference it from the SKILL text
instead of the invalid command.

Comment on lines +20 to +24
if ! git diff --quiet; then
echo 'Pre-commit modified files (likely formatting). Stage the changes and retry.'
git diff --name-only
exit 1
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

git diff --quiet will flag any pre-existing unstaged changes, not just hook-generated modifications.

Since every check command here is read-only (format:check, lint:check, biome ci), none of them modify files. This means git diff --quiet will detect pre-existing unstaged work and emit the misleading "Pre-commit modified files (likely formatting)" message, blocking the commit even though the hook didn't change anything.

Either remove this block (since no command writes files), or scope it to only the staged files:

🐛 Proposed fix
-  if ! git diff --quiet; then
-    echo 'Pre-commit modified files (likely formatting). Stage the changes and retry.'
-    git diff --name-only
-    exit 1
-  fi

If you do want an auto-fix + re-stage flow, replace the check-only commands with their fix variants (bun run format, bun run lint) and then use git add on the staged files, rather than checking the entire working tree.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ! git diff --quiet; then
echo 'Pre-commit modified files (likely formatting). Stage the changes and retry.'
git diff --name-only
exit 1
fi
[Lines 1-19 remain unchanged]
[Lines 25+ follow directly after removal]
🤖 Prompt for AI Agents
In @.githooks/pre-commit around lines 20 - 24, The pre-commit block uses "git
diff --quiet" which flags any unstaged working-tree changes and thus falsely
reports "Pre-commit modified files" even though the hook commands (format:check,
lint:check, biome ci) are read-only; fix by either removing this entire
diff-check block or change it to only inspect staged changes by replacing the
global check with a staged-only check (use the cached/staged diff variant) so it
only fails when the hook itself or staged files changed; alternatively, if you
want an autofix flow, run the fixer variants (e.g., format and lint without
:check), then re-stage affected files with git add before re-running the staged
diff check.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/claude-code-review.yml:
- Around line 67-70: The workflow step name "Claude Review (skipped: missing
secret)" contains an unquoted colon which breaks YAML parsing; update the step
declaration so the name is a quoted scalar (e.g., wrap the entire name value in
single or double quotes) to escape the colon, and for consistency also quote the
other step name that contains parentheses (the other "Claude Review (...)" step)
to avoid future parsing issues; ensure only the name field is changed and the
surrounding if/run keys remain untouched.
🧹 Nitpick comments (1)
.github/workflows/claude-code-review.yml (1)

18-21: fetch-depth: 0 is heavier than needed.

The preflight step already does its own git fetch --depth=1 origin "${default_branch}". A shallow checkout (fetch-depth: 1) is sufficient here since you only compare the single workflow file, not full history.

♻️ Suggested optimization
       - name: Checkout
         uses: actions/checkout@v4
-        with:
-          fetch-depth: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant