/flow:archivefrom flow
Close out a jstack task in two parts: before merge, keep GLOSSARY.md and ADRs current, write back to gbrain, and route each lesson; after merge, close tickets with their evidence and clean merged worktrees. Invoked by flow:route at the archive stage; not for mid-task cleanup.
Ships in flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The archive stage's provider. It has two parts, split by the merge:
gh pr view <n> --json state,mergedAt), not from memory.When the PR is still open, do the before-merge part, then record what is owed with stage.sh pending "<PR URL> <what is left>" (for example closes #74, worktree .claude/worktrees/x) and report the task as PR-ready. Do not merge the PR to get to the second part. When route starts a later task and stage.sh start lists pending entries, or the user says a PR was merged, run the after-merge part for each merged PR and then stage.sh settled <PR URL>. A repo with no remote runs both parts together.
Skip a section that does not apply, and say which and why in the report.
Read docs/agents/issue-tracker.md for where tickets live. If the repo has .jstack/config.json, its tracker section wins: type (github or local), local_dir, and label. If both are missing, use the tracker the task actually used.
gh issue close <n> --repo <owner/repo> --comment "<evidence>", where the evidence names the commits, the verification command, and what it showed.**Status:** done in the ticket file and append an ## Evidence section with the commit SHAs and the verification command and result.Closes #n) needs only the evidence comment.domain_docs.glossary (GLOSSARY.md by default) with the definition and what to avoid calling it. Follow spec:domain-modeling when it is on the locate list.domain_docs.adr (docs/adr/ by default) with context, decision, and consequences.Follow the global memory rules:
project/<id>/state is the project cognition card: what the project is, where it stands, what is next. Overwrite it, do not append.project/<id>/decisions/<topic>; project-specific lessons go to project/<id>/lessons/<topic>; cross-project knowledge goes to knowledge/<domain>/<topic>.Clean only worktrees this task created. With a remote, wait until the PR is merged and confirm mergedAt with the forge (gh pr view <url> --json state,mergedAt,baseRefName,headRefName) before touching anything. A repo with no remote has no PR to wait for; clean only after the branch commits are complete.
git worktree list --porcelain to get registered paths. Never infer or hand-type a worktree path.git rev-parse --show-toplevel; never remove it. Also leave a worktree marked locked.git -C <path> status --porcelain. Any output, including untracked files, means leave it.git fetch origin, then require the candidate's HEAD to be reachable from the PR's base branch with git merge-base --is-ancestor <head> origin/<base>. If that cannot be proved, leave it. Without a remote, require the branch to contain the task's completed commits.git worktree remove <path> only. Do not use --force. If removal fails, leave it and report why. Run git worktree prune after a successful removal.Report every removed worktree and every kept worktree with its reason. A worktree you cannot prove is safe stays.
A lesson is a correction, a trap, or a process change this task produced. For each one:
<domain_docs.conventions>/<topic>.md (docs/agents/conventions/ by default) when the repo has that directory. If it does not, skip and say the repo has no conventions library yet.gh issue list --repo jionpz/jstack --state open --search "<keywords>" first. Open a new issue only when no open issue already covers it: gh issue create --repo jionpz/jstack --title "<title>" --body "<what happened, what should change, evidence>". At most three per task; drop the rest with one line each.gh is unavailable or the repo has no remote, print the issue text instead of creating it.One line per section: tickets closed and their ids, docs updated, gbrain pages written, worktrees removed or kept with the reason, lessons routed with issue numbers or paths, sections skipped with the reason. Name the after-merge part as done or as pending with its stage.sh pending entry.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jionpz/jstack --plugin flow6 skills in this plugin
/executejstack's lean execute-stage provider. One task or one ticket done in the main session: inspect, change, run author checks, review the diff, commit. Route reads this file by path; do not model-invoke it./landjstack's default land-stage provider. Turn a verified, reviewed change into ordered branch commits and, when the repository has a remote, a ready PR with verification and adopted-default receipts. Route reads this file by path; do not model-invoke it./reviewjstack's default review-stage provider. One pass over the diff against the task: fix or dismiss each finding, record the evidence. Route reads this file by path; do not model-invoke it.