Factory Infrastructure

What Makes
Factory Work

Five infrastructure components that turn stateless agentsinto a coordinated, learning team.

Memory

Workers Share Context,
Never Repeat Themselves

Every pattern discovered, every bug fixed, every architectural decision — captured and shared. Workers don't re-learn what the team already knows.

Hybrid Search

Semantic understanding meets keyword precision. BM25 + vector embeddings find exactly what you need.

Memory Tiering

Working memory for recent context, cold storage for history, archive for long-term. Access patterns determine placement.

Cross-Session Persistence

Knowledge compounds across sessions. What one worker learns, all workers remember.

memory
# Worker discovers a pattern
mcp__cas__memory action=remember
"This codebase uses Zod for all API validation"
# Next day: new worker starts
mcp__cas__search action=context
Zod validation pattern (0.94)
API error handling rule (0.89)
Schema location convention (0.85)
Retrieved in 23ms — no re-teaching required
tasks
# Supervisor creates EPIC
mcp__cas__task action=create task_type=epic
# Workers check available tasks
mcp__cas__task action=ready
cas-1234 Add auth middleware
cas-1235 Create user schema
# Worker claims and starts
mcp__cas__task action=start id=cas-1234
✓ Task leased to worker-alpha (10m heartbeat)
Tasks

Supervisor Assigns,
Nothing Falls Through

Work is tracked from creation to completion. Workers claim tasks, dependencies are respected, and crashed workers don't leave orphaned work.

Task Leasing

Workers claim tasks with heartbeat. If a worker dies, tasks automatically return to the pool.

Dependencies & Blocking

Define what must complete before work begins. Automatic blocking and unblocking.

Verification System

Quality gates before completion. Automated checks ensure work meets acceptance criteria.

Rules

Mistakes Become
Guardrails Automatically

Every bug fix, every correction, every "don't do it that way" becomes a rule that prevents the same mistake across all workers, forever.

Rule Lifecycle
Draft
New rule discovered from mistake
Proven
Validated through repeated use
Archived
Outdated rules fade away
Auto-Sync to Claude Code

Proven rules automatically sync to .claude/rules/ so Claude Code respects them natively — no MCP call required.

rules
# Bug found: wrong import path
mcp__cas__rule action=create
"Import from @/lib/utils not ../../../lib/utils"
paths="**/*.ts,**/*.tsx"
# Rule proves useful: promote it
mcp__cas__rule action=helpful id=rule-42
✓ Promoted to proven (3 applications)
# Now synced to Claude Code
.claude/rules/import-paths.md
skills
# Create a reusable skill
mcp__cas__skill action=create
name="e2e-test"
invocation="/test-e2e"
# Any worker can use it
User: /test-e2e auth flow
Loading skill instructions...
Running Playwright tests...
12 tests passed (4.2s)
Skills

Teach Once,
Every Worker Knows It

Custom capabilities that any worker can invoke. Define complex workflows once, share them across your entire team of agents.

/commitStandardized commit workflow with review
/deployFull deployment pipeline with checks
/review-prPR review against project standards
Skill Inheritance

Project skills can extend global skills. Innovation at the project level can be promoted to the organization.

Worktrees

Parallel Work
Without Merge Hell

Multiple workers need to edit files simultaneously. Git worktrees give each worker their own complete working copy — parallel development without conflict.

Git Isolation Per Worker

Each worker gets their own worktree. No stepping on toes.

Conflict-Free Development

Multiple workers, multiple tasks, zero file conflicts during work.

Easy Merge Coordination

When work completes, merge back to main with full visibility.

worktrees
# Supervisor spawns workers
mcp__cas__factory action=spawn_workers count=3
✓ Worktrees created:
./project-worktrees/swift-fox/
./project-worktrees/calm-bear/
./project-worktrees/bold-hawk/
# Each worker has full repo access
swift-fox: editing src/auth/middleware.ts
calm-bear: editing src/api/routes.ts
bold-hawk: editing src/db/schema.ts
No conflicts — each worker has isolated files

Ready to Build Your Factory?

Stop managing stateless agents. Start orchestrating a team that learns, coordinates, and gets better every day.