Documents

rotifer-agent

Try it

Build a Rotifer Agent from existing Genes through a 7-phase workflow of decomposition, composition, creation, and testing.

What it does

Guides a Rotifer Agent build by decomposing user intent into 2–6 capability units, then selecting Genes from the local workspace or Cloud registry by Arena F(g) ranking. Composes them into a Genome using Seq, Par, Cond, or Try, creates the Agent in `.rotifer/agents/.json`, and runs validation tests with iterative optimization suggestions. The Skill itself contains no executable code — it tells the assistant which `rotifer` CLI commands to run, including `agent create`, `agent run`, `arena list`, and `search`.

When to use it

  • Composing a Document Quality Agent from grammar, readability, and tone Genes
  • Building a Code Review Agent with security, complexity, and docs Genes
  • Creating a serial Search & Summarize pipeline
  • Routing to the `gene` Skill when a capability unit has no matching Gene

The skill document

Rotifer Agent — From Genes to Agents

Decompose user intent into capability units, select Genes from the ecosystem, compose a Genome, create and validate an Agent.

Prerequisites

This Skill requires the Rotifer CLI:

npx @rotifer/playground --version
rotifer doctor

rotifer doctor checks the TypeScript→WASM toolchain. Composing an Agent from Native Genes means compiling them, and without esbuild and javy that step fails with an error that reads like a code problem.

Or use the MCP Server for IDE integration:

{
  "mcpServers": {
    "rotifer": {
      "command": "npx",
      "args": ["@rotifer/mcp-server"]
    }
  }
}

Hierarchy: Gene (atomic logic) → Genome (composition) → Agent (runnable entity)


Phase 1: Intent Decomposition

Break the user's goal into independent capability units (each maps to a Gene).

Steps:

  1. Confirm the Agent's input and expected output with the user
  2. Decompose the task into 2–6 capability units, each satisfying the Gene three axioms (functional cohesion, self-sufficient interface, independently evaluable)
  3. Label each unit with a domain (e.g. content.grammar, security.audit)
  4. Confirm the decomposition with the user before proceeding to Phase 2

Output format:

#Capability unitDomainInputOutput
1Grammar checkcontent.grammartextissues[], score
2Readability analysiscontent.readabilitytextgrade, suggestions[]

Phase 2: Gene Selection

Match existing Genes to each capability unit.

rotifer list                                  # what is already in this workspace
rotifer arena list --domain           # ranked by F(g) within one domain
rotifer search  --domain  # the Cloud registry — everyone else's Genes

The three answer different questions, and skipping the third is how a Genome ends up built only from what happened to be installed already.

Selection priority:

PrioritySourceCommand
1Local Gene with highest Arena rankrotifer arena list --domain
2Cloud Registryrotifer search rotifer info rotifer install
3Doesn't exist, needs creationProceed to Phase 3

Before committing a candidate to the Genome, run it on its own — a Gene that fails alone will fail inside a pipeline, where the error is much harder to locate:

rotifer run  --input '{"...": "..."}'

Show the user candidate Genes' F(g) fitness and fidelity, let them confirm the selection.


Phase 3: Gap Filling

If a capability unit has no existing Gene:

ApproachWhen to useAction
Create Wrapped GeneExternal API / Skill available to wrapRoute to gene Skill (dev module)
Create Native GenePure computation, no external dependenciesRoute to gene Skill (dev module)
Adjust decompositionCapability unit granularity is wrongReturn to Phase 1
Merge unitsTwo units are too coupled, splitting makes the interface awkwardMerge into one Gene

After all Genes are ready, proceed to Phase 4.


Phase 4: Genome Composition

Choose a composition strategy based on relationships between capability units.

Composition Strategy Decision Table

StrategySemanticsUse whenExample
Seq(A, B, C)Pipeline: A → B → CPrevious output feeds the nextCheck → Fix → Format
Par(A, B)Parallel: run simultaneouslyIndependent tasks, merge resultsGrammar check + Readability analysis
Cond(p, A, B)Branch: if p then A else BInput characteristics determine pathChinese → Chinese proofing / English → English proofing
Try(A, B)Fallback: A fails → BPrimary path unreliableMain API → Backup API
TryPool(A, B, C)Race: all try, first success winsMultiple equivalent implementationsMultiple translation services racing

Par Merge Strategies

When using Par, specify --par-merge:

StrategyBehaviorUse when
firstTake the first completed resultRacing scenario
concatConcatenate all results (array)Results are complementary
mergeDeep-merge objectsSame structure, merge fields

Seq Schema Compatibility Warning

