[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EQYAB7Q92KAC95C4F05ENG":3,"skill-same:01M7EQYAB7Q92KAC95C4F05ENG":48},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M7EQYAB7Q92KAC95C4F05ENG","handoff",null,"Archive this home - stop what runs, keep a note of ten lines at most in its log, hand what it has out to the uncategorized home, close its scope, switch off its scheduled tasks, and rename and settle this thread. It starts no next home. Use when the user invokes \u002Fhandoff or $handoff, archives a home from the jstack tree, or says to archive or close this home.","JoshuaHayesWasHere\u002Fjstack","JoshuaHayesWasHere","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78288453?v=4","01M7EQPZP0GDYN3SYY9SZZHFJE","Joshua Hayes","01M7EQPZPQKJDZR99NG512A8X2",1,"MIT","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fhome\u002Fskills\u002Fhandoff\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: handoff\ndescription: Archive this home - stop what runs, keep a note of ten lines at most in its log, hand what it has out to the uncategorized home, close its scope, switch off its scheduled tasks, and rename and settle this thread. It starts no next home. Use when the user invokes \u002Fhandoff or $handoff, archives a home from the jstack tree, or says to archive or close this home.\ntip: archives this home and starts no next one | archive | archive this home | close this home | wrap up\nuser-invocable: true\ndisable-model-invocation: true\ncard: \"Run the pipeline | 6 | Archives a home. It keeps a note of ten lines at most in the home's log, hands what the home has out to the uncategorized home, closes its scope and starts no next home. | Reach for it when a home's work is over, or from the tree's Archive item. | op: the operator; model: a home\"\n---\n\n# handoff\n\n```sh\nR=$(basename \"$(dirname \"$(git rev-parse --path-format=absolute --git-common-dir)\")\")\nH=~\u002F.local\u002Fstate\u002Fhome\u002F$R\nT=$(realpath ~\u002F.claude\u002Fskills\u002Fhandoff\u002F..\u002F..\u002Ftemplates)\nif [ -n \"${ZSH_VERSION:-}\" ]; then emulate sh; fi\nthis_home() {\n    M=\n    case ${1} in\n    '') M=$H ;;\n    *)\n        for f in \"$H\"\u002Fhome-id \"$H\"\u002F*\u002Fhome-id; do\n            if [ -f \"$f\" ] && [ \"$(awk 'NF {print $(1); exit}' \"$f\")\" = \"${1}\" ]; then\n                M=$(dirname \"$f\")\n                break\n            fi\n        done ;;\n    esac\n    if [ -z \"$M\" ]; then\n        echo \"no home: thread ${1} is no home of $R now, its id is in no home-id under $H. Nothing is written.\"\n        return 1\n    fi\n}\nhanded_off() {\n    L=\n    F=\n    for f in \"$H\"\u002Fhandoff.md \"$H\"\u002F*\u002Fhandoff.md \"$H\"\u002Flog\u002F*.md \"$H\"\u002F*\u002Flog\u002F*.md \"${H%\u002F*}\"\u002F_*\u002Fhandoff.md; do\n        if [ -n \"${1}\" ] && [ -f \"$f\" ] && [ \"$(sed -n 's\u002F^Was home:[[:space:]]*\\([^[:space:]][^[:space:]]*\\).*\u002F\\1\u002Fp' \"$f\" | head -n 1)\" = \"${1}\" ]; then\n            F=$f\n            L=$(dirname \"$f\")\n            case $L in *\u002Flog) L=${L%\u002Flog} ;; esac\n            break\n        fi\n    done\n}\nparty_home() {\n    M=\n    P=\n    for f in \"${H%\u002F*}\"\u002F_*\u002Fhome-id; do\n        if [ -n \"${1}\" ] && [ -f \"$f\" ] && [ ! -f \"${f%\u002F*}\u002FCHARTER.md\" ] && [ \"$(awk 'NF {print $(1); exit}' \"$f\")\" = \"${1}\" ]; then\n            M=$(dirname \"$f\")\n            P=${M##*\u002F_}\n            break\n        fi\n    done\n    [ -n \"$M\" ]\n}\n```\n\nThat is **the block at the top**: run it in the same call as each block below. Every block is sh, and the line before `this_home` makes zsh read them so. `$H` is the repo's state directory, which every home of the repo shares. `$T` is the `templates\u002F` directory of the repo this skill lives in. Each template there is the one copy of its text: read it when a step names it, not before.\n\nA handoff archives a home, and starts no home after it.\nA repo has one root home, and may have scoped homes beside it (`skills\u002Fhome\u002FSKILL.md`, \"Where a home's state lives\"), and each is archived in its own directory, `$M`: `$H` for the root home, `$H\u002F\u003Cscope>` for a scoped one.\n`this_home` sets it as the home skill does, from the one `home-id` that holds this thread's id.\n`handed_off` sets `$F` to the note that names a thread on its `Was home:` line, which step 3 writes, and `$L` to the directory of the home the thread was, or both to nothing.\nEach block below is run with that id in place of `\u003CthreadId>`: the `t3-code` server's `t3_thread_configure` with no arguments gives it as `threadId` (if your harness defers it, load it first).\nIn a session with no tool that gives the id, put nothing in its place: the blocks then archive nothing.\n\nA party that is no repo's home hands off too, to a next thread of its own.\nIts folder is `~\u002F.local\u002Fstate\u002Fhome\u002F_\u003Cname>`, beside the repos' state directories, and holds its thread id in a `home-id`.\n`party_home` finds it by that id, and sets `$M` to the folder and `$P` to the name.\nIt finds no expert, whose folder has a `CHARTER.md`: an expert rolls over as `$T\u002F..\u002Fskills\u002Fexpert\u002FSKILL.md` \"When to roll over\" says, and never by this skill.\n`handed_off` finds a party that handed off as it finds a home.\n\nBefore step 1, see which home this is:\n\n```sh\ncase '\u003CthreadId>' in\n'')\n    echo \"not known: the session gives no id for this thread, so no home is archived. Tell the user to run \u002Fhandoff in the home's own thread in T3 Code.\"\n    exit ;;\nesac\nif ! this_home '\u003CthreadId>' > \u002Fdev\u002Fnull && party_home '\u003CthreadId>'; then\n    printf 'party %s\\nhandoff: %s\\nwrite: %s\\n' \"$P\" \"$M\u002Fhandoff.md\" \"$M\u002Fhandoff.next.md\"\n    exit\nfi\nif ! this_home '\u003CthreadId>' > \u002Fdev\u002Fnull; then\n    handed_off '\u003CthreadId>'\n    case $F in\n    \"$H\"\u002Flog\u002F* | \"$H\"\u002F*\u002Flog\u002F*)\n        echo \"archived before: $F names this thread, so an earlier run archived this home: go to step 3\"\n        exit ;;\n    esac\nfi\nthis_home '\u003CthreadId>' || exit 1\nif [ \"$M\" = \"$H\" ]; then echo \"root\"; else echo \"scope ${M##*\u002F}\"; fi\nprintf 'write: %s\\n' \"$M\u002Fhandoff.next.md\"\n```\n\nIt prints which home this is and where step 2 writes the note.\nOn `party \u003Cname>`, this thread is that party's home and no repo's: do none of the steps below, and go by \"A party's home\".\nOn `archived before`, an earlier turn of this handoff archived the home and was cut off after it: run step 1, then step 3 and what follows it.\nOn `not known:` or `no home:`, nothing is written.\nThis thread is no home now: a crewmate, an ordinary thread, or a home that another took the place of.\nTell the user so in three lines at most, with what this thread leaves undone, and end here.\n\n## Steps\n\n1. **Stop what runs in the background.**\n   A watch or a loop this thread holds: stop each by its process id.\n   This thread is finished and must have nothing left that wakes it.\n   Each one goes in the note, under `Out, not on the bus:`, with what it watched.\n   Then run `git status --short` and `git log --oneline @{upstream}..` in each worktree this thread used, the main checkout included: each path and commit they print goes under `Uncommitted:` with its branch, and `none` only when both print nothing there.\n\n2. **Write the note**, at the path the block above printed after `write: `, in the shape of `$T\u002Fhandoff.md`: read it now.\n   It is the record of the archived home, kept in its `log\u002F`, and no home starts from it.\n   It holds only what nothing else holds: jbus holds the plan, the queue, the questions and what merged, so none of that is written here.\n   A rule of the user's is no line of it either: a standing rule is code, the text of the skill step that needs it, or a queued row, which the home queued when it heard it.\n   Facts and pointers, not narrative: a path or a thread id in place of an explanation.\n\n   A gate jbus could not take, which came as a message or sits in a Result or a Report, is held by nothing else while it is unanswered: write it under the labels, whole, with its default and its `Asked by:` and `Undo:` lines. The gates are not counted in the note's ten lines.\n\n3. **Archive.**\n   Call the `t3-code` server's `list_scheduled_tasks` (if your harness defers it, load it first) with no arguments.\n   Then run this with the block at the top, with this thread's id in place of `\u003CthreadId>` and the whole reply in place of the line in angle brackets.\n   In a session with no such tool, leave the line as it is:\n\n   ```sh\n   ME='\u003CthreadId>'\n   N=10 # lines a note has at most, its gates not counted\n   case $ME in\n   '' | *'\u003C'* | *'>'* | *' '*)\n       echo \"not known: put this thread's id in place of the placeholder. With no tool that gives it, nothing is archived: tell the user to run \u002Fhandoff in the home's own thread in T3 Code.\"\n       exit 1 ;;\n   esac\n   again=\n   if ! this_home \"$ME\" > \u002Fdev\u002Fnull; then\n       handed_off \"$ME\"\n       case $F in\n       \"$H\"\u002Flog\u002F* | \"$H\"\u002F*\u002Flog\u002F*) again=yes M=$L ;;\n       *)\n           echo \"not the home: this thread's id is in no home-id under $H and on no archived home's note. Nothing is archived, tell the user.\"\n           exit 1 ;;\n       esac\n   fi\n   scope=\n   if [ \"$M\" != \"$H\" ]; then scope=${M##*\u002F}; fi\n   note=$M\u002Fhandoff.next.md\n   if [ -n \"$again\" ]; then\n       kept=$F\n   else\n       why=\n       if [ ! -s \"$note\" ]; then\n           why=\"$note is not there\"\n       elif command grep -q '^\u003C' \"$note\"; then\n           why=\"a line of it is still the template's\"\n       else\n           above=$(awk '\u002F^## Gate\u002F {exit} NF' \"$note\")\n           lines=$(printf '%s\\n' \"$above\" | command grep -c .)\n           if [ \"$lines\" -gt \"$N\" ]; then why=\"it has $lines lines above its gates, and a note has at most $N\"; fi\n       fi\n       if [ -z \"$why\" ]; then\n           why=$(sed -n 's\u002F^\\([A-Z][^:\u003C]*:\\) \u003C.*\u002F\\1\u002Fp' \"$T\u002Fhandoff.md\" | while IFS= read -r label; do\n               printf '%s\\n' \"$above\" | command grep -q \"^$label [^\u003C]\" || echo \"it has no $label line above its gates that is filled in\"\n           done | head -n 1)\n       fi\n       if [ -n \"$why\" ]; then\n           echo \"not written: $why. Write the note there in the shape of $T\u002Fhandoff.md, then run this again.\"\n           exit 1\n       fi\n       handed_off \"$ME\"\n       kept=\n       case $F in \"$M\"\u002Flog\u002F*) kept=$F ;; esac\n       if [ -z \"$kept\" ]; then\n           if ! out=$(jbus out --scope \"${scope:-.}\" 2>&1); then\n               out=\"not known, jbus said: ${out:-nothing}\"\n           fi\n           if [ -n \"$scope\" ] && [ -f \"$M\u002Fgates.md\" ]; then\n               sep=$(printf '\\037')\n               moved=$(awk -v sep=\"$sep\" '\n                   function out() { if (open) printf \"%s%s%s%s%s\\n\", n, sep, by, sep, entry; entry = by = \"\"; open = 0 }\n                   \u002F^## Gate [0-9]+: \u002F { out(); n = $(3); sub(\u002F:$\u002F, \"\", n) }\n                   \u002F^$\u002F { next }\n                   \u002F^Status: open$\u002F { open = 1 }\n                   \u002F^Asked by: \u002F { by = $(0); sub(\u002F^Asked by: \u002F, \"\", by); sub(\u002F,.*\u002F, \"\", by) }\n                   { entry = entry $(0) \"\\002\" }\n                   END { out() }' \"$M\u002Fgates.md\" | while IFS=$sep read -r n by entry; do\n                   whose=\"the uncategorized home's\"\n                   if [ -z \"$by\" ] || [ \"$by\" = home ] || [ \"$by\" = \"home-$scope\" ]; then by=home-$scope whose=\"this home's own question\"; fi\n                   if said=$(printf '%s\\n' \"$entry\" | tr '\\002' '\\n' | jbus gate \"$by\" 2>&1); then\n                       echo \"gate $n of gates.md is $whose, $(printf '%s\\n' \"${said#asked: }\" | head -n 1)\"\n                   else\n                       echo \"gate $n of gates.md is kept whole in this note, jbus said: $(printf '%s' \"${said#not asked: }\" | head -n 1)\"\n                       printf 'KEEP%s\\n' \"$entry\"\n                   fi\n               done)\n               held=$(printf '%s\\n' \"$moved\" | sed -n 's\u002F^KEEP\u002F\u002Fp' | tr '\\002' '\\n')\n               moved=$(printf '%s\\n' \"$moved\" | command grep -v '^KEEP')\n               if ! mv \"$M\u002Fgates.md\" \"$M\u002Fgates-moved.md\"; then\n                   echo \"not archived: $M\u002Fgates.md could not be renamed to gates-moved.md. Run this again once that is put right.\"\n                   exit 1\n               fi\n               out=$(printf '%s\\n%s\\n' \"$out\" \"$moved\" | command grep .)\n           fi\n           if [ -n \"$scope\" ]; then label=\"Moved to uncategorized:\"; else label=\"Left with no home:\"; fi\n           kept=$M\u002Flog\u002F$(date +%F-%H%M).md\n           if [ -e \"$kept\" ]; then kept=$M\u002Flog\u002F$(date +%F-%H%M%S).md; fi\n           if ! mkdir -p \"$M\u002Flog\" || ! {\n               sed '\u002F^Was home:\u002Fd; \u002F^Archived:\u002Fd; \u002F^Moved to the root:\u002Fd; \u002F^Moved to uncategorized:\u002Fd; \u002F^Left with no home:\u002Fd' \"$note\"\n               if [ -n \"${held:-}\" ]; then printf '\\n%s\\n' \"$held\"; fi\n               printf '\\nArchived: %s, and no home was started after this one.\\n' \"$(date +%F)\"\n               if [ -z \"$out\" ]; then\n                   printf '%s none\\n' \"$label\"\n               else\n                   printf '%s\\n' \"$label\"\n                   printf '%s\\n' \"$out\" | sed 's\u002F^\u002F- \u002F'\n               fi\n               printf '\\nWas home: %s\\n' \"$ME\"\n           } > \"$kept\"; then\n               echo \"not archived: the note could not be written to $kept. Run this again once that is put right.\"\n               exit 1\n           fi\n       fi\n       if ! { [ ! -f \"$M\u002Fhandoff.md\" ] || mv \"$M\u002Fhandoff.md\" \"${kept%.md}-before.md\"; } ||\n           ! { [ -z \"$scope\" ] || uv run --project \"$T\u002F..\u002Fsource\" jbus retire \"$M\" > \u002Fdev\u002Fnull; } ||\n           ! uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$M\u002Fhome-id\" > \u002Fdev\u002Fnull; then\n           echo \"not archived: $M\u002Fhandoff.md could not be moved, jbus retire did not archive $M\u002Fplan.md, or $M\u002Fhome-id was not removed. Run this again once that is put right.\"\n           exit 1\n       fi\n   fi\n   if [ -f \"$note\" ]; then uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$note\" > \u002Fdev\u002Fnull; fi\n   if [ -n \"$scope\" ]; then\n       what=\"scope $scope is closed, and what it had out is the uncategorized home's\"\n   else\n       what=\"the root home is archived, and $R has no home until someone types \u002Fhome\"\n   fi\n   if [ -n \"$again\" ]; then\n       echo \"archived before: $what. Start no home: switch off its scheduled tasks, tell the user, then rename and settle this thread\"\n   else\n       echo \"archived: $what. Start no home: switch off its scheduled tasks, tell the user, then rename and settle this thread\"\n   fi\n   printf 'note: %s\\n' \"$kept\"\n   awk '\u002F^(Moved to the root|Moved to uncategorized|Left with no home):\u002F {on = 1; print; next} on && \u002F^- \u002F {print; next} {on = 0}' \"$kept\"\n   printf 'title: home: %s%s\\n' \"$R\" \"${scope:+ $scope}\"\n   jq -rs --arg me \"$ME\" '\n       if length == 1 and (.[0].tasks | type) == \"array\" then .[0] else error(\"no tasks\") end\n       | [.tasks[] | select(.boundThreadId == $me)]\n       | if length == 0 then \"none: no scheduled task posts into this thread\" else .[] end\n       | if type == \"string\" then .\n         else \"switch off \\(.scheduledTaskId): \\(.title) posts into this thread, and no home takes it over\" end' 2> \u002Fdev\u002Fnull \u003C\u003C 'THE_REPLY_ENDS_HERE' ||\n   \u003Cthe reply of list_scheduled_tasks>\n   THE_REPLY_ENDS_HERE\n       echo \"not read: put the whole reply of list_scheduled_tasks in place of the placeholder\"\n   ```\n\n   It does it all, in this order: it reads the note, asks jbus what this home has out, hands each open gate of a scoped home's `gates.md` to jbus as a question of the `uncategorized` home's, but a gate the home asked itself, under this home's own slug, the key it was asked under, so jbus asks a gate it holds nothing again (`features\u002Fjbus\u002Fspec\u002FOneList.tla`, `AnsweredLeaves`), keeps one jbus refuses whole in the note, and renames the file `gates-moved.md`, keeps the note in `$M\u002Flog\u002F` under a dated name with an `Archived:` line, the list of what was out and a `Was home:` line with this thread's id, moves an older `handoff.md` beside it, has `jbus retire` carry the fixes a scoped home's `blockers.json` counts to the catch-all's ledger and move its `plan.md` to `plan-archived.md`, under both homes' locks, and removes `home-id`.\n   Once `plan.md` is gone, each brief that named the scope is the catch-all's, and admit counts its fixes there, so a fix tried in the scope stays counted against its cap.\n   A second run changes nothing and prints `archived before`, with the same lines under it.\n   Its first line is what the steps below go by, and the lines under it are what step 4 tells the user and step 5 renames by: keep all of them.\n\n   - `not known:`, `not written:` and `not archived:`: nothing is archived.\n     Put right what it names, and run it again.\n     A note whose lines will not fit in ten is cut, not split: jbus holds the rest.\n   - `not the home:`: this thread's id is in no `home-id` and on no archived home's note.\n     Tell the user so, in three lines at most, and launch, rename and settle nothing.\n     The skill ends here.\n   - `archived` or `archived before`: go on with step 4.\n\n   What a home has out is what `jbus out` prints for it: each queue row of its briefs that is not over, each entry whose go holds with no live row, each of their crew or reviewer threads that is not settled, each question jbus holds for it and each open gate of its `gates.md`.\n   The block writes each under `Moved to uncategorized:` for a scoped home and under `Left with no home:` for the root, and prints them under its first line.\n   A scope is a home only while its directory has a `plan.md`, so once the block has run, every brief whose `Home:` line names the scope is the `uncategorized` home's by the rule `jbus home` keeps (`features\u002Fjbriefs\u002Fsrc\u002Fjbriefs\u002Fhome.py`): the root home owns no row.\n   jbus sends the `uncategorized` home what each of its threads has to tell, or the root home's thread while `uncategorized` has no home of its own, `jmerge` merges its pull requests as `uncategorized`'s, and that home's start lists its rows as its own: nothing is rewritten and nothing is sent.\n   With `plan.md` moved, jbus and the jstack tree count the scope as no home, and `\u002Fhome \u003Cscope>` moves it back and starts it again (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, step 1).\n   A root home that is archived leaves the repo with no home: jbus keeps running its queue and merging, a thread with something to tell finds no `home-id` and sends nothing, and its report waits on disk for the home someone starts with `\u002Fhome`.\n\n   A home's own `home-id` holds its id: the home's start wrote it there, and nothing else does.\n   `home-thread` is another file, the switch that has a home run the sweep: it is set by hand, and the block leaves it as it is.\n   The block changes only this home's directory, and no other home's files.\n   The `Was home:` line is the last line of the note: \"After the handoff\" reads it to say whose mail a late message is, and the start of a home of the same directory reads it to take over this thread's scheduled tasks and to settle this thread (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, \"The home before this one\").\n\n4. **Switch off its scheduled tasks, and tell the user.**\n   No home comes after this one to take a scheduled task over, so switch off each one the block printed a `switch off` line for, with the `t3-code` server's `update_scheduled_task` (if your harness defers it, load it first), `{\"scheduledTaskId\": \"\u003CscheduledTaskId>\", \"enabled\": false}`.\n   A task that is off runs nothing, so it cannot make this thread active again, and it keeps its address for a home started later in this directory to take over.\n   Delete none.\n   On `not read`, in a session with no such tool, there is nothing to do: tell the user that a task bound to this thread may still run.\n   Then tell the user, in three lines at most: the note's path, what moved to the `uncategorized` home (or, for the root, that the repo has no home until someone types `\u002Fhome`, with what was out), each task that is now off, and each gate the note carries.\n\n5. **Rename and settle.**\n\n   1. Rename this thread with `t3_thread_update`, so the list shows which home it was and that it is archived:\n\n      ```json\n      {\"action\": \"rename\", \"title\": \"\u003Ctitle> (archived \u003Cdate>)\"}\n      ```\n\n      `\u003Ctitle>` is what step 3 printed after `title: `.\n      `\u003Cdate>` is today as `date +%F` prints it.\n      No `threadId` means this thread.\n   2. Last, settle this thread with `t3_thread_organize`:\n\n      ```json\n      {\"action\": \"settle\"}\n      ```\n\n      It takes effect when the turn ends, so it is the last call of the handoff.\n      It clears this thread's pin with it.\n      A turn that fails or is cut off, or a message that comes in, leaves this thread active and pinned, and the reply of the call does not say which: a home started later in this directory looks at this thread and settles it if it has to (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, \"The home before this one\").\n\n## A party's home\n\nA party's home plans nothing, briefs nothing and launches nothing but its own next thread.\nIts handoff is its page and that launch, with no plan, no merge and no seed.\nTwo things, in order:\n\n1. **Write the new page**, at the path the first block printed after `write: `, `handoff.next.md` in the party's folder, in the shape its `handoff.md` has: the party's own, and not `$T\u002Fhandoff.md`. A party with no page yet writes where things stand, what is next and what is open. Facts and pointers, as step 2 says of a home's. Leave `handoff.md` as it is, and write no `Was home:` line: the next block does both.\n\n2. **Close, and start the next thread.** Run this with the block at the top:\n\n   ```sh\n   ME='\u003CthreadId>'\n   again=\n   if ! party_home \"$ME\"; then\n       handed_off \"$ME\"\n       case $L in\n       \"${H%\u002F*}\"\u002F_*) if [ ! -e \"$L\u002Fhome-id\" ]; then again=yes M=$L P=${L##*\u002F_}; fi ;;\n       esac\n       if [ -z \"$again\" ]; then\n           echo \"not a party's home: the id of thread $ME is in no ${H%\u002F*}\u002F_*\u002Fhome-id. Nothing is written.\"\n           exit 1\n       fi\n   fi\n   if [ -z \"$again\" ] && [ ! -s \"$M\u002Fhandoff.next.md\" ]; then\n       echo \"not written: $M\u002Fhandoff.next.md is not there. Write the new page to it, then run this again.\"\n       exit 1\n   fi\n   page=$M\u002FRESTART.md\n   boot=\n   if [ -f \"$page\" ]; then\n       boot=$(awk '\u002F^[ \\t]*```\u002F {if (open) last = text; text = \"\"; open = !open; next} open {text = text $(0) \"\\n\"} END {printf \"%s\", last}' \"$page\")\n   fi\n   told=\"Thread $ME, the $P thread before this one, handed off with \u002Fhandoff and is settled: send it nothing. Before anything else, read \\\"The thread a party's handoff started\\\" in $(realpath \"$T\u002F..\u002Fskills\u002Fhandoff\u002FSKILL.md\") and do what it says, with $P in place of \u003Cparty>. Then start from $M\u002Fhandoff.md${boot:+ and $page}.\"\n   first=\"You are the next thread of $P's home, in $M.\"\n   message=$(printf '%s\\n\\n%s\\n' \"${boot:-$first}\" \"$told\")\n   title=\"home: $P\"\n   model=$(uv run --project \"$T\u002F..\u002Fsource\" jroles expert) || model=\n   if ! launch=$(jq -cn --arg title \"$title\" --arg message \"$message\" --argjson selection \"${model:-null}\" '{title: $title, workspaceStrategy: {type: \"root\"}, message: $message} + if $selection then {modelSelection: $selection} else {} end') ||\n       ! rename=$(jq -cn --arg title \"$title (handed off $(date +%F))\" '{action: \"rename\", title: $title}'); then\n       echo \"not closed: jq did not run, and nothing is changed\"\n       exit 1\n   fi\n   if [ -n \"$again\" ]; then\n       echo \"closed before: $M\u002Fhandoff.md names this thread and $M\u002Fhome-id is gone. Launch only if no next thread was started\"\n   else\n       log=$M\u002Flog\n       kept=$log\u002F$(date +%F-%H%M)-handoff.md\n       if [ -e \"$kept\" ]; then kept=$log\u002F$(date +%F-%H%M%S)-handoff.md; fi\n       if { [ ! -f \"$M\u002Fhandoff.md\" ] || { mkdir -p \"$log\" && mv \"$M\u002Fhandoff.md\" \"$kept\"; }; } &&\n           sed '\u002F^Was home:\u002Fd' \"$M\u002Fhandoff.next.md\" > \"$M\u002Fhandoff.md\" &&\n           printf '\\nWas home: %s\\n' \"$ME\" >> \"$M\u002Fhandoff.md\" &&\n           uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$M\u002Fhandoff.next.md\" \"$M\u002Fhome-id\" > \u002Fdev\u002Fnull; then\n           echo \"a party's home: start its next thread, then rename and settle this thread\"\n       else\n           echo \"not closed: the old page could not be moved to $log, or the new one not written to $M\u002Fhandoff.md. Launch nothing, and run this again once that is put right.\"\n           exit 1\n       fi\n   fi\n   printf 'launch: %s\\nrename: %s\\nsettle: {\"action\": \"settle\"}\\n' \"$launch\" \"$rename\"\n   ```\n\n   The old page is in `log\u002F` under a dated name, the new one is `handoff.md` and ends in a `Was home:` line with this thread's id, and `home-id` is gone, so a second run changes nothing.\n   On `not a party's home:`, `not written:` or `not closed:`, nothing is launched: do what the line says, or tell the user.\n   On `closed before`, an earlier run of this block closed and its turn may have been cut before the launch: look for the next thread as \"A lost launch\" says, with the title on the `launch:` line.\n   With none, go on as on `a party's home`.\n   With one, launch nothing, and only rename and settle.\n\n   On `a party's home`, first stop what this thread has running in the background, as step 1 does. Then make three calls, in the order printed, each with the object after its word, as printed: `launch:` with the `t3-code` server's `t3_thread_launch`, `rename:` with `t3_thread_update`, `settle:` with `t3_thread_organize`, the last call of the turn (if your harness defers one, load it first). Between the launch and the rename, tell the user in three lines at most what was written, and the link to the next thread, `[\u003Ctitle>](t3-thread:\u002F\u002Fv1\u002F\u003Cits threadId>)`.\n\n   The root workspace is the main checkout of the project this thread is in, which is the party's folder, and the project and the modes are this thread's.\n   The model is the one the role map names for `expert`, for any party that hands off here, and that is never an expert, whose rollover is not this skill's: the block asks `jroles` for it, and the `launch:` line has it as `modelSelection`.\n   With no line for that role the call has no `modelSelection`, and the next thread runs on this thread's model.\n   A line the block prints on stderr says why the map gives no model: the launch is made all the same, and the user is told that line.\n   The message is the last fenced block of the folder's `RESTART.md`, the one a new thread of the party is started with by hand, and under it the lines that send the next thread to the section below.\n   With no such page it is those lines alone.\n   A launch has no retry key: if the call fails or its reply is lost, look for the thread as \"A lost launch\" says before launching again.\n   If the launch fails all the same, or the session has no `t3_thread_launch`, give the user the message to start a thread with, and rename and settle nothing.\n\n### A lost launch\n\nA launch has no retry key.\nIf the call fails or its reply is lost, look for the thread with `t3_thread_list` before launching again, so there are never two:\n\n```json\n{\"titleContains\": \"\u003Ctitle>\"}\n```\n\nThe list holds every thread whose title has those words, this thread among them, which still has that title.\nThe next thread is the one with exactly that title that is newer than this one.\n\n### The thread a party's handoff started\n\nThe message that started this thread sent it here.\nThis thread is no home by the home skill, and reads this section of this file and the block at the top, and no other part.\nGet this thread's id from the `t3-code` server's `t3_thread_configure` with no arguments, as `threadId`, and call `list_scheduled_tasks` with no arguments (if your harness defers one, load it first).\nThen run this with the block at the top, with the id, the name the message gives, and the whole reply in place of the words in angle brackets:\n\n```sh\nME='\u003CthreadId>'\nP='\u003Cparty>'\nM=${H%\u002F*}\u002F_$P\ncase $ME$P in\n'' | *'\u003C'* | *'>'* | *' '* | *\u002F*) M= ;;\nesac\nif [ -z \"$ME\" ] || [ -z \"$M\" ] || [ ! -f \"$M\u002Fhandoff.md\" ]; then\n    echo \"not written: this needs the thread's id and the name of a party whose folder under ${H%\u002F*} has a handoff.md\"\nelif [ \"$(cat \"$M\u002Fhome-id\" 2> \u002Fdev\u002Fnull)\" != \"$ME\" ] && ! (set -C && printf '%s\\n' \"$ME\" > \"$M\u002Fhome-id\") 2> \u002Fdev\u002Fnull; then\n    echo \"not written: $M\u002Fhome-id holds $(cat \"$M\u002Fhome-id\" 2> \u002Fdev\u002Fnull), another thread, which is the party's now. Take no task over, and tell the user.\"\nelse\n    echo \"written: $M\u002Fhome-id\"\n    was=$(sed -n 's\u002F^Was home:[[:space:]]*\\([^[:space:]]*\\).*\u002F\\1\u002Fp' \"$M\u002Fhandoff.md\" | head -n 1)\n    if [ -z \"$was\" ] || [ \"$was\" = \"$ME\" ]; then\n        echo \"no thread before this one: $M\u002Fhandoff.md names none, so no task is taken over\"\n    else\n        jq -rs --arg was \"$was\" '\n            if length == 1 and (.[0].tasks | type) == \"array\" then .[0] else error(\"no tasks\") end\n            | [.tasks[] | select(.boundThreadId == $was)]\n            | if length == 0 then \"none: no scheduled task posts into \\($was)\" else .[] end\n            | if type == \"string\" then .\n              else \"take \\(.scheduledTaskId): \\(.title) posts into \\($was), the thread before this one\" end' 2> \u002Fdev\u002Fnull \u003C\u003C 'THE_REPLY_ENDS_HERE' ||\n\u003Cthe reply of list_scheduled_tasks>\nTHE_REPLY_ENDS_HERE\n            echo \"not read: put the whole reply of list_scheduled_tasks in place of the placeholder\"\n    fi\nfi\n```\n\nOn `written:`, this thread's id is in the party's `home-id`, where whoever sends to the party reads it. It prints one line for each scheduled task that posts into the thread that handed off, and never a task's address. On `take \u003Cid>`, take the task over with the `t3-code` server's `update_scheduled_task` (if your harness defers it, load it first), `{\"scheduledTaskId\": \"\u003CscheduledTaskId>\", \"bindToCurrentThread\": true}`, and nothing else in the call: the task keeps its title, its prompt, its schedule and, for a webhook, its address, and one that was switched off stays off. After the calls, list the tasks again and run the block again: it prints `none` when every one is taken. A task it still prints had its call refused: tell the user its id and what the call answered, and make no second call. On `none` and `no thread before this one`, there is nothing to take. On `not written:` or `not read:`, fill in what the line names and run it again. A `not written:` that names another thread is not filled in: that thread started first and is the party's, so this one does nothing more.\n\nThen go on as the message says, from the party's handoff and its restart page.\n\n## After the handoff\n\nA home that is archived does nothing more.\nIts briefs name no thread, and a thread or a party that sends to the repo's home reads its `home-id` first, so a message should not reach it.\nIf one still does (a thread that kept an old id, a direct message, the user), run this with the block at the top before anything else:\n\n```sh\nME='\u003CthreadId>'\ncase $ME in\n'' | *'\u003C'* | *'>'*)\n    echo \"not known: put this thread's id in place of the placeholder. With no tool that gives it, do not act on the message: tell the sender to read $H\u002Fhome-id\" ;;\n*)\n    if this_home \"$ME\" > \u002Fdev\u002Fnull; then\n        echo \"a home: this thread's id is in $M\u002Fhome-id, so the message is this thread's to act on\"\n    else\n        handed_off \"$ME\"\n        next=\n        if [ -n \"$L\" ]; then next=$(awk 'NF {print $(1); exit}' \"$L\u002Fhome-id\" 2> \u002Fdev\u002Fnull); fi\n        case $L in\n        \"$H\" | \"$H\"\u002F*) if [ -z \"$next\" ]; then next=$(awk 'NF {print $(1); exit}' \"$H\u002Fhome-id\" 2> \u002Fdev\u002Fnull); fi ;;\n        esac\n        if [ -z \"$L\" ]; then\n            echo \"no home's: this thread's id is in no home-id and on no archived home's Was home: line, so no file says whose mail this is. Do not act on the message: tell the sender to read $H\u002Fhome-id\"\n        elif [ -n \"$next\" ] && [ \"$next\" != \"$ME\" ] && [ \"$L\" = \"${H%\u002F*}\u002F_${L##*\u002F_}\" ]; then\n            echo \"handed off: this thread's id is in no home-id. Do not act on the message and send it on to nobody: tell the sender, once, that $next is the home now\"\n        elif [ \"$L\" = \"${H%\u002F*}\u002F_${L##*\u002F_}\" ]; then\n            echo \"handed off: this thread's id is in no home-id, and $L\u002Fhome-id holds none yet. Do not act on the message and send it on to nobody: tell the sender, once, the id this thread's own launch of the next thread gave. With no such launch, tell the sender to read $L\u002Fhandoff.md\"\n        elif [ -n \"$next\" ] && [ \"$next\" != \"$ME\" ]; then\n            echo \"archived: this thread's id is in no home-id. Do not act on the message and send it on to nobody: tell the sender, once, that $next is the home now\"\n        else\n            echo \"archived: this thread's id is in no home-id, and $R has no home now. Do not act on the message and send it on to nobody: tell the sender, once, that $R has no home until someone types \u002Fhome, and that $H\u002Fhome-id names it then\"\n        fi\n    fi ;;\nesac\n```\n\nOn `a home`, this thread is not archived: go by the home skill.\nOn any other line, do not act on the message: no run, no launch, no merge, no change to the plan, whatever it asks and whoever sent it.\nDo what the line says and nothing more.\n`no home's` is a thread that never was a home: nothing is sent on.\nThe home it names on an `archived` line is the one the archived home's own directory has now, a home started there again, or else the root home.\nA `handed off` line is a party's, and names its next thread.\n\nOne kind of message is neither sent on nor answered, whatever the line says: one of this skill's own.\nIts first line has `handed off, and this was sent to it by`, or it starts `the home of \u003Crepo> is \u003Cid> now`, `\u003Crepo>: the home is \u003Cid> now` or `\u003Crepo>: there is no home now`.\nSettle again and end the turn, so that two archived threads never answer each other.\n\nA message is never sent on: the sender sends it again, to the id it is told.\nBetween two homes of one repo the send would be refused anyway, since `features\u002Fhome\u002Fhooks\u002Fagent-sends.sh` refuses a thread that was a home sending to its repo's home now.\nTell the sender with `t3_thread_send`, to its own id, once: a call whose reply is lost is not sent again.\nOn a line that names the home now:\n\n```json\n{\"threadId\": \"\u003Cthread>\", \"message\": \"\u003Crepo>: the home is \u003Cthe home's id> now, and your message was not sent on to it. Send it there if it still stands, and read the id in \u003Cthe home-id file> before each send.\"}\n```\n\nOn a line that says the repo has no home, the `t3_thread_send` is this one:\n\n```json\n{\"threadId\": \"\u003Cthread>\", \"message\": \"\u003Crepo>: there is no home now, and your message was not sent on. A home starts when someone types \u002Fhome: read the id in \u003Cthe home-id file> before each send.\"}\n```\n\nThe user is told the same in one line here, with the link to the home now, `[\u003Ctitle>](t3-thread:\u002F\u002Fv1\u002F\u003Cits threadId>)`, where there is one.\nWhere the line names a file and no id, the sender is told that path.\nThen settle this thread again.\n\nA crewmate thread (`\u002Fcrew \u003Cslug>`) never runs this skill. It ends by writing its `## Result`, as the `crew` skill says.\n","# handoff\n\n```sh\nR=$(basename \"$(dirname \"$(git rev-parse --path-format=absolute --git-common-dir)\")\")\nH=~\u002F.local\u002Fstate\u002Fhome\u002F$R\nT=$(realpath ~\u002F.claude\u002Fskills\u002Fhandoff\u002F..\u002F..\u002Ftemplates)\nif [ -n \"${ZSH_VERSION:-}\" ]; then emulate sh; fi\nthis_home() {\n    M=\n    case ${1} in\n    '') M=$H ;;\n    *)\n        for f in \"$H\"\u002Fhome-id \"$H\"\u002F*\u002Fhome-id; do\n            if [ -f \"$f\" ] && [ \"$(awk 'NF {print $(1); exit}' \"$f\")\" = \"${1}\" ]; then\n                M=$(dirname \"$f\")\n                break\n            fi\n        done ;;\n    esac\n    if [ -z \"$M\" ]; then\n        echo \"no home: thread ${1} is no home of $R now, its id is in no home-id under $H. Nothing is written.\"\n        return 1\n    fi\n}\nhanded_off() {\n    L=\n    F=\n    for f in \"$H\"\u002Fhandoff.md \"$H\"\u002F*\u002Fhandoff.md \"$H\"\u002Flog\u002F*.md \"$H\"\u002F*\u002Flog\u002F*.md \"${H%\u002F*}\"\u002F_*\u002Fhandoff.md; do\n        if [ -n \"${1}\" ] && [ -f \"$f\" ] && [ \"$(sed -n 's\u002F^Was home:[[:space:]]*\\([^[:space:]][^[:space:]]*\\).*\u002F\\1\u002Fp' \"$f\" | head -n 1)\" = \"${1}\" ]; then\n            F=$f\n            L=$(dirname \"$f\")\n            case $L in *\u002Flog) L=${L%\u002Flog} ;; esac\n            break\n        fi\n    done\n}\nparty_home() {\n    M=\n    P=\n    for f in \"${H%\u002F*}\"\u002F_*\u002Fhome-id; do\n        if [ -n \"${1}\" ] && [ -f \"$f\" ] && [ ! -f \"${f%\u002F*}\u002FCHARTER.md\" ] && [ \"$(awk 'NF {print $(1); exit}' \"$f\")\" = \"${1}\" ]; then\n            M=$(dirname \"$f\")\n            P=${M##*\u002F_}\n            break\n        fi\n    done\n    [ -n \"$M\" ]\n}\n```\n\nThat is **the block at the top**: run it in the same call as each block below. Every block is sh, and the line before `this_home` makes zsh read them so. `$H` is the repo's state directory, which every home of the repo shares. `$T` is the `templates\u002F` directory of the repo this skill lives in. Each template there is the one copy of its text: read it when a step names it, not before.\n\nA handoff archives a home, and starts no home after it.\nA repo has one root home, and may have scoped homes beside it (`skills\u002Fhome\u002FSKILL.md`, \"Where a home's state lives\"), and each is archived in its own directory, `$M`: `$H` for the root home, `$H\u002F\u003Cscope>` for a scoped one.\n`this_home` sets it as the home skill does, from the one `home-id` that holds this thread's id.\n`handed_off` sets `$F` to the note that names a thread on its `Was home:` line, which step 3 writes, and `$L` to the directory of the home the thread was, or both to nothing.\nEach block below is run with that id in place of `\u003CthreadId>`: the `t3-code` server's `t3_thread_configure` with no arguments gives it as `threadId` (if your harness defers it, load it first).\nIn a session with no tool that gives the id, put nothing in its place: the blocks then archive nothing.\n\nA party that is no repo's home hands off too, to a next thread of its own.\nIts folder is `~\u002F.local\u002Fstate\u002Fhome\u002F_\u003Cname>`, beside the repos' state directories, and holds its thread id in a `home-id`.\n`party_home` finds it by that id, and sets `$M` to the folder and `$P` to the name.\nIt finds no expert, whose folder has a `CHARTER.md`: an expert rolls over as `$T\u002F..\u002Fskills\u002Fexpert\u002FSKILL.md` \"When to roll over\" says, and never by this skill.\n`handed_off` finds a party that handed off as it finds a home.\n\nBefore step 1, see which home this is:\n\n```sh\ncase '\u003CthreadId>' in\n'')\n    echo \"not known: the session gives no id for this thread, so no home is archived. Tell the user to run \u002Fhandoff in the home's own thread in T3 Code.\"\n    exit ;;\nesac\nif ! this_home '\u003CthreadId>' > \u002Fdev\u002Fnull && party_home '\u003CthreadId>'; then\n    printf 'party %s\\nhandoff: %s\\nwrite: %s\\n' \"$P\" \"$M\u002Fhandoff.md\" \"$M\u002Fhandoff.next.md\"\n    exit\nfi\nif ! this_home '\u003CthreadId>' > \u002Fdev\u002Fnull; then\n    handed_off '\u003CthreadId>'\n    case $F in\n    \"$H\"\u002Flog\u002F* | \"$H\"\u002F*\u002Flog\u002F*)\n        echo \"archived before: $F names this thread, so an earlier run archived this home: go to step 3\"\n        exit ;;\n    esac\nfi\nthis_home '\u003CthreadId>' || exit 1\nif [ \"$M\" = \"$H\" ]; then echo \"root\"; else echo \"scope ${M##*\u002F}\"; fi\nprintf 'write: %s\\n' \"$M\u002Fhandoff.next.md\"\n```\n\nIt prints which home this is and where step 2 writes the note.\nOn `party \u003Cname>`, this thread is that party's home and no repo's: do none of the steps below, and go by \"A party's home\".\nOn `archived before`, an earlier turn of this handoff archived the home and was cut off after it: run step 1, then step 3 and what follows it.\nOn `not known:` or `no home:`, nothing is written.\nThis thread is no home now: a crewmate, an ordinary thread, or a home that another took the place of.\nTell the user so in three lines at most, with what this thread leaves undone, and end here.\n\n## Steps\n\n1. **Stop what runs in the background.**\n   A watch or a loop this thread holds: stop each by its process id.\n   This thread is finished and must have nothing left that wakes it.\n   Each one goes in the note, under `Out, not on the bus:`, with what it watched.\n   Then run `git status --short` and `git log --oneline @{upstream}..` in each worktree this thread used, the main checkout included: each path and commit they print goes under `Uncommitted:` with its branch, and `none` only when both print nothing there.\n\n2. **Write the note**, at the path the block above printed after `write: `, in the shape of `$T\u002Fhandoff.md`: read it now.\n   It is the record of the archived home, kept in its `log\u002F`, and no home starts from it.\n   It holds only what nothing else holds: jbus holds the plan, the queue, the questions and what merged, so none of that is written here.\n   A rule of the user's is no line of it either: a standing rule is code, the text of the skill step that needs it, or a queued row, which the home queued when it heard it.\n   Facts and pointers, not narrative: a path or a thread id in place of an explanation.\n\n   A gate jbus could not take, which came as a message or sits in a Result or a Report, is held by nothing else while it is unanswered: write it under the labels, whole, with its default and its `Asked by:` and `Undo:` lines. The gates are not counted in the note's ten lines.\n\n3. **Archive.**\n   Call the `t3-code` server's `list_scheduled_tasks` (if your harness defers it, load it first) with no arguments.\n   Then run this with the block at the top, with this thread's id in place of `\u003CthreadId>` and the whole reply in place of the line in angle brackets.\n   In a session with no such tool, leave the line as it is:\n\n   ```sh\n   ME='\u003CthreadId>'\n   N=10 # lines a note has at most, its gates not counted\n   case $ME in\n   '' | *'\u003C'* | *'>'* | *' '*)\n       echo \"not known: put this thread's id in place of the placeholder. With no tool that gives it, nothing is archived: tell the user to run \u002Fhandoff in the home's own thread in T3 Code.\"\n       exit 1 ;;\n   esac\n   again=\n   if ! this_home \"$ME\" > \u002Fdev\u002Fnull; then\n       handed_off \"$ME\"\n       case $F in\n       \"$H\"\u002Flog\u002F* | \"$H\"\u002F*\u002Flog\u002F*) again=yes M=$L ;;\n       *)\n           echo \"not the home: this thread's id is in no home-id under $H and on no archived home's note. Nothing is archived, tell the user.\"\n           exit 1 ;;\n       esac\n   fi\n   scope=\n   if [ \"$M\" != \"$H\" ]; then scope=${M##*\u002F}; fi\n   note=$M\u002Fhandoff.next.md\n   if [ -n \"$again\" ]; then\n       kept=$F\n   else\n       why=\n       if [ ! -s \"$note\" ]; then\n           why=\"$note is not there\"\n       elif command grep -q '^\u003C' \"$note\"; then\n           why=\"a line of it is still the template's\"\n       else\n           above=$(awk '\u002F^## Gate\u002F {exit} NF' \"$note\")\n           lines=$(printf '%s\\n' \"$above\" | command grep -c .)\n           if [ \"$lines\" -gt \"$N\" ]; then why=\"it has $lines lines above its gates, and a note has at most $N\"; fi\n       fi\n       if [ -z \"$why\" ]; then\n           why=$(sed -n 's\u002F^\\([A-Z][^:\u003C]*:\\) \u003C.*\u002F\\1\u002Fp' \"$T\u002Fhandoff.md\" | while IFS= read -r label; do\n               printf '%s\\n' \"$above\" | command grep -q \"^$label [^\u003C]\" || echo \"it has no $label line above its gates that is filled in\"\n           done | head -n 1)\n       fi\n       if [ -n \"$why\" ]; then\n           echo \"not written: $why. Write the note there in the shape of $T\u002Fhandoff.md, then run this again.\"\n           exit 1\n       fi\n       handed_off \"$ME\"\n       kept=\n       case $F in \"$M\"\u002Flog\u002F*) kept=$F ;; esac\n       if [ -z \"$kept\" ]; then\n           if ! out=$(jbus out --scope \"${scope:-.}\" 2>&1); then\n               out=\"not known, jbus said: ${out:-nothing}\"\n           fi\n           if [ -n \"$scope\" ] && [ -f \"$M\u002Fgates.md\" ]; then\n               sep=$(printf '\\037')\n               moved=$(awk -v sep=\"$sep\" '\n                   function out() { if (open) printf \"%s%s%s%s%s\\n\", n, sep, by, sep, entry; entry = by = \"\"; open = 0 }\n                   \u002F^## Gate [0-9]+: \u002F { out(); n = $(3); sub(\u002F:$\u002F, \"\", n) }\n                   \u002F^$\u002F { next }\n                   \u002F^Status: open$\u002F { open = 1 }\n                   \u002F^Asked by: \u002F { by = $(0); sub(\u002F^Asked by: \u002F, \"\", by); sub(\u002F,.*\u002F, \"\", by) }\n                   { entry = entry $(0) \"\\002\" }\n                   END { out() }' \"$M\u002Fgates.md\" | while IFS=$sep read -r n by entry; do\n                   whose=\"the uncategorized home's\"\n                   if [ -z \"$by\" ] || [ \"$by\" = home ] || [ \"$by\" = \"home-$scope\" ]; then by=home-$scope whose=\"this home's own question\"; fi\n                   if said=$(printf '%s\\n' \"$entry\" | tr '\\002' '\\n' | jbus gate \"$by\" 2>&1); then\n                       echo \"gate $n of gates.md is $whose, $(printf '%s\\n' \"${said#asked: }\" | head -n 1)\"\n                   else\n                       echo \"gate $n of gates.md is kept whole in this note, jbus said: $(printf '%s' \"${said#not asked: }\" | head -n 1)\"\n                       printf 'KEEP%s\\n' \"$entry\"\n                   fi\n               done)\n               held=$(printf '%s\\n' \"$moved\" | sed -n 's\u002F^KEEP\u002F\u002Fp' | tr '\\002' '\\n')\n               moved=$(printf '%s\\n' \"$moved\" | command grep -v '^KEEP')\n               if ! mv \"$M\u002Fgates.md\" \"$M\u002Fgates-moved.md\"; then\n                   echo \"not archived: $M\u002Fgates.md could not be renamed to gates-moved.md. Run this again once that is put right.\"\n                   exit 1\n               fi\n               out=$(printf '%s\\n%s\\n' \"$out\" \"$moved\" | command grep .)\n           fi\n           if [ -n \"$scope\" ]; then label=\"Moved to uncategorized:\"; else label=\"Left with no home:\"; fi\n           kept=$M\u002Flog\u002F$(date +%F-%H%M).md\n           if [ -e \"$kept\" ]; then kept=$M\u002Flog\u002F$(date +%F-%H%M%S).md; fi\n           if ! mkdir -p \"$M\u002Flog\" || ! {\n               sed '\u002F^Was home:\u002Fd; \u002F^Archived:\u002Fd; \u002F^Moved to the root:\u002Fd; \u002F^Moved to uncategorized:\u002Fd; \u002F^Left with no home:\u002Fd' \"$note\"\n               if [ -n \"${held:-}\" ]; then printf '\\n%s\\n' \"$held\"; fi\n               printf '\\nArchived: %s, and no home was started after this one.\\n' \"$(date +%F)\"\n               if [ -z \"$out\" ]; then\n                   printf '%s none\\n' \"$label\"\n               else\n                   printf '%s\\n' \"$label\"\n                   printf '%s\\n' \"$out\" | sed 's\u002F^\u002F- \u002F'\n               fi\n               printf '\\nWas home: %s\\n' \"$ME\"\n           } > \"$kept\"; then\n               echo \"not archived: the note could not be written to $kept. Run this again once that is put right.\"\n               exit 1\n           fi\n       fi\n       if ! { [ ! -f \"$M\u002Fhandoff.md\" ] || mv \"$M\u002Fhandoff.md\" \"${kept%.md}-before.md\"; } ||\n           ! { [ -z \"$scope\" ] || uv run --project \"$T\u002F..\u002Fsource\" jbus retire \"$M\" > \u002Fdev\u002Fnull; } ||\n           ! uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$M\u002Fhome-id\" > \u002Fdev\u002Fnull; then\n           echo \"not archived: $M\u002Fhandoff.md could not be moved, jbus retire did not archive $M\u002Fplan.md, or $M\u002Fhome-id was not removed. Run this again once that is put right.\"\n           exit 1\n       fi\n   fi\n   if [ -f \"$note\" ]; then uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$note\" > \u002Fdev\u002Fnull; fi\n   if [ -n \"$scope\" ]; then\n       what=\"scope $scope is closed, and what it had out is the uncategorized home's\"\n   else\n       what=\"the root home is archived, and $R has no home until someone types \u002Fhome\"\n   fi\n   if [ -n \"$again\" ]; then\n       echo \"archived before: $what. Start no home: switch off its scheduled tasks, tell the user, then rename and settle this thread\"\n   else\n       echo \"archived: $what. Start no home: switch off its scheduled tasks, tell the user, then rename and settle this thread\"\n   fi\n   printf 'note: %s\\n' \"$kept\"\n   awk '\u002F^(Moved to the root|Moved to uncategorized|Left with no home):\u002F {on = 1; print; next} on && \u002F^- \u002F {print; next} {on = 0}' \"$kept\"\n   printf 'title: home: %s%s\\n' \"$R\" \"${scope:+ $scope}\"\n   jq -rs --arg me \"$ME\" '\n       if length == 1 and (.[0].tasks | type) == \"array\" then .[0] else error(\"no tasks\") end\n       | [.tasks[] | select(.boundThreadId == $me)]\n       | if length == 0 then \"none: no scheduled task posts into this thread\" else .[] end\n       | if type == \"string\" then .\n         else \"switch off \\(.scheduledTaskId): \\(.title) posts into this thread, and no home takes it over\" end' 2> \u002Fdev\u002Fnull \u003C\u003C 'THE_REPLY_ENDS_HERE' ||\n   \u003Cthe reply of list_scheduled_tasks>\n   THE_REPLY_ENDS_HERE\n       echo \"not read: put the whole reply of list_scheduled_tasks in place of the placeholder\"\n   ```\n\n   It does it all, in this order: it reads the note, asks jbus what this home has out, hands each open gate of a scoped home's `gates.md` to jbus as a question of the `uncategorized` home's, but a gate the home asked itself, under this home's own slug, the key it was asked under, so jbus asks a gate it holds nothing again (`features\u002Fjbus\u002Fspec\u002FOneList.tla`, `AnsweredLeaves`), keeps one jbus refuses whole in the note, and renames the file `gates-moved.md`, keeps the note in `$M\u002Flog\u002F` under a dated name with an `Archived:` line, the list of what was out and a `Was home:` line with this thread's id, moves an older `handoff.md` beside it, has `jbus retire` carry the fixes a scoped home's `blockers.json` counts to the catch-all's ledger and move its `plan.md` to `plan-archived.md`, under both homes' locks, and removes `home-id`.\n   Once `plan.md` is gone, each brief that named the scope is the catch-all's, and admit counts its fixes there, so a fix tried in the scope stays counted against its cap.\n   A second run changes nothing and prints `archived before`, with the same lines under it.\n   Its first line is what the steps below go by, and the lines under it are what step 4 tells the user and step 5 renames by: keep all of them.\n\n   - `not known:`, `not written:` and `not archived:`: nothing is archived.\n     Put right what it names, and run it again.\n     A note whose lines will not fit in ten is cut, not split: jbus holds the rest.\n   - `not the home:`: this thread's id is in no `home-id` and on no archived home's note.\n     Tell the user so, in three lines at most, and launch, rename and settle nothing.\n     The skill ends here.\n   - `archived` or `archived before`: go on with step 4.\n\n   What a home has out is what `jbus out` prints for it: each queue row of its briefs that is not over, each entry whose go holds with no live row, each of their crew or reviewer threads that is not settled, each question jbus holds for it and each open gate of its `gates.md`.\n   The block writes each under `Moved to uncategorized:` for a scoped home and under `Left with no home:` for the root, and prints them under its first line.\n   A scope is a home only while its directory has a `plan.md`, so once the block has run, every brief whose `Home:` line names the scope is the `uncategorized` home's by the rule `jbus home` keeps (`features\u002Fjbriefs\u002Fsrc\u002Fjbriefs\u002Fhome.py`): the root home owns no row.\n   jbus sends the `uncategorized` home what each of its threads has to tell, or the root home's thread while `uncategorized` has no home of its own, `jmerge` merges its pull requests as `uncategorized`'s, and that home's start lists its rows as its own: nothing is rewritten and nothing is sent.\n   With `plan.md` moved, jbus and the jstack tree count the scope as no home, and `\u002Fhome \u003Cscope>` moves it back and starts it again (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, step 1).\n   A root home that is archived leaves the repo with no home: jbus keeps running its queue and merging, a thread with something to tell finds no `home-id` and sends nothing, and its report waits on disk for the home someone starts with `\u002Fhome`.\n\n   A home's own `home-id` holds its id: the home's start wrote it there, and nothing else does.\n   `home-thread` is another file, the switch that has a home run the sweep: it is set by hand, and the block leaves it as it is.\n   The block changes only this home's directory, and no other home's files.\n   The `Was home:` line is the last line of the note: \"After the handoff\" reads it to say whose mail a late message is, and the start of a home of the same directory reads it to take over this thread's scheduled tasks and to settle this thread (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, \"The home before this one\").\n\n4. **Switch off its scheduled tasks, and tell the user.**\n   No home comes after this one to take a scheduled task over, so switch off each one the block printed a `switch off` line for, with the `t3-code` server's `update_scheduled_task` (if your harness defers it, load it first), `{\"scheduledTaskId\": \"\u003CscheduledTaskId>\", \"enabled\": false}`.\n   A task that is off runs nothing, so it cannot make this thread active again, and it keeps its address for a home started later in this directory to take over.\n   Delete none.\n   On `not read`, in a session with no such tool, there is nothing to do: tell the user that a task bound to this thread may still run.\n   Then tell the user, in three lines at most: the note's path, what moved to the `uncategorized` home (or, for the root, that the repo has no home until someone types `\u002Fhome`, with what was out), each task that is now off, and each gate the note carries.\n\n5. **Rename and settle.**\n\n   1. Rename this thread with `t3_thread_update`, so the list shows which home it was and that it is archived:\n\n      ```json\n      {\"action\": \"rename\", \"title\": \"\u003Ctitle> (archived \u003Cdate>)\"}\n      ```\n\n      `\u003Ctitle>` is what step 3 printed after `title: `.\n      `\u003Cdate>` is today as `date +%F` prints it.\n      No `threadId` means this thread.\n   2. Last, settle this thread with `t3_thread_organize`:\n\n      ```json\n      {\"action\": \"settle\"}\n      ```\n\n      It takes effect when the turn ends, so it is the last call of the handoff.\n      It clears this thread's pin with it.\n      A turn that fails or is cut off, or a message that comes in, leaves this thread active and pinned, and the reply of the call does not say which: a home started later in this directory looks at this thread and settles it if it has to (`skills\u002Fhome\u002Fwhen-a-home-starts.md`, \"The home before this one\").\n\n## A party's home\n\nA party's home plans nothing, briefs nothing and launches nothing but its own next thread.\nIts handoff is its page and that launch, with no plan, no merge and no seed.\nTwo things, in order:\n\n1. **Write the new page**, at the path the first block printed after `write: `, `handoff.next.md` in the party's folder, in the shape its `handoff.md` has: the party's own, and not `$T\u002Fhandoff.md`. A party with no page yet writes where things stand, what is next and what is open. Facts and pointers, as step 2 says of a home's. Leave `handoff.md` as it is, and write no `Was home:` line: the next block does both.\n\n2. **Close, and start the next thread.** Run this with the block at the top:\n\n   ```sh\n   ME='\u003CthreadId>'\n   again=\n   if ! party_home \"$ME\"; then\n       handed_off \"$ME\"\n       case $L in\n       \"${H%\u002F*}\"\u002F_*) if [ ! -e \"$L\u002Fhome-id\" ]; then again=yes M=$L P=${L##*\u002F_}; fi ;;\n       esac\n       if [ -z \"$again\" ]; then\n           echo \"not a party's home: the id of thread $ME is in no ${H%\u002F*}\u002F_*\u002Fhome-id. Nothing is written.\"\n           exit 1\n       fi\n   fi\n   if [ -z \"$again\" ] && [ ! -s \"$M\u002Fhandoff.next.md\" ]; then\n       echo \"not written: $M\u002Fhandoff.next.md is not there. Write the new page to it, then run this again.\"\n       exit 1\n   fi\n   page=$M\u002FRESTART.md\n   boot=\n   if [ -f \"$page\" ]; then\n       boot=$(awk '\u002F^[ \\t]*```\u002F {if (open) last = text; text = \"\"; open = !open; next} open {text = text $(0) \"\\n\"} END {printf \"%s\", last}' \"$page\")\n   fi\n   told=\"Thread $ME, the $P thread before this one, handed off with \u002Fhandoff and is settled: send it nothing. Before anything else, read \\\"The thread a party's handoff started\\\" in $(realpath \"$T\u002F..\u002Fskills\u002Fhandoff\u002FSKILL.md\") and do what it says, with $P in place of \u003Cparty>. Then start from $M\u002Fhandoff.md${boot:+ and $page}.\"\n   first=\"You are the next thread of $P's home, in $M.\"\n   message=$(printf '%s\\n\\n%s\\n' \"${boot:-$first}\" \"$told\")\n   title=\"home: $P\"\n   model=$(uv run --project \"$T\u002F..\u002Fsource\" jroles expert) || model=\n   if ! launch=$(jq -cn --arg title \"$title\" --arg message \"$message\" --argjson selection \"${model:-null}\" '{title: $title, workspaceStrategy: {type: \"root\"}, message: $message} + if $selection then {modelSelection: $selection} else {} end') ||\n       ! rename=$(jq -cn --arg title \"$title (handed off $(date +%F))\" '{action: \"rename\", title: $title}'); then\n       echo \"not closed: jq did not run, and nothing is changed\"\n       exit 1\n   fi\n   if [ -n \"$again\" ]; then\n       echo \"closed before: $M\u002Fhandoff.md names this thread and $M\u002Fhome-id is gone. Launch only if no next thread was started\"\n   else\n       log=$M\u002Flog\n       kept=$log\u002F$(date +%F-%H%M)-handoff.md\n       if [ -e \"$kept\" ]; then kept=$log\u002F$(date +%F-%H%M%S)-handoff.md; fi\n       if { [ ! -f \"$M\u002Fhandoff.md\" ] || { mkdir -p \"$log\" && mv \"$M\u002Fhandoff.md\" \"$kept\"; }; } &&\n           sed '\u002F^Was home:\u002Fd' \"$M\u002Fhandoff.next.md\" > \"$M\u002Fhandoff.md\" &&\n           printf '\\nWas home: %s\\n' \"$ME\" >> \"$M\u002Fhandoff.md\" &&\n           uv run --project \"$T\u002F..\u002Fsource\" jbus tidy files \"$M\u002Fhandoff.next.md\" \"$M\u002Fhome-id\" > \u002Fdev\u002Fnull; then\n           echo \"a party's home: start its next thread, then rename and settle this thread\"\n       else\n           echo \"not closed: the old page could not be moved to $log, or the new one not written to $M\u002Fhandoff.md. Launch nothing, and run this again once that is put right.\"\n           exit 1\n       fi\n   fi\n   printf 'launch: %s\\nrename: %s\\nsettle: {\"action\": \"settle\"}\\n' \"$launch\" \"$rename\"\n   ```\n\n   The old page is in `log\u002F` under a dated name, the new one is `handoff.md` and ends in a `Was home:` line with this thread's id, and `home-id` is gone, so a second run changes nothing.\n   On `not a party's home:`, `not written:` or `not closed:`, nothing is launched: do what the line says, or tell the user.\n   On `closed before`, an earlier run of this block closed and its turn may have been cut before the launch: look for the next thread as \"A lost launch\" says, with the title on the `launch:` line.\n   With none, go on as on `a party's home`.\n   With one, launch nothing, and only rename and settle.\n\n   On `a party's home`, first stop what this thread has running in the background, as step 1 does. Then make three calls, in the order printed, each with the object after its word, as printed: `launch:` with the `t3-code` server's `t3_thread_launch`, `rename:` with `t3_thread_update`, `settle:` with `t3_thread_organize`, the last call of the turn (if your harness defers one, load it first). Between the launch and the rename, tell the user in three lines at most what was written, and the link to the next thread, `[\u003Ctitle>](t3-thread:\u002F\u002Fv1\u002F\u003Cits threadId>)`.\n\n   The root workspace is the main checkout of the project this thread is in, which is the party's folder, and the project and the modes are this thread's.\n   The model is the one the role map names for `expert`, for any party that hands off here, and that is never an expert, whose rollover is not this skill's: the block asks `jroles` for it, and the `launch:` line has it as `modelSelection`.\n   With no line for that role the call has no `modelSelection`, and the next thread runs on this thread's model.\n   A line the block prints on stderr says why the map gives no model: the launch is made all the same, and the user is told that line.\n   The message is the last fenced block of the folder's `RESTART.md`, the one a new thread of the party is started with by hand, and under it the lines that send the next thread to the section below.\n   With no such page it is those lines alone.\n   A launch has no retry key: if the call fails or its reply is lost, look for the thread as \"A lost launch\" says before launching again.\n   If the launch fails all the same, or the session has no `t3_thread_launch`, give the user the message to start a thread with, and rename and settle nothing.\n\n### A lost launch\n\nA launch has no retry key.\nIf the call fails or its reply is lost, look for the thread with `t3_thread_list` before launching again, so there are never two:\n\n```json\n{\"titleContains\": \"\u003Ctitle>\"}\n```\n\nThe list holds every thread whose title has those words, this thread among them, which still has that title.\nThe next thread is the one with exactly that title that is newer than this one.\n\n### The thread a party's handoff started\n\nThe message that started this thread sent it here.\nThis thread is no home by the home skill, and reads this section of this file and the block at the top, and no other part.\nGet this thread's id from the `t3-code` server's `t3_thread_configure` with no arguments, as `threadId`, and call `list_scheduled_tasks` with no arguments (if your harness defers one, load it first).\nThen run this with the block at the top, with the id, the name the message gives, and the whole reply in place of the words in angle brackets:\n\n```sh\nME='\u003CthreadId>'\nP='\u003Cparty>'\nM=${H%\u002F*}\u002F_$P\ncase $ME$P in\n'' | *'\u003C'* | *'>'* | *' '* | *\u002F*) M= ;;\nesac\nif [ -z \"$ME\" ] || [ -z \"$M\" ] || [ ! -f \"$M\u002Fhandoff.md\" ]; then\n    echo \"not written: this needs the thread's id and the name of a party whose folder under ${H%\u002F*} has a handoff.md\"\nelif [ \"$(cat \"$M\u002Fhome-id\" 2> \u002Fdev\u002Fnull)\" != \"$ME\" ] && ! (set -C && printf '%s\\n' \"$ME\" > \"$M\u002Fhome-id\") 2> \u002Fdev\u002Fnull; then\n    echo \"not written: $M\u002Fhome-id holds $(cat \"$M\u002Fhome-id\" 2> \u002Fdev\u002Fnull), another thread, which is the party's now. Take no task over, and tell the user.\"\nelse\n    echo \"written: $M\u002Fhome-id\"\n    was=$(sed -n 's\u002F^Was home:[[:space:]]*\\([^[:space:]]*\\).*\u002F\\1\u002Fp' \"$M\u002Fhandoff.md\" | head -n 1)\n    if [ -z \"$was\" ] || [ \"$was\" = \"$ME\" ]; then\n        echo \"no thread before this one: $M\u002Fhandoff.md names none, so no task is taken over\"\n    else\n        jq -rs --arg was \"$was\" '\n            if length == 1 and (.[0].tasks | type) == \"array\" then .[0] else error(\"no tasks\") end\n            | [.tasks[] | select(.boundThreadId == $was)]\n            | if length == 0 then \"none: no scheduled task posts into \\($was)\" else .[] end\n            | if type == \"string\" then .\n              else \"take \\(.scheduledTaskId): \\(.title) posts into \\($was), the thread before this one\" end' 2> \u002Fdev\u002Fnull \u003C\u003C 'THE_REPLY_ENDS_HERE' ||\n\u003Cthe reply of list_scheduled_tasks>\nTHE_REPLY_ENDS_HERE\n            echo \"not read: put the whole reply of list_scheduled_tasks in place of the placeholder\"\n    fi\nfi\n```\n\nOn `written:`, this thread's id is in the party's `home-id`, where whoever sends to the party reads it. It prints one line for each scheduled task that posts into the thread that handed off, and never a task's address. On `take \u003Cid>`, take the task over with the `t3-code` server's `update_scheduled_task` (if your harness defers it, load it first), `{\"scheduledTaskId\": \"\u003CscheduledTaskId>\", \"bindToCurrentThread\": true}`, and nothing else in the call: the task keeps its title, its prompt, its schedule and, for a webhook, its address, and one that was switched off stays off. After the calls, list the tasks again and run the block again: it prints `none` when every one is taken. A task it still prints had its call refused: tell the user its id and what the call answered, and make no second call. On `none` and `no thread before this one`, there is nothing to take. On `not written:` or `not read:`, fill in what the line names and run it again. A `not written:` that names another thread is not filled in: that thread started first and is the party's, so this one does nothing more.\n\nThen go on as the message says, from the party's handoff and its restart page.\n\n## After the handoff\n\nA home that is archived does nothing more.\nIts briefs name no thread, and a thread or a party that sends to the repo's home reads its `home-id` first, so a message should not reach it.\nIf one still does (a thread that kept an old id, a direct message, the user), run this with the block at the top before anything else:\n\n```sh\nME='\u003CthreadId>'\ncase $ME in\n'' | *'\u003C'* | *'>'*)\n    echo \"not known: put this thread's id in place of the placeholder. With no tool that gives it, do not act on the message: tell the sender to read $H\u002Fhome-id\" ;;\n*)\n    if this_home \"$ME\" > \u002Fdev\u002Fnull; then\n        echo \"a home: this thread's id is in $M\u002Fhome-id, so the message is this thread's to act on\"\n    else\n        handed_off \"$ME\"\n        next=\n        if [ -n \"$L\" ]; then next=$(awk 'NF {print $(1); exit}' \"$L\u002Fhome-id\" 2> \u002Fdev\u002Fnull); fi\n        case $L in\n        \"$H\" | \"$H\"\u002F*) if [ -z \"$next\" ]; then next=$(awk 'NF {print $(1); exit}' \"$H\u002Fhome-id\" 2> \u002Fdev\u002Fnull); fi ;;\n        esac\n        if [ -z \"$L\" ]; then\n            echo \"no home's: this thread's id is in no home-id and on no archived home's Was home: line, so no file says whose mail this is. Do not act on the message: tell the sender to read $H\u002Fhome-id\"\n        elif [ -n \"$next\" ] && [ \"$next\" != \"$ME\" ] && [ \"$L\" = \"${H%\u002F*}\u002F_${L##*\u002F_}\" ]; then\n            echo \"handed off: this thread's id is in no home-id. Do not act on the message and send it on to nobody: tell the sender, once, that $next is the home now\"\n        elif [ \"$L\" = \"${H%\u002F*}\u002F_${L##*\u002F_}\" ]; then\n            echo \"handed off: this thread's id is in no home-id, and $L\u002Fhome-id holds none yet. Do not act on the message and send it on to nobody: tell the sender, once, the id this thread's own launch of the next thread gave. With no such launch, tell the sender to read $L\u002Fhandoff.md\"\n        elif [ -n \"$next\" ] && [ \"$next\" != \"$ME\" ]; then\n            echo \"archived: this thread's id is in no home-id. Do not act on the message and send it on to nobody: tell the sender, once, that $next is the home now\"\n        else\n            echo \"archived: this thread's id is in no home-id, and $R has no home now. Do not act on the message and send it on to nobody: tell the sender, once, that $R has no home until someone types \u002Fhome, and that $H\u002Fhome-id names it then\"\n        fi\n    fi ;;\nesac\n```\n\nOn `a home`, this thread is not archived: go by the home skill.\nOn any other line, do not act on the message: no run, no launch, no merge, no change to the plan, whatever it asks and whoever sent it.\nDo what the line says and nothing more.\n`no home's` is a thread that never was a home: nothing is sent on.\nThe home it names on an `archived` line is the one the archived home's own directory has now, a home started there again, or else the root home.\nA `handed off` line is a party's, and names its next thread.\n\nOne kind of message is neither sent on nor answered, whatever the line says: one of this skill's own.\nIts first line has `handed off, and this was sent to it by`, or it starts `the home of \u003Crepo> is \u003Cid> now`, `\u003Crepo>: the home is \u003Cid> now` or `\u003Crepo>: there is no home now`.\nSettle again and end the turn, so that two archived threads never answer each other.\n\nA message is never sent on: the sender sends it again, to the id it is told.\nBetween two homes of one repo the send would be refused anyway, since `features\u002Fhome\u002Fhooks\u002Fagent-sends.sh` refuses a thread that was a home sending to its repo's home now.\nTell the sender with `t3_thread_send`, to its own id, once: a call whose reply is lost is not sent again.\nOn a line that names the home now:\n\n```json\n{\"threadId\": \"\u003Cthread>\", \"message\": \"\u003Crepo>: the home is \u003Cthe home's id> now, and your message was not sent on to it. Send it there if it still stands, and read the id in \u003Cthe home-id file> before each send.\"}\n```\n\nOn a line that says the repo has no home, the `t3_thread_send` is this one:\n\n```json\n{\"threadId\": \"\u003Cthread>\", \"message\": \"\u003Crepo>: there is no home now, and your message was not sent on. A home starts when someone types \u002Fhome: read the id in \u003Cthe home-id file> before each send.\"}\n```\n\nThe user is told the same in one line here, with the link to the home now, `[\u003Ctitle>](t3-thread:\u002F\u002Fv1\u002F\u003Cits threadId>)`, where there is one.\nWhere the line names a file and no id, the sender is told that path.\nThen settle this thread again.\n\nA crewmate thread (`\u002Fcrew \u003Cslug>`) never runs this skill. It ends by writing its `## Result`, as the `crew` skill says.\n",{"tip":24,"card":25,"name":5,"description":7,"user-invocable":26,"disable-model-invocation":26},"archives this home and starts no next one | archive | archive this home | close this home | wrap up","Run the pipeline | 6 | Archives a home. It keeps a note of ten lines at most in the home's log, hands what the home has out to the uncategorized home, closes its scope and starts no next home. | Reach for it when a home's work is over, or from the tree's Archive item. | op: the operator; model: a home",true,"main","daff051d2674b46e2eb8a333bbd3f3e40f8d1cea","features\u002Fhome\u002Fskills\u002Fhandoff",0,"https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere","Software Engineer @ Markel\r\n","2026-11-15 11:25:06",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":26},[37,40,43],{"tool":38,"command":39},"npx","npx skills add JoshuaHayesWasHere\u002Fjstack --skill handoff",{"tool":41,"command":42},"bunx","bunx skills add JoshuaHayesWasHere\u002Fjstack --skill handoff",{"tool":44,"command":45},"pnpm","pnpm dlx skills add JoshuaHayesWasHere\u002Fjstack --skill handoff","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fhome\u002Fskills\u002Fhandoff\u002FSKILL.md",[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7ERF9GXMY62V7QTVAR6G8DG","no-key","A skill its skills.json lists as hidden that a model may still call by itself, kept broken so the lint is seen to catch it.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fno-key\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7ERF83ZG3XKJ2SB8MJHCZ8H","fake-skill","A FAKE skill in a FAKE tree, named for its folder until the test renames the folder.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fnamed-tree\u002Fskills\u002Ffake-skill\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7ERF698RV4VF8QCDF8H8DA4","extra-key","A skill its skills.json does not list as hidden that a model still cannot call, kept broken so the lint is seen to catch it.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fextra-key\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7ERF2V8N73X9T0Y9PJ4SFV6","unslop","Cut AI tells from writing. Use when the user says text reads like AI, asks to unslop it, or before prose ships to people.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwriting\u002Fskills\u002Funslop\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EREWM67WX934XKABM4XCSZ","technical-writing","Write or review docs, READMEs, RFCs, PR descriptions and commit messages to a layered standard: Diataxis structure, Google developer style, STE rules and Global English.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwriting\u002Fskills\u002Ftechnical-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EREMHJS9JY10AM5EKVX3GP","why","Find why code is the way it is, from its history and every evidence source this session can query, with citations. Use for 'why does X work this way', 'why did we pick Y', regressions and postmortems. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwhy\u002FSKILL.md",[],[]]