agentleFS
kiloloopkiloloop/oacp-skills/skills/wrap-up/codex/SKILL.md

wrap-up

Skill0 starsChanged 12 days agoApache-2.0View on GitHub

End-of-session cleanup for Codex — inspect stale artifacts, run debrief, write significant org-memory events, run a delta-first self-improve pass, then publish bounded approved memory and repository changes.

  • Reads credentials

61 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refine, sync and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AlexPEClubSkill

    refine

    Always use when the user wants to discuss an exsiting feature or specification. Open an existing feature spec to improve, extend, or fundamentally challenge it. Pass the feature ID as argument (e.g. /refine PROJ-2).

    Also in 3 projects that use this

  • MicrosoftSkill

    sync

    Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.

    Also in 3 projects that use this

  • austintgriffithSkill

    orchestration

    Use when a Scaffold-ETH 2 build leaves localhost: planning the launch order, deploying and verifying contracts on a live network, standing up a fork of a real chain to rehearse a deploy, or fixing a contract bug that is already onchain. Not for running the app or a demo against that fork (`/frontend-playbook`).

    Also in 3 projects that use this

  • SentrySkill

    spec

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.

    Also in 5 projects that use this

  • nicolasestremSkill

    brainstorm

    Structured idea generation and solution exploration with systematic analysis.

    Also in 5 projects that use this

  • OpenAISkill

    security-scan

    Use for a standard, single-pass security audit of an entire repository or a scoped path, package, folder, or submodule with no diff to review. This is the default repository scan. Do not use for PR, commit, branch, or working-tree diffs, or for deep, multi-pass scans.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 12 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 56 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the nearest AGENTS.md first.

    line 21
  2. Very specific:

    Check the session project's .no-org-memory marker and applicable AGENTS.md before org-memory work.

    line 24
  3. Very specific:

    If this session created an exact branch or worktree in a sibling repository, audit that repository under its own instructions and auth …

    line 84
  4. Very specific:

    Use oacp inbox --json for the current Codex project.

    line 90
  5. Distinctive:

    Read references/cleanup.md only when a candidate exists or a snapshot command fails.

    line 94
  6. Distinctive:

    Use the cleanup reference's ancestry and squash passes.

    line 102
  7. Distinctive:

    never remove the current, persistent, peer-owned, dirty, or untracked worktree.

    line 110
  8. Distinctive:

    before removal, inspect ignored content and retain irreplaceable signed, staged-for-publication, or otherwise non-reproducible artifacts.

    line 112
  9. Distinctive:

    remove only a clean session-owned worktree whose branch is already proved merged.

    line 114
  10. Distinctive:

    keep detached or runtime-managed worktrees this session did not create.

    line 119
  11. Distinctive:

    Use a successful debrief as source material.

    line 133
  12. Distinctive:

    Before a repository push, follow its nearest AGENTS.md, inspect token-free remotes, and synchronize with:

    line 180
  13. Distinctive:

    If rebase or autostash restoration conflicts, abort/stop, preserve the work, and report that repository as unpublished.

    line 187
  14. Distinctive:

    Keep OACP memory, the current repository, and every sibling repository as separate Git scopes.

    line 211
  15. Distinctive:

    Default publication is bounded to OACP memory, the current repository, and another repository only when this wrap-up created or explicitly …

    line 215

“Common” is measured: kept by at least 6 in 10 of the 56 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Wrap-up

Close a Codex session in one ordered workflow while keeping cleanup, memory publication, repository publication, and external actions independently safe.

Invocation

  • $wrap-up runs the full sequence and authorizes the bounded local cleanup and publication described below.
  • $wrap-up --dry-run performs only read-only cleanup inspection, $debrief --dry-run, event planning, and a read-only self-improve audit. It makes no file edits, cleanup mutations, event writes, commits, or pushes.
  • An explicit no-push or local-only request runs the local sequence but performs no memory or repository commits or pushes.

Read the nearest AGENTS.md first. It owns repository identity, persistent branch/worktree policy, validation, authentication, and publication rules.

