Conversation
📝 WalkthroughWalkthroughAdds two agent skills (create-a-plan, create-pr), three PR-management Bash scripts, small agent skill pointer files, a GitHub Actions workflow for automated Claude reviews, and multiple documentation files indexing and describing the new skills and workflows. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(200,200,255,0.5)
participant Agent as "Agent (create-pr)"
participant Repo as "Local Repo / Branch"
participant GitHub as "GitHub (PR)"
participant CI as "CI"
participant Poll as "poll-pr.sh"
end
Agent->>Repo: prepare branch & commits
Agent->>GitHub: create or update PR (gh / GraphQL)
GitHub->>CI: trigger CI run
Poll->>GitHub: poll checks, reviews, comments
GitHub-->>Poll: checks & new comments
Poll-->>Agent: report status / failed checks / new feedback
Agent->>Repo: apply fixes / amend commits
Agent->>GitHub: push updates (updates PR)
GitHub->>CI: retrigger CI
CI-->>GitHub: final status
Agent->>GitHub: merge & cleanup (when green)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Fix all issues with AI agents
In @.agents/skills/create-pr/scripts/poll-pr.sh:
- Around line 168-194: Change the two gh api calls that populate issue_line and
review_comment_line to request only the latest comment (use
per_page=1&direction=desc) instead of per_page=100, and simplify the jq
expression to read the single returned item (e.g. use .[0] rather than max_by).
Concretely, update the API URLs for "repos/$repo/issues/$pr/comments" and
"repos/$repo/pulls/$pr/comments" (the lines that set issue_line and
review_comment_line) to include "&per_page=1&direction=desc" and adjust their jq
strings to handle a single-element array (so the rest of the code that reads
issue_id/rc_id and calls print_new continues to work).
- Around line 121-138: In poll-pr.sh inside the for loop that iterates with "for
i in $(seq 1 "$iterations")", reset the check state variables before calling gh
so stale values don't persist: explicitly initialize total, pending, failed, and
success (e.g., to empty string or 0) at the top of each iteration (before
computing checks_counts) so the later exit_when_green logic and any other checks
read fresh/unknown state rather than leftover values.
In @.agents/skills/create-pr/scripts/pr-body-update.sh:
- Around line 16-40: The flag-parsing loop can dereference missing values for
--file, --pr, and --repo causing an unbound-variable error under set -u; update
the case arms inside the while ... case block to validate that a following
argument exists before assigning to body_file, pr, or repo and if missing print
a clear error like "Missing value for --file/--pr/--repo" and call usage then
exit 1; locate the flag handlers for --file, --pr, and --repo in the while loop
and add a check (e.g., if [[ -z "${2+x}" || "${2#-}" == "$2" ]] style or simple
test for empty) and handle the error path there so the script fails with a
descriptive message instead of an unbound-variable exception.
- Around line 81-85: The GraphQL mutation call using `gh api graphql` (the
invocation that passes -f id="$pr_id" and -f body="$(cat "$body_file")") can
fail silently under set -e; wrap this call to detect failure and emit a
contextual error message that includes the PR id and a hint about the body file,
e.g., run the command in a conditional or capture its stderr/exit status and on
non-zero exit print a descriptive error via echo or >&2 (referencing the `gh api
graphql` invocation, the `pr_id` variable, and `body_file`) before exiting with
a non-zero code.
In @.agents/skills/create-pr/scripts/triage-pr.sh:
- Around line 94-102: The current gh API calls (e.g., the issue_line assignment
that queries "repos/$repo/issues/$pr/comments") paginate 100 results ascending,
so max_by(.created_at) may still miss newer comments; change the requests to
fetch only the most recent item by adding per_page=1&sort=created&direction=desc
(apply the same change for the review comments query that reads from
"repos/$repo/pulls/$pr/comments" and the reviews query
"repos/$repo/pulls/$pr/reviews"), then update the jq to handle a single-item
response (no need for max_by, just format the first object) so you reliably get
the latest comment/review.
In @.agents/skills/create-pr/SKILL.md:
- Line 78: The cleanup step currently instructs running a non-existent `wt
remove` command; update the worktree cleanup instructions in SKILL.md to call
the correct git command and include the worktree path: when using the ask-user
tool `request_user_input` to confirm cleanup, run `git worktree remove --force
<path>` (and remove any local branch if needed) and then switch back to the main
worktree; ensure the text replaces the `wt remove --yes --force` reference and
clearly notes the required worktree path argument and use of `--force`.
In `@AGENTS.md`:
- Line 2: The AGENTS.md index currently sets the root to "root: ./agents" which
is incorrect; update the root value to "root: ./.agents" so skill resolution
points at the hidden .agents directory (change the literal token root: ./agents
to root: ./.agents in the AGENTS.md entry that lists the skills index).
- Line 2: Update the Agent Skills Index so the declared root and each skill path
match the actual repo layout: change the root value from ./agents to
./.agents/skills and replace entries like create-a-plan:{create-a-plan.md} with
the correct subdirectory SKILL file paths (e.g.,
create-a-plan:{create-a-plan/SKILL.md}); do this for all listed skills
(create-pr, dojo-debug, dojo-entities, etc.), and reflow the long single line
into multiple lines so no line exceeds ~80 columns for readability and
maintainability.
🧹 Nitpick comments (4)
CLAUDE.legacy.md (1)
1-1: Header says# CLAUDE.mdbut the file isCLAUDE.legacy.md.Since this is the legacy copy (the PR description states CLAUDE.md is now a symlink to AGENTS.md), consider updating the heading to
# CLAUDE.legacy.mdor adding a note that this is the preserved legacy version to avoid confusion..github/workflows/claude-code-review.yml (1)
3-5: Workflow will run on draft PRs, consuming API credits.The
openedandsynchronizeevents fire for draft PRs too. Consider adding a job-level condition to skip drafts:Proposed fix
jobs: claude-code-review: runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }}.agents/skills/create-pr/scripts/triage-pr.sh (1)
55-61: "Failed" count includes SKIPPED, CANCELLED, NEUTRAL, etc.The jq filter
select(.conclusion != null and .conclusion != "SUCCESS")counts any non-SUCCESS conclusion as "failed". Depending on your intent, this may overcount — e.g.,SKIPPEDorNEUTRALchecks aren't truly failures. If this is deliberate for a conservative triage view, a brief code comment would clarify intent..agents/skills/create-pr/scripts/poll-pr.sh (1)
140-149: Two separategh pr checkscalls per iteration — consider combining.Lines 126-132 and 140-149 both call
gh pr checkswith slightly different jq queries. In a polling loop, this doubles the API calls per iteration. You could capture the raw JSON once and pipe it through two jq expressions.
| for i in $(seq 1 "$iterations"); do | ||
| now=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
| echo "[$now] Poll $i/$iterations" | ||
| changed=0 | ||
|
|
||
| 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 |
There was a problem hiding this comment.
Stale check variables may trigger a false early exit.
total, pending, failed, and success are set by read only when checks_counts is non-empty. If checks become temporarily unavailable in a later iteration, these variables retain their previous values. The exit_when_green guard on line 215 would then evaluate stale data, potentially exiting early when checks are actually unknown.
Reset the 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 '📝 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.
| for i in $(seq 1 "$iterations"); do | |
| now=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| echo "[$now] Poll $i/$iterations" | |
| changed=0 | |
| 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 | |
| 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 ' | |
| [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 |
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/poll-pr.sh around lines 121 - 138, In
poll-pr.sh inside the for loop that iterates with "for i in $(seq 1
"$iterations")", reset the check state variables before calling gh so stale
values don't persist: explicitly initialize total, pending, failed, and success
(e.g., to empty string or 0) at the top of each iteration (before computing
checks_counts) so the later exit_when_green logic and any other checks read
fresh/unknown state rather than leftover values.
| issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=100" --jq ' | ||
| if length == 0 then "" else | ||
| (max_by(.created_at)) | "\(.id)\t\(.created_at)\t\(.user.login)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])" | ||
| end | ||
| ' 2>/dev/null || true) | ||
| if [[ -n "$issue_line" ]]; then | ||
| IFS=$'\t' read -r issue_id issue_time issue_user issue_url issue_body <<< "$issue_line" | ||
| if [[ "$issue_id" != "$last_issue_comment_id" ]]; then | ||
| last_issue_comment_id="$issue_id" | ||
| print_new "conversation comment" "$issue_time" "$issue_user" "$issue_url" "$issue_body" | ||
| changed=1 | ||
| fi | ||
| fi | ||
|
|
||
| review_comment_line=$(gh api "repos/$repo/pulls/$pr/comments?per_page=100" --jq ' | ||
| if length == 0 then "" else | ||
| (max_by(.created_at)) | "\(.id)\t\(.created_at)\t\(.user.login)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])" | ||
| end | ||
| ' 2>/dev/null || true) | ||
| if [[ -n "$review_comment_line" ]]; then | ||
| IFS=$'\t' read -r rc_id rc_time rc_user rc_url rc_body <<< "$review_comment_line" | ||
| if [[ "$rc_id" != "$last_review_comment_id" ]]; then | ||
| last_review_comment_id="$rc_id" | ||
| print_new "inline review comment" "$rc_time" "$rc_user" "$rc_url" "$rc_body" | ||
| changed=1 | ||
| fi | ||
| fi |
There was a problem hiding this comment.
Same pagination issue as in triage-pr.sh — per_page=100 with default ascending sort may miss the latest items.
See the comment on triage-pr.sh lines 94-102. The same fix applies: use direction=desc&per_page=1 when you only need the most recent item.
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/poll-pr.sh around lines 168 - 194, Change
the two gh api calls that populate issue_line and review_comment_line to request
only the latest comment (use per_page=1&direction=desc) instead of per_page=100,
and simplify the jq expression to read the single returned item (e.g. use .[0]
rather than max_by). Concretely, update the API URLs for
"repos/$repo/issues/$pr/comments" and "repos/$repo/pulls/$pr/comments" (the
lines that set issue_line and review_comment_line) to include
"&per_page=1&direction=desc" and adjust their jq strings to handle a
single-element array (so the rest of the code that reads issue_id/rc_id and
calls print_new continues to work).
| 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 | ||
| done |
There was a problem hiding this comment.
Missing-value edge case on flags that require an argument.
If someone passes --file (or --pr / --repo) as the last argument without a value, $2 triggers an unbound-variable error under set -u. The error message won't indicate which flag was missing its value. This is a minor UX concern for a tooling script.
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/pr-body-update.sh around lines 16 - 40, The
flag-parsing loop can dereference missing values for --file, --pr, and --repo
causing an unbound-variable error under set -u; update the case arms inside the
while ... case block to validate that a following argument exists before
assigning to body_file, pr, or repo and if missing print a clear error like
"Missing value for --file/--pr/--repo" and call usage then exit 1; locate the
flag handlers for --file, --pr, and --repo in the while loop and add a check
(e.g., if [[ -z "${2+x}" || "${2#-}" == "$2" ]] style or simple test for empty)
and handle the error path there so the script fails with a descriptive message
instead of an unbound-variable exception.
| gh api graphql \ | ||
| -f query='mutation($id:ID!,$body:String!){updatePullRequest(input:{pullRequestId:$id, body:$body}){pullRequest{id}}}' \ | ||
| -f id="$pr_id" \ | ||
| -f body="$(cat "$body_file")" \ | ||
| >/dev/null |
There was a problem hiding this comment.
No error message if the GraphQL mutation itself fails.
With set -e, a failed gh api graphql call exits the script immediately with no descriptive message. Consider wrapping it to emit a contextual error.
Proposed fix
-gh api graphql \
- -f query='mutation($id:ID!,$body:String!){updatePullRequest(input:{pullRequestId:$id, body:$body}){pullRequest{id}}}' \
- -f id="$pr_id" \
- -f body="$(cat "$body_file")" \
- >/dev/null
+if ! gh api graphql \
+ -f query='mutation($id:ID!,$body:String!){updatePullRequest(input:{pullRequestId:$id, body:$body}){pullRequest{id}}}' \
+ -f id="$pr_id" \
+ -f body="$(cat "$body_file")" \
+ >/dev/null; then
+ echo "GraphQL updatePullRequest mutation failed for PR #$pr in $repo." >&2
+ exit 1
+fi📝 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.
| gh api graphql \ | |
| -f query='mutation($id:ID!,$body:String!){updatePullRequest(input:{pullRequestId:$id, body:$body}){pullRequest{id}}}' \ | |
| -f id="$pr_id" \ | |
| -f body="$(cat "$body_file")" \ | |
| >/dev/null | |
| if ! gh api graphql \ | |
| -f query='mutation($id:ID!,$body:String!){updatePullRequest(input:{pullRequestId:$id, body:$body}){pullRequest{id}}}' \ | |
| -f id="$pr_id" \ | |
| -f body="$(cat "$body_file")" \ | |
| >/dev/null; then | |
| echo "GraphQL updatePullRequest mutation failed for PR #$pr in $repo." >&2 | |
| exit 1 | |
| fi |
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/pr-body-update.sh around lines 81 - 85, The
GraphQL mutation call using `gh api graphql` (the invocation that passes -f
id="$pr_id" and -f body="$(cat "$body_file")") can fail silently under set -e;
wrap this call to detect failure and emit a contextual error message that
includes the PR id and a hint about the body file, e.g., run the command in a
conditional or capture its stderr/exit status and on non-zero exit print a
descriptive error via echo or >&2 (referencing the `gh api graphql` invocation,
the `pr_id` variable, and `body_file`) before exiting with a non-zero code.
| issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=100" --jq ' | ||
| if length == 0 then "" else | ||
| (max_by(.created_at)) | "\(.user.login)\t\(.created_at)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])" | ||
| end | ||
| ' 2>/dev/null || true) | ||
| if [[ -n "$issue_line" ]]; then | ||
| IFS=$'\t' read -r c_user c_time c_url c_body <<< "$issue_line" | ||
| echo "COMMENT: conversation $c_user $c_time $c_url $c_body" | ||
| fi |
There was a problem hiding this comment.
Pagination may miss the latest comment when there are >100 items.
The GitHub API returns comments sorted by created ascending by default. With per_page=100, only the first 100 are returned — if there are more, max_by(.created_at) finds the latest among the oldest 100, not the actual latest. The same issue applies to the review comments query on lines 104-108 and potentially the reviews query on lines 83-88.
Fix by requesting descending order and limiting to 1 result, since you only need the latest:
Proposed fix (example for issue comments; apply similarly to the other endpoints)
-issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=100" --jq '
- if length == 0 then "" else
- (max_by(.created_at)) | "\(.user.login)\t\(.created_at)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])"
- end
-' 2>/dev/null || true)
+issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=1&sort=created&direction=desc" --jq '
+ if length == 0 then "" else
+ .[0] | "\(.user.login)\t\(.created_at)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])"
+ end
+' 2>/dev/null || true)📝 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.
| issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=100" --jq ' | |
| if length == 0 then "" else | |
| (max_by(.created_at)) | "\(.user.login)\t\(.created_at)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])" | |
| end | |
| ' 2>/dev/null || true) | |
| if [[ -n "$issue_line" ]]; then | |
| IFS=$'\t' read -r c_user c_time c_url c_body <<< "$issue_line" | |
| echo "COMMENT: conversation $c_user $c_time $c_url $c_body" | |
| fi | |
| issue_line=$(gh api "repos/$repo/issues/$pr/comments?per_page=1&sort=created&direction=desc" --jq ' | |
| if length == 0 then "" else | |
| .[0] | "\(.user.login)\t\(.created_at)\t\(.html_url)\t\(.body | gsub("\\n"; " ") | gsub("\\t"; " ") | .[0:200])" | |
| end | |
| ' 2>/dev/null || true) | |
| if [[ -n "$issue_line" ]]; then | |
| IFS=$'\t' read -r c_user c_time c_url c_body <<< "$issue_line" | |
| echo "COMMENT: conversation $c_user $c_time $c_url $c_body" | |
| fi |
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/scripts/triage-pr.sh around lines 94 - 102, The
current gh API calls (e.g., the issue_line assignment that queries
"repos/$repo/issues/$pr/comments") paginate 100 results ascending, so
max_by(.created_at) may still miss newer comments; change the requests to fetch
only the most recent item by adding per_page=1&sort=created&direction=desc
(apply the same change for the review comments query that reads from
"repos/$repo/pulls/$pr/comments" and the reviews query
"repos/$repo/pulls/$pr/reviews"), then update the jq to handle a single-item
response (no need for max_by, just format the first object) so you reliably get
the latest comment/review.
|
|
||
| 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. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for 'wt' as an alias or function definition
echo "=== Searching for 'wt' definitions (excluding SKILL.md) ==="
rg -n 'alias\s+wt\b|function\s+wt\b|\bwt\s*=|wt\(\)' --type=sh --type=md --type=bash | head -20
echo ""
echo "=== Checking for 'wt' scripts or executables ==="
fd -t f -x grep -l "^#!/" {} \; | xargs grep -l '\bwt\b' 2>/dev/null | grep -v SKILL.md | head -10
echo ""
echo "=== All usages of 'wt' command in repo (excluding SKILL.md) ==="
rg 'wt\s+(remove|add|list|prune|lock|unlock)' --type=sh --type=md --type=bash | grep -v SKILL.md | head -15
echo ""
echo "=== Searching .gitconfig or .bashrc patterns ==="
fd -t f -e gitconfig -e bashrc -e zshrc 2>/dev/null | xargs grep 'wt' 2>/dev/null
echo ""
echo "=== Check if 'wt' appears in scripts directory ==="
find . -type d -name 'scripts' 2>/dev/null | head -5
rg '\bwt\b' scripts/ 2>/dev/null | head -10Repository: dojoengine/dojo.js
Length of output: 510
🏁 Script executed:
#!/bin/bash
# Check the actual usages in create-pr skill files
echo "=== Checking create-pr skill directory for 'wt' ==="
rg 'wt' .agents/skills/create-pr/ -n
echo ""
echo "=== Verify if 'wt' could be from an external tool or global alias ==="
# Check if there are any npm/yarn/pip dependencies that provide 'wt'
cat package.json 2>/dev/null | grep -A 20 '"dependencies"' | head -25Repository: dojoengine/dojo.js
Length of output: 676
🌐 Web query:
git worktree remove command syntax
💡 Result:
Command syntax
git worktree remove [--force|-f] <path><path>: the worktree directory to remove.- By default, only clean worktrees (no modified tracked files and no untracked files) can be removed. Use
--force/-fto remove an unclean worktree (and/or one with submodules). - The main worktree cannot be removed. [1]
Example
git worktree remove ../feature-wt
git worktree remove -f ../feature-wtSource: Git documentation for git-worktree remove. [1]
🏁 Script executed:
#!/bin/bash
# Check the broader context around line 78 to understand the workflow
echo "=== Context around line 78 (showing more context) ==="
sed -n '70,85p' .agents/skills/create-pr/SKILL.md
echo ""
echo "=== Check if there are any setup/initialization scripts that might define 'wt' ==="
rg 'export\s+wt|alias' .agents/ -n | head -20Repository: dojoengine/dojo.js
Length of output: 1013
wt remove is not a standard git command — should be git worktree remove
Line 78 instructs the agent to run wt remove --yes --force. This command doesn't exist in the repository or in standard git. The correct syntax is git worktree remove --force <path>. This will cause the workflow to fail during the cleanup phase after PR merge.
Proposed fix
- - **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 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 `git worktree remove --force .` to remove the worktree and local branch, then switch back to the main worktree.📝 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.
| - **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 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 `git worktree remove --force .` to remove the worktree and local branch, then switch back to the main worktree. |
🤖 Prompt for AI Agents
In @.agents/skills/create-pr/SKILL.md at line 78, The cleanup step currently
instructs running a non-existent `wt remove` command; update the worktree
cleanup instructions in SKILL.md to call the correct git command and include the
worktree path: when using the ask-user tool `request_user_input` to confirm
cleanup, run `git worktree remove --force <path>` (and remove any local branch
if needed) and then switch back to the main worktree; ensure the text replaces
the `wt remove --yes --force` reference and clearly notes the required worktree
path argument and use of `--force`.
| @@ -1,3 +1,6 @@ | |||
| <!-- SKILLS_INDEX_START --> | |||
| [Agent Skills Index]|root: ./agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dojo-debug:{dojo-debug.md},dojo-entities:{dojo-entities.md},dojo-events:{dojo-events.md},dojo-integration-test:{dojo-integration-test.md},dojo-react:{dojo-react.md},dojo-setup:{dojo-setup.md},dojo-state:{dojo-state.md},dojo-transactions:{dojo-transactions.md},dojo-wallets:{dojo-wallets.md},update-grpc-proto:{update-grpc-proto.md} | |||
There was a problem hiding this comment.
Fix the root path from ./agents to ./.agents.
The skills index specifies root: ./agents, but based on the PR objectives and related file paths (.agents/skills/create-a-plan/SKILL.md, .agents/skills/create-pr/SKILL.md), the correct root path should be ./.agents (with the leading dot for the hidden directory).
This path discrepancy will cause skill resolution failures.
🔧 Proposed fix
-[Agent Skills Index]|root: ./agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dojo-debug:{dojo-debug.md},dojo-entities:{dojo-entities.md},dojo-events:{dojo-events.md},dojo-integration-test:{dojo-integration-test.md},dojo-react:{dojo-react.md},dojo-setup:{dojo-setup.md},dojo-state:{dojo-state.md},dojo-transactions:{dojo-transactions.md},dojo-wallets:{dojo-wallets.md},update-grpc-proto:{update-grpc-proto.md}
+[Agent Skills Index]|root: ./.agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dojo-debug:{dojo-debug.md},dojo-entities:{dojo-entities.md},dojo-events:{dojo-events.md},dojo-integration-test:{dojo-integration-test.md},dojo-react:{dojo-react.md},dojo-setup:{dojo-setup.md},dojo-state:{dojo-state.md},dojo-transactions:{dojo-transactions.md},dojo-wallets:{dojo-wallets.md},update-grpc-proto:{update-grpc-proto.md}📝 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.
| [Agent Skills Index]|root: ./agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dojo-debug:{dojo-debug.md},dojo-entities:{dojo-entities.md},dojo-events:{dojo-events.md},dojo-integration-test:{dojo-integration-test.md},dojo-react:{dojo-react.md},dojo-setup:{dojo-setup.md},dojo-state:{dojo-state.md},dojo-transactions:{dojo-transactions.md},dojo-wallets:{dojo-wallets.md},update-grpc-proto:{update-grpc-proto.md} | |
| [Agent Skills Index]|root: ./.agents|IMPORTANT: Prefer retrieval-led reasoning over pre-training for any tasks covered by skills.|skills|create-a-plan:{create-a-plan.md},create-pr:{create-pr.md},dojo-debug:{dojo-debug.md},dojo-entities:{dojo-entities.md},dojo-events:{dojo-events.md},dojo-integration-test:{dojo-integration-test.md},dojo-react:{dojo-react.md},dojo-setup:{dojo-setup.md},dojo-state:{dojo-state.md},dojo-transactions:{dojo-transactions.md},dojo-wallets:{dojo-wallets.md},update-grpc-proto:{update-grpc-proto.md} |
🤖 Prompt for AI Agents
In `@AGENTS.md` at line 2, The AGENTS.md index currently sets the root to "root:
./agents" which is incorrect; update the root value to "root: ./.agents" so
skill resolution points at the hidden .agents directory (change the literal
token root: ./agents to root: ./.agents in the AGENTS.md entry that lists the
skills index).
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check skill files structure and AGENTS.md details
echo "=== Checking skill files directory structure ==="
find ./agents -type f -name "*.md" 2>/dev/null | head -30
echo ""
echo "=== Checking .agents directory if it exists ==="
find ./.agents -type f -name "*.md" 2>/dev/null | head -30
echo ""
echo "=== Checking AGENTS.md line length ==="
if [ -f "AGENTS.md" ]; then
echo "Line 2 character count:"
sed -n '2p' AGENTS.md | wc -c
echo ""
echo "Line 17 content (checking for 80-column guideline):"
sed -n '17p' AGENTS.md
else
echo "AGENTS.md not found in root"
fi
echo ""
echo "=== List all files in root and immediate subdirectories ==="
ls -la | grep -E "^d|\.md"Repository: dojoengine/dojo.js
Length of output: 2372
🏁 Script executed:
#!/bin/bash
# View AGENTS.md to understand the skill reference format
echo "=== AGENTS.md content (first 30 lines) ==="
head -30 AGENTS.md
echo ""
echo "=== Line 2 specifically ==="
sed -n '2p' AGENTS.md | fold -w 100 -s | head -20Repository: dojoengine/dojo.js
Length of output: 2201
🏁 Script executed:
#!/bin/bash
# Check if the SKILLS_INDEX is used by any code
echo "=== Searching for SKILLS_INDEX usage ==="
rg "SKILLS_INDEX|skills.*create-a-plan" --type md --type js --type ts --type json -i
echo ""
echo "=== Checking if there's any script that parses AGENTS.md ==="
rg "AGENTS\.md|Agent Skills Index" --type js --type ts --type sh
echo ""
echo "=== Check .agents directory structure more carefully ==="
ls -la .agents/
ls -la .agents/skills/
echo ""
echo "=== Check if agents directory (without dot) exists ==="
ls -la agents/ 2>/dev/null || echo "agents/ (without dot) does not exist"Repository: dojoengine/dojo.js
Length of output: 1956
Update the Agent Skills Index to match the actual file structure and adhere to line length guidelines.
The skill file paths in the index are incorrect:
- Declared root is
./agents, but actual files are at./.agents/skills/ - Index references
{create-a-plan.md}, but actual files are at./.agents/skills/create-a-plan/SKILL.md(uppercaseSKILL.mdin subdirectories)
Additionally, line 2 is 526 characters, violating the 80-column guideline explicitly stated in line 17 of this file. Reformat the index to either be more concise or split across multiple lines for maintainability.
🤖 Prompt for AI Agents
In `@AGENTS.md` at line 2, Update the Agent Skills Index so the declared root and
each skill path match the actual repo layout: change the root value from
./agents to ./.agents/skills and replace entries like
create-a-plan:{create-a-plan.md} with the correct subdirectory SKILL file paths
(e.g., create-a-plan:{create-a-plan/SKILL.md}); do this for all listed skills
(create-pr, dojo-debug, dojo-entities, etc.), and reflow the long single line
into multiple lines so no line exceeds ~80 columns for readability and
maintainability.
64fc85b to
33f02bb
Compare
33f02bb to
2eeec6c
Compare
This PR keeps agent tooling in sync:\n\n- Ensure AGENTS.md is canonical (CLAUDE.md symlinks to it)\n- Ensure skills are installed under .agents/skills and .claude/.cursor use symlinks\n- Regenerate AGENTS.md skills index from cartridge-gg/agents\n- Standardize Claude PR review workflow and remove legacy review jobs\n
Summary by CodeRabbit
New Features
Documentation