autonomous-workflow

Autonomous feature development workflow using isolated worktrees. Use to autonomously implement features from task description through tested PR delivery. Handles worktree creation, implementation, testing, iteration, documentation, and PR creation. Triggers on autonomous feature development, end-to-end implementation, or "implement X autonomously."

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "autonomous-workflow" with this command: npx skills add mthines/gw-tools/mthines-gw-tools-gw-autonomous-workflow

Autonomous Workflow

Execute complete feature development cycles autonomously—from task intake through tested PR delivery—using isolated Git worktrees.


⚠️ CRITICAL: Before Starting ANY Work

You MUST complete these steps IN ORDER before writing any code:

Step 1: Detect Workflow Mode (MANDATORY)

Analyze the task scope to determine the workflow mode:

ModeCriteriaArtifacts Required
Full4+ files OR complex/architecturalYES - MANDATORY
Lite1-3 files AND simple/straightforwardNo

When in doubt, choose Full Mode.

Step 2: Create Artifact Files (Full Mode ONLY)

For Full Mode, you MUST create these files in .gw/{branch-name}/ BEFORE Phase 1 Planning begins:

# Create artifact directory
mkdir -p .gw/{branch-name}

# Create required files
touch .gw/{branch-name}/task.md
touch .gw/{branch-name}/plan.md
FilePurposeWhen to Update
task.mdDynamic checklist, decisions, blockersAt milestones (every 2-3 files)
plan.mdImplementation strategy, file listAfter Phase 1 analysis
walkthrough.mdFinal summary for PRPhase 6 (MANDATORY)

⛔ DO NOT proceed to implementation without these files for Full Mode tasks.


⚠️ ARTIFACT UPDATE TRIGGERS (Full Mode)

Update .gw/{branch}/task.md at these key points:

TriggerUpdate Action
Logical milestone (2-3 files)Batch update Completed items
Phase transitionUpdate Status section, move items
Decision madeAdd row to Decisions Log
Test iteration (fail→fix→rerun)Log result in Test Iterations
Blocker encounteredUpdate Blockers section

Batch updates preferred: Update after completing a logical unit of work rather than after every single file. This reduces overhead while maintaining visibility.

Step 3: Announce Mode Selection

State your mode selection explicitly:

"This is a Full Mode task (affects 5+ files). Creating .gw/{branch-name}/ artifacts now."

or

"This is a Lite Mode task (2 files, simple fix). Proceeding without artifacts."


Prerequisites: gw CLI Installation

Before Phase 2 (Worktree Setup), verify the gw CLI is installed:

which gw

If gw is NOT installed

STOP and prompt the user to install gw. The workflow cannot proceed without it.

Installation options (present to user):

# Via npm (recommended)
npm install -g @gw-tools/gw

# Via Homebrew (macOS)
brew install mthines/gw-tools/gw

# Via pnpm
pnpm add -g @gw-tools/gw

After installation, set up shell integration:

# For zsh (add to ~/.zshrc)
echo 'eval "$(gw install-shell)"' >> ~/.zshrc
source ~/.zshrc

# For bash (add to ~/.bashrc)
echo 'eval "$(gw install-shell)"' >> ~/.bashrc
source ~/.bashrc

# For fish (add to ~/.config/fish/config.fish)
echo 'gw install-shell | source' >> ~/.config/fish/config.fish
source ~/.config/fish/config.fish

Verify installation:

gw --version
gw --help

Then initialize gw in the repository (if not already done):

# For existing repositories
gw init

# With auto-copy files (recommended)
gw init --auto-copy-files .env,secrets/ --post-checkout "npm install"

Once gw is installed and configured, resume the workflow from Phase 2.


Rules

RuleDescription
overviewHIGH - Workflow phases, when to use, expected outcomes
smart-worktree-detectionCRITICAL - Fuzzy match task to current worktree, prompt to continue or create new
phase-0-validationCRITICAL - MANDATORY - Validate requirements before any work
phase-1-planningHIGH - Deep codebase analysis and implementation planning
phase-2-worktreeCRITICAL - MANDATORY - Create isolated worktree with gw add
phase-3-implementationHIGH - Incremental implementation with continuous validation
phase-4-testingCRITICAL - Fast iteration loop until tests pass (Ralph Wiggum pattern)
phase-5-documentationMEDIUM - Update README, CHANGELOG, API docs
phase-6-pr-creationHIGH - Create draft PR, deliver results
phase-7-cleanupLOW - Optional worktree removal after merge
decision-frameworkHIGH - Branch naming, test strategy, iteration decisions
error-recoveryHIGH - Recovery procedures for common errors
safety-guardrailsCRITICAL - Validation checkpoints, resource limits, rollback
parallel-coordinationHIGH - Multi-agent coordination, handoff protocol
artifacts-overviewHIGH - Three-artifact pattern (Task, Plan, Walkthrough), file locations
task-trackingHIGH - Dynamic task updates throughout workflow
walkthrough-generationMEDIUM - Final summary generation at Phase 6

Templates

Structured templates for consistent artifact generation:

TemplatePurpose
task.template.mdDynamic task checklist
plan.template.mdImplementation plan
walkthrough.template.mdFinal summary

Quick Reference

Full Mode (4+ files, complex changes)