Known limitation: Seq composition requires the previous Gene's outputSchema to be compatible with the next Gene's inputSchema. The current version does not auto-validate — schema mismatches cause runtime errors.

Recommendation: Before creating a Seq composition, manually compare adjacent Genes' inputSchema / outputSchema in phenotype.json to confirm field names and types match.

Nested Composition

Strategies can be nested:

Seq(
  Par(grammar-checker, readability-analyzer),
  tone-analyzer
)

Corresponding CLI:

rotifer agent create doc-qa \
  --genes grammar-checker readability-analyzer tone-analyzer \
  --composition Seq

The current CLI only supports top-level composition strategies. Nested compositions require manual editing of .rotifer/agents/.json.


Phase 5: Agent Creation

Execute creation after confirming the composition plan.

Manual Gene Selection

rotifer agent create  \
  --genes    \
  --composition  \
  --par-merge 

Auto-select Genes (by domain ranking)

rotifer agent create  \
  --domain  \
  --top  \
  --composition 

After creation, verify the Agent configuration file .rotifer/agents/.json is correct.


Phase 6: Test Run

rotifer agent list
rotifer agent run  --input '{"text": "Test input content"}'

rotifer agent list shows every Agent in the workspace with its state and genome — use it to confirm the Agent was created with the Genes you intended before running it, and to recover the exact name when a run reports "agent not found".

Validation checklist:

  • Does the output structure match the expected schema?
  • Were all Genes executed? (check logs)
  • Is schema passing correct in Seq composition?
  • Are Par merge results complete?
  • Do error paths (Try/TryPool) degrade correctly?

If results are unsatisfactory, proceed to Phase 7.


Phase 7: Iterative Optimization

ProblemOptimization
One Gene's output quality is poorrotifer arena list --domain for ranked local alternatives, or rotifer search to look beyond what is installed
Not sure which Gene in the pipeline is at faultrotifer run --input '{...}' on each one in isolation
Seq intermediate results missing fieldsCheck schema compatibility, consider inserting an adapter Gene
Par merge results are messySwitch --par-merge strategy
Latency too highSeq → Par (if Genes are independent)
Overall below expectationsRoute to rotifer-arena Skill for head-to-head Gene evaluation

Scenario Examples

Scenario 1: Document Quality Agent

Goal: Input text, output grammar issues + readability score + tone analysis.

Decomposition:

#CapabilityGeneDomain
1Grammar checkgrammar-checkercontent.grammar
2Readability analysisreadability-analyzercontent.readability
3Tone analysistone-analyzercontent.tone

Composition: All three accept text input, no dependencies → Par + concat.

rotifer agent create doc-quality \
  --genes grammar-checker readability-analyzer tone-analyzer \
  --composition Par \
  --par-merge concat

rotifer agent run doc-quality --input '{"text": "Document content to check..."}'

Scenario 2: Code Review Agent

Goal: Input code file, output security vulnerabilities + complexity report + documentation suggestions.

#CapabilityGeneDomain
1Security auditsecurity-auditorsecurity.audit
2Complexity analysiscode-complexitycode.analysis
3Documentation generationdocs-writercontent.docs

Composition: Security audit and complexity analysis can run in parallel, documentation depends on both → Seq(Par(1,2), 3).

rotifer agent create code-review \
  --genes security-auditor code-complexity docs-writer \
  --composition Seq

rotifer agent run code-review --input '{"code": "...", "language": "typescript"}'

Note: The Par(security-auditor, code-complexity) merged output must be compatible with docs-writer's inputSchema. Manual verification required.

Scenario 3: Search & Summarize Agent

Goal: Input a search query, search → summarize → format output.

#CapabilityGeneDomain
1Web searchgenesis-web-searchsearch.web
2Text summarizationtext-summarizercontent.summarize
3Markdown formattingmarkdown-formattercontent.format

Composition: Strict serial pipeline → Seq.

rotifer agent create search-digest \
  --genes genesis-web-search text-summarizer markdown-formatter \
  --composition Seq

rotifer agent run search-digest --input '{"query": "Rotifer Protocol agent framework"}'

Note the Seq schema chain: genesis-web-search output field names must match text-summarizer's inputSchema. Run cat genes/*/phenotype.json | jq '.inputSchema, .outputSchema' to verify before creating.


What this Skill does on your machine

It has no code of its own — it tells your assistant which rotifer commands to run. That is why its manifest declares process execution, filesystem read/write and outbound network access: every one of those is the CLI acting, not this Skill.

