Get the FREE Ultimate OpenClaw Setup Guide →

agentica-spawn

npx machina-cli add skill parcadei/Continuous-Claude-v3/agentica-spawn --openclaw
Files (1)
SKILL.md
2.0 KB

Agentica Spawn Skill

Use this skill after user selects an Agentica pattern.

When to Use

  • After agentica-orchestrator prompts user for pattern selection
  • When user explicitly requests a multi-agent pattern (swarm, hierarchical, etc.)
  • When implementing complex tasks that benefit from parallel agent execution
  • For research tasks requiring multiple perspectives (use Swarm)
  • For implementation tasks requiring coordination (use Hierarchical)
  • For iterative refinement (use Generator/Critic)
  • For high-stakes validation (use Jury)

Pattern Selection to Spawn Method

Swarm (Research/Explore)

swarm = Swarm(
    perspectives=[
        "Security expert analyzing for vulnerabilities",
        "Performance expert optimizing for speed",
        "Architecture expert reviewing design"
    ],
    aggregate_mode=AggregateMode.MERGE,
)
result = await swarm.execute(task_description)

Hierarchical (Build/Implement)

hierarchical = Hierarchical(
    coordinator_premise="You break tasks into subtasks",
    specialist_premises={
        "planner": "You create implementation plans",
        "implementer": "You write code",
        "reviewer": "You review code for issues"
    },
)
result = await hierarchical.execute(task_description)

Generator/Critic (Iterate/Refine)

gc = GeneratorCritic(
    generator_premise="You generate solutions",
    critic_premise="You critique and suggest improvements",
    max_rounds=3,
)
result = await gc.run(task_description)

Jury (Validate/Verify)

jury = Jury(
    num_jurors=5,
    consensus_mode=ConsensusMode.MAJORITY,
    premise="You evaluate the solution"
)
verdict = await jury.decide(bool, question)

Environment Variables

All spawned agents receive:

  • SWARM_ID: Unique identifier for this swarm run
  • AGENT_ROLE: Role within the pattern (coordinator, specialist, etc.)
  • PATTERN_TYPE: Which pattern is running

Source

git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/agentica-spawn/SKILL.mdView on GitHub

Overview

Agentica Spawn enables launching multi-agent execution patterns once a user selects a pattern. It supports Swarm, Hierarchical, Generator/Critic, and Jury to handle parallel exploration, coordinated builds, iterative refinement, and rigorous validation.

How This Skill Works

Upon pattern selection, the skill instantiates the corresponding pattern object (Swarm with multiple perspectives and MERGE aggregation, Hierarchical with a coordinator and specialists, GeneratorCritic with generator/critic premises and max rounds, or Jury with multiple jurors and a majority consensus). It then executes the task (e.g., await swarm.execute(task_description) or gc.run(task_description) or jury.decide(...)). Spawned agents receive environment variables SWARM_ID, AGENT_ROLE, and PATTERN_TYPE to identify their context.

When to Use It

  • After agentica-orchestrator prompts user for pattern selection
  • When the user explicitly requests a multi-agent pattern (swarm, hierarchical, etc.)
  • When implementing complex tasks that benefit from parallel agent execution
  • For research tasks requiring multiple perspectives (use Swarm)
  • For high-stakes validation (use Jury)

Quick Start

  1. Step 1: After the user selects a pattern, instantiate the appropriate pattern object (e.g., Swarm(...), Hierarchical(...), GeneratorCritic(...), or Jury(...))
  2. Step 2: Call the execute/run/decide method with a task_description (e.g., await swarm.execute(task_description)) or gc.run(task_description)
  3. Step 3: Retrieve the result or verdict and interpret the aggregated output, ensuring traceability via SWARM_ID, AGENT_ROLE, and PATTERN_TYPE

Best Practices

  • Define clear roles and sub-roles for each pattern (e.g., Swarm perspectives, Hierarchical coordinator and specialists) before spawning
  • Specify a sensible default for aggregation or consensus (e.g., MERGE for Swarm, MAJORITY for Jury) and document it
  • Provide explicit prompts and interfaces for each agent role to ensure coherent data flow
  • Leverage Generator/Critic rounds to iteratively refine solutions before finalizing
  • Maintain traceability by exposing environment variables (SWARM_ID, AGENT_ROLE, PATTERN_TYPE) and logging outcomes

Example Use Cases

  • Security-focused research using Swarm with perspectives like security expert, performance expert, and architecture reviewer
  • Building a software feature using Hierarchical with planner, implementer, and reviewer roles
  • Iterative code improvement via GeneratorCritic rounds to refine a solution
  • High-stakes design validation using a Jury to reach a majority verdict on a proposed solution
  • Comparative multi-pattern experiments to evaluate parallel vs. coordinated approaches

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers