AGENT SKILL

agterm-split-prs

Hand the pull requests this session has been juggling off to agterm sessions of their own: one sibling session per PR, each in a worktree on the PR's branch, each running a fresh agent with a brief written from this conversation. Optionally starts a flows process (ext-pr, jsf-pr, …) in each. This session lets go of those PRs afterwards.

License 许可
MIT
最近更新
2026-11-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
agterm-split-prs
description
Hand the pull requests this session has been juggling off to agterm sessions of their own: one sibling session per PR, each in a worktree on the PR's branch, each running a fresh agent with a brief written from this conversation. Optionally starts a flows process (ext-pr, jsf-pr, …) in each. This session lets go of those PRs afterwards.
when_to_use
Trigger on: agterm-split-prs, /agterm-split-prs, "split the PRs into sessions", "a session per PR", "create separate sessions for both PRs", "раздай PR по сессиям", "отбери PR в отдельные сессии", "по сессии на каждый PR", or when one conversation holds several PRs and the user wants to run a per-session flow (`flow start … --bind`) on each.
allowed-tools
[ "Bash", "Read", "Write" ]
argument-hint
optional: which PRs; optional: --flow <process>

02 资源文件 48

03 SKILL.md 正文

agterm-split-prs

Works only inside agterm (AGTERM_ENABLED=1). Every agtermctl call below takes --socket "$AGTERM_SOCKET" after the subcommand, as its own argument.

1. The PRs

List every PR this conversation worked on: repo, number, URL, head branch, state (gh pr view <url> --json number,url,headRefName,state,isDraft). Merged or closed ones stay out. The user named some: only those. Unclear which: ask, listing them. Show the list in one line each before going on.

2. A checkout per PR

Never switch the main checkout: it may be dirty or on someone else's branch.

  • A worktree already on that branch (git worktree list): reuse it.

  • Otherwise add one where the repo keeps them: .worktrees/<slug> if git check-ignore -q .worktrees/x says it is ignored, else a sibling ../<repo>-wt-<slug>. Then check the PR out there, which also sets the upstream and handles PRs from forks:

    git -C <main> worktree add --detach <path> && cd <path> && gh pr checkout <n>
    

3. A brief per PR

Write <scratchpad>/briefs/<repo>-<n>.md, in English, self-contained: the new agent has none of this conversation. It holds:

  • the PR (URL, branch → base) and that the directory is a worktree of it;
  • what the PR does, in a few lines, and its state (draft, CI, reviews);
  • what this conversation decided about it, and what is still open for the user;
  • shared background the PRs have in common (one paragraph, the same in every brief);
  • the rules that applied here: what needs the user's explicit go (marking ready, reviewers, Slack, merge, anything irreversible), commit conventions, the language to talk to the user in;
  • the first move: read the PR (gh pr view <n> --comments, gh pr diff <n>), give the user a short status, wait for instructions.

No single quotes in the brief's path: it is read inside a zsh -lc '…'.

4. The sessions

Launch the agent the way this one was launched: read this pane's foreground from agtermctl tree --json for the session $AGTERM_SESSION_ID and keep its flags (--dangerously-skip-permissions, --model …), dropping any prompt or --resume.

prev="$AGTERM_SESSION_ID"
id=$(agtermctl session new --socket "$AGTERM_SOCKET" --after "$prev" --no-select \
  --cwd <worktree> --name "<repo>#<n>" \
  --command "zsh -lc 'claude <flags> \"\$(cat <brief>)\"'")
agtermctl session context "<repo>#<n> <what it is>" --target "$id" --socket "$AGTERM_SOCKET"
prev="$id"   # the next one goes after this one, keeping the PRs in order
  • --after already names the workspace: never pass --workspace with it.
  • session context takes the text first, then the options.

5. Check they came up

About 20 seconds later, for each id: tree --json shows claude in its foreground, and agtermctl session text --target <id> --lines 15 shows it working. A new folder makes Claude ask "Do you trust this folder?": do not answer it for the user, tell them which session waits on it.

6. A flow in each (only if asked)

--flow <process> given, or the user asked to run a flow per PR: once a session's agent is at its prompt, flow start <process> --bind dev=<id> for it. flowd types the step into that session; its agent reports there, not here.

7. Let go

Report a table: session name, worktree, state (working / waits on trust / flow run id). From now on these PRs belong to their sessions: do not commit, push or comment on them from here. A question about one: point the user to its session.

04 同仓库更多 Skills

isachivka
isachivka/beware-of-skills

yt-dub

Give a YouTube video Yandex's Russian voice-over (the Yandex Browser / voice-over-translation one) at any length — including past Yandex's 4-hour limit — and mux it into the best video YouTube serves, with the original sound kept as a second track; optionally drop the result into Plex on SugarDaddy. Also when only the translated audio is wanted.

图像与多媒体
★ 0
isachivka
isachivka/beware-of-skills

codex-proxy

Run an OpenAI-compatible Chat Completions endpoint on localhost that spends the user's ChatGPT/Codex subscription instead of an API key — for apps that take a Base URL, API key and model id (dictation post-processing, editors, scripts). Install it as an always-on LaunchAgent, check its status, print the key, try a request, or debug a failing app.

开发工程师后端与接口
★ 0
isachivka
isachivka/beware-of-skills

revdiff-ru

Review a diff in revdiff with everything except the code translated into Russian, line numbering preserved 1:1 so annotations map back to the real files. One command does the translation; then /revdiff:revdiff opens the result.

开发工程师
★ 0
isachivka
isachivka/beware-of-skills

peer-chat

A prompt starting with "Chat from Codex:" is a peer message: answer it only through peer-chat.py, never in your own output. Also use when the user says "chat with codex", "talk to codex", "work with codex", "do this with codex", "build this with codex", "discuss this with codex" (the agent in the other pane of this agterm split). Not for a one-shot task handed off, and not for a read-only second opinion.

Skill与智能体开发
★ 0
isachivka
isachivka/beware-of-skills

memory-review

Use when an agent memory directory has grown large enough that nobody remembers what is in it, when memories look stale or contradictory, when the same fact seems to live in both memory and a CLAUDE.md, or when the user asks to review, prune, audit or clean up their memories. Also use before retiring a project whose memories should move somewhere else.

开发工程师
★ 0
isachivka
isachivka/beware-of-skills

decomment

Strip the noise comments an AI agent left behind on a branch — the ones that restate the code line by line or narrate the change as a story ("was X, now Y", "added a guard here"). Git holds the history and the code holds the present; only genuinely non-obvious comments survive.

开发工程师Skill与智能体开发
★ 0