# Trellis Finish Work

Wrap up the current session: verify quality gate passed, remind user to commit, archive...

- Repository: https://github.com/mindfold-ai/Trellis (15078 stars)
- Category: Git and review
- License: AGPL-3.0
- Last updated: 2026-09-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mindfold-ai/Trellis --skill trellis-finish-work -g -a claude-code -y`
Codex: `npx skills add mindfold-ai/Trellis --skill trellis-finish-work -g -a codex -y`
Cursor: `npx skills add mindfold-ai/Trellis --skill trellis-finish-work -g -a cursor -y`
Gemini CLI: `npx skills add mindfold-ai/Trellis --skill trellis-finish-work -g -a gemini-cli -y`

## Description

Wrap up the current session: verify quality gate passed, remind user to commit, archive completed tasks, and record session progress to the developer journal. Use when done coding and ready to end the session.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Finish Work

Wrap up the current session: archive the active task (and any other completed-but-unarchived tasks the user wants to clean up) and record the session journal. Code commits are NOT done here, those happen in workflow Phase 3.4 before you invoke this command.

## Step 1: Survey current state

```bash
python3 ./.trellis/scripts/get_context.py --mode record
```

This prints:

- **My active tasks**, review whether any besides the current one are actually done (code merged, AC met) and should be archived this round.
- **Git status**, quick visual on what's dirty.
- **Recent commits**, you'll need their hashes in Step 4 for `--commit`.

If `--mode record` surfaces other completed tasks not tied to the current session, surface them to the user with a one-shot confirmation: "These N tasks look done, archive them too in this round? [y/N]". Default is no; the current active task is always archived in Step 3 regardless.

## Step 2: Sanity check, classify dirty paths

Run:

```bash
git status --porcelain
```

Filter out paths under `.trellis/workspace/` and `.trellis/tasks/`, those are managed by `add_session.py` and `task.py archive` auto-commits and will appear dirty as part of this skill's own work.

For each remaining dirty path, decide whether it belongs to **the current task** or to **other parallel work** (e.g., another terminal window editing the same repo). Heuristics:

- Paths referenced in the current task's `prd.md` / `implement.jsonl` / `check.jsonl` → current task
- Paths in code areas matching the task's stated scope, or that you remember editing this session → current task
- Paths in unrelated areas you have no recollection of touching this session → other parallel work

Then route:

- **Any remaining path looks like current-task work**, bail out with:
  > "Working tree has uncommitted code changes from this task: `<list>`. Return to workflow Phase 3.4 to commit them before running ``finish-work` (Trellis command)`."

The rest: https://github.com/mindfold-ai/Trellis/blob/HEAD/.agents/skills/trellis-finish-work/SKILL.md
