flurdy/agent-skills/complete-task
Claude Code and agent skill by flurdy/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Complete an in-progress task by running clean-code, staging, and committing. Close the bead on trunk, leave it open for PR creation, and protect detached commits. Use after /verify-task.
Install
npx vskill@latest install flurdy/agent-skills/complete-taskSKILL.md
The same SKILL.md was published earlier as flurdy/agent-skills/complete-task.
Complete Task
Run clean-code, stage, and commit an in-progress task — the finalization phase of development. Normally a fully verified bead closes on trunk / direct-commit, stays open for /create-pr in PR mode, and stays open on detached HEAD until the commit is safely owned. Applicable project policy wins. Future-event-only evidence uses the explicit deferred-verification choice in §6, not an unqualified completion claim.
When to Use
- Code changes are verified and ready to commit
- After
/verify-taskhas passed (or verification is not needed), or returned the qualified
deferred-verification tracking handoff
- Replacing manual Phase 3 (Commit and Close) steps
Prerequisites
Run /verify-task before this skill to confirm requirements are met and test coverage is adequate. If you haven't verified yet, do that first. Its deferred-verification tracking handoff is the only incomplete-evidence exception: the verdict remains Incomplete evidence, and only the named future-event check is outstanding. All other requirements and presently executable checks must pass with unchanged scope. Any failed, stale, not-run check, missing local coverage or ordinary unavailable evidence blocks this path; never relabel a failure as waiting for a rollout.
Consume the report's requirement rows, revision and pending-event packet; do not infer eligibility from a clean tree or commit. This exception permits committing authorized implementation and the confirmed tracking disposition in §6, not claiming full verification.
Usage
Instructions
1. Identify the Task
Determine which bead is being completed, then prove which store owns it before reading or closing anything. Never infer the owning store from the bead ID or the current directory: at a workspace root the cwd store is the workspace store, not the repository that owns the work.
If multiple beads are in progress, ask the user which one to complete. If no beads are in progress, ask the user what to do.
Act on the resolver status:
| status | action | |
|---|---|---|
resolved | take directory; every later bd call in this skill uses bd -C <directory> | |
ambiguous | show matches[].selector, ask which <repo>:<id> is meant; close nothing | |
unavailable | report failures; commit as normal but leave the bead untouched and say why | |
not-found | ask the user for the right ID; never guess another store or create a bead |
Then read it in its owning store:
2. Run Clean Code
If clean-code fails:
- Fix auto-fixable issues
- Re-run to confirm zero warnings and zero errors
- If issues remain that change behavior, ask the user before fixing
3. Select new work or an existing verified commit
Inspect git status --porcelain=v1 --untracked-files=all first. Stop if the status command fails. With task changes, HEAD may be unborn: stage and create the initial commit normally.
Only on the existing-commit path, require git rev-parse HEAD to succeed; stop if it does not. If there is nothing to commit, do not create an empty commit. This includes a rerun after preserving an earlier detached commit on a branch. Confirm that HEAD is the exact task commit, the working tree is clean, and verification evidence applies to that commit; rerun /verify-task if evidence is missing or HEAD changed (the qualified pending-event report is sufficient only for the exception below). Show the SHA and ask Finalize this verified commit or Stop. Only after confirmation, skip staging and committing and continue to §5. If HEAD or task identity is uncertain, leave the bead open; an empty diff is not proof that the task is complete.
For an existing pending-event commit, show the SHA as not fully verified and use the single §6 choice instead of the ordinary existing-commit confirmation. Skip staging/committing, then classify in §5; no tracking writes before that explicit choice. Before §6, ensure the report still describes the committed contents and record the resulting SHA. Changed task content requires fresh verification.
Stage changes for a new commit
Stage only the files changed for this task:
Rules:
- Never use
git add -Aorgit add . - Never stage root folders only (e.g.,
git add src/) - Stage specific files or small subdirectories
- Exclude unrelated changes — if unrelated changes exist, leave them unstaged
- Exclude files that likely contain secrets (.env, credentials, etc.)
4. Commit
For staged task changes only, create a commit using conventional commit format:
Commit message rules:
- Use conventional commit prefix:
feat:,fix:,docs:,chore:,refactor:,perf:,test: - Infer the type from the bead type (feature →
feat:, bug →fix:, task → contextual) - Keep the message concise (1-2 sentences) focused on the "why"
- Do not push to remote
5. Detect the Workflow Mode
Require either a successful new commit or an explicitly confirmed existing verified commit from §3, or its existing pending-event commit awaiting §6 confirmation. Then classify the current checkout; no path bypasses detached-HEAD protection. For attached checkouts, explicit project guidance takes precedence over the branch/remote heuristics below; a heuristic is not a delivery-boundary declaration. Never infer a PR workflow where project policy declares trunk delivery, or close before that policy's required integration/merge has actually happened.
Classify in this order:
- Detached mode —
current_branchis empty. The commit exists athead_shabut no branch owns
it, regardless of remotes or default-branch detection.
- Trunk / direct-commit mode — attached
current_branchequalsdefault_branch, or there is no
remote. The commit itself is the deliverable.
- PR mode — attached feature branch (
current_branchdiffers fromdefault_branch) with a
remote. The PR is the next lifecycle step.
6. Finalize the Bead
Never close a bead if the commit failed or changes are still uncommitted. Apply the Beads ownership rules: resolve the exact target freshly before every independent write and use its proven directory. A failed resolution writes nothing.
Detached mode — never close the bead. Report the detached commit SHA, leave the bead in_progress, and offer the exact preservation command without running it automatically:
After the user creates an attached branch, /complete-task may be rerun to classify the workflow and finalize the bead. Detached commits cannot enter the deferred-verification exception below.
Future-event-only verification
Use the shared deferred-verification rule, not a second policy. Only a qualified report from the prerequisites enters this branch: failed, stale or ordinary unavailable evidence is not eligible. This branch precedes normal finalization and cannot use its Close the bead anyway escape hatch to bypass the declared-boundary gate.
Show the report, committed SHA, applicable project guidance and delivery evidence, the exact proposed follow-up or original-bead note using the shared checklist, wake date, provenance link, and honest close reason. Resolve any missing date/check/environment detail before requesting a choice; do not invent one. Ask one AskUserQuestion for explicit confirmation of the displayed proposal:
- Snooze the original (Recommended) — keep the evidence obligation on this bead and defer it to
the agreed date; always available for eligible future-event-only work.
- Close implementation + deferred follow-up — offer only when an explicit project declaration
separates delivery from future verification and its boundary has been reached. Cite both. A merge boundary not yet reached means snooze only; do not reinterpret PR mode as delivered implementation.
- Stop — no lifecycle changes; preserve the verification gap in the report.
No tracking writes on declined, abandoned or incomplete approval. This single choice also confirms an existing pending-event commit from §3. Neither choosing nor loading this skill authorizes a new rollout, job, remote sync, policy edit or unavailable test. A changed proposal needs fresh confirmation.
A. Close implementation + deferred follow-up
Check for an existing verification follow-up in the proven store, including closed/deferred rows and their actual discovered-from links to this bead. Match revision, check and environment, not just the title. Read its full record; reuse a matching outstanding record only after confirming it with the user. A closed match, multiple matches or an unreadable inventory requires reconciliation, not a new duplicate. For a new record, check the installed bd create --help and bd defer --help contracts. Preserve the original's exact Jira external_ref via --external-ref when present; omit that flag otherwise. Never guess a key or drop an association to make creation succeed.
Re-resolve the original immediately before creating in that same store:
The note carries the shared checklist and provenance; add the approved external reference if present. Resolve the returned ID, confirm it belongs to the same store, and read back (also for a reused record):
Require the saved status deferred, future defer_until, exact check/revision/environment, discovered-from link and external reference to match the proposal. A failed readback or an ambiguous create result means the original stays open; report any returned ID and do not create another on retry without reconciling. Never silently repair the saved record or fall through to normal closure.
Only after that verification, freshly resolve the original again and close with the actual follow-up ID:
If the close fails or is uncertain, retain the follow-up and report both records; a rerun reuses that record after reconciliation, not another create. Successful pending-verification closure must skip §6a; continue to §7. It proves implementation delivery only, never runtime verification.
B. Snooze the original
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/complete-task/SKILL.md
Popularity
- Repository stars
- 10
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/flurdy/agent-skills/complete-task)