RunsThe rotifer CLI (@rotifer/playground), fetched from npm if not installed.
ReadsGenes and Agent definitions in the current project workspace.
WritesOnly what the commands below write — Genes into the project's genes/, Agent definitions into .rotifer/agents/. Nothing outside the project.
SendsCloud registry and Arena queries, to the public Rotifer API. Your code is not uploaded unless you run rotifer publish yourself.

Commands that install, publish or overwrite are proposed for your approval first, never run silently.


SkillRelationshipWhen to route
gene (dev module)Gene creation/developmentPhase 3 gap filling
rotifer-arenaGene comparison & evaluationPhase 7 when replacing underperforming Genes
genomeGenome quality analysisAfter Agent creation for overall assessment

Constraints

  • Agent configuration files are stored in .rotifer/agents/.json and should not be committed to Git
  • A single Agent should contain 2–6 Genes; more than 6 suggests splitting into multiple Agents
  • Seq schema compatibility is a known limitation — always verify manually before creating
  • Nested compositions require manual JSON editing; the CLI only supports top-level strategies

Questions people ask

Does this Skill write its own code?
No — it instructs the assistant which `rotifer` CLI commands to run, such as `rotifer agent create`, `rotifer agent run`, `rotifer arena list`, and `rotifer search`. Genes and Agent definitions it writes go only into the project's `genes/` and `.rotifer/agents/` directories.
What composition strategies does it support?
Seq, Par, Cond, Try, and TryPool, with Par merge modes `first`, `concat`, and `merge`. Nested compositions require manual editing of `.rotifer/agents/.json` because the CLI only supports top-level strategies.
What known limitations should I plan around?
Seq requires manually verifying that each Gene's outputSchema matches the next Gene's inputSchema — the CLI does not auto-validate, so mismatches surface as runtime errors. A single Agent is sized for 2–6 Genes; more suggests splitting into multiple Agents.

Related skills

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván555 installs18 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván854 installs69 stars

Read and write Excel workbooks, worksheets, ranges, tables, and charts in OneDrive through Microsoft Graph with managed OAuth.

by byungkyu800 installs42 stars

More from xiaoba-dev

Browse all skills

Route any Rotifer request to the right sub-capability — onboarding, scaffolding, diagnostics, search, or fidelity upgrade.

by xiaoba-dev17 installs

Compare two Rotifer Genes head-to-head and get a Markdown report with F(g) fitness and V(g) security grades.

by xiaoba-dev14 installs

Rank an Agent's Rotifer Genes against the Arena and swap in stronger ones. Invoked explicitly via /evolve — scan local capabilities, compare Genes, inspect fitness scores, and replace weak ones with user approval. Not for capabilities outside Rotifer.

by xiaoba-dev17 installs

Cross-vendor adversarial review. WARNING — this sends your brief, and any source files you approve, to a model hosted by a THIRD-PARTY vendor, where it stays in that vendor's session history under their retention terms. Ship a plan, proposal, or design to a model from a DIFFERENT vendor to attack it; every objection carries a verifiable anchor; the defender rules with an evidence tag on each ruling; the final round classifies into still-disputed / unresolved / verified-consensus instead of forcing agreement; a fresh-session judge is mandatory whenever the outcome looks too clean. Invoke only when the user explicitly asks for an adversarial review by a model from another vendor. One model role-playing several experts is not this skill.

by xiaoba-dev2 installs

Session knowledge distillation: assign what you just learned in this session into an agent's four-layer persistent knowledge base (rule / memory / skill / decision record). The core is four disciplines — search before adding, pick the right layer, guard against bloat, and run a hygiene pass before landing anything. Fits agent workflows that already have (or want to build) these four layers; this is not a general note- taking tool. Invoke explicitly at the end of a session to consolidate what was learned.

by xiaoba-dev2 installs

Installs a documentation governance architecture in a project and diagnoses what it is missing. Three actions: audit diagnoses the current state against seven components (source-of-truth layering / decision records / cascade discipline / planning system / checkpoints bound to actions / gates / incident traceability); init installs what is missing (config, a script copy, a pre-commit gate, two Claude Code hooks, decision and plan templates); check keeps verifying that what the docs claim about reality still holds (TODOs left hanging too long, cascade memos never carried out, plan status that doesn't match reality, broken references, broken links, § section references pointing to the wrong place, missing index entries, broken tables, endpoints the docs declare but the code doesn't have). The framework was distilled from the documentation system of a large protocol project, and every check is tied to a real incident. ⚠️ init modifies the repository and installs hooks that keep running aft

by xiaoba-dev1 installs