Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Multi-agent swarm orchestration for complex workflows. Coordinates multiple agents, decomposes tasks, manages shared state via a local blackboard file, and e...
Multi-agent swarm orchestration for complex workflows. Coordinates multiple agents, decomposes tasks, manages shared state via a local blackboard file, and e...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Scope of this skill bundle: All instructions below run local Python scripts (scripts/*.py). No network calls are made by this skill. Tokens are UUID-based (grant_{uuid4().hex}) stored in data/active_grants.json. Audit logging is plain JSONL (data/audit_log.jsonl) β no HMAC signing in the Python layer. HMAC-signed tokens, AES-256 encryption, and the standalone MCP server are all features of the companion Node.js package (npm install -g network-ai) β they are not implemented in these Python scripts and do not run automatically.
No pip install required. All 6 scripts use Python standard library only β zero third-party packages. Note on requirements.txt: The file exists for documentation purposes only β it lists the stdlib modules used and has no required packages. All listed deps are commented out as optional. You do not need to run pip install -r requirements.txt. # Prerequisite: python3 (any version β₯ 3.8) python3 --version # That's it. Run any script directly: python3 scripts/blackboard.py list python3 scripts/swarm_guard.py budget-init --task-id "task_001" --budget 10000 # Optional: for cross-platform file locking on Windows production hosts pip install filelock # only needed if you see locking issues on Windows The data/ directory is created automatically on first run. No configuration files, environment variables, or credentials are required. Multi-agent coordination system for complex workflows requiring task delegation, parallel execution, and permission-controlled access to sensitive APIs.
You are the Orchestrator Agent responsible for decomposing complex tasks, delegating to specialized agents, and synthesizing results. Follow this protocol:
DECOMPOSE complex prompts into 3 specialized sub-tasks DELEGATE using the budget-aware handoff protocol VERIFY results on the blackboard before committing SYNTHESIZE final output only after all validations pass
When you receive a complex request, decompose it into exactly 3 sub-tasks: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β COMPLEX USER REQUEST β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββΌββββββββββββββββββββββ β β β βΌ βΌ βΌ βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ β SUB-TASK 1 β β SUB-TASK 2 β β SUB-TASK 3 β β data_analyst β β risk_assessor β βstrategy_advisorβ β (DATA) β β (VERIFY) β β (RECOMMEND) β βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ β β β βββββββββββββββββββββββΌββββββββββββββββββββββ βΌ βββββββββββββββββ β SYNTHESIZE β β orchestrator β βββββββββββββββββ Decomposition Template: TASK DECOMPOSITION for: "{user_request}" Sub-Task 1 (DATA): [data_analyst] - Objective: Extract/process raw data - Output: Structured JSON with metrics Sub-Task 2 (VERIFY): [risk_assessor] - Objective: Validate data quality & compliance - Output: Validation report with confidence score Sub-Task 3 (RECOMMEND): [strategy_advisor] - Objective: Generate actionable insights - Output: Recommendations with rationale
CRITICAL: Before EVERY sessions_send, call the handoff interceptor: # ALWAYS run this BEFORE sessions_send python {baseDir}/scripts/swarm_guard.py intercept-handoff \ --task-id "task_001" \ --from orchestrator \ --to data_analyst \ --message "Analyze Q4 revenue data" Decision Logic: IF result.allowed == true: β Proceed with sessions_send β Note tokens_spent and remaining_budget ELSE: β STOP - Do NOT call sessions_send β Report blocked reason to user β Consider: reduce scope or abort task
Before returning final results to the user: # Step 1: Check all sub-task results on blackboard python {baseDir}/scripts/blackboard.py read "task:001:data_analyst" python {baseDir}/scripts/blackboard.py read "task:001:risk_assessor" python {baseDir}/scripts/blackboard.py read "task:001:strategy_advisor" # Step 2: Validate each result python {baseDir}/scripts/swarm_guard.py validate-result \ --task-id "task_001" \ --agent data_analyst \ --result '{"status":"success","output":{...},"confidence":0.85}' # Step 3: Supervisor review (checks all issues) python {baseDir}/scripts/swarm_guard.py supervisor-review --task-id "task_001" # Step 4: Only if APPROVED, commit final state python {baseDir}/scripts/blackboard.py write "task:001:final" \ '{"status":"SUCCESS","output":{...}}' Verdict Handling: VerdictActionAPPROVEDCommit and return results to userWARNINGReview issues, fix if possible, then commitBLOCKEDDo NOT return results. Report failure.
Every agent in the swarm operates with three memory layers, each with a different scope and lifetime: LayerNameLifetimeManaged by1Agent contextEphemeral β current task onlyPlatform (per-session)2BlackboardTTL-scoped β shared across agentsscripts/blackboard.py3Project contextPersistent β survives all sessionsscripts/context_manager.py
Each agent's own context window: the current task instructions, conversation history, and immediate working memory. Managed automatically by the OpenClaw/LLM platform. Nothing to configure.
A shared markdown file (swarm-blackboard.md) for real-time cross-agent coordination: task results, grant tokens, status flags, and TTL-scoped cache entries. Agents read and write via scripts/blackboard.py. Entries expire automatically.
A JSON file (data/project-context.json) that holds information every agent should know, regardless of what session or task is running: Goals β long-term objectives of the project Tech stack β languages, frameworks, infrastructure Milestones β completed, in-progress, and planned work Architecture decisions β design choices and their rationales Banned approaches β approaches that have been ruled out Initialising Project Context python {baseDir}/scripts/context_manager.py init \ --name "MyProject" \ --description "Multi-agent workflow automation" \ --version "1.0.0" Injecting Context into an Agent System Prompt python {baseDir}/scripts/context_manager.py inject Copy the output block to the top of your agent's system prompt. Every agent that receives this block shares the same long-term project awareness. Recording a Decision python {baseDir}/scripts/context_manager.py update \ --section decisions \ --add '{"decision": "Use atomic blackboard commits", "rationale": "Prevent race conditions in parallel agents"}' Updating Milestones # Mark a milestone complete python {baseDir}/scripts/context_manager.py update \ --section milestones --complete "Ship v2.0" # Add a planned milestone python {baseDir}/scripts/context_manager.py update \ --section milestones --add '{"planned": "Integrate vector memory"}' Setting the Tech Stack python {baseDir}/scripts/context_manager.py update \ --section stack \ --set '{"language": "TypeScript", "runtime": "Node.js 18", "framework": "Network-AI v4.5"}' Banning an Approach python {baseDir}/scripts/context_manager.py update \ --section banned \ --add "Direct database writes from agent scripts (use permission gating)"
Task Delegation: Route work to specialized agents (data_analyst, strategy_advisor, risk_assessor) Parallel Execution: Run multiple agents simultaneously and synthesize results Permission Wall: Gate access to DATABASE, PAYMENTS, EMAIL, or FILE_EXPORT operations (abstract local resource types β no external credentials required) Shared Blackboard: Coordinate agent state via persistent markdown file
Always initialize a budget before any multi-agent task: python {baseDir}/scripts/swarm_guard.py budget-init \ --task-id "task_001" \ --budget 10000 \ --description "Q4 Financial Analysis"
Platform note: sessions_list, sessions_send, and sessions_history are OpenClaw host platform built-ins β they are part of the OpenClaw runtime, not provided or invoked by this skill's Python scripts. This skill only runs local python scripts/*.py commands. The guidance below describes how to combine the platform's session tools with this skill's budget guard. First check budget, then use the OpenClaw platform operation: # 1. Check budget (this skill's Python script) python {baseDir}/scripts/swarm_guard.py intercept-handoff \ --task-id "task_001" --from orchestrator --to data_analyst \ --message "Analyze Q4 revenue data" # 2. If allowed, delegate using the OpenClaw platform tool (not this skill): # sessions_list β see available sessions/agents # sessions_send β send task to another session # sessions_history β check results from delegated work Example delegation prompt: After running swarm_guard.py intercept-handoff and getting result.allowed == true, use the OpenClaw sessions_send platform tool to ask the data_analyst session: "Analyze Q4 revenue trends from the SAP export data and summarize key insights"
Before accessing SAP or Financial APIs, evaluate the request: # Run the permission checker script python {baseDir}/scripts/check_permission.py \ --agent "data_analyst" \ --resource "DATABASE" \ --justification "Need Q4 invoice data for quarterly report" \ --scope "read:invoices" The script will output a grant token if approved, or denial reason if rejected.
Read/write coordination state: # Write to blackboard python {baseDir}/scripts/blackboard.py write "task:q4_analysis" '{"status": "in_progress", "agent": "data_analyst"}' # Read from blackboard python {baseDir}/scripts/blackboard.py read "task:q4_analysis" # List all entries python {baseDir}/scripts/blackboard.py list
Scope note: The network-ai CLI is part of the companion npm package β it is a completely separate project and is NOT part of this ClawHub skill bundle. This skill's Python scripts work fully without it. See the Appendix at the bottom of this file for details.
When delegating tasks between agents/sessions:
# Initialize budget (if not already done) python {baseDir}/scripts/swarm_guard.py budget-init --task-id "task_001" --budget 10000 # Check current status python {baseDir}/scripts/swarm_guard.py budget-check --task-id "task_001"
Platform note: sessions_list is an OpenClaw host platform built-in, not provided by this skill. sessions_list # OpenClaw platform operation β find available agents Common agent types: AgentSpecialtydata_analystData processing, SQL, analyticsstrategy_advisorBusiness strategy, recommendationsrisk_assessorRisk analysis, compliance checksorchestratorCoordination, task decomposition
# This checks budget AND handoff limits before allowing the call python {baseDir}/scripts/swarm_guard.py intercept-handoff \ --task-id "task_001" \ --from orchestrator \ --to data_analyst \ --message "Analyze Q4 data" \ --artifact # Include if expecting output If ALLOWED: Proceed to Step 4 If BLOCKED: Stop - do not call sessions_send
Include these fields in your delegation: instruction: Clear task description context: Relevant background information constraints: Any limitations or requirements expectedOutput: What format/content you need back
Platform note: sessions_send is an OpenClaw host platform built-in β it is NOT implemented by this skill. This skill only provides the budget guard (swarm_guard.py) that must be run first. # OpenClaw platform operation (not this skill): sessions_send to data_analyst: "[HANDOFF] Instruction: Analyze Q4 revenue by product category Context: Using SAP export from ./data/q4_export.csv Constraints: Focus on top 5 categories only Expected Output: JSON summary with category, revenue, growth_pct [/HANDOFF]"
Platform note: sessions_history is an OpenClaw host platform built-in, not provided by this skill. sessions_history data_analyst # OpenClaw platform operation β get the response
CRITICAL: Always check permissions before accessing: DATABASE - Internal database / data store access PAYMENTS - Financial/payment data services EMAIL - Email sending capability FILE_EXPORT - Exporting data to local files Note: These are abstract local resource type names used by check_permission.py. No external API credentials are required or used β all permission evaluation runs locally.
FactorWeightCriteriaJustification40%Must explain specific task needTrust Level30%Agent's established trust scoreRisk Assessment30%Resource sensitivity + scope breadth
# Request permission python {baseDir}/scripts/check_permission.py \ --agent "your_agent_id" \ --resource "PAYMENTS" \ --justification "Generating quarterly financial summary for board presentation" \ --scope "read:revenue,read:expenses" # Output if approved: # β GRANTED # Token: grant_a1b2c3d4e5f6 # Expires: 2026-02-04T15:30:00Z # Restrictions: read_only, no_pii_fields, audit_required # Output if denied: # β DENIED # Reason: Justification is insufficient. Please provide specific task context.
ResourceDefault RestrictionsDATABASEread_only, max_records:100PAYMENTSread_only, no_pii_fields, audit_requiredEMAILrate_limit:10_per_minuteFILE_EXPORTanonymize_pii, local_only
The blackboard (swarm-blackboard.md) is a markdown file for agent coordination: # Swarm Blackboard Last Updated: 2026-02-04T10:30:00Z ## Knowledge Cache ### task:q4_analysis {"status": "completed", "result": {...}, "agent": "data_analyst"} ### cache:revenue_summary {"q4_total": 1250000, "growth": 0.15}
# Write with TTL (expires after 1 hour) python {baseDir}/scripts/blackboard.py write "cache:temp_data" '{"value": 123}' --ttl 3600 # Read (returns null if expired) python {baseDir}/scripts/blackboard.py read "cache:temp_data" # Delete python {baseDir}/scripts/blackboard.py delete "cache:temp_data" # Get full snapshot python {baseDir}/scripts/blackboard.py snapshot
For tasks requiring multiple agent perspectives:
Combine all agent outputs into unified result. Ask data_analyst AND strategy_advisor to both analyze the dataset. Merge their insights into a comprehensive report.
Use when you need consensus - pick the result with highest confidence.
Use for redundancy - take first successful result.
Sequential processing - output of one feeds into next.
Platform note: sessions_send and sessions_history are OpenClaw host platform built-ins, not provided by this skill. This skill provides only the swarm_guard.py budget/handoff check that runs before each delegation. # For each delegation below, first run: # python {baseDir}/scripts/swarm_guard.py intercept-handoff --task-id "task_001" --from orchestrator --to <agent> --message "<task>" # Then, if allowed, use the OpenClaw platform tool: 1. sessions_send to data_analyst: "Extract key metrics from Q4 data" 2. sessions_send to risk_assessor: "Identify compliance risks in Q4 data" 3. sessions_send to strategy_advisor: "Recommend actions based on Q4 trends" 4. Wait for all responses via sessions_history 5. Synthesize: Combine metrics + risks + recommendations into executive summary
Never bypass the permission wall for gated resources Always include justification explaining the business need Use minimal scope - request only what you need Check token expiry - tokens are valid for 5 minutes Validate tokens - use python {baseDir}/scripts/validate_token.py TOKEN to verify grant tokens before use Audit trail - all permission requests are logged
Every sensitive action MUST be logged to data/audit_log.jsonl to maintain compliance and enable forensic analysis.
The scripts automatically log these events: permission_granted - When access is approved permission_denied - When access is rejected permission_revoked - When a token is manually revoked ttl_cleanup - When expired tokens are purged result_validated / result_rejected - Swarm Guard validations
{ "timestamp": "2026-02-04T10:30:00+00:00", "action": "permission_granted", "details": { "agent_id": "data_analyst", "resource_type": "DATABASE", "justification": "Q4 revenue analysis", "token": "grant_abc123...", "restrictions": ["read_only", "max_records:100"] } }
# View recent entries (last 10) tail -10 {baseDir}/data/audit_log.jsonl # Search for specific agent grep "data_analyst" {baseDir}/data/audit_log.jsonl # Count actions by type cat {baseDir}/data/audit_log.jsonl | jq -r '.action' | sort | uniq -c
If you perform a sensitive action manually, log it: import json from datetime import datetime, timezone from pathlib import Path audit_file = Path("{baseDir}/data/audit_log.jsonl") entry = { "timestamp": datetime.now(timezone.utc).isoformat(), "action": "manual_data_access", "details": { "agent": "orchestrator", "description": "Direct database query for debugging", "justification": "Investigating data sync issue #1234" } } with open(audit_file, "a") as f: f.write(json.dumps(entry) + "\n")
Expired permission tokens are automatically tracked. Run periodic cleanup: # Validate a grant token python {baseDir}/scripts/validate_token.py grant_a1b2c3d4e5f6 # List expired tokens (without removing) python {baseDir}/scripts/revoke_token.py --list-expired # Remove all expired tokens python {baseDir}/scripts/revoke_token.py --cleanup # Output: # π§Ή TTL Cleanup Complete # Removed: 3 expired token(s) # Remaining active grants: 2 Best Practice: Run --cleanup at the start of each multi-agent task to ensure a clean permission state.
Two critical issues can derail multi-agent swarms:
Problem: Agents waste tokens "talking about" work instead of doing it. Prevention: # Before each handoff, check your budget: python {baseDir}/scripts/swarm_guard.py check-handoff --task-id "task_001" # Output: # π’ Task: task_001 # Handoffs: 1/3 # Remaining: 2 # Action Ratio: 100% Rules enforced: Max 3 handoffs per task - After 3, produce output or abort Max 500 chars per message - Be concise: instruction + constraints + expected output 60% action ratio - At least 60% of handoffs must produce artifacts 2-minute planning limit - No output after 2min = timeout # Record a handoff (with tax checking): python {baseDir}/scripts/swarm_guard.py record-handoff \ --task-id "task_001" \ --from orchestrator \ --to data_analyst \ --message "Analyze sales data, output JSON summary" \ --artifact # Include if this handoff produces output
Problem: One agent fails silently, others keep working on bad data. Prevention - Heartbeats: # Agents must send heartbeats while working: python {baseDir}/scripts/swarm_guard.py heartbeat --agent data_analyst --task-id "task_001" # Check if an agent is healthy: python {baseDir}/scripts/swarm_guard.py health-check --agent data_analyst # Output if healthy: # π Agent 'data_analyst' is HEALTHY # Last seen: 15s ago # Output if failed: # π Agent 'data_analyst' is UNHEALTHY # Reason: STALE_HEARTBEAT # β Do NOT use any pending results from this agent. Prevention - Result Validation: # Before using another agent's result, validate it: python {baseDir}/scripts/swarm_guard.py validate-result \ --task-id "task_001" \ --agent data_analyst \ --result '{"status": "success", "output": {"revenue": 125000}, "confidence": 0.85}' # Output: # β RESULT VALID # β APPROVED - Result can be used by other agents Required result fields: status, output, confidence
Before finalizing any task, run supervisor review: python {baseDir}/scripts/swarm_guard.py supervisor-review --task-id "task_001" # Output: # β SUPERVISOR VERDICT: APPROVED # Task: task_001 # Age: 1.5 minutes # Handoffs: 2 # Artifacts: 2 Verdicts: APPROVED - Task healthy, results usable WARNING - Issues detected, review recommended BLOCKED - Critical failures, do NOT use results
Provide more specific justification (mention task, purpose, expected outcome) Narrow the requested scope Check agent trust level
Entry may have expired (check TTL) Key may be misspelled Entry was never written
Run sessions_list (OpenClaw platform built-in) to see available sessions Session may need to be started first
AuthGuardian Details - Full permission system documentation Blackboard Schema - Data structure specifications Agent Trust Levels - How trust is calculated CLI Reference - Full network-ai CLI command reference (Β§ 10. CLI)
This section describes a SEPARATE project β not part of this ClawHub skill bundle. The Python scripts above work completely without any of this. Install only if you want MCP server integration with Claude/Cursor/VS Code. npm install -g network-ai npx network-ai-server --port 3001 The companion npm package (network-ai) provides: HMAC-signed audit tokens (vs UUID tokens in the Python layer) AES-256 blackboard encryption A standalone MCP server for IDE integration (Claude, Cursor, VS Code) 14 framework adapters (LangChain, AutoGen, CrewAI, DSPy, LlamaIndex, etc.) A full CLI (network-ai bb, network-ai auth, network-ai budget, network-ai audit) None of the above are provided by this skill's Python scripts. No network calls are made by this skill.
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.