autonomous-execution
Guidelines for autonomous execution in automation/orchestration contexts
What this skill does
# Autonomous Execution Guidelines
## Purpose
Provide clear guidelines for agents running in autonomous automation contexts (tmux sessions, background agents, orchestration workflows) where human interaction is not available.
## Activation cues
- Running in tmux session spawned by orchestration system
- Executing as part of automated PR fixing (fixpr, fixcomment workflows)
- Background agent tasks with no interactive terminal
- Any automation context where asking questions blocks progress
## Core Principle
**Success = Remote commits pushed**
In autonomous contexts:
- Exit 0 without commits = FAILURE
- Asking questions without proceeding = FAILURE
- Stopping for user input = FAILURE
## Critical Rules for Autonomous Execution
### 1. Git Dirty State Handling
**If you encounter unexpected staged changes or modified files after checkout:**
```bash
# 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**:
- ✅ ALWAYS handle dirty state automatically
- ✅ Clean and proceed, don't block
- ❌ NEVER ask "Do you want me to keep/stash/discard?"
- ❌ NEVER stop with "Per instructions, I have to stop"
### 2. Decision Making
**Make autonomous decisions within task scope:**
- ✅ Clean dirty git state automatically
- ✅ Choose between equivalent approaches
- ✅ Fix obvious issues without confirmation
- ✅ Determine which tests to run
- ✅ Decide commit message phrasing
**Only ask questions for:**
- ❓ Ambiguous requirements affecting correctness
- ❓ Multiple valid architectural approaches with tradeoffs
- ❓ User preference choices that impact UX
**NEVER ask about:**
- ❌ Operational details (git state, temp files, etc.)
- ❌ Obvious bug fixes
- ❌ Standard code formatting/style choices
- ❌ Test execution strategy
### 3. Working Directory Assumptions
**In automation contexts, assume:**
- Working directory is temporary (`/tmp/worldarchitect.ai/pr-*`)
- Dirty state is safe to clean/reset
- Previous run artifacts can be discarded
- No valuable uncommitted work exists
**Therefore:**
- Clean aggressively without asking
- Reset to clean state if uncertain
- Focus on completing task, not preserving unknown state
### 4. Error Recovery
**When encountering issues:**
```python
# 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
```
### 5. Success Criteria
**Only exit 0 if:**
- ✅ Remote commits pushed to PR branch
- ✅ All requested changes implemented
- ✅ Tests pass (if required by task)
**Exit 1 if:**
- ❌ Unable to make commits due to technical issue
- ❌ Tests fail and cannot be fixed
- ❌ Actual blocker preventing completion
**NEVER:**
- ❌ Exit 0 after asking question without proceeding
- ❌ Exit 0 with "I need more information to continue"
- ❌ Exit 0 with "waiting for user response"
## Examples
### ✅ CORRECT: Autonomous Dirty State Handling
```bash
# Agent encounters dirty state
git status
# On branch feature-x
# Changes not staged for commit:
# modified: mvp_site/agents.py
# modified: .beads/issues.jsonl
# Agent analyzes context
git diff --stat
# mvp_site/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
```
### ❌ WRONG: Stopping to Ask
```bash
# Agent encounters dirty state
git status
# Changes not staged for commit:
# modified: mvp_site/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
```
### ✅ CORRECT: Autonomous Decision Making
```bash
# Agent fixing PR with multiple test failures
# Analyzes failures
./run_tests.sh mvp_site/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 mvp_site/agents.py (change field names)
Edit mvp_site/tests/test_agents.py (change test field names)
# Verifies
./run_tests.sh mvp_site/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
```
## Integration with Other Skills
- **pr-workflow-manager**: Use PR workflow best practices, but handle dirty state autonomously
- **receiving-code-review**: Implement feedback, clean state automatically
- **build-test-lint-autopilot**: Run tests, decide which to execute autonomously
## Monitoring and Debugging
When running autonomously, provide clear logging:
```bash
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.
## Summary
**In autonomous contexts:**
1. Handle dirty state automatically (clean and proceed)
2. Make decisions within task scope
3. Only exit 0 if commits are pushed
4. Never stop to ask operational questions
5. Provide clear logging for debugging
**Remember**: Automation contexts have no human watching. Asking questions = blocking forever = failure.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.