Check the session project's .no-org-memory marker and applicable AGENTS.md before org-memory work. An opt-out skips debrief, events, and memory publication, including dry-run variants, with skipped: project_opt_out. An ambient store or an additional cleanup repository cannot override it.

Set WRAP_UP_SKILL to the absolute directory containing this SKILL.md before invoking bundled resources. Resolve the active memory home from project binding or current runtime metadata; do not select a home from a repository basename.

1. Capture a read-only snapshot

Confirm the operational root and capture status before changing anything:

REPO_ROOT="$(git rev-parse --show-toplevel)"
CURRENT_BRANCH="$(git -C "$REPO_ROOT" branch --show-current)"
git -C "$REPO_ROOT" status --short
git -C "$REPO_ROOT" worktree list --porcelain
git -C "$REPO_ROOT" worktree prune --dry-run --verbose

Resolve the base and persistent branches/worktrees from AGENTS.md.

First set MEMORY_HOME exactly as debrief does: use the main repository's resolved .agent-memory.json home when bound, otherwise ${OACP_HOME:-$HOME/oacp}. Inspect the binding with env -u AGENT_MEMORY_HOME -u OACP_HOME agent-memory status, or read the exact binding and resolve a relative home against its directory. Stop on an invalid binding. Pass this same value to the audit and subsequent debrief/publication; an ambient AGENT_MEMORY_HOME must not redirect either step. Then run the bundled advisory snapshot (read-only; Python standard library):

python3 "$WRAP_UP_SKILL/scripts/wrap_up_audit.py" --repo "$REPO_ROOT" --json \
  --memory-home "${MEMORY_HOME:?resolve it as debrief does}" \
  [--keep-branch <persistent-branch>]... [--keep-worktree <persistent-path>]... \
  [--keep-branch-prefix <peer-runtime/>]... \
  [--owned-branch <created-branch>]... [--owned-worktree <created-path>]...

Supply authorized GH_TOKEN/GITHUB_TOKEN only when PR reads are needed, or --allow-ambient-gh only after repository policy permits the verified human identity. Otherwise accept skipped PR state. Helper recommendations never authorize removal: independently apply every guard in step 2 and the cleanup reference, including session ownership and exact merged head. Pass ownership flags only from this session's recorded creation evidence; absent ownership, failed status, unknown repository identity, or diverged tips are keep outcomes. The snapshot includes local_tip, pr_head_oid, and the actual worktree path. Ancestry candidates use safe deletion; same-repository squash evidence permits a force-delete suggestion only after full head equality.

For standalone callers, the helper's CLI-compatible fallback order is --memory-home, AGENT_MEMORY_HOME, OACP_HOME, nearest valid .agent-memory.json binding, canonical workspace marker, then ~/agent-memory. A malformed nearest binding is an error, never a fallback. The wrap-up workflow always passes the debrief-resolved home explicitly instead. The inbox home remains separate (OACP_HOME, otherwise ~/oacp); a memory binding does not imply an OACP inbox. No workspace directory convention selects a memory store.

If this session created an exact branch or worktree in a sibling repository, audit that repository under its own instructions and auth policy. Cleanup scope covers only those recorded artifacts; a runtime prefix or .worktrees/ location is not ownership. General sibling cleanup and publication require separate scope. Keep each repository's candidates and decisions separate.

Use oacp inbox --json for the current Codex project. Distinguish ordinary pending messages from held-unverified enforce-mode rows. Never parse held fields, and never treat either class as processed cleanup.

Read references/cleanup.md only when a candidate exists or a snapshot command fails.

2. Clean stale artifacts

Skip all mutations in dry-run mode. In a full run, the invocation authorizes only the local candidates that satisfy every guard below.

Use the cleanup reference's ancestry and squash passes. Safe-delete ancestry branches with git branch -d; a full wrap-up authorizes force deletion only of an exact session-created squash-merged branch after confirming MERGED and local tip equality with the merged PR's headRefOid. Pre-existing branches need separate force-cleanup authority. A vanished remote is not merge evidence.

