AI Coworker Development Principles

Status: Foundational specification Created: 2026-03-31 Authors: Mark Bodman, Claude (Software Engineer) References: Diversity of Thought Framework, IT4IT v3.0.1, EP-BUILD-HANDOFF spec


Purpose

This document defines the architectural principles for developing AI Coworker agents within the Digital Product Factory. It is the governing specification for all future agent design, tool assignment, memory strategy, and multi-agent orchestration.

These principles are derived from production testing, industry framework research (Anthropic Agent SDK, OpenAI Agents SDK, LangGraph, CrewAI, AutoGen), and the platform’s Diversity of Thought framework.


Principle 1: Specialization Over Generalization

A specialist with 5 focused tools outperforms a generalist with 40.

Rule

Each AI Coworker agent should have access to no more than 10 tools relevant to its current task. When tool count exceeds 15, tool selection accuracy degrades significantly, regardless of model capability.

Implementation

Tools are tagged with the phases and contexts in which they are relevant. The platform filters the tool list before each agent invocation, presenting only the tools the agent needs for its current role.

type ToolDefinition = {
  name: string;
  buildPhases?: BuildPhaseTag[];  // Only available during these phases
  // ... other fields
};

Evidence


Principle 2: Orchestrator-Worker Pattern

Workrooms own the process; specialists execute it; the COO owns cross-room follow-through.

Rule

Use the canonical Workroom shape, Process Overseer, governed dispatcher and independent review gates across business operations and delivery. Build Studio is one execution surface alongside external agents. A direct, authorized coworker handoff may supply expertise; it does not replace the room’s lifecycle or transfer authority.

The Process Overseer follows local work through its outcome. The COO checks cross-room progress and owns unresolved recovery follow-through. A handoff, scheduler tick, heartbeat or queued task is not verified progress. Human involvement is for a specific required decision or exhausted authorized recovery, not routine status chasing.

COO responsibility is scoped to the installation’s declared purpose. DEV, PROD and sandbox/test contexts coordinate through the existing authenticated federation and task/evidence boundaries. A peer’s missing corpus is an owned context request, not permission to invent a production decision. Preserve installation and source identity, applicability and authority; a shared role name or copied database does not make two instances one principal. The owning installation controls its work.

The current contract and pending delivery/acceptance are in Coordinated Workrooms. This supersedes the early build-pipeline-only interpretation and its fixed phase/model table. Model and tool selection follow the current task, measured capability and scoped authority; historical model names are not policy.


Principle 3: Structured Handoffs, Not Conversation History

Pass decisions and context, not transcripts.

Rule

When work transitions between agents (or between phases), the outgoing agent produces a structured handoff document. The incoming agent reads only this document — never the raw conversation history from the previous phase.

Implementation

interface PhaseHandoff {
  fromPhase: BuildPhase;
  toPhase: BuildPhase;
  summary: string;              // 2-3 sentences, plain language
  evidence: Record<string, unknown>;  // Phase-specific artifacts
  openIssues: string[];         // What the next agent should know
  userPreferences: string[];    // Decisions the user made
}

Rationale


Principle 4: Diversity of Thought in Agent Design

Different agents should think differently, not just have different tools.

Rule

Each agent’s system prompt defines three cognitive components from the Diversity of Thought framework:

Component What it defines Example
Perspective How the agent frames the problem Software Engineer sees “code structure”; Ops Engineer sees “deployment safety”
Heuristics Strategies for finding solutions Engineer uses test-driven development; Ops uses rollback-first deployment
Interpretive Model What “good” means Engineer optimizes for correctness; Ops optimizes for availability

Implementation

Agent system prompts explicitly declare their perspective, heuristics, and success criteria. This is not decorative — it determines which solutions the agent considers and which it misses.

When a complex problem requires multiple perspectives (a rugged landscape in Diversity of Thought terms), the orchestrator consults multiple specialists before deciding. The combined output exceeds what any single agent would produce.

Rationale


Principle 5: Selective Memory, Not Total Recall

Remember decisions and rationale. Re-derive details from source.

Rule

The vector store (pgvector, inside Postgres) stores salient context — decisions, user preferences, design rationale, and cross-conversation insights. It does not store raw conversation transcripts, code content, or data that can be derived from the codebase or git history.

What to Store

Store Example Why
User decisions “User chose in-memory state over database for this demo” Informs future suggestions
Design rationale “Complaints tracker uses client-side state because it’s a demo feature” Prevents re-litigating decisions
Cross-conversation context “The promoter image is JIT-built from the portal container” Connects knowledge across sessions
Discovered constraints “Anthropic subscription only gives Haiku access” Prevents repeated failures
Quality patterns “This user prefers Tailwind over CSS modules” Personalizes agent behavior

