{"id":"71f82bae-231a-4f25-b248-8af63f6bde44","shortId":"Pasjej","kind":"skill","title":"pilot-role-assign","tagline":"Assign and manage hierarchical roles within a swarm for coordinated task distribution.  Use this skill when: 1. Agents need different responsibilities (leader, worker, coordinator) 2. You want capability-based role assignment (GPU workers, CPU workers) 3. You need dynamic role re","description":"# pilot-role-assign\n\nDynamically assign and manage roles in agent swarms using capability-based matching.\n\n## Commands\n\n### Advertise agent capabilities\n```bash\npilotctl --json publish \"registry-hostname\" \"capabilities:$SWARM_NAME\" \\\n  --data \"{\\\"agent\\\":\\\"$AGENT_ID\\\",\\\"capabilities\\\":{\\\"cpu_cores\\\":16,\\\"ram_gb\\\":64,\\\"gpu\\\":true}}\"\n```\n\n### Assign role to agent\n```bash\npilotctl --json send-message \"$AGENT_ADDRESS\" \\\n  --data \"{\\\"type\\\":\\\"role_assignment\\\",\\\"role\\\":\\\"$ROLE_NAME\\\",\\\"assigned_by\\\":\\\"$COORDINATOR_ID\\\"}\"\n\npilotctl --json publish \"registry-hostname\" \"roles:$SWARM_NAME\" \\\n  --data \"{\\\"agent\\\":\\\"$AGENT_ID\\\",\\\"role\\\":\\\"$ROLE_NAME\\\",\\\"assigned_at\\\":\\\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\\\"}\"\n```\n\n### Query current role distribution\n```bash\nROLE_DIST=$(pilotctl --json inbox \\\n  | jq '[.messages[] | select(.topic == \"roles:'$SWARM_NAME'\")] | group_by(.payload.role) | map({role: .[0].payload.role, count: length})')\necho \"$ROLE_DIST\" | jq '.'\n```\n\n## Workflow Example\n\nCoordinator assigns roles based on capabilities:\n\n```bash\n#!/bin/bash\nSWARM_NAME=\"compute-swarm\"\nREGISTRY_HOST=\"registry.example.com\"\n\n# Get agent capabilities\nCAPABILITIES=$(pilotctl --json inbox | jq '[.messages[] | select(.topic == \"capabilities:'$SWARM_NAME'\") | .payload]')\n\nfor agent_data in $(echo \"$CAPABILITIES\" | jq -r '.[] | @base64'); do\n  AGENT=$(echo \"$agent_data\" | base64 -d | jq -r '.agent')\n  HAS_GPU=$(echo \"$agent_data\" | base64 -d | jq -r '.capabilities.gpu // false')\n\n  if [ \"$HAS_GPU\" = \"true\" ]; then\n    ROLE=\"gpu_worker\"\n  else\n    ROLE=\"worker\"\n  fi\n\n  AGENT_ADDR=$(pilotctl --json peers | jq -r '.[] | select(.node_id == \"'$AGENT'\") | .address')\n\n  pilotctl --json send-message \"$AGENT_ADDR\" \\\n    --data \"{\\\"type\\\":\\\"role_assignment\\\",\\\"role\\\":\\\"$ROLE\\\"}\" &\ndone\nwait\n```\n\n## Dependencies\n\nRequires pilot-protocol skill, jq, and base64.","tags":["pilot","role","assign","skills","teoslayer","agent-skills","ai-agents","clawhub","networking","openclaw","overlay-network","p2p"],"capabilities":["skill","source-teoslayer","skill-pilot-role-assign","topic-agent-skills","topic-ai-agents","topic-clawhub","topic-networking","topic-openclaw","topic-overlay-network","topic-p2p","topic-pilot-protocol"],"categories":["pilot-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/TeoSlayer/pilot-skills/pilot-role-assign","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add TeoSlayer/pilot-skills","source_repo":"https://github.com/TeoSlayer/pilot-skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 6 github stars · SKILL.md body (1,845 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:15:00.324Z","embedding":null,"createdAt":"2026-05-18T13:22:46.407Z","updatedAt":"2026-05-18T19:15:00.324Z","lastSeenAt":"2026-05-18T19:15:00.324Z","tsv":"'/bin/bash':179 '0':162 '1':21 '16':85 '2':29 '3':41 '64':88 'addr':246,263 'address':102,256 'advertis':65 'agent':22,57,66,79,80,94,101,124,125,189,204,213,215,221,225,245,255,262 'assign':4,5,36,50,52,91,106,110,130,173,267 'base':34,62,175 'base64':211,217,227,280 'bash':68,95,144,178 'capabilities.gpu':231 'capability-bas':32,60 'capabl':33,61,67,75,82,177,190,191,199,208 'command':64 'comput':183 'compute-swarm':182 'coordin':14,28,112,172 'core':84 'count':164 'cpu':39,83 'current':141 'd':218,228 'data':78,103,123,205,216,226,264 'date':132 'depend':272 'differ':24 'dist':146,168 'distribut':16,143 'done':270 'dt':136 'dynam':44,51 'echo':166,207,214,224 'els':241 'exampl':171 'fals':232 'fi':244 'gb':87 'get':188 'gpu':37,89,223,235,239 'group':157 'h':137 'hierarch':8 'host':186 'hostnam':74,119 'id':81,113,126,254 'inbox':149,194 'jq':150,169,195,209,219,229,250,278 'json':70,97,115,148,193,248,258 'leader':26 'length':165 'm':135,138 'manag':7,54 'map':160 'match':63 'messag':100,151,196,261 'name':77,109,122,129,156,181,201 'need':23,43 'node':253 'payload':202 'payload.role':159,163 'peer':249 'pilot':2,48,275 'pilot-protocol':274 'pilot-role-assign':1,47 'pilotctl':69,96,114,147,192,247,257 'protocol':276 'publish':71,116 'queri':140 'r':210,220,230,251 'ram':86 're':46 'registri':73,118,185 'registry-hostnam':72,117 'registry.example.com':187 'requir':273 'respons':25 'role':3,9,35,45,49,55,92,105,107,108,120,127,128,142,145,154,161,167,174,238,242,266,268,269 'select':152,197,252 'send':99,260 'send-messag':98,259 'skill':19,277 'skill-pilot-role-assign' 'source-teoslayer' 'swarm':12,58,76,121,155,180,184,200 'sz':139 'task':15 'topic':153,198 'topic-agent-skills' 'topic-ai-agents' 'topic-clawhub' 'topic-networking' 'topic-openclaw' 'topic-overlay-network' 'topic-p2p' 'topic-pilot-protocol' 'true':90,236 'type':104,265 'u':133 'use':17,59 'wait':271 'want':31 'within':10 'worker':27,38,40,240,243 'workflow':170 'y':134","prices":[{"id":"b1d13f4f-568c-4914-812b-9900abab0f0e","listingId":"71f82bae-231a-4f25-b248-8af63f6bde44","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"TeoSlayer","category":"pilot-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:22:46.407Z"}],"sources":[{"listingId":"71f82bae-231a-4f25-b248-8af63f6bde44","source":"github","sourceId":"TeoSlayer/pilot-skills/pilot-role-assign","sourceUrl":"https://github.com/TeoSlayer/pilot-skills/tree/main/skills/pilot-role-assign","isPrimary":false,"firstSeenAt":"2026-05-18T13:22:46.407Z","lastSeenAt":"2026-05-18T19:15:00.324Z"}],"details":{"listingId":"71f82bae-231a-4f25-b248-8af63f6bde44","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"TeoSlayer","slug":"pilot-role-assign","github":{"repo":"TeoSlayer/pilot-skills","stars":6,"topics":["agent-skills","ai-agents","clawhub","networking","openclaw","overlay-network","p2p","pilot-protocol"],"license":"agpl-3.0","html_url":"https://github.com/TeoSlayer/pilot-skills","pushed_at":"2026-05-13T06:08:49Z","description":"80+ agent skills for Pilot Protocol — communication, file transfer, trust, task routing, swarm coordination, and more","skill_md_sha":"c64851cfca5eef220452f32350d1f8b7755ddf54","skill_md_path":"skills/pilot-role-assign/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/TeoSlayer/pilot-skills/tree/main/skills/pilot-role-assign"},"layout":"multi","source":"github","category":"pilot-skills","frontmatter":{"name":"pilot-role-assign","license":"AGPL-3.0","description":"Assign and manage hierarchical roles within a swarm for coordinated task distribution.  Use this skill when: 1. Agents need different responsibilities (leader, worker, coordinator) 2. You want capability-based role assignment (GPU workers, CPU workers) 3. You need dynamic role reassignment on failures or scaling events  Do NOT use this skill when: - All agents are homogeneous (no role differentiation needed) - Roles are static and configured at startup (use tags)","compatibility":"Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start)."},"skills_sh_url":"https://skills.sh/TeoSlayer/pilot-skills/pilot-role-assign"},"updatedAt":"2026-05-18T19:15:00.324Z"}}