[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79PJ3ZDABVQ9GNNVS7ED9FV":3,"skill-same:01M79PJ3ZDABVQ9GNNVS7ED9FV":56},{"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":36,"commitSha":37,"skillDirectory":38,"forksCount":14,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M79PJ3ZDABVQ9GNNVS7ED9FV","detach",null,"worktrail-detach — supervised out-of-harness launch with log\u002Fpid\u002Fexit sentinel so long-running runs survive the Claude Code background-task reaper","behindthedash\u002Fworktrail","behindthedash","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30299179?v=4","01M79PHT5395GJXDSNP7MYP63D","OC","01M79PHT68KHMYHPS9D9RCYFJZ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetach\u002Fskill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: detach\ndescription: worktrail-detach — supervised out-of-harness launch with log\u002Fpid\u002Fexit sentinel so long-running runs survive the Claude Code background-task reaper\ntriggers:\n  files:\n    - src\u002Fworktrail\u002Fruntime\u002Fdetach.py\n    - tests\u002Fruntime\u002Ftest_detach.py\n    - skills\u002Fworktrail-go\u002Freferences\u002Fsubagent-prompts.md\n  keywords:\n    - worktrail-detach\n    - detach\n    - run_in_background\n    - supervise\n    - exit sentinel\n    - full-real\n    - Monitor\n---\n\nYou are working on **`worktrail-detach`**, the primitive that runs a long-running command outside\nthe agent harness's tracked process tree (`src\u002Fworktrail\u002Fruntime\u002Fdetach.py`, console script\n`worktrail-detach`).\n\n## Domain purpose\nClaude Code's Bash tool `run_in_background` registers the child as a harness-tracked task, and on\nthis fleet's WSL host the harness periodically reaps *all* of its own tracked background tasks\n(bare `[killed]`, no exit code, no traceback, session survives). Every `worktrail-live full-real`,\n`worktrail-preflight run`, and headless `worktrail-skill-dispatch` launched that way died mid-run\n(some within 10–25 s), while the identical command launched detached ran to a clean exit every time\n(`~\u002F.devops\u002Fbackground-kill-hypotheses.md` H9, confirmed 2026-08-29; 27 logged incidents through\n2026-09-01). No cgroup\u002FOOM is involved and no setting disables the reap — the fix is to never hand\nthe harness a handle. `worktrail-detach` makes that a testable primitive instead of a hand-typed\n`nohup … & disown` each agent had to remember (and got wrong: `nohup` *inside* a\n`run_in_background` call is still tracked).\n\n## Business rules \u002F invariants\n- **`launch` is a plain foreground Bash call that returns immediately** with a JSON handle\n  (`name`, `pid`, `supervisor_pid`, `log`, `pid_file`, `exit_file`, `cwd`, `wait_cmd`). Never\n  wrap it in `run_in_background`, `nohup … &`, `setsid`, or a trailing `&`.\n- **Supervisor runs in its own session** (`subprocess.Popen(start_new_session=True)`, re-invoking\n  `python -m worktrail.runtime.detach _supervise`); the real command is its child. Tests assert\n  `os.getsid`\u002F`os.getpgid` differ from the launcher's.\n- **State per handle lives under `$WORKTRAIL_HOME\u002Fdetached\u002F`** (default `~\u002F.worktrail\u002Fdetached`,\n  overridable via `--state-dir`): `\u003Cname>.log` (stdout+stderr, appended, bracketed by\n  `[worktrail-detach] started …` \u002F `exit rc=N` lines), `\u003Cname>.pid` (child pid), `\u003Cname>.exit`\n  (return code sentinel, written only after the child exits). A spawn failure writes `127`.\n- **`--name` must match `^[A-Za-z0-9][A-Za-z0-9._-]{0,120}$`** — it becomes a filename; path\n  escapes are rejected with `SystemExit`.\n- **`launch` refuses to clobber a still-running handle of the same name** (returns\n  `{\"error\": \"already-running\"}`, exit code 3) unless `--force`. Stale pid\u002Fexit files are unlinked\n  on relaunch.\n- **Signals forward to the child**: the supervisor traps SIGTERM\u002FSIGINT\u002FSIGHUP and re-sends them\n  to the child, so killing the supervisor pid stops the run cleanly.\n- **`status` states**: `exited` (sentinel present) > `unknown` (no pid file; exit code 2) >\n  `running` (pid alive) > `gone` (pid dead, no sentinel — read the log).\n- **`wait` is the single source of truth for completion**: follows the log from the current end\n  (`--from-start` replays), prints only lines matching `--match` regex (default: none), then\n  `[worktrail-detach] exited rc=N`, and exits with the run's own rc. A pid that dies without a\n  sentinel yields exit 1 (`gone without exit sentinel`); `--timeout` yields 124.\n\n## Non-obvious behaviors\n- `launch` polls up to 5 s for the supervisor to write the pid file so the handle's `pid` is\n  usually populated; `pid` may be `null` on a very slow host — `status` will still resolve it.\n- `wait` gives the supervisor one `--interval` after the child pid disappears before declaring\n  it gone, since the sentinel lands a beat after the child exits.\n- The log's `started cmd=[...]` header contains the command's own text, so a `--match` pattern\n  can match its own invocation line — tests put scripts in files for that reason.\n\n## How the skill docs use it\n`skills\u002Fworktrail-go\u002Freferences\u002Fsubagent-prompts.md` `#orchestrator` launches `full-real` as\n`worktrail-detach launch --name \"orch-\u003Crepo>-\u003Cspec>\" --cwd \"$SPEC_ROOT\" -- worktrail-live full-real …`,\nconfirms health with `worktrail-detach status`, then arms one `Monitor` on the handle's `wait_cmd`\nwith a `--match` covering progress and failure signatures (`pull\u002F[0-9]+|MERGED|quarantin|escalat|FAILED|Traceback|circuit|blocked`).\nNever `sleep` (harness blocks it) and never `tail -f` the log yourself. `#openspec-propose`\nlong spawns use the same pattern with `worktrail-skill-dispatch`.\n\n## Critical files\n- `src\u002Fworktrail\u002Fruntime\u002Fdetach.py` — `launch` \u002F `supervise` \u002F `status` \u002F `wait` and the CLI\n- `tests\u002Fruntime\u002Ftest_detach.py` — spawns real subprocesses (session placement and sentinel\n  bookkeeping cannot be asserted with a mocked `Popen`)\n\n## Critical Rules\n- Any new long-running console-script invocation documented in a skill must use\n  `worktrail-detach launch` from a foreground call — never `run_in_background`.\n- `worktrail-detach` is a `[project.scripts]` entry; `tests\u002Ftest_plugin_surface.py` requires every\n  skill-doc mention to match it exactly.\n\n---\n**Last Updated:** 2026-09-02\n","You are working on **`worktrail-detach`**, the primitive that runs a long-running command outside\nthe agent harness's tracked process tree (`src\u002Fworktrail\u002Fruntime\u002Fdetach.py`, console script\n`worktrail-detach`).\n\n## Domain purpose\nClaude Code's Bash tool `run_in_background` registers the child as a harness-tracked task, and on\nthis fleet's WSL host the harness periodically reaps *all* of its own tracked background tasks\n(bare `[killed]`, no exit code, no traceback, session survives). Every `worktrail-live full-real`,\n`worktrail-preflight run`, and headless `worktrail-skill-dispatch` launched that way died mid-run\n(some within 10–25 s), while the identical command launched detached ran to a clean exit every time\n(`~\u002F.devops\u002Fbackground-kill-hypotheses.md` H9, confirmed 2026-08-29; 27 logged incidents through\n2026-09-01). No cgroup\u002FOOM is involved and no setting disables the reap — the fix is to never hand\nthe harness a handle. `worktrail-detach` makes that a testable primitive instead of a hand-typed\n`nohup … & disown` each agent had to remember (and got wrong: `nohup` *inside* a\n`run_in_background` call is still tracked).\n\n## Business rules \u002F invariants\n- **`launch` is a plain foreground Bash call that returns immediately** with a JSON handle\n  (`name`, `pid`, `supervisor_pid`, `log`, `pid_file`, `exit_file`, `cwd`, `wait_cmd`). Never\n  wrap it in `run_in_background`, `nohup … &`, `setsid`, or a trailing `&`.\n- **Supervisor runs in its own session** (`subprocess.Popen(start_new_session=True)`, re-invoking\n  `python -m worktrail.runtime.detach _supervise`); the real command is its child. Tests assert\n  `os.getsid`\u002F`os.getpgid` differ from the launcher's.\n- **State per handle lives under `$WORKTRAIL_HOME\u002Fdetached\u002F`** (default `~\u002F.worktrail\u002Fdetached`,\n  overridable via `--state-dir`): `\u003Cname>.log` (stdout+stderr, appended, bracketed by\n  `[worktrail-detach] started …` \u002F `exit rc=N` lines), `\u003Cname>.pid` (child pid), `\u003Cname>.exit`\n  (return code sentinel, written only after the child exits). A spawn failure writes `127`.\n- **`--name` must match `^[A-Za-z0-9][A-Za-z0-9._-]{0,120}$`** — it becomes a filename; path\n  escapes are rejected with `SystemExit`.\n- **`launch` refuses to clobber a still-running handle of the same name** (returns\n  `{\"error\": \"already-running\"}`, exit code 3) unless `--force`. Stale pid\u002Fexit files are unlinked\n  on relaunch.\n- **Signals forward to the child**: the supervisor traps SIGTERM\u002FSIGINT\u002FSIGHUP and re-sends them\n  to the child, so killing the supervisor pid stops the run cleanly.\n- **`status` states**: `exited` (sentinel present) > `unknown` (no pid file; exit code 2) >\n  `running` (pid alive) > `gone` (pid dead, no sentinel — read the log).\n- **`wait` is the single source of truth for completion**: follows the log from the current end\n  (`--from-start` replays), prints only lines matching `--match` regex (default: none), then\n  `[worktrail-detach] exited rc=N`, and exits with the run's own rc. A pid that dies without a\n  sentinel yields exit 1 (`gone without exit sentinel`); `--timeout` yields 124.\n\n## Non-obvious behaviors\n- `launch` polls up to 5 s for the supervisor to write the pid file so the handle's `pid` is\n  usually populated; `pid` may be `null` on a very slow host — `status` will still resolve it.\n- `wait` gives the supervisor one `--interval` after the child pid disappears before declaring\n  it gone, since the sentinel lands a beat after the child exits.\n- The log's `started cmd=[...]` header contains the command's own text, so a `--match` pattern\n  can match its own invocation line — tests put scripts in files for that reason.\n\n## How the skill docs use it\n`skills\u002Fworktrail-go\u002Freferences\u002Fsubagent-prompts.md` `#orchestrator` launches `full-real` as\n`worktrail-detach launch --name \"orch-\u003Crepo>-\u003Cspec>\" --cwd \"$SPEC_ROOT\" -- worktrail-live full-real …`,\nconfirms health with `worktrail-detach status`, then arms one `Monitor` on the handle's `wait_cmd`\nwith a `--match` covering progress and failure signatures (`pull\u002F[0-9]+|MERGED|quarantin|escalat|FAILED|Traceback|circuit|blocked`).\nNever `sleep` (harness blocks it) and never `tail -f` the log yourself. `#openspec-propose`\nlong spawns use the same pattern with `worktrail-skill-dispatch`.\n\n## Critical files\n- `src\u002Fworktrail\u002Fruntime\u002Fdetach.py` — `launch` \u002F `supervise` \u002F `status` \u002F `wait` and the CLI\n- `tests\u002Fruntime\u002Ftest_detach.py` — spawns real subprocesses (session placement and sentinel\n  bookkeeping cannot be asserted with a mocked `Popen`)\n\n## Critical Rules\n- Any new long-running console-script invocation documented in a skill must use\n  `worktrail-detach launch` from a foreground call — never `run_in_background`.\n- `worktrail-detach` is a `[project.scripts]` entry; `tests\u002Ftest_plugin_surface.py` requires every\n  skill-doc mention to match it exactly.\n\n---\n**Last Updated:** 2026-09-02\n",{"name":5,"triggers":24,"description":7},{"files":25,"keywords":29},[26,27,28],"src\u002Fworktrail\u002Fruntime\u002Fdetach.py","tests\u002Fruntime\u002Ftest_detach.py","skills\u002Fworktrail-go\u002Freferences\u002Fsubagent-prompts.md",[30,5,31,32,33,34,35],"worktrail-detach","run_in_background","supervise","exit sentinel","full-real","Monitor","main","db448e94704b506e1a5a0665d349fc422611fe9e",".claude\u002Fskills\u002Fdetach","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail","https:\u002F\u002Fgithub.com\u002Fbehindthedash","2026-11-14 18:34:42",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add behindthedash\u002Fworktrail --skill detach",{"tool":48,"command":49},"bunx","bunx skills add behindthedash\u002Fworktrail --skill detach",{"tool":51,"command":52},"pnpm","pnpm dlx skills add behindthedash\u002Fworktrail --skill detach","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetach\u002Fskill.md",true,[],[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79PMY53NKDHVZ2AFSGNNJH7","worktrail-sdd-workflow","Internal SDD workflow executor invoked by \u002Fgo only. Do not call directly. Executes classified routes A–J: feature planning, implementation (parallel orchestration, PR generation), defect repair, refactoring, spec changes, investigation, and workflow evolution.","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-sdd-workflow\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79PMKBE8SYW0ZP14AEJDM5D","worktrail-routing-config","Configure Worktrail's agent routing table (`~\u002F.worktrail\u002Frouting.yaml`, or a repo-local `routing:` policy block) — which harness\u002Fmodel executes each role and tier, and how fallback between them works. Use when the operator wants to add or remove a harness\u002Fadapter (claude\u002Fcodex\u002Fopencode), add a model to an existing harness (e.g. adding a DeepSeek model to opencode), pin or change who does code review, add a new tier or purpose mapping, change the default tier, or is confused about which harness actually served a spawn (e.g. \"why did this use Codex when I only configured Claude\"). Trigger phrases: \"routing.yaml\", \"add a harness\", \"disable a harness\", \"add an adapter\", \"remove an adapter\", \"add a model\", \"add deepseek to opencode\", \"change the reviewer\", \"pin the reviewer\", \"routing tiers\", \"routing targets\", \"default_tier\", \"independent reviewer\", \"why did codex get called\". This skill is about *editing the config file*; it does not cover `\u002Fgo`'s own dispatch mechanics (see `worktrail-go`'s SKILL.md Phase 7 for how `tier_for()`\u002F`select_cell()` resolve it at runtime).","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-routing-config\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79PMB24YTZTZVVAKA4A4R38","worktrail-repo-init","Bootstrap a new repo, or migrate an existing single-branch repo, onto the workspace's repo-standards doctrine (~\u002Frules\u002FCLAUDE.repo.md): the AGENTS.md-is-truth\u002FCLAUDE.md-imports-it split, a dev\u002Fprd, dev\u002Fstg\u002Fprd, or main-only (trunk) branch model with matching GitHub rulesets, an OpenSpec scaffold, an auto-merge workflow, and a seeded .worktrail\u002Fpolicy.yaml. Trigger phrases: \"onboard this repo\", \"apply repo standards\", \"initialize repo standards\", \"set up this repo like the rest of the fleet\", \"bring this repo into line with the repo standards doctrine\".","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-repo-init\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79PM54RFP51Q2JPQGE13ZP8","worktrail-help","Show the Worktrail front-door commands and accepted positional arguments. Use when the user asks how to invoke worktrail-go, wants the available handoff, spec, pr, repo, or route forms, invokes worktrail-go with help or with a bare noun, or asks how to answer a filed product decision (worktrail-decision).","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-help\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M79PKVZVBF4VFT5XEPCPNM9S","worktrail-handoff","Capture a discovered problem, gap, tech debt, or deferred work into a local work queue so a future agent session can pick it up cold. Use mid-session whenever you set work aside instead of doing it now — a fix you judge out of scope for this PR, work that belongs in a follow-up or a separate\u002Flater PR, an item you're deferring, or something worth fixing you won't tackle now — so the outstanding item isn't lost without derailing current work; can be called multiple times per session. Trigger phrases: \"defer this\", \"item deferred\", \"out of scope for this PR\", \"follow-up work\", \"leave for another PR\", \"capture for later\", \"outstanding item\". This skill captures only. Picking a brief back up is the front door's job: worktrail-go \u003Cbrief-id>.","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-handoff\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M79PKJZD9MPN7Q8GWR01KX0J","worktrail-go","Use when the user invokes worktrail-go, asks to pick up queued work, resume active specs, implement or fix a spec, route engineering work, or orient across repositories. Renders the orientation dashboard, classifies free-text requests, claims\u002Fresumes handoff briefs, and dispatches SDD work without requiring the user to know sdd-workflow. Grammar: worktrail-go [REPO] \u003Cnoun> \u003Cverb>, nouns handoff \u002F spec \u002F pr \u002F decision. Triggers: worktrail-go, worktrail-go help, worktrail-go spec fix, worktrail-go spec implement, worktrail-go spec route F, worktrail-go handoff new, worktrail-go handoff auto, worktrail-go decision answer, worktrail-go BRIEF-ID, bare worktrail-go, multi-repo orientation.","https:\u002F\u002Fgithub.com\u002Fbehindthedash\u002Fworktrail\u002Fblob\u002Fmain\u002Fskills\u002Fworktrail-go\u002FSKILL.md",[],[]]