Agentplane task closure recovery

From basilisk-labs/agentplane · View interactive version

Agentplane task closure recovery is an AI agent skill from the GitHub repository basilisk-labs/agentplane. Use when Agentplane task completion, direct finish, branch_pr integration, hosted-close, close-tail PRs, PR metadata, dirty task artifacts, or remote branch divergence need diagnosis or recovery.

How to use this skill

Skill file

Agentplane Task Closure Recovery

Use This Skill When

First Classification

  1. Read workflow mode:
agentplane config show
  1. Identify the task state:
agentplane task show <task-id>
agentplane task verify-show <task-id>
git status --short --untracked-files=no
git rev-parse --abbrev-ref HEAD
  1. Query incident advice:
agentplane incidents advise <task-id>

Direct Mode

Expected close path:

agentplane verify <task-id> --ok --by CODER --note "..."
agentplane finish <task-id> --author CODER --body "Verified: ..." --result "..." --commit <git-rev>

If finish is blocked:

Branch PR Mode

Classify before recovery:

Useful commands:

gh pr list --state all --head "task-close/<task-id>/<sha>"
gh pr view <number> --json state,mergedAt,headRefName,baseRefName,url
git ls-remote --heads origin "task/<task-id>/*"
git ls-remote --heads origin "task-close/<task-id>/*"

Known Recovery Patterns

Remote Branch Already Exists

If pr open fails after trying to push:

  1. Compare local branch tip to the remote branch tip.
  2. If they match, continue PR creation instead of forcing another push.
  3. If they differ, stop and classify divergence before overwriting anything.

Obsolete Close Tail

If hosted closure already landed on main:

  1. Treat the canonical close commit on base as a no-op condition.
  2. Do not create a new manual close-tail PR.
  3. Clean up only branches/PRs that are proven obsolete.

Dirty Base After Closure

If close paths wrote task artifacts or incident mirrors:

  1. Confirm the dirty paths are allowed for the closure operation.
  2. Stage only closure-scoped artifacts.
  3. Keep unrelated active task dirtiness untouched.

Verification

Minimum evidence:

Record recovery facts in the task README Findings; promote reusable external incidents only through the incident workflow.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.