[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DSW99EPXDVAG8GHR785CC5":3,"skill-same:01M6DSW99EPXDVAG8GHR785CC5":109},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M6DSW99EPXDVAG8GHR785CC5","wrap-up",null,"End-of-session cleanup, debrief, org-memory events, self-improve, commit, and push in one command.","kiloloop\u002Foacp-skills","kiloloop","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F264514437?v=4","01M6DSS1K2JKZD3YRMXRH54968","Kiloloop","01M6DSS1SMM810F7327W2YX7ZZ",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"wrap up","up","wrap","memory","commit","cleanup","push","improve","command","session","session cleanup","self","end","debrief","2026-11-10 10:12:30",false,"---\nname: wrap-up\ndescription: End-of-session cleanup, debrief, org-memory events, self-improve, commit, and push in one command.\n---\n\n# \u002Fwrap-up — Session Wrap-Up\n\nComposes end-of-session steps into a single command: cleanup stale artifacts, optional debrief, org-memory events, self-improve (with approval pause), commit, and push.\n\n## Arguments\n\n- `\u002Fwrap-up` — full wrap-up sequence\n- `\u002Fwrap-up --dry-run` — run cleanup + debrief + self-improve but skip commit and push\n\n## Instructions\n\nWhen the user runs `\u002Fwrap-up`, execute these steps in strict order:\n\n### 1. Cleanup stale artifacts\n\nScope: merged branches and stale worktrees, plus an inbox report (1d) — in the primary repository, plus any repository where this session created a specific local worktree or branch. In such a sibling, clean only those named artifacts: no general branch cleanup, commits, pushes, or remote-branch deletion there. Ownership evidence is this session's own creation commands or recorded paths; a runtime prefix or a `.worktrees\u002F` location alone is not.\n\n> **Working-directory guard (run FIRST)**: verify `git rev-parse --show-toplevel` matches the session's primary repo before any cleanup command — a `cd` from earlier in the session persists in the shell, and cleanup silently runs against the wrong repo. If it doesn't match, `cd` back to the project root. Where the harness forbids `cd` to the root (a worktree-anchored session), run each cleanup command as `git -C \u003Croot> …`. A worktree-isolated session refuses `git -C \u003Croot>` too: run branch and worktree cleanup from the session's own worktree — it shares the repository's branches and worktree records — pass that path to `cleanup_branches.sh`, and leave any pull of the main clone to the user.\n>\n> **Memory home**: steps 1d, 2, 2b and 4b assume `$OACP_HOME`. A repo bound to its own agent-memory home (`agent-memory status` reports a binding as the source) uses that home instead: 1d has no inbox to check (say so), step 2 publishes with `--oacp-dir \u003Chome>`, 2b and 4b pass `--home \u003Chome>`, and 4b pushes only when `\u003Chome>\u002F.oacp-memory-repo` exists — otherwise report the home as unsynced. A home outside the sandbox's write allowlist needs the step 2 and 2b writes run unsandboxed; sandboxed, they fail `Operation not permitted` and write nothing.\n\n#### 1a. Just-merged PR worktrees\n\n- If the session merged a PR from a dedicated worktree, finish its cleanup in this wrap-up — reporting the path is not the finish line. You cannot remove the worktree you are standing in, so move first: `cd \u003Cmain-root>` → artifact check (below) → `git worktree remove \u003Cpath>` → branch deletion (below) → `git pull --ff-only origin \u003Cbase>`, so the main clone stops sitting behind its own merge. The fast-forward doesn't touch peer worktrees, which sit on their own branches. Skip the pull when the project's guidance makes pulling the main clone a deploy (live jobs run from it); report the clone as behind instead.\n- **When the harness forbids `cd` to the root**, `git -C \u003Cmain-root> worktree remove \u003Cpath>` works from inside the worktree (add `--force` only after the artifact check — it also deletes untracked files). Sandboxed, the removal can fail `Operation not permitted` on the worktree and its `.git\u002Fworktrees\u002F\u003Cname>` record; run it unsandboxed — from the main root too: a sandboxed `git worktree remove` can delete the worktree directory and then fail on the record, leaving a half-removed worktree that only an unsandboxed `git worktree prune` repairs. The shell's cwd is then a deleted directory, so make the removal the last step and use absolute paths for anything after it.\n- **Harness-managed worktrees**: a worktree-isolated session is refused that `git -C` as well — leave it with `ExitWorktree` as the last step. `remove` deletes a worktree that `EnterWorktree` created; one entered by path is refused, so use `keep` (which returns to the starting directory), then run `git -C \u003Cmain-root> worktree remove \u003Cpath>`. A worktree the desktop app created for the session is the app's: archiving the session hands it back.\n- **Gitignored artifacts don't block removal — check for irreplaceable ones first**: `git worktree remove` succeeds when the only remaining content is gitignored (build output like `release\u002F`, `dist\u002F`), silently deleting it. Before removing a build worktree, check those directories for non-reproducible or pending-publish artifacts (e.g., signed installers staged for a later upload); if any exist, surface them and let the user decide. Rebuildable-by-design outputs are fine to delete — say so in the report.\n- After removing, try `git branch -d \u003Cbranch>`. If it refuses because the repo is squash-only, verify the PR is `MERGED` and the local tip exactly equals its merged head (`gh pr view \u003Cn> --json state,headRefOid`); a full non-dry-run `\u002Fwrap-up` then authorizes `git branch -D` for that exact session-created branch. Pre-existing branches still need separate approval.\n\n#### 1b. Merged branches\n\nSquash merges leave branch tips that are never ancestors of `main`, so `git branch --merged` and `-d` are both blind to them — without a PR-state check, merged branches accumulate indefinitely while cleanup reports \"nothing to clean\". Run the two-pass cleanup (ancestry pass + PR-state pass), packaged as [`scripts\u002Fcleanup_branches.sh`](scripts\u002Fcleanup_branches.sh):\n\n```bash\nbash \u003Cskill-dir>\u002Fscripts\u002Fcleanup_branches.sh \u003Crepo-root> [--keep \u003Cbranch>]... [--keep-prefix \u003Cprefix>]...\n```\n\nPass `--keep` for each persistent branch the project names, and `--keep-prefix \u003Cruntime>\u002F` for each peer runtime working in the repo (e.g. `codex\u002F`) — a peer's merged branch is still its own to clean up. `--dry-run` previews; `--base` overrides the base (default `origin\u002FHEAD`, else `main`). Ensure `gh` is authenticated for the repo first. Under a network-filtering sandbox, run the script unsandboxed: a `gh` nested in a script can fail TLS through the proxy even when the same `gh` typed directly works. Don't trust a probe either — `gh pr list --repo \u003Cowner>\u002F\u003Cname>` can succeed on a repo the script still can't resolve (it resolves from the local remote) — so the `SKIP pass 2` line, which quotes gh's error, is the only signal: fix auth or the sandbox and re-run. The script's contract:\n\n- **Pass 1 (ancestry)**: `git branch --merged \u003Cbase>` → `git branch -D` (the listing already proves the tip is in the base; `-d` would also demand HEAD or upstream containment, which fails from a worktree on another branch).\n- **Pass 2 (PR head)**: for each remaining local branch not checked out in any worktree, look up its merged PR and delete ONLY when the local tip exactly equals that PR's merged `headRefOid` — a `MERGED` state alone is not enough, since the branch may carry unpublished commits made after the merge, and deleting it would orphan them. The exact-head verification is the safety, not the `-D` flag. The base, `--keep`\u002F`--keep-prefix` branches, worktree-checked-out branches (including other agents'), branches with no merged PR, and branches whose tip diverged from the merged head are never deleted. Pass 2 prints `KEEP \u003Cbranch> — \u003Creason>` for the no-merged-PR and diverged-tip cases; reserved and checked-out branches print `KEEP` only when pass 1 lists them as merged and are otherwise skipped silently. Review the `KEEP` lines by hand — never `-D` those branches either.\n- Run this broad pass only in the primary repo or a repo the user fully opted into. In a sibling included only for this session's artifacts, delete just the recorded branches.\n- **Remote counterparts**: deleting merged remote refs on a shared repo is outward-facing — list candidates and let the user authorize `git push --delete`. Assess from `git ls-remote --heads origin` after `git remote prune origin` (`git branch -a`'s remote-tracking refs go stale and inflate the list). Repos that auto-delete head branches have already removed a merged PR's ref; `push --delete` there fails `remote ref does not exist` and breaks any `&&` chain, so let the prune be the cleanup.\n- Report: \"Deleted N merged branches (K ancestry + M squash); kept P unmerged\" or \"No merged branches to clean\"\n\n#### 1c. Stale worktrees\n\n- Run `git worktree prune`, then list remaining: `git worktree list`\n- **Leftover directories that are not worktrees**: a `.worktrees\u002F\u003Cname>\u002F` directory absent from `git worktree list` is residue (often just a `.claude\u002F` inside, left when a worktree was removed without `--force`, or recreated by the harness when the removed worktree was the session's own cwd). A runtime's parent directory whose children are listed worktrees (`.worktrees\u002F\u003Cruntime>\u002F`) is not residue — compare leaf paths. Never count it as a stale worktree; report each with its contents and hand the user the removal command (`! rm -rf \u003Crepo>\u002F.worktrees\u002F\u003Cname>`) rather than deleting it yourself.\n- **Peer-agent ownership guard**: a worktree whose path or branch names another agent or runtime belongs to that agent — report it, never remove it, even when its PR is merged. Peer worktrees don't always self-identify by name: another agent's PR-review checkout may appear as a detached-HEAD worktree under a temp path with no branch name. Treat any worktree this session didn't create, in a tmp path or detached at a reviewed PR's head, as peer-owned.\n- For entries this session owns, remove a worktree only when its branch is merged — in squash-only repos, merged-PR evidence counts even when ancestry doesn't show it. If the only signal is a vanished remote branch, ask first (it may be intentionally local-only). Not merged → leave in place, warn.\n- After removal, `git branch -d \u003Cbranch>` when Git reports it merged. Never force-delete an unverified branch: `-D` only under 1a's or 1b's verification (ancestry-merged into the base, or a local tip exactly equal to its merged PR's head).\n- Report: \"Pruned N worktrees\" or \"No stale worktrees\"\n\n#### 1d. Inbox report\n\n- Resolve the project from the `.oacp` marker at the **main** repo root — a linked worktree has no marker of its own, so a cwd read inside one silently skips this step. Pass the session's root with `git -C` so a drifted cwd can't resolve a different project:\n\n  ```bash\n  ROOT=$(dirname \"$(git -C \u003Croot> rev-parse --path-format=absolute --git-common-dir)\")\n  [ -f \"$ROOT\u002F.oacp\" ] && python3 -c \"import json,sys; print(json.load(open(sys.argv[1]))['project_name'])\" \"$ROOT\u002F.oacp\"\n  ```\n\n- No marker → use `basename \"$ROOT\"` only if `$OACP_HOME\u002Fprojects\u002F\u003Cbasename>\u002F` exists; otherwise skip the inbox report. A resolved name that isn't the session's project is a cwd bug, not an unregistered project.\n- Inbox dir: `$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fagents\u002F\u003Cagent>\u002Finbox\u002F`\n- List YAML files with `command ls -1 \u003Cdir> | command grep '\\.yaml$'` (not a `*.yaml` glob — zsh `nomatch` errors when empty; `command` bypasses aliases; `-1` keeps the output grep-able)\n- Files present → report them; never delete or archive them (OACP archives messages, and archival belongs to `\u002Fcheck-inbox`). Held-unverified or INVALID messages under an OACP enforce posture are surfaced explicitly, never treated as ordinary backlog. **A fresh message that verifies is unprocessed work, not a report item**: process it with `\u002Fcheck-inbox` now, before step 2, so the debrief covers it.\n- Empty → report \"Inbox clean\". **A missing directory is not clean**: the agent has no workspace in that project on this machine — report \"no \u003Cagent> inbox for \u003Cproject> on this machine\".\n\n### 2. Run debrief (optional)\n\n- If a `\u002Fdebrief` skill is installed, invoke it — it auto-detects the project and publishes one immutable record per session to the org-memory debrief store (`$OACP_HOME\u002Forg-memory\u002Fdebriefs\u002F\u003Cproject>\u002F\u003CYYYY>\u002F\u003CMM>\u002F`). Otherwise, skip with a one-line note.\n- Let `\u002Fdebrief` own the record's dates: the store keys its directory and filename on the session's UTC start, not on a project's local-timezone convention.\n- **Second wrap-up in one session**: if this session already has a record, neither skip the step nor re-run with the same identity (that collides by construction) — publish a continuation segment per `\u002Fdebrief`'s collision handling. The test is coverage: when the latest segment's `ended_utc` is only minutes old and nothing material has happened since (bookkeeping, a memory push, this wrap-up), report that segment's path instead of publishing an empty one. Read its `ended_utc` before deciding; recall is not the check.\n- If debrief fails, warn and continue — debrief is non-fatal. A missing store is not a failure; the writer provisions its own tree.\n\n### 2b. Write org-memory events\n\nWrite events for the session's significant outcomes to the org-level memory log, which other agents read for cross-project context.\n\n**Skip this step** if `$OACP_HOME\u002Forg-memory\u002Fevents\u002F` does not exist (org-memory not initialized — run `agent-memory org init` to set up).\n\n**What to write**: only outcomes that matter to other agents and projects — not routine task completion.\n\n| Write an event for | Type | Example |\n|--------------------|------|---------|\n| PR merged | `event` | \"PR #44 merged: org-level memory spec + CLI\" |\n| Architecture\u002Fdesign decision | `decision` | \"Standardized on REST for public APIs\" |\n| New standing rule or convention | `rule` | \"All repos in this org require signed commits\" |\n| Release or deployment | `event` | \"v0.2.0 published\" |\n\n**Do NOT write events for**: routine code fixes, test additions, doc typos, inbox messages processed, self-improve findings.\n\n> **Existing-rule check**: before writing a `rule` or `decision`, grep the topic in `org-memory\u002Frules.md` and `decisions.md` (headings via `command grep -n '^### '`, then keywords), in today's and yesterday's `org-memory\u002Fevents\u002F` (UTC-dated filenames — a peer's same-day event isn't folded into `decisions.md` until synthesis), and in the installed skills. Hit in org-memory → write nothing, or write only the genuine delta as a refinement pointing at the rule. Hit in a skill → the session broke a standing rule; an honest event names that rule and the delta it lacks (often a recovery path), not a rediscovery.\n\n**How**: use `agent-memory event write`, with the step 2 debrief as source material:\n\n```bash\nagent-memory event write --home \"$OACP_HOME\" --agent claude --project \"\u003Cproject>\" \\\n  --type \u003Cdecision|event|rule> --slug \u003Cshort-slug> \\\n  --body \"\u003Cone-line description>\" \\\n  [--source-ref \u003Cdebrief-filename-stem>] [--related \"PR #N,...\"]\n```\n\n`--source-ref` names the debrief the event was folded from. Under `\u002Fwrap-up --dry-run`, add `--dry-run`: it validates and prints the record without writing.\n\n> **Slug constraint**: lowercase alphanumeric + hyphens only, 1-64 chars, must start and end with alphanumeric. **No dots** — convert version segments to hyphens (e.g., `release-0-2-3` not `release-0.2.3`). Requires `agent-memory` on PATH; if it is unavailable, report the missing `agent-memory-cli` prerequisite and skip event writing. Success prints `published:` or `idempotent:`.\n>\n> **Under an active envelope the event body is command text to the hook**: a destructive token quoted inside `--body` (a recursive-force remove, a forced push flag, a verify-skipping flag) denies the write when the envelope declares `destructive_ops: false`, data or not. Spell the action in words — \"a forced push\", \"the recursive remove\" — never quote the flag.\n\n**Keep it lightweight**: write events only for the outcomes in the table above — most sessions warrant none or a few. If the session was trivial (only reading files, answering questions), write zero events and report \"No org-memory events (routine session).\"\n\nReport: \"Wrote N org-memory events\" or \"Skipped (org-memory not initialized)\" or \"No org-memory events (routine session)\".\n\n### 3. Run \u002Fself-improve\n\n- Invoke the `\u002Fself-improve` skill\n- The skill will present findings and ask \"Which changes should I apply?\"\n- **Pause here** — wait for user approval before continuing\n- **The user has said they are away** (\"stepping out\", \"just run wrap-up\"): the pause cannot resolve, so don't hold the wrap-up on it — present the findings, apply none, record them where the user will find them on return (the project's status memory, `$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fmemory\u002Fopen_threads.md`), and continue.\n- Apply approved changes\n- If no findings, report \"No issues found\" and continue\n\n### 3b. Self-improve the self-improve skill\n\nAfter step 3 completes, run `\u002Fself-improve self-improve` — a targeted review of the self-improve skill itself. This catches issues with the review process that only surface during execution (e.g., missed edge cases, incorrect analysis patterns, user corrections during step 3).\n\n- **Skip if step 3 had no findings and no user corrections** — nothing to learn from a clean run\n- If findings exist, apply with approval and commit alongside step 4\n\n### 4. Commit changes\n\n- Run `git status` to check for uncommitted changes\n- If no changes, skip to step 4b\n- Stage changed files explicitly (no `git add -A` or `git add .`)\n- Exclude from staging: `.env`, credentials, secrets, `settings.json`\n- Commit message: `wrap-up: \u003Cbrief summary of changes>` for wrap-up's own housekeeping edits\n- **Other repos step 3 edited**: self-improve can edit skills or instruction files that live in a separate repo. Commit and push those there only when this session made the edits, staging explicit paths and leaving other runtimes' files alone. Check `git -C \u003Crepo> rev-list --count origin\u002F\u003Cbranch>..HEAD` too — self-improve may commit without pushing, so a clean `status` is not \"nothing to do\".\n- **Paused mid-dispatch on a feature branch**: commit the task's own work with its conventional message (referencing its issue), push the branch so the work survives the pause, and leave the dispatch message in the inbox — it stays unprocessed until its completion reply. The PR, review request, and merge wait for the resumed session.\n- **Paused with a review round in flight**: the work is already pushed at the declared head, so there is nothing to commit, and step 5 must NOT push that branch — any push voids the reviewer's round. Write the owed close-out (what to do on feedback vs. LGTM, the message ids, the task's start time — naming only commands whose contract you checked against the script's usage header, since a hand-off can name a script that cannot do the step) to the project's status memory (`$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fmemory\u002Fopen_threads.md`, read at the next session's start) and report the round as in flight.\n- If `--dry-run`: show what would be committed but do not commit\n\n### 4b. OACP memory sync (optional)\n\nPush the cross-machine memory snapshot if memory sync is active. Captures new `org-memory\u002Fevents\u002F` entries from step 2b, debriefs from step 2, and any session memory edits.\n\n```bash\ntest -f \"$OACP_HOME\u002F.oacp-memory-repo\" || { echo \"memory sync: not active (skip)\"; exit 0; }\nagent-memory push --home \"$OACP_HOME\" --agent claude\n```\n\n- **Skip silently** if the `.oacp-memory-repo` marker is absent — memory sync is not initialized on this machine (`agent-memory enable` to opt in, or `agent-memory clone` on a second machine). Requires `agent-memory` on PATH; if it is missing, warn and skip.\n- `agent-memory push` is idempotent: it stages allowlisted files (`org-memory\u002F**`, `projects\u002F*\u002Fmemory\u002F**`), commits, and pushes when a remote exists. No-op if no changes.\n- **Pass `--agent`**: without it the commit author falls back to `$AGENT_MEMORY_AGENT`, then `$AGENT_NAME`, then `$USER`, publishing agent-authored commits under the human's name. Name the agent actually running the session.\n- **Another session's fresh uncommitted files → skip the push and say so.** Run `git -C \"$OACP_HOME\" status --short` first: a dirty or untracked path you did not write, modified within the last ~30 minutes, belongs to a peer session still mid-wrap-up. The push stages every allowlisted file, so pushing now would publish their in-flight edits under your commit. Report \"memory: push skipped — N in-flight files from another session\" and let the next push carry yours. Hours-old leftovers with no live session are the opposite case: carry them.\n- If commit signing or the git credential helper needs access the sandbox blocks, run the push unsandboxed.\n- Independent of step 5 — failure here does not block the current-repo push. Report the memory-push outcome separately.\n- If `--dry-run`: the push has no dry-run flag — show `git -C \"$OACP_HOME\" status --short` and skip.\n- Report: commit SHA + file count, or \"memory: clean (no changes)\", or \"memory: skipped (sync not active)\", or the skip line above.\n\n### 5. Push to remote\n\n- **Pull-rebase before push** to avoid conflicts with parallel runtimes that may have pushed:\n\n  ```bash\n  git pull --rebase --autostash origin \u003Cbranch>\n  ```\n\n  (`--autostash` carries uncommitted files over the rebase.) If the rebase conflicts, abort with `git rebase --abort`, warn the user, and skip push; if the autostash pop conflicts, git keeps the stash — warn and resolve before pushing.\n- Push current branch to origin: `git push origin \u003Cbranch>` — never a branch with a review round in flight (step 4)\n- If `--dry-run`: skip push\n- Report: branch, commit SHA, remote URL\n\n### 6. Summary\n\nPrint a final status block:\n\n```\nWrap-up complete:\n- Cleanup: N branches, M worktrees pruned, inbox \u003Cstatus>\n- Debrief: \u003Cstatus> $OACP_HOME\u002Forg-memory\u002Fdebriefs\u002F\u003Cproject>\u002F\u003CYYYY>\u002F\u003CMM>\u002F\u003Cfile>.md\n- Org-memory: N events written (or \"skipped\" or \"routine session\")\n- Self-improve: N findings (M applied)\n- Commit: \u003Csha> on \u003Cbranch> (or \"no changes\" or \"review round in flight\")\n- Other repos: \u003Crepo>@\u003Csha> (or \"none\")\n- OACP memory: \u003Csha> (or \"clean\" or \"skipped (sync not active)\" or \"skipped (dry-run)\")\n- Push: \u003Cbranch> -> origin (or \"skipped (dry-run)\")\n```\n\n## Notes\n\n- **Mid-wrap-up dispatches (OACP v0.4.1+ envelopes)**: if a new task auto-accepts during wrap-up, its compiled scope envelope can deny wrap-up's own later side effects (steps 4-5 commits\u002Fpushes are outside a reply-only task's envelope). Run the dispatched task's lifecycle to terminal — reply, audit update, `oacp envelope clear` — then resume wrap-up where it paused. Don't interleave the two.\n- Cleanup deletes are verification-gated: ancestry-merged into the base, or a local tip exactly equal to a merged PR's head. Unverified branches are never force-deleted.\n- Wrap-up reports inbox messages and never deletes or archives them: OACP archives messages rather than deleting them, and processing and archival belong to `\u002Fcheck-inbox`.\n- Debrief failure is non-fatal. The remaining steps still run.\n- Commit scope: the current repo, repos step 3 edited (both step 4), and the memory repo (4b, if the marker is present). Other repos are touched only to clean exact local worktrees or branches this session created. The debrief store is not committed separately — 4b's `agent-memory push` carries `org-memory\u002F**`.\n- Under a network-filtering sandbox, signed commits, SSH pushes, and nested `gh` calls can fail with TLS errors (e.g. `x509: OSStatus -26276`) while credentials are fine — retry unsandboxed rather than debugging the call or the token.\n- Use `command grep` \u002F `command ls` \u002F `command find` in shell commands if your shell aliases these to other tools.\n- `OACP_HOME` defaults: see `oacp doctor` for the active path.\n","# \u002Fwrap-up — Session Wrap-Up\n\nComposes end-of-session steps into a single command: cleanup stale artifacts, optional debrief, org-memory events, self-improve (with approval pause), commit, and push.\n\n## Arguments\n\n- `\u002Fwrap-up` — full wrap-up sequence\n- `\u002Fwrap-up --dry-run` — run cleanup + debrief + self-improve but skip commit and push\n\n## Instructions\n\nWhen the user runs `\u002Fwrap-up`, execute these steps in strict order:\n\n### 1. Cleanup stale artifacts\n\nScope: merged branches and stale worktrees, plus an inbox report (1d) — in the primary repository, plus any repository where this session created a specific local worktree or branch. In such a sibling, clean only those named artifacts: no general branch cleanup, commits, pushes, or remote-branch deletion there. Ownership evidence is this session's own creation commands or recorded paths; a runtime prefix or a `.worktrees\u002F` location alone is not.\n\n> **Working-directory guard (run FIRST)**: verify `git rev-parse --show-toplevel` matches the session's primary repo before any cleanup command — a `cd` from earlier in the session persists in the shell, and cleanup silently runs against the wrong repo. If it doesn't match, `cd` back to the project root. Where the harness forbids `cd` to the root (a worktree-anchored session), run each cleanup command as `git -C \u003Croot> …`. A worktree-isolated session refuses `git -C \u003Croot>` too: run branch and worktree cleanup from the session's own worktree — it shares the repository's branches and worktree records — pass that path to `cleanup_branches.sh`, and leave any pull of the main clone to the user.\n>\n> **Memory home**: steps 1d, 2, 2b and 4b assume `$OACP_HOME`. A repo bound to its own agent-memory home (`agent-memory status` reports a binding as the source) uses that home instead: 1d has no inbox to check (say so), step 2 publishes with `--oacp-dir \u003Chome>`, 2b and 4b pass `--home \u003Chome>`, and 4b pushes only when `\u003Chome>\u002F.oacp-memory-repo` exists — otherwise report the home as unsynced. A home outside the sandbox's write allowlist needs the step 2 and 2b writes run unsandboxed; sandboxed, they fail `Operation not permitted` and write nothing.\n\n#### 1a. Just-merged PR worktrees\n\n- If the session merged a PR from a dedicated worktree, finish its cleanup in this wrap-up — reporting the path is not the finish line. You cannot remove the worktree you are standing in, so move first: `cd \u003Cmain-root>` → artifact check (below) → `git worktree remove \u003Cpath>` → branch deletion (below) → `git pull --ff-only origin \u003Cbase>`, so the main clone stops sitting behind its own merge. The fast-forward doesn't touch peer worktrees, which sit on their own branches. Skip the pull when the project's guidance makes pulling the main clone a deploy (live jobs run from it); report the clone as behind instead.\n- **When the harness forbids `cd` to the root**, `git -C \u003Cmain-root> worktree remove \u003Cpath>` works from inside the worktree (add `--force` only after the artifact check — it also deletes untracked files). Sandboxed, the removal can fail `Operation not permitted` on the worktree and its `.git\u002Fworktrees\u002F\u003Cname>` record; run it unsandboxed — from the main root too: a sandboxed `git worktree remove` can delete the worktree directory and then fail on the record, leaving a half-removed worktree that only an unsandboxed `git worktree prune` repairs. The shell's cwd is then a deleted directory, so make the removal the last step and use absolute paths for anything after it.\n- **Harness-managed worktrees**: a worktree-isolated session is refused that `git -C` as well — leave it with `ExitWorktree` as the last step. `remove` deletes a worktree that `EnterWorktree` created; one entered by path is refused, so use `keep` (which returns to the starting directory), then run `git -C \u003Cmain-root> worktree remove \u003Cpath>`. A worktree the desktop app created for the session is the app's: archiving the session hands it back.\n- **Gitignored artifacts don't block removal — check for irreplaceable ones first**: `git worktree remove` succeeds when the only remaining content is gitignored (build output like `release\u002F`, `dist\u002F`), silently deleting it. Before removing a build worktree, check those directories for non-reproducible or pending-publish artifacts (e.g., signed installers staged for a later upload); if any exist, surface them and let the user decide. Rebuildable-by-design outputs are fine to delete — say so in the report.\n- After removing, try `git branch -d \u003Cbranch>`. If it refuses because the repo is squash-only, verify the PR is `MERGED` and the local tip exactly equals its merged head (`gh pr view \u003Cn> --json state,headRefOid`); a full non-dry-run `\u002Fwrap-up` then authorizes `git branch -D` for that exact session-created branch. Pre-existing branches still need separate approval.\n\n#### 1b. Merged branches\n\nSquash merges leave branch tips that are never ancestors of `main`, so `git branch --merged` and `-d` are both blind to them — without a PR-state check, merged branches accumulate indefinitely while cleanup reports \"nothing to clean\". Run the two-pass cleanup (ancestry pass + PR-state pass), packaged as [`scripts\u002Fcleanup_branches.sh`](scripts\u002Fcleanup_branches.sh):\n\n```bash\nbash \u003Cskill-dir>\u002Fscripts\u002Fcleanup_branches.sh \u003Crepo-root> [--keep \u003Cbranch>]... [--keep-prefix \u003Cprefix>]...\n```\n\nPass `--keep` for each persistent branch the project names, and `--keep-prefix \u003Cruntime>\u002F` for each peer runtime working in the repo (e.g. `codex\u002F`) — a peer's merged branch is still its own to clean up. `--dry-run` previews; `--base` overrides the base (default `origin\u002FHEAD`, else `main`). Ensure `gh` is authenticated for the repo first. Under a network-filtering sandbox, run the script unsandboxed: a `gh` nested in a script can fail TLS through the proxy even when the same `gh` typed directly works. Don't trust a probe either — `gh pr list --repo \u003Cowner>\u002F\u003Cname>` can succeed on a repo the script still can't resolve (it resolves from the local remote) — so the `SKIP pass 2` line, which quotes gh's error, is the only signal: fix auth or the sandbox and re-run. The script's contract:\n\n- **Pass 1 (ancestry)**: `git branch --merged \u003Cbase>` → `git branch -D` (the listing already proves the tip is in the base; `-d` would also demand HEAD or upstream containment, which fails from a worktree on another branch).\n- **Pass 2 (PR head)**: for each remaining local branch not checked out in any worktree, look up its merged PR and delete ONLY when the local tip exactly equals that PR's merged `headRefOid` — a `MERGED` state alone is not enough, since the branch may carry unpublished commits made after the merge, and deleting it would orphan them. The exact-head verification is the safety, not the `-D` flag. The base, `--keep`\u002F`--keep-prefix` branches, worktree-checked-out branches (including other agents'), branches with no merged PR, and branches whose tip diverged from the merged head are never deleted. Pass 2 prints `KEEP \u003Cbranch> — \u003Creason>` for the no-merged-PR and diverged-tip cases; reserved and checked-out branches print `KEEP` only when pass 1 lists them as merged and are otherwise skipped silently. Review the `KEEP` lines by hand — never `-D` those branches either.\n- Run this broad pass only in the primary repo or a repo the user fully opted into. In a sibling included only for this session's artifacts, delete just the recorded branches.\n- **Remote counterparts**: deleting merged remote refs on a shared repo is outward-facing — list candidates and let the user authorize `git push --delete`. Assess from `git ls-remote --heads origin` after `git remote prune origin` (`git branch -a`'s remote-tracking refs go stale and inflate the list). Repos that auto-delete head branches have already removed a merged PR's ref; `push --delete` there fails `remote ref does not exist` and breaks any `&&` chain, so let the prune be the cleanup.\n- Report: \"Deleted N merged branches (K ancestry + M squash); kept P unmerged\" or \"No merged branches to clean\"\n\n#### 1c. Stale worktrees\n\n- Run `git worktree prune`, then list remaining: `git worktree list`\n- **Leftover directories that are not worktrees**: a `.worktrees\u002F\u003Cname>\u002F` directory absent from `git worktree list` is residue (often just a `.claude\u002F` inside, left when a worktree was removed without `--force`, or recreated by the harness when the removed worktree was the session's own cwd). A runtime's parent directory whose children are listed worktrees (`.worktrees\u002F\u003Cruntime>\u002F`) is not residue — compare leaf paths. Never count it as a stale worktree; report each with its contents and hand the user the removal command (`! rm -rf \u003Crepo>\u002F.worktrees\u002F\u003Cname>`) rather than deleting it yourself.\n- **Peer-agent ownership guard**: a worktree whose path or branch names another agent or runtime belongs to that agent — report it, never remove it, even when its PR is merged. Peer worktrees don't always self-identify by name: another agent's PR-review checkout may appear as a detached-HEAD worktree under a temp path with no branch name. Treat any worktree this session didn't create, in a tmp path or detached at a reviewed PR's head, as peer-owned.\n- For entries this session owns, remove a worktree only when its branch is merged — in squash-only repos, merged-PR evidence counts even when ancestry doesn't show it. If the only signal is a vanished remote branch, ask first (it may be intentionally local-only). Not merged → leave in place, warn.\n- After removal, `git branch -d \u003Cbranch>` when Git reports it merged. Never force-delete an unverified branch: `-D` only under 1a's or 1b's verification (ancestry-merged into the base, or a local tip exactly equal to its merged PR's head).\n- Report: \"Pruned N worktrees\" or \"No stale worktrees\"\n\n#### 1d. Inbox report\n\n- Resolve the project from the `.oacp` marker at the **main** repo root — a linked worktree has no marker of its own, so a cwd read inside one silently skips this step. Pass the session's root with `git -C` so a drifted cwd can't resolve a different project:\n\n  ```bash\n  ROOT=$(dirname \"$(git -C \u003Croot> rev-parse --path-format=absolute --git-common-dir)\")\n  [ -f \"$ROOT\u002F.oacp\" ] && python3 -c \"import json,sys; print(json.load(open(sys.argv[1]))['project_name'])\" \"$ROOT\u002F.oacp\"\n  ```\n\n- No marker → use `basename \"$ROOT\"` only if `$OACP_HOME\u002Fprojects\u002F\u003Cbasename>\u002F` exists; otherwise skip the inbox report. A resolved name that isn't the session's project is a cwd bug, not an unregistered project.\n- Inbox dir: `$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fagents\u002F\u003Cagent>\u002Finbox\u002F`\n- List YAML files with `command ls -1 \u003Cdir> | command grep '\\.yaml$'` (not a `*.yaml` glob — zsh `nomatch` errors when empty; `command` bypasses aliases; `-1` keeps the output grep-able)\n- Files present → report them; never delete or archive them (OACP archives messages, and archival belongs to `\u002Fcheck-inbox`). Held-unverified or INVALID messages under an OACP enforce posture are surfaced explicitly, never treated as ordinary backlog. **A fresh message that verifies is unprocessed work, not a report item**: process it with `\u002Fcheck-inbox` now, before step 2, so the debrief covers it.\n- Empty → report \"Inbox clean\". **A missing directory is not clean**: the agent has no workspace in that project on this machine — report \"no \u003Cagent> inbox for \u003Cproject> on this machine\".\n\n### 2. Run debrief (optional)\n\n- If a `\u002Fdebrief` skill is installed, invoke it — it auto-detects the project and publishes one immutable record per session to the org-memory debrief store (`$OACP_HOME\u002Forg-memory\u002Fdebriefs\u002F\u003Cproject>\u002F\u003CYYYY>\u002F\u003CMM>\u002F`). Otherwise, skip with a one-line note.\n- Let `\u002Fdebrief` own the record's dates: the store keys its directory and filename on the session's UTC start, not on a project's local-timezone convention.\n- **Second wrap-up in one session**: if this session already has a record, neither skip the step nor re-run with the same identity (that collides by construction) — publish a continuation segment per `\u002Fdebrief`'s collision handling. The test is coverage: when the latest segment's `ended_utc` is only minutes old and nothing material has happened since (bookkeeping, a memory push, this wrap-up), report that segment's path instead of publishing an empty one. Read its `ended_utc` before deciding; recall is not the check.\n- If debrief fails, warn and continue — debrief is non-fatal. A missing store is not a failure; the writer provisions its own tree.\n\n### 2b. Write org-memory events\n\nWrite events for the session's significant outcomes to the org-level memory log, which other agents read for cross-project context.\n\n**Skip this step** if `$OACP_HOME\u002Forg-memory\u002Fevents\u002F` does not exist (org-memory not initialized — run `agent-memory org init` to set up).\n\n**What to write**: only outcomes that matter to other agents and projects — not routine task completion.\n\n| Write an event for | Type | Example |\n|--------------------|------|---------|\n| PR merged | `event` | \"PR #44 merged: org-level memory spec + CLI\" |\n| Architecture\u002Fdesign decision | `decision` | \"Standardized on REST for public APIs\" |\n| New standing rule or convention | `rule` | \"All repos in this org require signed commits\" |\n| Release or deployment | `event` | \"v0.2.0 published\" |\n\n**Do NOT write events for**: routine code fixes, test additions, doc typos, inbox messages processed, self-improve findings.\n\n> **Existing-rule check**: before writing a `rule` or `decision`, grep the topic in `org-memory\u002Frules.md` and `decisions.md` (headings via `command grep -n '^### '`, then keywords), in today's and yesterday's `org-memory\u002Fevents\u002F` (UTC-dated filenames — a peer's same-day event isn't folded into `decisions.md` until synthesis), and in the installed skills. Hit in org-memory → write nothing, or write only the genuine delta as a refinement pointing at the rule. Hit in a skill → the session broke a standing rule; an honest event names that rule and the delta it lacks (often a recovery path), not a rediscovery.\n\n**How**: use `agent-memory event write`, with the step 2 debrief as source material:\n\n```bash\nagent-memory event write --home \"$OACP_HOME\" --agent claude --project \"\u003Cproject>\" \\\n  --type \u003Cdecision|event|rule> --slug \u003Cshort-slug> \\\n  --body \"\u003Cone-line description>\" \\\n  [--source-ref \u003Cdebrief-filename-stem>] [--related \"PR #N,...\"]\n```\n\n`--source-ref` names the debrief the event was folded from. Under `\u002Fwrap-up --dry-run`, add `--dry-run`: it validates and prints the record without writing.\n\n> **Slug constraint**: lowercase alphanumeric + hyphens only, 1-64 chars, must start and end with alphanumeric. **No dots** — convert version segments to hyphens (e.g., `release-0-2-3` not `release-0.2.3`). Requires `agent-memory` on PATH; if it is unavailable, report the missing `agent-memory-cli` prerequisite and skip event writing. Success prints `published:` or `idempotent:`.\n>\n> **Under an active envelope the event body is command text to the hook**: a destructive token quoted inside `--body` (a recursive-force remove, a forced push flag, a verify-skipping flag) denies the write when the envelope declares `destructive_ops: false`, data or not. Spell the action in words — \"a forced push\", \"the recursive remove\" — never quote the flag.\n\n**Keep it lightweight**: write events only for the outcomes in the table above — most sessions warrant none or a few. If the session was trivial (only reading files, answering questions), write zero events and report \"No org-memory events (routine session).\"\n\nReport: \"Wrote N org-memory events\" or \"Skipped (org-memory not initialized)\" or \"No org-memory events (routine session)\".\n\n### 3. Run \u002Fself-improve\n\n- Invoke the `\u002Fself-improve` skill\n- The skill will present findings and ask \"Which changes should I apply?\"\n- **Pause here** — wait for user approval before continuing\n- **The user has said they are away** (\"stepping out\", \"just run wrap-up\"): the pause cannot resolve, so don't hold the wrap-up on it — present the findings, apply none, record them where the user will find them on return (the project's status memory, `$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fmemory\u002Fopen_threads.md`), and continue.\n- Apply approved changes\n- If no findings, report \"No issues found\" and continue\n\n### 3b. Self-improve the self-improve skill\n\nAfter step 3 completes, run `\u002Fself-improve self-improve` — a targeted review of the self-improve skill itself. This catches issues with the review process that only surface during execution (e.g., missed edge cases, incorrect analysis patterns, user corrections during step 3).\n\n- **Skip if step 3 had no findings and no user corrections** — nothing to learn from a clean run\n- If findings exist, apply with approval and commit alongside step 4\n\n### 4. Commit changes\n\n- Run `git status` to check for uncommitted changes\n- If no changes, skip to step 4b\n- Stage changed files explicitly (no `git add -A` or `git add .`)\n- Exclude from staging: `.env`, credentials, secrets, `settings.json`\n- Commit message: `wrap-up: \u003Cbrief summary of changes>` for wrap-up's own housekeeping edits\n- **Other repos step 3 edited**: self-improve can edit skills or instruction files that live in a separate repo. Commit and push those there only when this session made the edits, staging explicit paths and leaving other runtimes' files alone. Check `git -C \u003Crepo> rev-list --count origin\u002F\u003Cbranch>..HEAD` too — self-improve may commit without pushing, so a clean `status` is not \"nothing to do\".\n- **Paused mid-dispatch on a feature branch**: commit the task's own work with its conventional message (referencing its issue), push the branch so the work survives the pause, and leave the dispatch message in the inbox — it stays unprocessed until its completion reply. The PR, review request, and merge wait for the resumed session.\n- **Paused with a review round in flight**: the work is already pushed at the declared head, so there is nothing to commit, and step 5 must NOT push that branch — any push voids the reviewer's round. Write the owed close-out (what to do on feedback vs. LGTM, the message ids, the task's start time — naming only commands whose contract you checked against the script's usage header, since a hand-off can name a script that cannot do the step) to the project's status memory (`$OACP_HOME\u002Fprojects\u002F\u003Cproject>\u002Fmemory\u002Fopen_threads.md`, read at the next session's start) and report the round as in flight.\n- If `--dry-run`: show what would be committed but do not commit\n\n### 4b. OACP memory sync (optional)\n\nPush the cross-machine memory snapshot if memory sync is active. Captures new `org-memory\u002Fevents\u002F` entries from step 2b, debriefs from step 2, and any session memory edits.\n\n```bash\ntest -f \"$OACP_HOME\u002F.oacp-memory-repo\" || { echo \"memory sync: not active (skip)\"; exit 0; }\nagent-memory push --home \"$OACP_HOME\" --agent claude\n```\n\n- **Skip silently** if the `.oacp-memory-repo` marker is absent — memory sync is not initialized on this machine (`agent-memory enable` to opt in, or `agent-memory clone` on a second machine). Requires `agent-memory` on PATH; if it is missing, warn and skip.\n- `agent-memory push` is idempotent: it stages allowlisted files (`org-memory\u002F**`, `projects\u002F*\u002Fmemory\u002F**`), commits, and pushes when a remote exists. No-op if no changes.\n- **Pass `--agent`**: without it the commit author falls back to `$AGENT_MEMORY_AGENT`, then `$AGENT_NAME`, then `$USER`, publishing agent-authored commits under the human's name. Name the agent actually running the session.\n- **Another session's fresh uncommitted files → skip the push and say so.** Run `git -C \"$OACP_HOME\" status --short` first: a dirty or untracked path you did not write, modified within the last ~30 minutes, belongs to a peer session still mid-wrap-up. The push stages every allowlisted file, so pushing now would publish their in-flight edits under your commit. Report \"memory: push skipped — N in-flight files from another session\" and let the next push carry yours. Hours-old leftovers with no live session are the opposite case: carry them.\n- If commit signing or the git credential helper needs access the sandbox blocks, run the push unsandboxed.\n- Independent of step 5 — failure here does not block the current-repo push. Report the memory-push outcome separately.\n- If `--dry-run`: the push has no dry-run flag — show `git -C \"$OACP_HOME\" status --short` and skip.\n- Report: commit SHA + file count, or \"memory: clean (no changes)\", or \"memory: skipped (sync not active)\", or the skip line above.\n\n### 5. Push to remote\n\n- **Pull-rebase before push** to avoid conflicts with parallel runtimes that may have pushed:\n\n  ```bash\n  git pull --rebase --autostash origin \u003Cbranch>\n  ```\n\n  (`--autostash` carries uncommitted files over the rebase.) If the rebase conflicts, abort with `git rebase --abort`, warn the user, and skip push; if the autostash pop conflicts, git keeps the stash — warn and resolve before pushing.\n- Push current branch to origin: `git push origin \u003Cbranch>` — never a branch with a review round in flight (step 4)\n- If `--dry-run`: skip push\n- Report: branch, commit SHA, remote URL\n\n### 6. Summary\n\nPrint a final status block:\n\n```\nWrap-up complete:\n- Cleanup: N branches, M worktrees pruned, inbox \u003Cstatus>\n- Debrief: \u003Cstatus> $OACP_HOME\u002Forg-memory\u002Fdebriefs\u002F\u003Cproject>\u002F\u003CYYYY>\u002F\u003CMM>\u002F\u003Cfile>.md\n- Org-memory: N events written (or \"skipped\" or \"routine session\")\n- Self-improve: N findings (M applied)\n- Commit: \u003Csha> on \u003Cbranch> (or \"no changes\" or \"review round in flight\")\n- Other repos: \u003Crepo>@\u003Csha> (or \"none\")\n- OACP memory: \u003Csha> (or \"clean\" or \"skipped (sync not active)\" or \"skipped (dry-run)\")\n- Push: \u003Cbranch> -> origin (or \"skipped (dry-run)\")\n```\n\n## Notes\n\n- **Mid-wrap-up dispatches (OACP v0.4.1+ envelopes)**: if a new task auto-accepts during wrap-up, its compiled scope envelope can deny wrap-up's own later side effects (steps 4-5 commits\u002Fpushes are outside a reply-only task's envelope). Run the dispatched task's lifecycle to terminal — reply, audit update, `oacp envelope clear` — then resume wrap-up where it paused. Don't interleave the two.\n- Cleanup deletes are verification-gated: ancestry-merged into the base, or a local tip exactly equal to a merged PR's head. Unverified branches are never force-deleted.\n- Wrap-up reports inbox messages and never deletes or archives them: OACP archives messages rather than deleting them, and processing and archival belong to `\u002Fcheck-inbox`.\n- Debrief failure is non-fatal. The remaining steps still run.\n- Commit scope: the current repo, repos step 3 edited (both step 4), and the memory repo (4b, if the marker is present). Other repos are touched only to clean exact local worktrees or branches this session created. The debrief store is not committed separately — 4b's `agent-memory push` carries `org-memory\u002F**`.\n- Under a network-filtering sandbox, signed commits, SSH pushes, and nested `gh` calls can fail with TLS errors (e.g. `x509: OSStatus -26276`) while credentials are fine — retry unsandboxed rather than debugging the call or the token.\n- Use `command grep` \u002F `command ls` \u002F `command find` in shell commands if your shell aliases these to other tools.\n- `OACP_HOME` defaults: see `oacp doctor` for the active path.\n",{"name":5,"description":7},"main","ea78d5cce0208a15b59f6f2c49e729ba71a3c5af","skills\u002Fwrap-up",1,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills","https:\u002F\u002Foacp.dev\u002Fskills\u002F","https:\u002F\u002Fgithub.com\u002Fkiloloop","https:\u002F\u002Fkiloloop.com","2026-10-31 14:39:52",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add kiloloop\u002Foacp-skills --skill wrap-up",{"tool":53,"command":54},"bunx","bunx skills add kiloloop\u002Foacp-skills --skill wrap-up",{"tool":56,"command":57},"pnpm","pnpm dlx skills add kiloloop\u002Foacp-skills --skill wrap-up","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",true,[61,66,69,72,75,78,81,85,88,94,98,102,106],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":65},"algorithms.md","REFERENCE","参考文档","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Falgorithms.md",{"path":67,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":68},"failure_modes.md","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Ffailure_modes.md",{"path":70,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":71},"formulas.md","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Fformulas.md",{"path":73,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":74},"implementation_notes.md","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Fimplementation_notes.md",{"path":76,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":77},"integration_arbitragex.md","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Fintegration_arbitragex.md",{"path":79,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":80},"manifest.json","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Fmanifest.json",{"path":82,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":83,"sourceHtmlUrl":84},"README.md",4001,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FREADME.md",{"path":86,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":87},"references.json","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Freferences.json",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"scripts\u002Fcleanup_branches.sh","SCRIPT","脚本",5715,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Fscripts\u002Fcleanup_branches.sh",{"path":95,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":96,"sourceHtmlUrl":97},"shared\u002FINTENT.md",3229,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Fshared\u002FINTENT.md",{"path":99,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":100,"sourceHtmlUrl":101},"skill.yaml",324,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Fskill.yaml",{"path":103,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":104,"sourceHtmlUrl":105},"tests\u002Ftest_cleanup_branches.py",4498,"https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Ftests\u002Ftest_cleanup_branches.py",{"path":107,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":14,"sourceHtmlUrl":108},"validation_tests.md","https:\u002F\u002Fgithub.com\u002Fhefarica\u002Farbitragex-v2\u002Fblob\u002Fmain\u002F.claude\u002Fagents\u002Fskills\u002Fcross-chain-arbitrage-risk-model\u002Fvalidation_tests.md",[110,121,126,141,147,169],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":33},"01M6DSWR7WDRG7C3D31R4QKW5T","\u003Cskill-name>","\u003Cone-line description>","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Ftemplate\u002Fcodex\u002FSKILL.md",[],[117,118,119,120],"skill name","name","\u003Cskill name>","line",{"skillNo":122,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":33},"01M6DSWMRPCHQH4HJJF3MATTXZ","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Ftemplate\u002Fclaude\u002FSKILL.md",[],[117,118,119,120],{"skillNo":127,"name":5,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":33},"01M6DSWH83XKNGJSKX2XWQCRKJ","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.","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Fcodex\u002FSKILL.md",[],[20,21,19,132,133,26,134,28,135,136,29,137,30,31,32,138,139,22,24,140],"first","publish","write","artifacts","stale","delta","repository","codex","run",{"skillNo":142,"name":143,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":33},"01M6DSWEQBS2CE6F2H8T3VQNZY","claude","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002Fclaude\u002FSKILL.md",[],[],{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":33},"01M6DSW4FRNRKRQ0TRMZAYNMKZ","self-improve","Audit and improve Codex operating guidance: skills, curated project memory, AGENTS.md, and relevant configuration. Use for explicit self-improve requests, routine wrap-up drift checks, stale or conflicting guidance, or an approved cleanup. Route release-wide OACP migrations and context-budget audits to audit-oacp-skills. Do not hand-edit generated Codex memories or installed plugin\u002Fsystem artifacts.","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fself-improve\u002Fcodex\u002FSKILL.md",[],[30,154,26,155,24,156,157,158,159,160,161,162,20,163,164,165,166,167,168,22],"self improve","route","release","audit","Budget","system","edit","context","generated","do","drift","memories","project","operating","oacp",{"skillNo":170,"name":143,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":33},"01M6DSW1YM216MF8SRF4VTEW0V","https:\u002F\u002Fgithub.com\u002Fkiloloop\u002Foacp-skills\u002Fblob\u002Fmain\u002Fskills\u002Fself-improve\u002Fclaude\u002FSKILL.md",[],[]]