Skip to content
Back to skills

Done

ASecurity

Use when the user signals work completion with 'done', 'fertig', 'finished', 'abschluss', '/done'. Detects current branch (main vs feature), runs closure checks defined in CLAUDE.md, handles commit and push based on branch context, closes the issue of work that landed without a PR, and reports a strict short summary.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 28, 2026
developmentgobashgitdocumentation

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add fo0/traygent --skill done --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Done?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Done
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fo0-done/badge)](https://www.skillsdirectory.com/skills/fo0-done)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: done
description: "Use when the user signals work completion with 'done', 'fertig', 'finished', 'abschluss', '/done'. Detects current branch (main vs feature), runs closure checks defined in CLAUDE.md, handles commit and push based on branch context, closes the issue of work that landed without a PR, and reports a strict short summary."
metadata:
  origin: claude-code-optimizer
---

# Done — Work Closure

## When to Use

- User says "done", "fertig", "finished", "abschluss", "/done"
- End of a feature, bugfix, or task when ready to wrap up

## Scope Boundaries

**Owns:** closing a piece of work out — format, the automated-check chain, scope check, commit, push, closing the issue of work that landed without a PR.
**Does not own:** the review itself (`basic-review`), the PR object (`pr`), remote build state (`ci`). It _suggests_ those and never runs them — that fence is what keeps `/done` predictable enough to type without reading it first.

## Workflow

### 1. Detect branch context

```bash
git rev-parse --abbrev-ref HEAD && git status --porcelain && git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline 2>/dev/null || echo "no upstream"
```

Classify:

- `main` / `master` / `develop` / `trunk` → **main branch mode** (conservative)
- anything else → **feature branch mode** (standard)

### 2. Read CLAUDE.md closure requirements

- **Commands section** → identify the automated-check commands, in the canonical order stated there
- **Git Conventions** → commit format (e.g. Conventional Commits), branch rules, merge strategy
- **Documentation Rules** → verify affected docs (CLAUDE.md, README.md, MEMORY.md, SCRATCHPAD.md, BACKLOG.md) are up to date

### 3. Auto-format (write mode)

Run **this project's** format-write command, exactly as CLAUDE.md → _Commands_ names it. It MUST run before the rest of the chain — formatting drift introduced during the session otherwise reaches CI and fails the format check there.

- If no format-write command is listed in CLAUDE.md, skip this step (project has no formatter configured).
- If formatting changed files, **stage them with `git add -u` so they go into the upcoming commit (step 6)** — do NOT split formatting into its own commit.
- Re-run `git status --porcelain` after formatting to see what changed.

### 4. Run automated checks

Execute the project's check chain from CLAUDE.md → _Commands_, in the order stated there. If any stage fails:

- **Feature branch:** report failure, stop. Do not commit.
- **Main branch:** hard stop. Never push to main on red.

### 5. Verify scope

Run `git status` and verify no unexpected `.claude/**`, `CLAUDE.md`, `AGENTS.md`, or `agent_docs/**` changes are staged — if a tool (or anything else) touched them and they weren't the point of the task, revert with `git checkout -- <paths>` before committing. A project skill this work wrote or corrected under `agent_docs/memory_process.md → Project skills` is expected, not reverted.

### 5b. Context budget check

```bash
wc -c CLAUDE.md MEMORY.md SCRATCHPAD.md README.md 2>/dev/null
```

Over 14,000 / 16,000 / 8,000 chars → offload per `agent_docs/context_budget.md` **now**, in this commit: move content to `agent_docs/` (or `docs/adr/`, `agent_docs/memory_archive/`) and leave a one-line pointer. Never delete to fit. This is the closure gate that keeps the always-loaded files from drifting — deferring it just moves the cost to every future session.

`README.md` over 12,000 chars, or this work added reference detail to it → move the reference sections to `docs/` per `agent_docs/context_budget.md → README.md`, in this commit.

An ADR this work wrote or changed: its file over 8,000 chars (`wc -c`) → move its detail sections per `agent_docs/adr_template.md → Head, details and index`, and its row in `docs/adr/README.md` is current — both in this commit.

### 5c. Skill check

`agent_docs/memory_process.md → Project skills` decides, for this work alone. Open it only when the work used a skill and had to deviate from it, renamed a command or path a skill names, or worked a multi-step procedure out; what happens then — unattended included — is stated there, and a skill is written only for a procedure that clears all four threshold points. Most work ends this step with nothing to do, and then the report does not mention it. A skill written, corrected or deleted is named in the report's first line; a deletion's evidence goes into the commit body.

### 6. Commit uncommitted changes (if any)

- Follow project's commit message convention (Conventional Commits if defined)
- Reference the work's issue if it has one (`CLAUDE.md → Git Conventions → Issues`), e.g. `feat: add X (#42)`
- **Main branch:** if uncommitted diff is large/unfocused → ask user before committing. Unattended (`$CLAUDE_CODE_REMOTE=true`) nobody answers: leave it uncommitted, report the `git diff --stat` as the open point, and finish the steps that do not depend on it (CLAUDE.md → _Autonomy_).

### 7. Push

- **Identity first** (`agent_docs/autonomy.md → Commit identity`): `git log --format='%an <%ae> | %cn <%ce>' HEAD --not --remotes=origin` lists the commits no remote branch holds yet. Every line carries `git config user.name` `<git config user.email>` on both sides; a `user.*` value this session wrote into a git config is removed first (`git config --show-origin --get-all user.email` names the file). A line that differs: rewrite with `git rebase -r -x 'git branch -r --contains HEAD | grep -q . || git commit --amend --no-edit --reset-author' $(git merge-base HEAD origin/<default branch>)`, which leaves every commit a remote holds untouched, and check again. A rebase that stops is aborted. Nothing is pushed until every line holds.
- **Feature branch:** `git push` (use `git push -u origin <branch>` on first push)
- **Main branch:** `git push origin <branch>` — only after all checks green
- **Never force-push** unless user explicitly requests

### 8. Suggest PR + CI (feature branch only)

After push on a feature branch the follow-ups are `/pr`, then `/ci` — named in the report's `Next:` line (step 10), never run from here and never printed beside the report. Both skills auto-route by state.

### 9. Close related GitHub issue (if applicable)

- **Any branch but the default** (`gh repo view --json defaultBranchRef`; `develop` included) — leave the issue open: a PR into the default branch closes it on merge through `Closes #n`, into another base `/pr merge` closes it (`agent_docs/autonomy.md → Issue-based work`).
- **Default branch, step 7 pushed** — the work landed without a PR: comment on the issue in **English** with a short summary of what was delivered, then close it. Left uncommitted (step 6) → the issue stays open and goes into `Next:`.

### 10. Report

Strict format, strict limits:

```
✅ <branch>: <what was done>

→ Next: <only if something is open; omit entirely if nothing pending>
```

## Rules

- **Format-write always runs before lint** — never commit unformatted files. CI's `format:check` is unforgiving.
- **Pre-commit guard is a backstop, not a substitute.** If `agent_docs/ci_formatting_guard.md` is set up, commits auto-format staged files even outside this skill — but still run format-write here so the diff you review matches what gets committed, and never bypass the hook with `--no-verify`.
- **Ambiguous state on main** (large uncommitted diff, unclear scope) → ask first; unattended → uncommitted plus a report line (step 6).
- **The report is the two lines above and nothing else.** No preamble, no postamble, nothing the commit message already says; the `Next:` line only when something is open — and when it names a step, the one handoff line from `CLAUDE.md → Handoff Prompt` closes the report.
- If nothing to commit AND nothing to push AND no issue for step 9 to close → single-line confirmation: `✅ <branch>: already clean, nothing to do.`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.