[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M759VNASD1MP5BQJ039NA4NZ":3,"skill-same:01M759VNASD1MP5BQJ039NA4NZ":51},{"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":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M759VNASD1MP5BQJ039NA4NZ","open-threads",null,"Sweep recent sessions across the fleet's chat DB, classify their open threads (blocked-on-user \u002F interrupted \u002F parked \u002F awaiting-review \u002F stale), and propose a small consolidated set of fresh sessions to continue the work — spawned on confirmation via the amicode_session tool. Use at session start, on request (\"rehash the last two weeks\"), or when resuming after time away.","harmoniqs\u002Famicode","harmoniqs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199011497?v=4","01M759PQCJ9Y093EC5HC3344DW","Harmoniqs","01M759PQD5S85W68FZKV3XD1X0",7,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Fskills\u002Fopen-threads\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: open-threads\ndescription: Sweep recent sessions across the fleet's chat DB, classify their open threads (blocked-on-user \u002F interrupted \u002F parked \u002F awaiting-review \u002F stale), and propose a small consolidated set of fresh sessions to continue the work — spawned on confirmation via the amicode_session tool. Use at session start, on request (\"rehash the last two weeks\"), or when resuming after time away.\nagents: [researcher, director]\nsurface: public\n---\n\nSweep what the fleet actually did, surface what is still open, and turn the\nspawnable parts into a small set of fresh sessions that continue the work.\nThe unit of resumption is a THEME, not a thread.\n\n## Usage\n\n`\u002Fopen-threads` — sweep the last 14 days.\n`\u002Fopen-threads \u003Cdays>` — custom window (e.g. `\u002Fopen-threads 7`).\n`\u002Fopen-threads --report` — report only; skip the spawn proposal.\n\nThe argument is: $ARGUMENTS\n\n## Instructions\n\n### Step 0: Find the chat DB (read-only, always)\n\nThe canonical Amicode server aggregates every fleet device's sessions into one\nSQLite DB. Resolve it in this order: the `OPENCODE_DB` env if set, else\n`~\u002F.local\u002Fshare\u002Fopencode\u002Fopencode.db`. On a fleet client, run the sweep ON the\ncanonical server (see the `fleet` skill for which machine holds the role) —\nnever copy the DB around. Open it READ-ONLY (the server owns it):\n\n```python\ncon = sqlite3.connect(\"file:\u003Cdb-path>?mode=ro\", uri=True)\n```\n\nIf the DB is locked or missing, report that and stop — do not retry with a\nwritable connection.\n\n### Step 1: Pull top-level sessions in the window\n\n`window_days` = argument or 14. Run one query for the session list, one for\npending todos. Then, per session, pull the LAST assistant message that carries\ntext (join `message` → `part`, keep `type == \"text\"` parts; truncate to ~3 KB).\n\n```python\nimport sqlite3, datetime, json\n\ncon = sqlite3.connect(\"file:\u003Cdb-path>?mode=ro\", uri=True, timeout=5)\nsince = (datetime.datetime.now() - datetime.timedelta(days=window_days)).timestamp() * 1000\n\nsessions = con.execute(\"\"\"\n  select id, title, datetime(time_created\u002F1000,'unixepoch'), directory\n  from session\n  where parent_id is null and time_archived is null and time_created > ?\n  order by time_created\n\"\"\", (since,)).fetchall()\n\ntodos = con.execute(\"\"\"\n  select s.title, t.content from todo t join session s on s.id = t.session_id\n  where t.status != 'completed' order by t.time_created\n\"\"\").fetchall()\n\ndef last_text(session_id):\n    for (mid,) in con.execute(\"\"\"\n      select m.id from message m\n      where m.session_id = ? and json_extract(m.data,'$.role')='assistant'\n      order by m.time_created desc limit 8\n    \"\"\", (session_id,)):\n        parts = con.execute(\"select data from part where message_id=? order by time_created\", (mid,)).fetchall()\n        text = \" \".join(json.loads(p[0]).get(\"text\", \"\")\n                        for p in parts if json.loads(p[0]).get(\"type\") == \"text\")\n        if text.strip():\n            return text[:3000]\n    return \"\"\n```\n\nFilter NOISE titles before classifying — sessions named `Greeting`, `New\nsession - \u003CISO>`, `test`, and obvious scratch names carry no threads. Subagent\nsessions are already excluded by `parent_id is null`.\n\n### Step 2: Classify every surviving session\n\nRead the last assistant text (the ending usually says it outright: \"waiting\non\", \"next up\", \"say the word\", a mid-action line with no wrap-up) and the\npending todos that name the session. Bucket each thread:\n\n- **BLOCKED-ON-USER** — a decision, key, sign-off, or merge the human owes.\n  These are REPORT items, never spawn candidates: a fresh session cannot\n  press the button that only the user can press.\n- **INTERRUPTED** — the session died mid-action (last text is an unfinished\n  step, no verdict, no wrap-up). Prime spawn candidates.\n- **PARKED** — ended at a documented next step (campaign ledger \"next queue\",\n  a pre-authorized experiment, a named follow-up). Spawn candidates; the\n  parked step is the seed prompt.\n- **AWAITING-REVIEW** — green PRs \u002F cards waiting on a human. Report items.\n  If a thread names a specific PR, verify its current state with one `gh pr\n  view` call before reporting — sessions age faster than GitHub.\n- **STALE** — decisions that expired, deadlines long past, month-old\n  \"awaiting decision\" items. Report as \"retire unless you say otherwise\".\n\n### Step 3: Consolidate into a spawn plan\n\nThe smart part is the MERGING. One session per theme, never one per thread:\n\n- Group related threads (same repo, same campaign, same incident) into ONE\n  session whose prompt lists every thread it owns.\n- Cap the plan at 3-4 sessions total. If more themes survive the sweep, put\n  the overflow on the report as \"not spooled — say the word\".\n- Each proposed session needs: a short title (it becomes a tab label), and a\n  first prompt that is SELF-CONTAINED — the child starts with zero memory of\n  this sweep, so the prompt must carry the pointers verbatim: file paths,\n  PR\u002Fissue numbers, run dirs, branch names, and the parked next step, in\n  plain text. A prompt that says \"continue the warp work\" is worthless; one\n  that says \"PR #150 awaits merge review; then Piccolo#321 was interrupted\n  mid-debug on a stale precompile at \u003Cpath>\" is a working session.\n- `mode` is `fresh` for consolidation spawns. `fork` is the exception — only\n  when continuing a thread requires the parent's full transcript rather than\n  a state summary, and say so in the plan when you use it.\n\n### Step 4: Report, then confirm before spawning\n\nDeliver the report first: the classified table (thread, session date, what's\nopen, bucket), BLOCKED-ON-USER and AWAITING-REVIEW items called out as\nexplicitly yours-not-spawnable, and the STALE retire list. Then present the\nspawn plan and ask via the `question` tool (`multiple: true`, one option per\nproposed session, plus a \"spawn nothing\" option). NEVER spawn without an\nexplicit selection — every spawned session starts its first turn immediately\non the user's model budget, and the tool hard-caps at 4 per call anyway.\n\n### Step 5: Spawn\n\nFor each confirmed theme, one `amicode_session` call: `prompt` = the\nself-contained seed from Step 3, `title` = the tab label, `count: 1`. The\nparent pane auto-opens the children as background tabs.\n\n**If the `amicode_session` tool is not available** (not yet deployed on this\ninstall, or an older extension): say so plainly, deliver the report, and\noffer to run the highest-priority theme inline in THIS session instead — do\nnot pretend the spawn happened.\n\n### Report format\n\nSkimmable, grouped by bucket, newest first. Thread lines carry: date, session\ntitle, one line on what's open. The spawn plan is a numbered list of proposed\nsessions with their seed-prompt summaries — the full prompts are what you\npass to the tool, not what you print in chat.\n","Sweep what the fleet actually did, surface what is still open, and turn the\nspawnable parts into a small set of fresh sessions that continue the work.\nThe unit of resumption is a THEME, not a thread.\n\n## Usage\n\n`\u002Fopen-threads` — sweep the last 14 days.\n`\u002Fopen-threads \u003Cdays>` — custom window (e.g. `\u002Fopen-threads 7`).\n`\u002Fopen-threads --report` — report only; skip the spawn proposal.\n\nThe argument is: $ARGUMENTS\n\n## Instructions\n\n### Step 0: Find the chat DB (read-only, always)\n\nThe canonical Amicode server aggregates every fleet device's sessions into one\nSQLite DB. Resolve it in this order: the `OPENCODE_DB` env if set, else\n`~\u002F.local\u002Fshare\u002Fopencode\u002Fopencode.db`. On a fleet client, run the sweep ON the\ncanonical server (see the `fleet` skill for which machine holds the role) —\nnever copy the DB around. Open it READ-ONLY (the server owns it):\n\n```python\ncon = sqlite3.connect(\"file:\u003Cdb-path>?mode=ro\", uri=True)\n```\n\nIf the DB is locked or missing, report that and stop — do not retry with a\nwritable connection.\n\n### Step 1: Pull top-level sessions in the window\n\n`window_days` = argument or 14. Run one query for the session list, one for\npending todos. Then, per session, pull the LAST assistant message that carries\ntext (join `message` → `part`, keep `type == \"text\"` parts; truncate to ~3 KB).\n\n```python\nimport sqlite3, datetime, json\n\ncon = sqlite3.connect(\"file:\u003Cdb-path>?mode=ro\", uri=True, timeout=5)\nsince = (datetime.datetime.now() - datetime.timedelta(days=window_days)).timestamp() * 1000\n\nsessions = con.execute(\"\"\"\n  select id, title, datetime(time_created\u002F1000,'unixepoch'), directory\n  from session\n  where parent_id is null and time_archived is null and time_created > ?\n  order by time_created\n\"\"\", (since,)).fetchall()\n\ntodos = con.execute(\"\"\"\n  select s.title, t.content from todo t join session s on s.id = t.session_id\n  where t.status != 'completed' order by t.time_created\n\"\"\").fetchall()\n\ndef last_text(session_id):\n    for (mid,) in con.execute(\"\"\"\n      select m.id from message m\n      where m.session_id = ? and json_extract(m.data,'$.role')='assistant'\n      order by m.time_created desc limit 8\n    \"\"\", (session_id,)):\n        parts = con.execute(\"select data from part where message_id=? order by time_created\", (mid,)).fetchall()\n        text = \" \".join(json.loads(p[0]).get(\"text\", \"\")\n                        for p in parts if json.loads(p[0]).get(\"type\") == \"text\")\n        if text.strip():\n            return text[:3000]\n    return \"\"\n```\n\nFilter NOISE titles before classifying — sessions named `Greeting`, `New\nsession - \u003CISO>`, `test`, and obvious scratch names carry no threads. Subagent\nsessions are already excluded by `parent_id is null`.\n\n### Step 2: Classify every surviving session\n\nRead the last assistant text (the ending usually says it outright: \"waiting\non\", \"next up\", \"say the word\", a mid-action line with no wrap-up) and the\npending todos that name the session. Bucket each thread:\n\n- **BLOCKED-ON-USER** — a decision, key, sign-off, or merge the human owes.\n  These are REPORT items, never spawn candidates: a fresh session cannot\n  press the button that only the user can press.\n- **INTERRUPTED** — the session died mid-action (last text is an unfinished\n  step, no verdict, no wrap-up). Prime spawn candidates.\n- **PARKED** — ended at a documented next step (campaign ledger \"next queue\",\n  a pre-authorized experiment, a named follow-up). Spawn candidates; the\n  parked step is the seed prompt.\n- **AWAITING-REVIEW** — green PRs \u002F cards waiting on a human. Report items.\n  If a thread names a specific PR, verify its current state with one `gh pr\n  view` call before reporting — sessions age faster than GitHub.\n- **STALE** — decisions that expired, deadlines long past, month-old\n  \"awaiting decision\" items. Report as \"retire unless you say otherwise\".\n\n### Step 3: Consolidate into a spawn plan\n\nThe smart part is the MERGING. One session per theme, never one per thread:\n\n- Group related threads (same repo, same campaign, same incident) into ONE\n  session whose prompt lists every thread it owns.\n- Cap the plan at 3-4 sessions total. If more themes survive the sweep, put\n  the overflow on the report as \"not spooled — say the word\".\n- Each proposed session needs: a short title (it becomes a tab label), and a\n  first prompt that is SELF-CONTAINED — the child starts with zero memory of\n  this sweep, so the prompt must carry the pointers verbatim: file paths,\n  PR\u002Fissue numbers, run dirs, branch names, and the parked next step, in\n  plain text. A prompt that says \"continue the warp work\" is worthless; one\n  that says \"PR #150 awaits merge review; then Piccolo#321 was interrupted\n  mid-debug on a stale precompile at \u003Cpath>\" is a working session.\n- `mode` is `fresh` for consolidation spawns. `fork` is the exception — only\n  when continuing a thread requires the parent's full transcript rather than\n  a state summary, and say so in the plan when you use it.\n\n### Step 4: Report, then confirm before spawning\n\nDeliver the report first: the classified table (thread, session date, what's\nopen, bucket), BLOCKED-ON-USER and AWAITING-REVIEW items called out as\nexplicitly yours-not-spawnable, and the STALE retire list. Then present the\nspawn plan and ask via the `question` tool (`multiple: true`, one option per\nproposed session, plus a \"spawn nothing\" option). NEVER spawn without an\nexplicit selection — every spawned session starts its first turn immediately\non the user's model budget, and the tool hard-caps at 4 per call anyway.\n\n### Step 5: Spawn\n\nFor each confirmed theme, one `amicode_session` call: `prompt` = the\nself-contained seed from Step 3, `title` = the tab label, `count: 1`. The\nparent pane auto-opens the children as background tabs.\n\n**If the `amicode_session` tool is not available** (not yet deployed on this\ninstall, or an older extension): say so plainly, deliver the report, and\noffer to run the highest-priority theme inline in THIS session instead — do\nnot pretend the spawn happened.\n\n### Report format\n\nSkimmable, grouped by bucket, newest first. Thread lines carry: date, session\ntitle, one line on what's open. The spawn plan is a numbered list of proposed\nsessions with their seed-prompt summaries — the full prompts are what you\npass to the tool, not what you print in chat.\n",{"name":5,"agents":24,"surface":27,"description":7},[25,26],"researcher","director","public","main","bf84fdd4c1494800695bd5881702b3118dbf98be","packages\u002Fextension\u002Fskills\u002Fopen-threads",2,"https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode","https:\u002F\u002Fgithub.com\u002Fharmoniqs","harmoniqs.ai","research tools, for researchers, by reseachers","2026-11-12 14:46:24",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add harmoniqs\u002Famicode --skill open-threads",{"tool":43,"command":44},"bunx","bunx skills add harmoniqs\u002Famicode --skill open-threads",{"tool":46,"command":47},"pnpm","pnpm dlx skills add harmoniqs\u002Famicode --skill open-threads","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Fskills\u002Fopen-threads\u002FSKILL.md",true,[],[52,59,66,72,79,86],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M759XGHEQRJ1GWZTPRFF9Z1W","malformed","Frontmatter that parses as YAML but is missing the required name field.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fmalformed\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M759XDVQ1PYPMT876X8J21TQ","duplicated","Second skill carrying the duplicated frontmatter name.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdup-two\u002FSKILL.md",[],[],{"skillNo":67,"name":61,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M759XBZYBHF38JDWSRHAC6E1","First skill carrying the duplicated frontmatter name.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdup-one\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M759XAQBSP29BKTTXR1WF2D7","drifted","A skill whose API claims have drifted from the fixture packages.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdrifted\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M759X8CNBPVK98C6M45D0QMB","clean","A clean skill whose every extracted claim resolves against the fixture packages.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fclean\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M759X73H6N2G0VDH8CJ5TF11","broken-paths","A skill with a broken relative link and a broken cited package path.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fbroken-paths\u002FSKILL.md",[],[]]