PhaseCommand/Action
0. ValidationAsk clarifying questions, get user confirmation
1. PlanningAnalyze codebase, POPULATE .gw/{branch}/task.md and plan.md
2. Worktreegw add feat/feature-name
3. ImplementationCode in worktree, UPDATE task.md at milestones
4. Testingnpm test, LOG each iteration in task.md
5. DocumentationUpdate README, CHANGELOG
6. PR CreationCREATE walkthrough.md, gh pr create --draft, SHOW walkthrough to user
7. Cleanupgw remove feat/feature-name (after merge)

Lite Mode (1-3 files, simple changes)

PhaseCommand/Action
0. ValidationQuick clarification if needed
1. PlanningBrief mental plan (no artifact files)
2. Worktreegw add fix/bug-name (optional for trivial)
3. ImplementationCode directly, commit when done
4. Testingnpm test, fix any failures
5. PR Creationgh pr create --draft

Workflow Modes

ModeFiles ChangedArtifactsUse When
Lite1-3 filesNoSimple fixes, small enhancements
Full4+ filesYesFeatures, refactors, complex changes

Full Mode: Creates .gw/{branch}/ artifacts for progress tracking and context recovery.

Lite Mode: Faster execution without artifact overhead. Still uses worktree isolation.

Key Principles

  1. Detect workflow mode FIRST: Determine Full vs Lite before any other action.
  2. Create artifacts BEFORE planning (Full Mode): .gw/{branch}/task.md and plan.md are MANDATORY.
  3. Always validate first (Phase 0): Never skip directly to implementation.
  4. Always create worktree (Phase 2): Isolation is mandatory (can skip for trivial fixes).
  5. Update task.md at milestones: Every 2-3 files or at logical checkpoints (not every file).
  6. Smart worktree detection: Check if current worktree matches task before creating new.
  7. Iterate until correct: No artificial iteration limits (Ralph Wiggum pattern).
  8. Fast feedback loops: Run tests frequently, fix failures immediately.
  9. Self-validate continuously: Check work at every step.
  10. ⛔ CREATE walkthrough.md AND SHOW IT at Phase 6: This is MANDATORY for Full Mode.
  11. Stop and ask when blocked: Don't guess on ambiguity.

Artifact System

Inspired by Google Antigravity, this workflow produces three artifacts in .gw/{branch-name}/:

ArtifactFileCreatedPurpose
Tasktask.mdPhase 1Dynamic checklist, decisions, discoveries
Planplan.mdPhase 1Implementation strategy
Walkthroughwalkthrough.mdPhase 6Final summary for PR

Files are gitignored and grouped by branch for easy browsing.

⚠️ CRITICAL: Artifact Update Requirements

ArtifactUpdate FrequencyBlocking Gate
plan.mdOnce in Phase 1⛔ Must be POPULATED (not empty) before Phase 2
task.mdAt milestones (every 2-3 files)⛔ Must reflect completed work at phase transitions
walkthrough.mdOnce in Phase 6⛔ Must be CREATED AND SHOWN to user before completion

Workflow Flow

┌─────────────────────────────────────────────────────┐
│  MODE DETECTION ← MANDATORY FIRST STEP              │
│  Analyze task → Choose Full (4+ files) or Lite      │
│  Full Mode: Create .gw/{branch}/ artifacts NOW      │
└─────────────────────────────────────────────────────┘
    ↓
Phase 0: Validation ← MANDATORY
    ↓ (user confirms)
Phase 1: Planning
    ⛔ Full Mode: POPULATE plan.md + task.md (not empty!)
    ↓ (plan validated)
Phase 2: Worktree Setup ← MANDATORY (with smart detection)
    ↓ (worktree created)
Phase 3: Implementation
    📝 Full Mode: UPDATE task.md at milestones (every 2-3 files)
    ↓ (code complete)
Phase 4: Testing ← iterate until passing
    📝 Full Mode: LOG each test iteration in task.md
    ↓ (all tests pass)
Phase 5: Documentation
    ↓ (docs complete)
Phase 6: PR Creation
    ⛔ Full Mode: CREATE walkthrough.md + SHOW to user
    ↓ (draft PR delivered)
Phase 7: Cleanup (optional)

Smart Worktree Detection

Before creating a new worktree, the workflow checks if the current context matches the task:

ScenarioAction
On main/masterAlways create new worktree
Worktree name matches task keywordsPrompt user to continue or create new
No keyword matchCreate new worktree

Fast Iteration Loop (Phase 4)

Based on the Ralph Wiggum pattern:

while not all_tests_pass:
    1. Run tests
    2. If pass: done
    3. If fail: analyze → fix → commit → continue
    4. Safety: warn at 10 iterations, stop at 20

Troubleshooting Quick Reference

IssueCheckRecovery
Wrong worktreegw list, pwdgw cd <correct-branch>
gw command not foundwhich gwnpm install -g @gw-tools/gw
Secrets missingcat .gw/config.jsongw sync <branch> .env
Agent stuck in looptask.md iteration historyTry alternative approach, ask user
Tests keep failingtask.md test resultsFocus on ONE failure, escalate at 7+
Agent hallucinated cmdError messageSee error-recovery
plan.md emptycat .gw/{branch}/plan.mdSTOP, populate plan.md before proceeding
task.md not updatedcat .gw/{branch}/task.mdUpdate immediately with all completed work
walkthrough.md missingls .gw/{branch}/Create before announcing completion

Related Skills

References

Detailed examples and scenarios (loaded on-demand):

Research Sources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

@gw-multi-worktree-dev

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

autonomous-workflow

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

@gw-git-worktree-workflows

No summary provided by upstream source.

Repository SourceNeeds Review
General

@gw-config-management

No summary provided by upstream source.

Repository SourceNeeds Review