agents/skills/multi-agent-skill-creator/SKILL.md
This skill guides the design, implementation, and verification of a multi-agent coordinated workflow (a "multi-agent skill") for a specific, repeatable task.
It operates under a Cold Logic mandate: it must be respectful, honest, objective, and data-driven. It should actively help the user optimize their workflow by proposing alternatives, challenging assumptions, and identifying when a multi-agent approach is unnecessary.
true for all
checklist items.The creation process runs through four stages:
graph TD
A[Stage 1: Feasibility & Discovery] --> B[Stage 2: Architecture Proposal]
B --> C[Stage 3: Artifact Generation]
C --> D[Stage 4: Validation Setup]
Propose 2-3 design options for the multi-agent system. For each option, present a comparative analysis using the following metrics:
Example Table:
| Metric | Option A: Linear (Fast) | Option B: Loop (Rigorous) |
|---|---|---|
| Structure | Scoper -> Writer | Scoper -> Writer <-> Auditor |
| Context Efficiency | High (~70% reduction) | High (~60% reduction) |
| Token Overhead | Low (+20%) | Medium (+50% due to loops) |
| Wall-Time | Low (~1.5x) | Medium/High (2-3x) |
| Reliability | Moderate (No verification) | Very High (Checklist enforced) |
Action: Wait for the user to select or refine a proposal before proceeding.
Generate the directory structure and files for the new skill.
[new-skill-name]/
├── SKILL.md # Core protocol and stage definitions
├── README.md # High-level overview and verification docs
├── schema.json # Data contracts (JSON Schema)
├── personas/ # Catalog of specialized expert definitions
│ ├── scoping.json
│ ├── implementation.json
│ └── auditor.json
personas/role.json){
"$schema": "../schema.json#definitions/PersonaDef",
"role": "RoleName",
"mandate": [
"MANDATE: Describe the main responsibility of this role.",
"GROUNDING: Resolve all paths relative to the repository root and verify environment state before running tools.",
"TONE: Zero Preamble. No conversational filler. Artifacts only."
],
"checklist": {
"requirement_1_verified": [
"Description of what needs to be checked to satisfy this requirement."
]
}
}
schema.json)Provide a JSON schema defining ProjectSpec (inputs), StateBlock (workflow
state), and ReviewFeedback (auditor output). Use
https://json-schema.org/draft-07/schema# as the schema declaration.
Rule: The StateBlock definition MUST include fields for tracking loop
convergence:
stage_attempts: A map of stage name to integer attempt count.loop_counters: A map tracking consecutive feedback cycles between
implementation and review.SKILL.md)Generate a step-by-step execution protocol defining the state machine. The
generated SKILL.md MUST follow this skeleton structure:
# [Skill Name] Protocol
## Stages Overview
Define a Stage 0 for initial environment grounding, followed by your sequential execution stages.
- **Stage 0: Environment Grounding & Safety Verification**
- **Stage 1: [Stage Name]**
- **Stage 2: [Stage Name]**
...
---
## Stage 0: Environment Grounding & Safety Verification
1. **Verify Environment**: Discover and verify active repository root, current branch, and availability of required tools (e.g. git, python).
2. **Initialize State**: Create or read `state.json` (complying with `schema.json`). Initialize loop counters (`stage_attempts` set to 0).
3. **Transition**: Move to Stage 1.
## Stage 1: [Stage Name]
...
---
## Stage Handoff & Loop Limits
Define loop limits for feedback cycles (e.g., maximum 3 iterations for review loops before escalating to human). Track attempts using `state.json` loop counters.
For complex workflows with detailed instructions, keeping all stage rules in a
single SKILL.md will lead to context bloat. To optimize context usage (based
on MAGI best practices):
SKILL.md: The main SKILL.md should only contain the high-level
orchestration state machine, stage names, and routing logic.ROUTING.md: Create a ROUTING.md file to map stages to specific
personas and reference files.references/ Directory: Move detailed, stage-specific step-by-step
instructions into separate markdown files under a references/ directory
(e.g., references/stage1_scope.md).To ensure the new skill's artifacts remain consistent and functional, generate
validation and testing tools within the new skill's directory, utilizing the
templates in the templates/ directory:
PRESUBMIT.py: Use
templates/PRESUBMIT.py.template as a
base. This script runs static analysis on the new skill's files to verify
link integrity, reachability, and schema compliance.run_tests.py: Use
templates/run_tests.py.template as a
base. This script runs behavioral unit tests for the skill stages.run_presubmit.py: A helper script to run the presubmit checks
locally (you can adapt the run_presubmit.py from this
skill creator)..style.yapf and
.style.mdformat (copied from this skill creator) to
ensure formatting consistency.SKILL.md to prevent infinite loops.