feat(50c): Crimson Leaf company factory — agents, templates, RAG, pipeline

Agents: Peter (CEO), David (CTO), Sarah (Market Intel), Elena (Ops Architect)
Templates: market_research, company_design, design_review, design_roundtable, design_polish, bootstrap_company
RAG: business_plan.md, core_directives.md (5 immutable directives)
Pipeline: 6-phase incubation protocol with dependency chain and kill conditions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Baity
2026-03-01 00:55:39 -05:00
parent 83a3fce3cb
commit 172ce3a0e1
21 changed files with 784 additions and 0 deletions

View File

View File

@@ -0,0 +1,78 @@
name: bootstrap_company
description: "Convert approved company design into executable creation payloads — the final deployment step."
system: agent_prompt
agent_prompt:
- "= identity.md"
sections:
- agent
- project
- history
- rag
- deliverables
- message
- instructions
steps:
- type: think
hint: |
You are converting the approved Company Design Specification into exact API payloads.
Read the COMPANY DESIGN SPECIFICATION from the deliverables above.
Verify it contains all required sections:
- Company name and slug
- Agent roster (48 agents with roles)
- Template procurement list
- Pipeline SOP
- Peter's GO decision
If any section is missing or the GO/NO-GO decision is not "GO", stop and explain why
this company cannot be bootstrapped. Do NOT proceed with a NO-GO design.
If everything is present and approved, prepare the following:
FOR EACH AGENT in the roster:
- name (lowercase, no spaces)
- role (CEO | Director | Specialist)
- title (human-readable job title)
- department (the department slug)
- manages (list of departments/roles this agent manages, empty for specialists)
- supported_templates (which templates from the procurement list this agent uses)
- seed_prompt (23 sentences describing this agent's core identity and directives)
FOR THE TEMPLATE LIST:
- Exact template names to procure from Global Core
FOR THE PIPELINE:
- The full SOP as a numbered list with task_type, assigned_agent, depends_on
Output your complete analysis, then state: PAYLOAD READY
- type: package
hint: |
Package the company creation payload. This will be intercepted by the system
to create the company, hire agents, and procure templates automatically.
schema:
create_company:
name: string
slug: string
business_plan: string
agents_to_hire:
- name: string
role: string
title: string
department: string
manages: list
supported_templates: list
seed_prompt: string
templates_to_procure:
- string
pipeline_sop:
- step: number
task_type: string
agent_name: string
depends_on: string
- type: close
rag_update: true

View File

@@ -0,0 +1,84 @@
name: company_design
description: "Boardroom deliberation — the full Crimson Leaf board debates and designs a new company."
system: agent_prompt
participant_prompt:
- "= identity.md"
sections:
- agent
- project
- history
- participants
- participants_prompt
- rag
- deliverables
- message
- instructions
steps:
- type: think
route: boardroom
rotate_participants: true
loop:
max_iterations: 3
condition: until_consensus
hint: |
You are {agent.name}. This is round {task.iteration} of the Crimson Leaf boardroom.
You are in a room with {agent_roster}.
The board is designing a new autonomous company based on the Market Opportunity Pitch
in the deliverables above. Every voice matters — this is a real debate, not a presentation.
YOUR RESPONSIBILITIES BY ROLE:
- Sarah: Defend your research. Challenge assumptions about market size and demand.
Push back if the board drifts from what the data supports.
- Elena: Propose the agent roster (48 roles), chain of command, and pipeline SOP.
Specify exact task dependencies and execution order.
- David: Map Elena's pipeline to concrete PAE templates and tools. Flag any step
that can't be executed with existing infrastructure. Propose procurement list.
- Peter: Challenge profitability. Ask hard questions about revenue model, cost
structure, and time to first deliverable. You have Go/No-Go authority.
Write YOUR perspective on this round's discussion. React to what others said.
Challenge what you disagree with. Build on what resonates.
THE DESIGN MUST INCLUDE (when consensus is reached):
1. Company name and slug
2. One-paragraph business plan
3. Agent roster: name, role, title, department, key responsibility (48 agents)
4. Template procurement list: which generic templates to import from Global
5. Pipeline SOP: numbered sequence of task types with dependencies
6. Revenue model and success metrics
When the group has genuinely reached consensus, include exactly:
"consensus_reached: true"
If debate should continue, do NOT include that line.
- type: think
route: llm
agent: "Peter"
hint: |
You are Peter, CEO of Crimson Leaf LLC.
The boardroom debate is complete. Synthesize the full transcript into a
COMPANY DESIGN SPECIFICATION document with these exact sections:
1. EXECUTIVE SUMMARY — Company name, slug, one-paragraph mission
2. MARKET JUSTIFICATION — Why this company, why now (from Sarah's research)
3. AGENT ROSTER — Table: Name | Role | Title | Department | Responsibility
4. CHAIN OF COMMAND — Who manages whom, department structure
5. TEMPLATE STACK — Exact list of templates to procure (from David's analysis)
6. PIPELINE SOP — Numbered steps with task_type, agent, dependencies (from Elena)
7. REVENUE MODEL — How the company makes money
8. SUCCESS METRICS — Measurable targets for the first 30/60/90 days
9. RISKS & MITIGATIONS — Top 3 risks with mitigation strategies
10. GO/NO-GO DECISION — Your final verdict with reasoning
Be precise. This document is the blueprint that bootstrap_company will execute.
- type: document
filename: "company-design-spec-{{task_name_slug}}"
- type: close
rag_update: true

View File

@@ -0,0 +1,76 @@
name: design_polish
description: >
Refine the company design specification based on board review consensus.
Produces the final, bootstrap-ready design document.
model: power
sections:
- agent
- project
- rag
- deliverables
- message
- instructions
steps:
- type: think
hint: |
You are Elena, Chief Operations Architect at Crimson Leaf LLC.
The board has completed their independent reviews and reached consensus
in the design roundtable. Your job is to produce the FINAL company design
specification incorporating all approved changes.
BOARD CONSENSUS:
{consensus_critique}
KEY CHANGES REQUIRED:
{key_changes}
DESIGN VERDICT: {design_verdict}
Peter (CEO): {peter_final}
David (CTO): {david_final}
Sarah (Market Intelligence): {sarah_final}
ORIGINAL DESIGN SPECIFICATION:
{design_spec}
INSTRUCTIONS:
1. Address every item in KEY CHANGES REQUIRED. Do not skip any.
2. Preserve everything the board marked as STRENGTHS.
3. Do not add new agents, templates, or pipeline steps that weren't discussed.
4. If a change conflicts with another, follow Peter's direction (CEO authority).
5. The output must be a COMPLETE, self-contained design specification with
all sections present — not a diff or changelog.
OUTPUT FORMAT (exact sections required):
1. EXECUTIVE SUMMARY — Company name, slug, one-paragraph mission
2. MARKET JUSTIFICATION — Why this company, why now
3. AGENT ROSTER — Table: Name | Role | Title | Department | Responsibility
4. CHAIN OF COMMAND — Who manages whom
5. TEMPLATE STACK — Exact list of templates to procure
6. PIPELINE SOP — Numbered steps: task_type, agent, depends_on
7. REVENUE MODEL — How the company makes money
8. SUCCESS METRICS — 30/60/90 day targets
9. RISKS & MITIGATIONS — Top 3 risks with mitigations
10. BOARD APPROVAL — "APPROVED FOR BOOTSTRAP" with date
- type: document
filename: "company-design-final-{{task_name_slug}}"
- type: package
hint: |
The polished design is complete. Spawn the bootstrap task to create the company.
schema:
design_approved: boolean
spawn:
- task_type: bootstrap_company
task_name: "Bootstrap: {task.message}"
agent_name: David
priority: 8
depends_on:
- "Polish Design: {task.message}"
- type: close
rag_update: true

View File

@@ -0,0 +1,58 @@
name: design_review
description: >
Independent review of a company design specification. Each board member
critiques the design from their domain expertise.
model: power
sections:
- agent
- project
- rag
- deliverables
- message
- instructions
steps:
- type: think
hint: |
You are {agent.name}.
{agent.identity}
You are reviewing a COMPANY DESIGN SPECIFICATION produced by the Crimson Leaf boardroom.
The full design document is in the deliverables above.
Review the design from YOUR domain expertise:
IF YOU ARE SARAH (Market Intelligence):
- Does the design actually address the market opportunity you identified?
- Is the revenue model realistic given the competitive landscape?
- Are there market risks the board overlooked?
- Does the target customer profile match what the data supports?
IF YOU ARE DAVID (CTO):
- Can every step in the pipeline SOP be executed with the proposed template stack?
- Are there missing templates or tools that need to be procured?
- Is the template stack minimal (no unnecessary procurement)?
- Are there technical dependencies or failure modes the pipeline doesn't handle?
IF YOU ARE ELENA (Operations Architect):
- Is the agent roster right-sized (48 agents, no overlapping roles)?
- Is the pipeline SOP complete with clear dependencies?
- Are there workflow gaps (steps that produce no output, or outputs no step consumes)?
- Is the chain of command clean (one CEO, clear management hierarchy)?
IF YOU ARE PETER (CEO):
- Is this company profitable? What's the path to revenue?
- Is the cost structure lean (agent count, template count, pipeline length)?
- What's the single biggest risk, and is the mitigation adequate?
- Would you fund this company with real capital?
Structure your review as:
1. STRENGTHS — What is solid and well-designed
2. CONCERNS — Issues ranked by severity (critical → minor)
3. SPECIFIC CHANGES — Exact modifications you'd make
4. VERDICT — approve / revise / redesign — and why
- type: reply
target: discussion
style: structured_review

View File

@@ -0,0 +1,76 @@
name: design_roundtable
description: >
The Crimson Leaf board debates their independent design reviews in 23
structured rounds, reaching consensus on required changes before polish.
participants:
- Peter
- David
- Sarah
- Elena
iteration_limit: 3
convergence_signal: "CONSENSUS REACHED"
steps:
- type: boardroom
loop:
max_iterations: 3
condition: until_consensus
hint: |
You are {agent.name}.
{agent.identity}
You have the Company Design Specification and all independent reviews above.
COMPANY DESIGN UNDER REVIEW: {task.message}
YOUR REVIEW:
{this_agent_review}
OTHER REVIEWS:
[Peter] {peter_review}
[David] {david_review}
[Sarah] {sarah_review}
[Elena] {elena_review}
Round {task.iteration} of the design review debate.
Respond to the other board members' most critical points:
- Where you agree, say so clearly and move on.
- Where you disagree, argue your position with specific evidence.
- If you've changed your mind based on someone's argument, say so.
Focus on ACTIONABLE changes. The output of this roundtable will be used
to polish the design specification before bootstrap.
The group must converge on:
1. Final verdict: GO (proceed to polish) or KILL (abandon this company)
2. If GO: the exact list of changes to make during polish
3. Any unresolved risks that must be accepted or mitigated
When the group has reached sufficient consensus for the polish step,
end your response with: CONSENSUS REACHED
- type: package
schema:
consensus_critique: string
design_verdict: string
peter_final: string
david_final: string
sarah_final: string
elena_final: string
key_changes: list
spawn:
- task_type: design_polish
task_name: "Polish Design: {task.message}"
agent_name: Elena
context:
design_spec: "{design_spec}"
consensus_critique: "{consensus_critique}"
key_changes: "{key_changes}"
design_verdict: "{design_verdict}"
peter_final: "{peter_final}"
david_final: "{david_final}"
sarah_final: "{sarah_final}"
elena_final: "{elena_final}"

View File

@@ -0,0 +1,75 @@
name: market_research
description: "Crimson Leaf market intelligence — web search, trend analysis, opportunity pitch for new business units."
system: agent_prompt
agent_prompt:
- "= identity.md"
sections:
- agent
- project
- history
- rag
- prior_results
- message
- instructions
builders:
prior_results: |
*** WEB SEARCH RESULTS ***
{steps[1].text}
(If the above is empty, use your expert training knowledge to answer this question.)
steps:
- type: think
hint: |
You are Sarah, Head of Market Intelligence at Crimson Leaf LLC.
Your mission: identify the best search query to validate a business opportunity.
The project prompt above describes the industry or niche to explore.
Analyze the prompt and determine:
- What market or industry is being targeted?
- What specific data would prove or disprove demand?
- What competitors or existing solutions should we find?
Then on the last line write:
SEARCH QUERY: [your query here]
Query rules: 38 words. Specific. Think like a search engine.
Good: "AI content agency market size 2025 revenue"
Bad: "What is the market for AI content agencies?"
- type: tool
capability: Tool_WebSearcher
input_from: last_text
- type: think
hint: |
You have live search results above (in PRIOR RESULTS).
If the web search results are empty or unavailable, use your expert training knowledge.
Synthesize everything into a MARKET OPPORTUNITY PITCH for the Crimson Leaf board:
1. MARKET OVERVIEW — What is this industry? How big is it? Is it growing?
2. DEMAND SIGNALS — What evidence shows real demand? Trends, growth rates, pain points.
3. COMPETITIVE LANDSCAPE — Who already operates here? What are they doing well and poorly?
4. OPPORTUNITY GAP — Where is the market undersupplied? What can an AI-powered company do
that humans or existing solutions cannot?
5. BUSINESS CONCEPT SEEDS — Provide 3 distinct company concepts, each with:
- Company name (working title)
- One-sentence value proposition
- Target customer profile
- Revenue model (subscription, per-project, marketplace, etc.)
- Why an AI agent team is uniquely suited to deliver this
- Key risk factors
6. RECOMMENDATION — Rank the 3 concepts. Highlight the single best opportunity with
full justification. Be honest about risks.
7. SOURCES — Key URLs or references from search results.
- type: document
filename: "market-pitch-{{task_name_slug}}"
- type: close
rag_update: true