For worktrees:

  • never remove the current, persistent, peer-owned, dirty, or untracked worktree;
  • before removal, inspect ignored content and retain irreplaceable signed, staged-for-publication, or otherwise non-reproducible artifacts;
  • remove only a clean session-owned worktree whose branch is already proved merged;
  • begin administrative pruning with git worktree prune --dry-run --verbose; in full mode, rerun immediately and mutate only when the exact candidate set is unchanged and every entry was resolved as stale;
  • keep detached or runtime-managed worktrees this session did not create.

Remote branch deletion is a separate outward-facing approval. Inbox lifecycle is not wrap-up cleanup: report queued paths and leave them for $check-inbox to verify, process, reply, and archive terminally.

3. Run debrief

Unless the project opted out, invoke $debrief using project auto-detection. This attempt is required, but failure is non-fatal: report it and continue. Do not fabricate a debrief when the skill fails. In dry-run mode invoke $debrief --dry-run.

4. Write significant org-memory events

Use a successful debrief as source material. Skip when debrief failed, org-memory is not initialized, or the session produced no cross-project outcome.

Deduplicate against tracked and untracked events. Write at most 3–5 entries and write zero for routine fixes, tests, documentation cleanup, inbox processing, self-improve findings, or read-only work. Read references/publication.md only when an event is plausibly eligible. In dry-run mode, report proposed events without writing them.

5. Run delta-first self-improve

Invoke $self-improve in session-delta mode. Start with:

  • skills actually used this session;
  • guidance, curated memory, or config changed this session;
  • observed failures, workarounds, conflicts, stale claims, or discovery gaps.

Expand only when evidence indicates drift. Route release-wide migrations, multi-skill capability changes, and context-budget audits to $audit-oacp-skills.

Dry-run keeps this audit read-only. Match findings against the user's existing approved files and outcomes first; apply already approved changes without asking again. Pause only for new scope and relay the complete approval menu: recommendation, numbered items, target files and repositories, exact outcomes, and allowed replies. After the user resolves it, continue without a second publication question unless publication was narrowed or disabled.

A pause must report all state gathered so far and every deferred cleanup, event, memory, commit, and push action. Use Wrap-up paused — self-improve approval required, never the completion report.

6. Publish memory and repository changes

A full wrap-up commits/pushes only bounded approved repository changes. It publishes OACP memory once unless the session project opted out. Skip publication for dry-run, no-push, local-only, narrower scope, or unavailable required authentication.

agent-memory push --home <resolved-memory-home> --agent codex is the sole memory publication path. Never substitute manual memory-repository staging, commits, repair, or force push. Handle each source repository independently and stage explicit paths only. Exclude unrelated or pre-existing changes, credentials, private keys, .env, local settings, generated caches, and live runtime state.

Before a repository push, follow its nearest AGENTS.md, inspect token-free remotes, and synchronize with:

git pull --rebase --autostash origin "$CURRENT_BRANCH"

If rebase or autostash restoration conflicts, abort/stop, preserve the work, and report that repository as unpublished. Read references/publication.md only when publication is actionable.

7. Summarize

Wrap-up complete:
- Cleanup: N branches, M worktrees, inbox <clean / pending / held>
- Debrief: <saved path or failure>
- Org-memory events: N written / planned / skipped
- Self-improve: N findings (M applied)
- Memory: <pushed SHA / no changes / skipped / failed>
- Commits: <repo>@<sha> on <branch>; ... (or "no changes")
- Pushes: <repo>: <branch> -> origin; ... (or "skipped")
- Deferred: <remaining dirty, held, or approval-gated work>

A successful debrief or edit does not imply that its repository was committed or pushed.

Durable rules

  • Keep OACP memory, the current repository, and every sibling repository as separate Git scopes.
  • Exact sibling branches/worktrees created by this session are cleanup-only scope unless their publication was separately approved.
  • Default publication is bounded to OACP memory, the current repository, and another repository only when this wrap-up created or explicitly approved changes there. Other repositories require opt-in.
  • PR creation, merge, release/promotion, deployment, remote-branch deletion, and unrelated existing changes always require separate authority.
  • Preserve unrelated user and concurrent-runtime work.
  • Codex does not compile, extend, or clear the Claude-only OACP enforcement envelope.
  • Consolidate repeatable lessons into their owning guidance; do not append a second procedure or learned log.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.