aops-core/skills/end_session/SKILL.md
Canonical session close — commit, push, PR, release_task, reflection blocks, handover. Use /dump for emergency bail (no commit/PR/reflection).
npx skillsauth add nicsuzor/academicops end_sessionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Close a session cleanly by committing/pushing changes, filing PRs, resolving tasks, and providing reflections. For mid-flight bails without task completion, use /dump instead.
release_task.Determine if session was Read-only (no mutating tools used, no tasks modified/created) or Full-form (modifying).
Print Output: none — read-only Q&A and exit.
Identify the active task, in priority order: (1) the $AOPS_TASK_ID env var — authoritative, auto-populated — falling back if unset to the git branch name's segment after the last / (e.g. polecat/aops-1f9ec7b0 → aops-1f9ec7b0; do not read or synthesise a filesystem-state file); (2) an explicit task ID argument; (3) otherwise release_task auto-creates an ad-hoc task.
Run TaskList() and reconcile mirrored tasks. For each native task marked completed carrying PKB <id> (excluding the bound parent task), if the PKB task is not terminal, call mcp__pkb__complete_task.
If files changed, commit, push, and open a PR against this repo's default working branch — dev for academicOps (main is publish-only), otherwise the repo's own default (do not copy the dev convention onto a repo that has no dev branch). Write a PR body that describes the change for its reviewer; skip merge-gate / do-not-merge / "awaiting Nic" banners — branch protection is the real gate, so a banner warns nobody who can act on it. Canonical rule: [[framework-conventions-summary#pr-body-conventions]].
Resolve the parent epic and project node from the bound task, then use mcp__plugin_aops-core_pkb__append to add a line to the project file's Active Epics section: - [[<epic-id>]] — <epic title> (task [[<bound-task-id>]], PR <url-or-'none'>).
Verify all child tasks are in terminal states (done, cancelled, superseded, archived) before closing the parent, then call release_task with id, status, session_id="$AOPS_SESSION_ID", whichever of pr_url, branch, issue_url, follow_up_tasks apply, and a release_summary (result-oriented, self-contained, naming specific resources/issues like org/repo#NNN, <= 500 chars).
status: merge_ready vs status: review deliberately (they are not interchangeable — see the canonical protocol in [[taxonomy#status-values-and-transitions]]). Use status: merge_ready when you opened a PR and the task is now parked on that PR's review/merge — set pr_url. Use status: review only when the task is parked on a human decision (it needs Nic's or an agent's judgment/direction before it can proceed) — not merely because a PR is open. A reconcile sweep may auto-close a merged status: merge_ready task, but it will never auto-close a status: review task; mis-tagging a PR-parked task as status: review leaves it stuck, and mis-tagging a decision-parked task as status: merge_ready invites a wrong auto-close.Include these three markdown headers in your response before the handover block:
## Output
- [Artefact Link] (Description)
## Tasks worked
- <task-id> (< precis >) — <created | updated | completed | cancelled | referenced>
## Framework Reflection
**Outcome**: success | partial | failure
**Accomplishments**: <what you completed — comma list, or `-` bullets, or `none`>
**Friction points**: <issue/task URLs filed via /learn; no description prose — or `none`>
**Proposed changes**: <one concrete instruction or tool improvement — or `none`>
**Field**:). These four labels are the parse contract: the deterministic parser in transcript_parser.py buckets the reflection by matching them verbatim. Plain-bullet labels (- Friction points:), renamed labels (Proposed improvement:), or free-form prose match nothing — the whole body then falls through to the unstructured fallback and gets dumped into accomplishments, leaving friction_points empty. **Outcome**, **Accomplishments**, **Friction points**, and **Proposed changes** are the only labels the pipeline reads. The exact grammar is the SSoT in transcript-metadata-schema.md.task-acba1234 ( precis )).transcript-metadata-schema.md for the field/warning contract. ## Output must carry a real artefact link (PR/commit URL); if there genuinely is none, write Output: none — <reason>. No link and no explicit "none" → end-session does not pass.Emit exactly this markdown block:
### Session Handover
- **Session ID**: `$AOPS_SESSION_ID`
- **Primary Task**: `<task-id>` (<short title>)
- **PR**: <url>
- **Branch**: `<branch>`
- **Issue**: <url or "none">
- **Follow-ups**: `<task-id> (<short title>)` (or "none")
- **What you asked**: <original user instruction, including deliverables and constraints.>
- **Summary**: <release_summary value>
Omit lines for PR, Issue, and Follow-ups if they do not exist.
If leaving multiple distinct follow-up threads, append:
### Thread Pickup: what next?
- **Thread A** — `/pull <task-id>` (<short title>): <one-line action / why it's next>
- **Thread B** — `/pull <task-id>` (<short title>): <one-line action / dependency>
Terminate execution immediately after the handover or thread pickup blocks. Do not add trailing text.
data-ai
Canonical session close — commit, push, PR, release_task, reflection blocks, handover. Use /dump for emergency bail (no commit/PR/reflection).
data-ai
Emergency session bail — fast resume task + short handover, no commit/PR/reflection. For when you (or the user) need a clean context now. Use /end-session for canonical close.
data-ai
Daily note lifecycle — compose and maintain a factual daily note. Reports the state of the day; does not prioritise or recommend. SSoT for daily note structure.
testing
Launder supervisor/worker task-log output into a Nic-facing narrative — what happened, where things are headed, and what (if anything) is genuinely his to decide. Never relays raw process detail (worker IDs, thread pointers, log paths) or verbatim task-log stream-of-consciousness.