[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75WHA0NKH95HT58Q5G5AAD3":3,"skill-same:01M75WHA0NKH95HT58Q5G5AAD3":45},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":44},"01M75WHA0NKH95HT58Q5G5AAD3","swarm-shutdown",null,"Gracefully shutdown a swarm team","stevengonsalvez\u002Fainb-toolkit","stevengonsalvez","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9320602?v=4","01M75W59QRYZYANWY3XG8CJB1P","Steven Gonsalvez","01M75W59RD5YW1RT67BDV0EAZF",1,"MIT","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-shutdown\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: swarm-shutdown\ndescription: Gracefully shutdown a swarm team\nuser-invocable: true\n---\n\n# \u002Fswarm-shutdown\n\nGracefully shutdown a swarm team with optional force flag.\n\n## Usage\n\n```bash\n\u002Fswarm-shutdown \u003Cteam-id> [--force]\n```\n\n## Arguments\n\n| Argument | Required | Description |\n|----------|----------|-------------|\n| `\u003Cteam-id>` | Yes | The swarm team ID to shutdown |\n| `--force` | No | Skip graceful shutdown, kill immediately |\n\n## Process\n\nWhen you receive this command:\n\n### Graceful Shutdown (Default)\n\n1. **Broadcast Shutdown Message**\n   ```bash\n   source {{HOME_TOOL_DIR}}\u002Futils\u002Fswarm-lib.sh\n\n   echo \"Initiating graceful shutdown of $TEAM_ID...\"\n\n   # Notify all agents\n   swarm_broadcast \"$TEAM_ID\" \"system\" \"shutdown\" \\\n     '{\"reason\": \"graceful shutdown requested\", \"checkpoint\": true}'\n\n   echo \"Shutdown message broadcast to all agents\"\n   ```\n\n2. **Wait for Checkpoint**\n   ```bash\n   echo \"Waiting 10 seconds for agents to checkpoint...\"\n   sleep 10\n   ```\n\n3. **Verify Agent Status**\n   ```bash\n   # Check if agents have acknowledged\n   TEAM_DIR=\"{{HOME_TOOL_DIR}}\u002Fswarm\u002F$TEAM_ID\"\n\n   for inbox in \"$TEAM_DIR\"\u002Finbox\u002F*.jsonl; do\n     AGENT=$(basename \"$inbox\" .jsonl)\n     LAST_MSG=$(tail -1 \"$inbox\" 2>\u002Fdev\u002Fnull | jq -r '.type' || echo \"\")\n\n     if [ \"$LAST_MSG\" = \"checkpoint\" ]; then\n       echo \"  + $AGENT checkpointed\"\n     else\n       echo \"  o $AGENT (no checkpoint confirmation)\"\n     fi\n   done\n   ```\n\n4. **Kill tmux Sessions**\n   ```bash\n   TEAM_JSON=$(cat \"$TEAM_DIR\u002Fteam.json\")\n\n   # Kill leader\n   LEADER_SESSION=$(echo \"$TEAM_JSON\" | jq -r '.leader.session')\n   if tmux has-session -t \"$LEADER_SESSION\" 2>\u002Fdev\u002Fnull; then\n     tmux kill-session -t \"$LEADER_SESSION\"\n     echo \"  + Killed leader: $LEADER_SESSION\"\n   fi\n\n   # Kill agents\n   for session in $(echo \"$TEAM_JSON\" | jq -r '.members[].session'); do\n     if tmux has-session -t \"$session\" 2>\u002Fdev\u002Fnull; then\n       tmux kill-session -t \"$session\"\n       echo \"  + Killed agent: $session\"\n     fi\n   done\n   ```\n\n5. **Update Team State**\n   ```bash\n   swarm_update_team \"$TEAM_ID\" '{\"status\": \"shutdown\", \"shutdown_at\": \"'\"$(date -Iseconds)\"'\"}'\n   ```\n\n6. **Report**\n   ```bash\n   echo \"\"\n   echo \"========================================\"\n   echo \"  Swarm Shutdown Complete: $TEAM_ID\"\n   echo \"========================================\"\n   echo \"\"\n   echo \"  Team data preserved at:\"\n   echo \"    $TEAM_DIR\u002F\"\n   echo \"\"\n   echo \"  To archive: \u002Fswarm-archive $TEAM_ID\"\n   echo \"  To restart: \u002Fswarm-create with same epic\"\n   echo \"\"\n   ```\n\n### Force Shutdown (--force)\n\nSkip the graceful steps and kill immediately:\n\n```bash\necho \"Force shutdown of $TEAM_ID...\"\n\n# Kill all sessions without waiting\nswarm_shutdown \"$TEAM_ID\" --force\n\necho \"Force shutdown complete\"\n```\n\n## Output\n\n### Graceful Shutdown\n```\n================================================================\n  SWARM SHUTDOWN: swarm-1738585396\n================================================================\n\nPhase 1: Broadcasting shutdown...\n  -> Sent to leader\n  -> Sent to agent-1\n  -> Sent to agent-2\n  -> Sent to agent-3\n\nPhase 2: Waiting for checkpoints (10s)...\n  ==================== 100%\n\nPhase 3: Verifying checkpoints...\n  + leader: checkpointed\n  + agent-1: checkpointed\n  + agent-2: checkpointed\n  o agent-3: no response (will force kill)\n\nPhase 4: Terminating sessions...\n  + Killed: swarm-1738585396-leader\n  + Killed: swarm-1738585396-agent-1\n  + Killed: swarm-1738585396-agent-2\n  + Killed: swarm-1738585396-agent-3\n\nPhase 5: Updating team state...\n  + Status set to: shutdown\n\n================================================================\n  SHUTDOWN COMPLETE\n================================================================\n\n  Team data preserved at: {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\u002F\n\n  Options:\n    Archive team:    swarm-lib.sh archive swarm-1738585396\n    View final state: cat {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\u002Fteam.json\n    Restart:         \u002Fswarm-create --epic bd-epic-123\n\n================================================================\n```\n\n### Force Shutdown\n```\n================================================================\n  FORCE SHUTDOWN: swarm-1738585396\n================================================================\n\nKilling sessions immediately...\n  + Killed: swarm-1738585396-leader\n  + Killed: swarm-1738585396-agent-1\n  + Killed: swarm-1738585396-agent-2\n\nStatus updated to: shutdown\n\n================================================================\n```\n\n## Agent Checkpoint Protocol\n\nWhen agents receive a shutdown message, they should:\n\n1. **Complete or Pause Current Work**\n   - If close to completion: finish the task\n   - Otherwise: save progress state\n\n2. **Update Beads**\n   ```bash\n   # Mark task as paused\u002Fblocked\n   bd update $CURRENT_TASK --status blocked --reason \"Swarm shutdown\"\n   ```\n\n3. **Send Checkpoint Confirmation**\n   ```bash\n   swarm_send_message \"$TEAM_ID\" \"$AGENT_NAME\" \"system\" \"checkpoint\" \\\n     '{\"task\": \"'\"$CURRENT_TASK\"'\", \"progress\": 75, \"state\": \"saved\"}'\n   ```\n\n4. **Clean Up**\n   - Close any open files\n   - Save session notes to shared\u002F\n\n## Post-Shutdown Options\n\n### Archive Team\n```bash\n# Move team to .archive\u002F directory\nswarm-lib.sh archive swarm-1738585396\n```\n\n### Delete Team\n```bash\n# Permanently remove team data\nrm -rf {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\n```\n\n### Restart Team\n```bash\n# Create new swarm from same epic\n\u002Fswarm-create --epic bd-epic-platform-rebuild --agents 3\n```\n\n## Error Handling\n\n| Error | Resolution |\n|-------|------------|\n| Team not found | Verify team ID exists |\n| Sessions already dead | Proceeds with state update only |\n| Permission denied | Check tmux socket permissions |\n| Checkpoint timeout | Force flag used automatically after timeout |\n","# \u002Fswarm-shutdown\n\nGracefully shutdown a swarm team with optional force flag.\n\n## Usage\n\n```bash\n\u002Fswarm-shutdown \u003Cteam-id> [--force]\n```\n\n## Arguments\n\n| Argument | Required | Description |\n|----------|----------|-------------|\n| `\u003Cteam-id>` | Yes | The swarm team ID to shutdown |\n| `--force` | No | Skip graceful shutdown, kill immediately |\n\n## Process\n\nWhen you receive this command:\n\n### Graceful Shutdown (Default)\n\n1. **Broadcast Shutdown Message**\n   ```bash\n   source {{HOME_TOOL_DIR}}\u002Futils\u002Fswarm-lib.sh\n\n   echo \"Initiating graceful shutdown of $TEAM_ID...\"\n\n   # Notify all agents\n   swarm_broadcast \"$TEAM_ID\" \"system\" \"shutdown\" \\\n     '{\"reason\": \"graceful shutdown requested\", \"checkpoint\": true}'\n\n   echo \"Shutdown message broadcast to all agents\"\n   ```\n\n2. **Wait for Checkpoint**\n   ```bash\n   echo \"Waiting 10 seconds for agents to checkpoint...\"\n   sleep 10\n   ```\n\n3. **Verify Agent Status**\n   ```bash\n   # Check if agents have acknowledged\n   TEAM_DIR=\"{{HOME_TOOL_DIR}}\u002Fswarm\u002F$TEAM_ID\"\n\n   for inbox in \"$TEAM_DIR\"\u002Finbox\u002F*.jsonl; do\n     AGENT=$(basename \"$inbox\" .jsonl)\n     LAST_MSG=$(tail -1 \"$inbox\" 2>\u002Fdev\u002Fnull | jq -r '.type' || echo \"\")\n\n     if [ \"$LAST_MSG\" = \"checkpoint\" ]; then\n       echo \"  + $AGENT checkpointed\"\n     else\n       echo \"  o $AGENT (no checkpoint confirmation)\"\n     fi\n   done\n   ```\n\n4. **Kill tmux Sessions**\n   ```bash\n   TEAM_JSON=$(cat \"$TEAM_DIR\u002Fteam.json\")\n\n   # Kill leader\n   LEADER_SESSION=$(echo \"$TEAM_JSON\" | jq -r '.leader.session')\n   if tmux has-session -t \"$LEADER_SESSION\" 2>\u002Fdev\u002Fnull; then\n     tmux kill-session -t \"$LEADER_SESSION\"\n     echo \"  + Killed leader: $LEADER_SESSION\"\n   fi\n\n   # Kill agents\n   for session in $(echo \"$TEAM_JSON\" | jq -r '.members[].session'); do\n     if tmux has-session -t \"$session\" 2>\u002Fdev\u002Fnull; then\n       tmux kill-session -t \"$session\"\n       echo \"  + Killed agent: $session\"\n     fi\n   done\n   ```\n\n5. **Update Team State**\n   ```bash\n   swarm_update_team \"$TEAM_ID\" '{\"status\": \"shutdown\", \"shutdown_at\": \"'\"$(date -Iseconds)\"'\"}'\n   ```\n\n6. **Report**\n   ```bash\n   echo \"\"\n   echo \"========================================\"\n   echo \"  Swarm Shutdown Complete: $TEAM_ID\"\n   echo \"========================================\"\n   echo \"\"\n   echo \"  Team data preserved at:\"\n   echo \"    $TEAM_DIR\u002F\"\n   echo \"\"\n   echo \"  To archive: \u002Fswarm-archive $TEAM_ID\"\n   echo \"  To restart: \u002Fswarm-create with same epic\"\n   echo \"\"\n   ```\n\n### Force Shutdown (--force)\n\nSkip the graceful steps and kill immediately:\n\n```bash\necho \"Force shutdown of $TEAM_ID...\"\n\n# Kill all sessions without waiting\nswarm_shutdown \"$TEAM_ID\" --force\n\necho \"Force shutdown complete\"\n```\n\n## Output\n\n### Graceful Shutdown\n```\n================================================================\n  SWARM SHUTDOWN: swarm-1738585396\n================================================================\n\nPhase 1: Broadcasting shutdown...\n  -> Sent to leader\n  -> Sent to agent-1\n  -> Sent to agent-2\n  -> Sent to agent-3\n\nPhase 2: Waiting for checkpoints (10s)...\n  ==================== 100%\n\nPhase 3: Verifying checkpoints...\n  + leader: checkpointed\n  + agent-1: checkpointed\n  + agent-2: checkpointed\n  o agent-3: no response (will force kill)\n\nPhase 4: Terminating sessions...\n  + Killed: swarm-1738585396-leader\n  + Killed: swarm-1738585396-agent-1\n  + Killed: swarm-1738585396-agent-2\n  + Killed: swarm-1738585396-agent-3\n\nPhase 5: Updating team state...\n  + Status set to: shutdown\n\n================================================================\n  SHUTDOWN COMPLETE\n================================================================\n\n  Team data preserved at: {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\u002F\n\n  Options:\n    Archive team:    swarm-lib.sh archive swarm-1738585396\n    View final state: cat {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\u002Fteam.json\n    Restart:         \u002Fswarm-create --epic bd-epic-123\n\n================================================================\n```\n\n### Force Shutdown\n```\n================================================================\n  FORCE SHUTDOWN: swarm-1738585396\n================================================================\n\nKilling sessions immediately...\n  + Killed: swarm-1738585396-leader\n  + Killed: swarm-1738585396-agent-1\n  + Killed: swarm-1738585396-agent-2\n\nStatus updated to: shutdown\n\n================================================================\n```\n\n## Agent Checkpoint Protocol\n\nWhen agents receive a shutdown message, they should:\n\n1. **Complete or Pause Current Work**\n   - If close to completion: finish the task\n   - Otherwise: save progress state\n\n2. **Update Beads**\n   ```bash\n   # Mark task as paused\u002Fblocked\n   bd update $CURRENT_TASK --status blocked --reason \"Swarm shutdown\"\n   ```\n\n3. **Send Checkpoint Confirmation**\n   ```bash\n   swarm_send_message \"$TEAM_ID\" \"$AGENT_NAME\" \"system\" \"checkpoint\" \\\n     '{\"task\": \"'\"$CURRENT_TASK\"'\", \"progress\": 75, \"state\": \"saved\"}'\n   ```\n\n4. **Clean Up**\n   - Close any open files\n   - Save session notes to shared\u002F\n\n## Post-Shutdown Options\n\n### Archive Team\n```bash\n# Move team to .archive\u002F directory\nswarm-lib.sh archive swarm-1738585396\n```\n\n### Delete Team\n```bash\n# Permanently remove team data\nrm -rf {{HOME_TOOL_DIR}}\u002Fswarm\u002Fswarm-1738585396\n```\n\n### Restart Team\n```bash\n# Create new swarm from same epic\n\u002Fswarm-create --epic bd-epic-platform-rebuild --agents 3\n```\n\n## Error Handling\n\n| Error | Resolution |\n|-------|------------|\n| Team not found | Verify team ID exists |\n| Sessions already dead | Proceeds with state update only |\n| Permission denied | Check tmux socket permissions |\n| Checkpoint timeout | Force flag used automatically after timeout |\n",{"name":5,"description":7,"user-invocable":24},true,"main","9cf32d1e636db09530158af14ba301bfa5d401e9","skills\u002Fswarm-shutdown","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez","stevengonsalvez.com","2026-11-12 00:50:59",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":24},[34,37,40],{"tool":35,"command":36},"npx","npx skills add stevengonsalvez\u002Fainb-toolkit --skill swarm-shutdown",{"tool":38,"command":39},"bunx","bunx skills add stevengonsalvez\u002Fainb-toolkit --skill swarm-shutdown",{"tool":41,"command":42},"pnpm","pnpm dlx skills add stevengonsalvez\u002Fainb-toolkit --skill swarm-shutdown","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-shutdown\u002FSKILL.md",[],[46,53,60,66,73,80],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M75WK9B8DKVJBJJ4CX2QMJMX","well-formed","Fixture skill that satisfies every mechanical rule, used to prove the conformance check passes a clean tree instead of failing everything.","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fclean\u002Fwell-formed\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M75WK6ZGDXJJN8879K49QEYG","underscore-tools","Fixture skill that spells the tool allowlist key with an underscore instead of the hyphen the spec requires.","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fbroken\u002Funderscore-tools\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":6,"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},"01M75WK524MVT2H9E27ZCEA3HR","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fbroken\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M75WJWZBMKR8R60PG3T3MCCC","long-description","Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling. Fixture skill with a deliberately oversized description used to prove the conformance check rejects anything past the 1024 character ceiling.","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fbroken\u002Flong-description\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M75WJVRH3J22WKED7E5D01S8","some-other-name","Fixture skill whose frontmatter name does not match its parent directory name.","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fbroken\u002Fdir-mismatch\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M75WJTC7H5FRP6S129VBSMZC","bad_Name","Fixture skill whose name uses an underscore and a capital letter, so it violates the agentskills.io name pattern.","https:\u002F\u002Fgithub.com\u002Fstevengonsalvez\u002Fainb-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fagentskills\u002Fbroken\u002Fbad_Name\u002FSKILL.md",[],[]]