What NOT to Store

Skip Example Why
Raw conversation “User said: build it now…” Ephemeral, bulky, low signal
Code content “The complaints page contains…” Read from sandbox or git
Build artifacts Test output, diffs, logs Stored in FeatureBuild record
Transient state “Build is in plan phase” Query the database

Implementation

Each agent stores memories at natural decision points — not after every exchange. The memory is tagged with the agent role, build phase, and topic so retrieval is contextual.

Semantic recall uses the query context (current conversation + build phase) to retrieve the 5-8 most relevant memories. This is sufficient because memories are distilled to decisions and rationale, not raw detail.

Rationale


Principle 6: Tools Must Be Self-Documenting

If the model can’t understand a tool from its schema, the schema is wrong.

Rule

Every tool definition includes:

The build phase system prompt includes a tool usage guide that maps common tasks to specific tools with parameter examples.

Implementation

TOOL GUIDE:
- To create a new file: write_sandbox_file(path, content) — content is the FULL file
- To modify existing file: read first, then edit_sandbox_file(path, old_text, new_text)
- To run commands: run_sandbox_command(command)

Rationale


Principle 7: Human-in-the-Loop at Phase Boundaries

The human approves transitions, not individual tool calls.

Rule

Human approval gates exist at phase boundaries (ideate → plan, plan → build, review → ship), not at individual tool calls within a phase. Within a phase, the agent operates autonomously using its scoped tools.

Exception: executionMode: "proposal" tools present a card for approval before executing side effects that affect production (deploying to production, registering products, modifying user data).

Implementation

Rationale


Principle 8: Fail Fast, Explain Clearly

Stop on the first error. Don’t retry blindly. Tell the user what happened.

Rule

Classify the actual tool result before deciding what happens next.

Keep the blocker, recovery owner, next safe action and unblocking trigger in the canonical Workroom rather than asking the user to remember them. Follow the common recoverability contract and the current COO coordination contract. This supersedes the early blanket stop-and-ask guidance.

Tool repetition limits are a final circuit breaker, not a recovery strategy. The result and its documented retryability determine whether another attempt is useful; a different argument or new request identity is not itself a remedy.


Principle 9: Responsible Capacity Utilization

Use paid AI capacity for governed value, not empty activity.

Rule

AI coworkers should treat available paid capacity as an operating asset. When authorized work is available, idle capacity is waste. When no useful, safe, evidence-producing work is available, the coworker should record or surface the blocker rather than spend tokens to appear busy.

Useful capacity work includes:

Implementation

Capacity use should be driven by Standing Orders, calendar/availability state, safe work queues, and existing authority controls. Coworkers may continue low-risk governed work when humans are unavailable, but must stop at approval boundaries for consequential actions.

Rationale

A salaried employee who does nothing while valuable work exists wastes organizational capacity. Fixed-price or subscription AI capacity has the same economic shape. The goal is not to burn tokens. The goal is to convert available capacity into reviewed work, evidence, learning, and platform improvement.


Application

These principles apply to:

When these principles conflict with expediency, the principles win. A well-structured agent that works reliably is worth more than a quick hack that fails unpredictably.


Principle 10: Query The Canonical Business Product Boundary

Do not turn business products into digital architecture or invent the people who consume them.

Rule

When an AI coworker needs to reason about what an organization sells, it queries the organization-scoped ProductLine and Product hierarchy under Goods and Services for Sale. DigitalProduct remains the architecture record for software, data, and digital platforms. Storefront archetypes and taxonomy nodes are reference definitions; neither is the organization’s mutable product truth.

For selectable commercial objects, continue through ProductOffering → CatalogItem. StorefrontItem is a channel projection and must not become a second price/name authority. ServiceOffering continues to own DigitalProduct operational commitments; follow its optional commercialOffering trace only when that link was explicitly recorded.

The organization is the default provider for a simple business. Consumer claims must be derived from real customer, booking, order, subscription, or fulfilment evidence. Product-line capture alone never proves a product team, business unit, subscriber, entitlement, or consumer.

Implementation

Rationale

The provider-consumer boundary is stable from a one-person business to a large enterprise. Scale changes disclosure and reporting detail, not the canonical model. Keeping the query boundary explicit prevents plausible-sounding but fabricated organization structure from entering plans, prompts, or reports.