From claude-commands
Provides guidelines for autonomous execution in automation/orchestration contexts (tmux, background agents, PR fixing) where human interaction is unavailable. Emphasizes git dirty state handling, autonomous decision-making, and error recovery.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:autonomous-executionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provide clear guidelines for agents running in autonomous automation contexts (tmux sessions, background agents, orchestration workflows) where human interaction is not available.
Provide clear guidelines for agents running in autonomous automation contexts (tmux sessions, background agents, orchestration workflows) where human interaction is not available.
Success = Remote commits pushed
In autonomous contexts:
If you encounter unexpected staged changes or modified files after checkout:
# Step 1: Inspect to understand context
git status
git diff --stat
# Step 2: Decide based on context
# - Previous failed run artifacts? → Clean
# - Irrelevant files (.beads/, temp files)? → Clean
# - Related to current PR? → Inspect and integrate
# Step 3: Clean automatically (NEVER ask user)
git reset --hard origin/<branch-name>
git clean -fd
# Step 4: Proceed with task
CRITICAL:
Make autonomous decisions within task scope:
Only ask questions for:
NEVER ask about:
In automation contexts, assume:
/tmp/your-project.com/pr-*)Therefore:
When encountering issues:
# WRONG: Stop and ask
"I hit an error. Should I retry or abort?"
# RIGHT: Attempt recovery automatically
try_alternative_approach()
if still_fails:
log_error_and_exit_1() # Let orchestration system handle fallback
Only exit 0 if:
Exit 1 if:
NEVER:
# Agent encounters dirty state
git status
# On branch feature-x
# Changes not staged for commit:
# modified: $PROJECT_ROOT/agents.py
# modified: .beads/issues.jsonl
# Agent analyzes context
git diff --stat
# $PROJECT_ROOT/agents.py | 2 +-
# .beads/issues.jsonl | 1 +
# Agent decides: artifacts from previous run, safe to clean
git reset --hard origin/feature-x
git clean -fd
# Agent proceeds with task
gh pr checkout 123
# ... continues fixing PR
# ... makes commits
git push
# ✅ Exit 0 with commits made
# Agent encounters dirty state
git status
# Changes not staged for commit:
# modified: $PROJECT_ROOT/agents.py
# Agent stops and asks
"I hit unexpected local changes. Per instructions, I have to stop.
Do you want me to: 1) keep, 2) stash, 3) discard?"
# ❌ Exit 0 without making commits
# This is a FAILURE in automation context
# Agent fixing PR with multiple test failures
# Analyzes failures
./run_tests.sh $PROJECT_ROOT/tests/test_agents.py
# FAILED: test_faction_enablement (wrong field name)
# FAILED: test_minigame_settings (wrong field name)
# Makes autonomous decisions
# - Both failures: same root cause (factionMinigameEnabled → faction_minigame_enabled)
# - Fix: change all instances to snake_case
# - Tests to run: test_agents.py (directly affected)
# Implements fix
Edit $PROJECT_ROOT/agents.py (change field names)
Edit $PROJECT_ROOT/tests/test_agents.py (change test field names)
# Verifies
./run_tests.sh $PROJECT_ROOT/tests/test_agents.py
# ✅ All tests pass
# Commits and pushes
git add -A
git commit -m "[codex-automation-commit] fix PR #4018: correct field name to faction_minigame_enabled"
git push
# ✅ Exit 0 with commits made
When running autonomously, provide clear logging:
echo "[AUTONOMOUS] Detected dirty state, cleaning automatically"
echo "[AUTONOMOUS] Decided to reset to origin/branch-name"
echo "[AUTONOMOUS] Proceeding with PR fixes after clean"
This helps debugging while maintaining autonomous execution.
In autonomous contexts:
Remember: Automation contexts have no human watching. Asking questions = blocking forever = failure.
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsOrchestrates skills and agents for code workflows, delegating git commits/conflicts, enforcing file policies, and running completion pipelines. Use on startup.
Manages agent execution with task decomposition, two-stage review, and batch sizing. Enforces isolation, verification, and human checkpoints to prevent runaway parallelization.
Guides PR automation and multi-agent orchestration workflows using tmux sessions and A2A communication. Includes cross-org PR monitoring and agent dispatch for fix/analysis tasks.