optimus-done

Validate gates, clean worktrees, and update task state to DONE.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/alexgarzao/optimus --skill optimus-done
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimus-done
Source: https://github.com/alexgarzao/optimus/tree/main/done/skills/optimus-done
Command: npx skills add https://github.com/alexgarzao/optimus --skill optimus-done

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Closing a task safely requires validating that all gates were passed, ensuring the PR is finalized, and cleaning up local and remote work artifacts. This Skill orchestrates end-to-end finalization of a task by enforcing gate checks, marking DONE, and performing workspace cleanup.

Core Features & Use Cases

  • Enforces sequential gate checks (no uncommitted changes, no unpushed commits, PR review feedback, and final PR state) before marking a task as DONE.
  • Updates the task state to DONE (or Cancelado) and triggers notification hooks; supports post-completion cleanup including worktree removal and branch hygiene.
  • Handles edge cases such as PRs that are merged, closed, or open, and provides guided prompts or overrides when needed.
  • Supports dry-run mode to preview operations without applying changes.

Quick Start

Run /optimus-done T-012 to securely finalize a task and clean up its workspace after the PR final state is reached.

Frequently Asked Questions about optimus-done

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely close a git task and clean up its worktree after a PR merge?

To safely close a task and clean up worktrees, you must validate sequential gates including uncommitted changes, unpushed commits, and PR review feedback. Once the PR final state is reached, the task state updates to DONE and workspace cleanup removes local and remote artifacts.

What is the best way to automate branch cleanup and task state management?

Automating branch cleanup and task state management requires enforcing deterministic default-branch resolution and GitHub CLI checks. This approach applies structured prompts to validate PR states, update task lifecycles to DONE, and trigger post-completion worktree removal.

Can I preview worktree removal and task state changes before applying them?

Yes, you can preview worktree removal and task state changes using dry-run mode. Dry-run mode allows you to validate gate checks, verify PR states, and simulate task finalization operations without applying any actual changes to your workspace.

Does this task finalization process handle edge cases like closed or open PRs?

Yes, the task finalization process handles edge cases for PRs that are merged, closed, or open. It provides guided prompts or overrides when needed to ensure proper branch hygiene and state updates regardless of the final PR state.

Why do I need to check for unpushed commits before marking a task as DONE?

Checking for unpushed commits is required because finalizing a task safely enforces sequential gate checks. These gates ensure no uncommitted changes remain, PR review feedback is addressed, and the final PR state is verified before updating the task to DONE.

What governance checks are enforced when finalizing a task lifecycle end-to-end?

Finalizing a task lifecycle enforces governance checks via deterministic default-branch resolution, GitHub CLI validations, and structured prompts. These mechanisms verify gate compliance, reduce human error, and ensure proper task state transitions from initial plan through final review to DONE.