[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DG0Z6R9WHPWXZH1SX16036":3,"skill-same:01M6DG0Z6R9WHPWXZH1SX16036":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":29,"frontMatter":30,"refName":25,"commitSha":31,"skillDirectory":32,"forksCount":13,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M6DG0Z6R9WHPWXZH1SX16036","add-compact",null,"Add \u002Fcompact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in \u002Fcompact slash command. Main-group or trusted sender only.","mbaker95\u002Fnanodex","mbaker95","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11398294?v=4","01M6DFXVNAJHZG78Y2D700Y6V3","01M6DFXVTTW83QGKTJ9FJ5YCH5",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fadd-compact\u002FSKILL.md",[],[18,19,20,21,22,23,24,25],"compact","add compact","sdk","sessions","command","context","only","main","2026-11-10 10:12:30",false,"---\nname: add-compact\ndescription: Add \u002Fcompact command for manual context compaction. Solves context rot in long sessions by forwarding the SDK's built-in \u002Fcompact slash command. Main-group or trusted sender only.\n---\n\n# Add \u002Fcompact Command\n\nAdds a `\u002Fcompact` session command that compacts conversation history to fight context rot in long-running sessions. Uses the Claude Agent SDK's built-in `\u002Fcompact` slash command — no synthetic system prompts.\n\n**Session contract:** `\u002Fcompact` keeps the same logical session alive. The SDK returns a new session ID after compaction (via the `init` system message), which the agent-runner forwards to the orchestrator as `newSessionId`. No destructive reset occurs — the agent retains summarized context.\n\n## Phase 1: Pre-flight\n\nCheck if `src\u002Fsession-commands.ts` exists:\n\n```bash\ntest -f src\u002Fsession-commands.ts && echo \"Already applied\" || echo \"Not applied\"\n```\n\nIf already applied, skip to Phase 3 (Verify).\n\n## Phase 2: Apply Code Changes\n\nMerge the skill branch:\n\n```bash\ngit fetch upstream skill\u002Fcompact\ngit merge upstream\u002Fskill\u002Fcompact\n```\n\n> **Note:** `upstream` is the remote pointing to `qwibitai\u002Fnanoclaw`. If using a different remote name, substitute accordingly.\n\nThis adds:\n- `src\u002Fsession-commands.ts` (extract and authorize session commands)\n- `src\u002Fsession-commands.test.ts` (unit tests for command parsing and auth)\n- Session command interception in `src\u002Findex.ts` (both `processGroupMessages` and `startMessageLoop`)\n- Slash command handling in `container\u002Fagent-runner\u002Fsrc\u002Findex.ts`\n\n### Validate\n\n```bash\nnpm test\nnpm run build\n```\n\n### Rebuild container\n\n```bash\n.\u002Fcontainer\u002Fbuild.sh\n```\n\n### Restart service\n\n```bash\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.nanoclaw  # macOS\n# Linux: systemctl --user restart nanoclaw\n```\n\n## Phase 3: Verify\n\n### Integration Test\n\n1. Start NanoClaw in dev mode: `npm run dev`\n2. From the **main group** (self-chat), send exactly: `\u002Fcompact`\n3. Verify:\n   - The agent acknowledges compaction (e.g., \"Conversation compacted.\")\n   - The session continues — send a follow-up message and verify the agent responds coherently\n   - A conversation archive is written to `groups\u002F{folder}\u002Fconversations\u002F` (by the PreCompact hook)\n   - Container logs show `Compact boundary observed` (confirms SDK actually compacted)\n   - If `compact_boundary` was NOT observed, the response says \"compact_boundary was not observed\"\n4. From a **non-main group** as a non-admin user, send: `@\u003Cassistant> \u002Fcompact`\n5. Verify:\n   - The bot responds with \"Session commands require admin access.\"\n   - No compaction occurs, no container is spawned for the command\n6. From a **non-main group** as the admin (device owner \u002F `is_from_me`), send: `@\u003Cassistant> \u002Fcompact`\n7. Verify:\n   - Compaction proceeds normally (same behavior as main group)\n8. While an **active container** is running for the main group, send `\u002Fcompact`\n9. Verify:\n   - The active container is signaled to close (authorized senders only — untrusted senders cannot kill in-flight work)\n   - Compaction proceeds via a new container once the active one exits\n   - The command is not dropped (no cursor race)\n10. Send a normal message, then `\u002Fcompact`, then another normal message in quick succession (same polling batch):\n11. Verify:\n    - Pre-compact messages are sent to the agent first (check container logs for two `runAgent` calls)\n    - Compaction proceeds after pre-compact messages are processed\n    - Messages **after** `\u002Fcompact` in the batch are preserved (cursor advances to `\u002Fcompact`'s timestamp only) and processed on the next poll cycle\n12. From a **non-main group** as a non-admin user, send `@\u003Cassistant> \u002Fcompact`:\n13. Verify:\n    - Denial message is sent (\"Session commands require admin access.\")\n    - The `\u002Fcompact` is consumed (cursor advanced) — it does NOT replay on future polls\n    - Other messages in the same batch are also consumed (cursor is a high-water mark — this is an accepted tradeoff for the narrow edge case of denied `\u002Fcompact` + other messages in the same polling interval)\n    - No container is killed or interrupted\n14. From a **non-main group** (with `requiresTrigger` enabled) as a non-admin user, send bare `\u002Fcompact` (no trigger prefix):\n15. Verify:\n    - No denial message is sent (trigger policy prevents untrusted bot responses)\n    - The `\u002Fcompact` is consumed silently\n    - Note: in groups where `requiresTrigger` is `false`, a denial message IS sent because the sender is considered reachable\n16. After compaction, verify **no auto-compaction** behavior — only manual `\u002Fcompact` triggers it\n\n### Validation on Fresh Clone\n\n```bash\ngit clone \u003Cyour-fork> \u002Ftmp\u002Fnanoclaw-test\ncd \u002Ftmp\u002Fnanoclaw-test\nclaude  # then run \u002Fadd-compact\nnpm run build\nnpm test\n.\u002Fcontainer\u002Fbuild.sh\n# Manual: send \u002Fcompact from main group, verify compaction + continuation\n# Manual: send @\u003Cassistant> \u002Fcompact from non-main as non-admin, verify denial\n# Manual: send @\u003Cassistant> \u002Fcompact from non-main as admin, verify allowed\n# Manual: verify no auto-compaction behavior\n```\n\n## Security Constraints\n\n- **Main-group or trusted\u002Fadmin sender only.** The main group is the user's private self-chat and is trusted (see `docs\u002FSECURITY.md`). Non-main groups are untrusted — a careless or malicious user could wipe the agent's short-term memory. However, the device owner (`is_from_me`) is always trusted and can compact from any group.\n- **No auto-compaction.** This skill implements manual compaction only. Automatic threshold-based compaction is a separate concern and should be a separate skill.\n- **No config file.** NanoClaw's philosophy is customization through code changes, not configuration sprawl.\n- **Transcript archived before compaction.** The existing `PreCompact` hook in the agent-runner archives the full transcript to `conversations\u002F` before the SDK compacts it.\n- **Session continues after compaction.** This is not a destructive reset. The conversation continues with summarized context.\n\n## What This Does NOT Do\n\n- No automatic compaction threshold (add separately if desired)\n- No `\u002Fclear` command (separate skill, separate semantics — `\u002Fclear` is a destructive reset)\n- No cross-group compaction (each group's session is isolated)\n- No changes to the container image, Dockerfile, or build script\n\n## Troubleshooting\n\n- **\"Session commands require admin access\"**: Only the device owner (`is_from_me`) or main-group senders can use `\u002Fcompact`. Other users are denied.\n- **No compact_boundary in logs**: The SDK may not emit this event in all versions. Check the agent-runner logs for the warning message. Compaction may still have succeeded.\n- **Pre-compact failure**: If messages before `\u002Fcompact` fail to process, the error message says \"Failed to process messages before \u002Fcompact.\" The cursor advances past sent output to prevent duplicates; `\u002Fcompact` remains pending for the next attempt.\n","# Add \u002Fcompact Command\n\nAdds a `\u002Fcompact` session command that compacts conversation history to fight context rot in long-running sessions. Uses the Claude Agent SDK's built-in `\u002Fcompact` slash command — no synthetic system prompts.\n\n**Session contract:** `\u002Fcompact` keeps the same logical session alive. The SDK returns a new session ID after compaction (via the `init` system message), which the agent-runner forwards to the orchestrator as `newSessionId`. No destructive reset occurs — the agent retains summarized context.\n\n## Phase 1: Pre-flight\n\nCheck if `src\u002Fsession-commands.ts` exists:\n\n```bash\ntest -f src\u002Fsession-commands.ts && echo \"Already applied\" || echo \"Not applied\"\n```\n\nIf already applied, skip to Phase 3 (Verify).\n\n## Phase 2: Apply Code Changes\n\nMerge the skill branch:\n\n```bash\ngit fetch upstream skill\u002Fcompact\ngit merge upstream\u002Fskill\u002Fcompact\n```\n\n> **Note:** `upstream` is the remote pointing to `qwibitai\u002Fnanoclaw`. If using a different remote name, substitute accordingly.\n\nThis adds:\n- `src\u002Fsession-commands.ts` (extract and authorize session commands)\n- `src\u002Fsession-commands.test.ts` (unit tests for command parsing and auth)\n- Session command interception in `src\u002Findex.ts` (both `processGroupMessages` and `startMessageLoop`)\n- Slash command handling in `container\u002Fagent-runner\u002Fsrc\u002Findex.ts`\n\n### Validate\n\n```bash\nnpm test\nnpm run build\n```\n\n### Rebuild container\n\n```bash\n.\u002Fcontainer\u002Fbuild.sh\n```\n\n### Restart service\n\n```bash\nlaunchctl kickstart -k gui\u002F$(id -u)\u002Fcom.nanoclaw  # macOS\n# Linux: systemctl --user restart nanoclaw\n```\n\n## Phase 3: Verify\n\n### Integration Test\n\n1. Start NanoClaw in dev mode: `npm run dev`\n2. From the **main group** (self-chat), send exactly: `\u002Fcompact`\n3. Verify:\n   - The agent acknowledges compaction (e.g., \"Conversation compacted.\")\n   - The session continues — send a follow-up message and verify the agent responds coherently\n   - A conversation archive is written to `groups\u002F{folder}\u002Fconversations\u002F` (by the PreCompact hook)\n   - Container logs show `Compact boundary observed` (confirms SDK actually compacted)\n   - If `compact_boundary` was NOT observed, the response says \"compact_boundary was not observed\"\n4. From a **non-main group** as a non-admin user, send: `@\u003Cassistant> \u002Fcompact`\n5. Verify:\n   - The bot responds with \"Session commands require admin access.\"\n   - No compaction occurs, no container is spawned for the command\n6. From a **non-main group** as the admin (device owner \u002F `is_from_me`), send: `@\u003Cassistant> \u002Fcompact`\n7. Verify:\n   - Compaction proceeds normally (same behavior as main group)\n8. While an **active container** is running for the main group, send `\u002Fcompact`\n9. Verify:\n   - The active container is signaled to close (authorized senders only — untrusted senders cannot kill in-flight work)\n   - Compaction proceeds via a new container once the active one exits\n   - The command is not dropped (no cursor race)\n10. Send a normal message, then `\u002Fcompact`, then another normal message in quick succession (same polling batch):\n11. Verify:\n    - Pre-compact messages are sent to the agent first (check container logs for two `runAgent` calls)\n    - Compaction proceeds after pre-compact messages are processed\n    - Messages **after** `\u002Fcompact` in the batch are preserved (cursor advances to `\u002Fcompact`'s timestamp only) and processed on the next poll cycle\n12. From a **non-main group** as a non-admin user, send `@\u003Cassistant> \u002Fcompact`:\n13. Verify:\n    - Denial message is sent (\"Session commands require admin access.\")\n    - The `\u002Fcompact` is consumed (cursor advanced) — it does NOT replay on future polls\n    - Other messages in the same batch are also consumed (cursor is a high-water mark — this is an accepted tradeoff for the narrow edge case of denied `\u002Fcompact` + other messages in the same polling interval)\n    - No container is killed or interrupted\n14. From a **non-main group** (with `requiresTrigger` enabled) as a non-admin user, send bare `\u002Fcompact` (no trigger prefix):\n15. Verify:\n    - No denial message is sent (trigger policy prevents untrusted bot responses)\n    - The `\u002Fcompact` is consumed silently\n    - Note: in groups where `requiresTrigger` is `false`, a denial message IS sent because the sender is considered reachable\n16. After compaction, verify **no auto-compaction** behavior — only manual `\u002Fcompact` triggers it\n\n### Validation on Fresh Clone\n\n```bash\ngit clone \u003Cyour-fork> \u002Ftmp\u002Fnanoclaw-test\ncd \u002Ftmp\u002Fnanoclaw-test\nclaude  # then run \u002Fadd-compact\nnpm run build\nnpm test\n.\u002Fcontainer\u002Fbuild.sh\n# Manual: send \u002Fcompact from main group, verify compaction + continuation\n# Manual: send @\u003Cassistant> \u002Fcompact from non-main as non-admin, verify denial\n# Manual: send @\u003Cassistant> \u002Fcompact from non-main as admin, verify allowed\n# Manual: verify no auto-compaction behavior\n```\n\n## Security Constraints\n\n- **Main-group or trusted\u002Fadmin sender only.** The main group is the user's private self-chat and is trusted (see `docs\u002FSECURITY.md`). Non-main groups are untrusted — a careless or malicious user could wipe the agent's short-term memory. However, the device owner (`is_from_me`) is always trusted and can compact from any group.\n- **No auto-compaction.** This skill implements manual compaction only. Automatic threshold-based compaction is a separate concern and should be a separate skill.\n- **No config file.** NanoClaw's philosophy is customization through code changes, not configuration sprawl.\n- **Transcript archived before compaction.** The existing `PreCompact` hook in the agent-runner archives the full transcript to `conversations\u002F` before the SDK compacts it.\n- **Session continues after compaction.** This is not a destructive reset. The conversation continues with summarized context.\n\n## What This Does NOT Do\n\n- No automatic compaction threshold (add separately if desired)\n- No `\u002Fclear` command (separate skill, separate semantics — `\u002Fclear` is a destructive reset)\n- No cross-group compaction (each group's session is isolated)\n- No changes to the container image, Dockerfile, or build script\n\n## Troubleshooting\n\n- **\"Session commands require admin access\"**: Only the device owner (`is_from_me`) or main-group senders can use `\u002Fcompact`. Other users are denied.\n- **No compact_boundary in logs**: The SDK may not emit this event in all versions. Check the agent-runner logs for the warning message. Compaction may still have succeeded.\n- **Pre-compact failure**: If messages before `\u002Fcompact` fail to process, the error message says \"Failed to process messages before \u002Fcompact.\" The cursor advances past sent output to prevent duplicates; `\u002Fcompact` remains pending for the next attempt.\n",{"name":5,"description":7},"b6b2f4d4a0c7243409d1684119a6772629bfeba6",".claude\u002Fskills\u002Fadd-compact","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex","https:\u002F\u002Fgithub.com\u002Fmbaker95","2026-03-12 23:02:12",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add mbaker95\u002Fnanodex --skill add-compact",{"tool":42,"command":43},"bunx","bunx skills add mbaker95\u002Fnanodex --skill add-compact",{"tool":45,"command":46},"pnpm","pnpm dlx skills add mbaker95\u002Fnanodex --skill add-compact","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fadd-compact\u002FSKILL.md",true,[],[51,77,93,115,127,139],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":26},"01M6DG2XYNH5XV7XGTJJ1SF0TG","agent-browser","Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002Fcontainer\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76],"agent browser","browser","pages","forms","task","test web","take","use","extract","data","user","read","screenshots","research","test","web","just","Bash","browse",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":26},"01M6DG2TPZAT3SMWSYFJ3K82TE","x-integration","X (Twitter) integration for NanoClaw. Post tweets, like, reply, retweet, and quote. Use for setup, testing, or troubleshooting X functionality. Triggers on \"setup x\", \"x integration\", \"twitter\", \"post tweet\", \"tweet\".","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fx-integration\u002FSKILL.md",[],[84,85,65,86,87,88,89,90,91,92],"x integration","integration","testing","setup","troubleshooting","twitter","reply","quote","triggers",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":26},"01M6DG2Q4BJQ046BZSR9N7GZ72","use-local-whisper","Use when the user wants local voice transcription instead of OpenAI Whisper API. Switches to whisper.cpp running on Apple Silicon. WhatsApp only for now. Requires voice-transcription skill to be applied first.","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fuse-local-whisper\u002FSKILL.md",[],[100,101,65,102,103,104,105,24,68,106,107,108,109,110,111,112,113,114],"whisper","local whisper","local","use local whisper","apple","openai whisper","voice","apple silicon","api","first","openai","cpp","transcription","openai whisper api","whatsapp",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":26},"01M6DG2N2Z1V8VV4MQFRKFAQV0","update-skills","Check for and apply updates to installed skill branches from upstream.","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[],[122,123,124,125,126],"update","update skills","upstream","branches","check",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":26},"01M6DG2J5D7Y3R2BF8V87XZAXF","update-nanoclaw","Efficiently bring upstream NanoClaw updates into a customized install, with preview, selective cherry-pick, and low token usage.","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fupdate-nanoclaw\u002FSKILL.md",[],[122,134,135,136,124,137,138],"update nanoclaw","install","pick","token","preview",{"skillNo":140,"name":87,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":26},"01M6DG2FN7S7DVD337CNT5Y67D","Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate messaging channels, register their main channel, or start the background services. Triggers on \"setup\", \"install\", \"configure nanoclaw\", or first-time setup requests.","https:\u002F\u002Fgithub.com\u002Fmbaker95\u002Fnanodex\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsetup\u002FSKILL.md",[],[87,135,92,145,146,25,65,147,68,148,109,149,150,151,152],"time","dependencies","channel","configure","services","start","messaging","run"]