origin-close-session

Orchestrates permission audit, trouble logging, doc updates, and git cleanup to close out finished repository work.

Updated Dec 9, 2025
One-click install
npx skills add https://github.com/Aki2022/skills --skill origin-close-session-aki2022
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: origin-close-session
Source: https://github.com/Aki2022/skills/tree/main/origin-close-session
Command: npx skills add https://github.com/Aki2022/skills --skill origin-close-session-aki2022

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finishing a coding task often leaves loose ends: stale documentation, unrecorded session troubles, unmerged branches, and leftover worktrees. Running cleanup steps in the wrong order means doc edits miss the commit, and skipping docs governance leaves guides out of sync with the code that just shipped. ## Core Features & Use Cases - Ordered closeout orchestration: Runs origin-permission-audit (when elevated access was granted), then origin-trouble-log, then origin-doc-update, then origin-git-cleanup so docs land in the same commit as the code. - Gated merge handling: Respects human-gated merge policies by stopping at a committed, pushed, open PR instead of forcing a merge to main. - Safe destructive cleanup: Commits, pushes, and merges autonomously, but requires confirmation before deleting branches, worktrees, or refs the session did not create. - Use Case: After a PR is merged, invoke it to record session troubles, update the workstream docs and ADRs, commit everything together, sync main, and remove only approved stale branches. ## Quick Start Ask the assistant to wrap up this finished task and get the repository back to a clean, synced main with docs updated.

Frequently Asked Questions about origin-close-session

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up a git repository after merging a PR?

Invoke the closeout flow, which surveys the repository, commits remaining changes including doc edits, merges and syncs main, then deletes merged branches and worktrees. Deletion of anything the session did not create requires your confirmation first.

Why should documentation be updated before git cleanup commits?

Doc edits made after the cleanup commit land in a separate afterthought commit or get forgotten entirely. Running doc updates first lets the cleanup stage see them as uncommitted changes and include them in one reviewable commit.

Can I use this when the merge must stay human-gated?

Yes. State the human-gated merge policy and the flow stops once work is committed, pushed, and the PR exists, leaving the PR open and the branch intact. It will not merge to main or delete the branch the open PR needs.

What happens if the repository has no docs governance?

When docs/00_index.md is absent, the documentation step is skipped and stated as such. The trouble-log sweep and git cleanup still run, so the session is recorded and the tree ends clean on main.

When should I not use this closeout workflow?

Avoid it for mid-task rebases, cherry-picks, status-only checks, or doc edits with no cleanup intent. It is designed for finished work being wrapped up, not for in-progress branch surgery.