Factory Rules

Type: Operating principles

Definition

The Factory Rules are 10 foundational rules that govern all Kelly instances. They were first codified in a Kelly tweet (ID: 2021025015395926352) describing them as "the first set of generalized rules that should be followed by all instances of Kelly." They encode the week's hard-won learnings as operational constraints.

The Rules

  1. Kelly Router = main agent (no new registration required)
  2. 5 Named Agents: Research Lead, Project Lead, Test Lead + 2 more
  3. RALPH retry protocol: 3 attempts, pass diagnostics, escalate on same error twice
  4. BMM agents used for build phase
  5. CIS agents used for research phase
  6. TEA agent (Murat) for testing audit
  7. sessions_send for inter-agent communication
  8. Project files in /clawd/projects/{project-id}/
  9. USER.md symlinked across workspaces
  10. BMAD library preserved at /clawd/bmad/ — referenced by path, not loaded into context

Architecture Implications

  • Router pattern is built into OpenClaw (configuration, not development)
  • Named agents have fixed roles — spawn new instances by config change
  • Factory rules = operational DNA for new instances