Skip to content

Commit 10e09be

Browse files
Nick Sullivanclaude
andcommitted
🔧 Fix critical issues from bot review
- Fix bash syntax errors in validation-and-review section - Fix four-backtick code fence formatting - Fix hardcoded {owner}/{repo} with dynamic repo detection - Change sleep to 3 minutes for bot feedback (180s) - Add repository info detection for gh api calls - Improve error handling with actual fix attempts Addresses feedback from automated code review. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e2b68e2 commit 10e09be

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

.claude/commands/autotask.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,27 @@ echo "🔍 Running validation and review..."
252252

253253
# Step 1: Git hooks handle the basics
254254

255-
echo "🪝 Running pre-commit hooks..." git add .
255+
echo "🪝 Running pre-commit hooks..."
256+
git add .
256257

257-
if [ -d ".husky" ]; then npx husky run pre-commit || { echo "Fixing hook failures..." #
258-
Auto-fix and retry } elif [ -f ".pre-commit-config.yaml" ]; then pre-commit run
259-
--all-files || { echo "Fixing hook failures..." # Auto-fix and retry } fi
258+
if [ -d ".husky" ]; then
259+
npx husky run pre-commit || {
260+
echo "❌ Pre-commit hooks failed, attempting fixes..."
261+
npx eslint --fix . 2>/dev/null || true
262+
npx prettier --write . 2>/dev/null || true
263+
npx husky run pre-commit
264+
}
265+
elif [ -f ".pre-commit-config.yaml" ]; then
266+
pre-commit run --all-files || {
267+
echo "❌ Pre-commit hooks failed, attempting fixes..."
268+
pre-commit run --all-files
269+
}
270+
fi
260271

261272
# Step 2: Conditional agent review based on complexity
262273

263274
echo "📊 Analyzing changes to determine review needs..."
264-
265-
````
275+
```
266276

267277
Based on the analysis, I'll deploy appropriate review agents:
268278

@@ -370,8 +380,12 @@ Autonomously handling bot feedback without waiting for user intervention:
370380
echo "⏳ Waiting for bot reviews to complete..."
371381
PR_NUMBER=$(gh pr view --json number -q .number)
372382
373-
# Initial wait for bots to run (typically 2-5 minutes)
374-
sleep 120
383+
# Get repository info
384+
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
385+
386+
# Initial wait for bots to run
387+
echo "⏰ Waiting 3 minutes for bots to complete initial analysis..."
388+
sleep 180
375389
376390
MAX_ATTEMPTS=5
377391
ATTEMPT=0
@@ -382,12 +396,12 @@ while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
382396
383397
# Get all bot comments
384398
BOT_COMMENTS=$(gh api \
385-
repos/{owner}/{repo}/pulls/$PR_NUMBER/comments \
399+
"repos/$REPO/pulls/$PR_NUMBER/comments" \
386400
--jq '.[] | select(.user.type == "Bot" or .user.login | endswith("[bot]")) | {id: .id, body: .body, path: .path, line: .line}')
387401
388402
# Also check review comments
389403
BOT_REVIEWS=$(gh api \
390-
repos/{owner}/{repo}/pulls/$PR_NUMBER/reviews \
404+
"repos/$REPO/pulls/$PR_NUMBER/reviews" \
391405
--jq '.[] | select(.user.type == "Bot" or .user.login | endswith("[bot]")) | {state: .state, body: .body}')
392406
393407
# Check CI status

0 commit comments

Comments
 (0)