Product Requirements Document: Legionis

Your Full AI Workforce Platform

Document Version: 3.0 Date: 2026-02-17 Owner: Director of Product Management Status: Active Product: Legionis V2V Phase: Phase 3 — Strategic Commitments Related Decisions: DR-2026-001 (Full-Capability Day 1), DR-2026-002 (Cloud Storage First), DR-2026-003 (Naming — "Legionis"), Pricing Model (Team-Based Modules) Architecture Reference: See architecture-stack.md for verified pricing and technical specifications


1. Product Overview

1.1 Vision

Legionis is a general-purpose AI workforce platform — teams of autonomous AI agents that augment human work across every business function. Where other AI tools give you a single chatbot, Legionis gives you a full organizational workforce: product managers, marketers, architects, finance directors, legal counsel, and executives — 81 agents across 11 teams, each with distinct expertise, working together through structured collaboration.

One-line vision: "Your full AI workforce. Many acting as one."

Competitive Moat: 6 Core Differentiators

Legionis is defensible through six interlocking differentiators that form a flywheel: users start with one team, agents collaborate to produce quality work, deliverables save to the user's cloud, memory compounds, trust deepens because users own everything, and they add more teams.

#DifferentiatorWhat It MeansWhy It Matters
1Cloud Storage ConnectivityConnect to Google Drive (OneDrive, Dropbox planned). Deliverables save to user's folder structure. File IDs survive renames and reorganization.Data ownership from day one. Work persists in the user's own cloud, not trapped in a SaaS black box. Stable file IDs enable compounding memory.
2Bring Your Own Tokens (BYOT)Users connect their own OpenAI, Anthropic, or Google API keys. Pay providers directly at their rates.Zero markup. Full cost transparency. No vendor lock-in on the AI layer. Users control model selection and spend.
3Modular Agent ProvisioningUsers acquire teams by department. Start with one, expand as needed. Each team brings a lead, specialists, knowledge packs, and a coach.No bloatware. Pay for what you use. Organic expansion as the user discovers more use cases.
4Collaborative Agent ArchitectureAgents don't just respond to the user. They consult each other, delegate sub-tasks to specialists, review each other's work, and debate genuine tradeoffs with structured arguments. Agents spawn other agents.Multi-perspective quality that no single-agent chatbot can match. The user gets synthesis, not raw output.
5Organizational Memory (Context Layer)Decisions, interactions, assumptions, learnings, feedback, and document indexes are saved as markdown files in the user's own cloud storage. Cross-referenced and instantly recallable.Memory compounds over time. The 100th decision is informed by the first 99. The user owns this data as portable files, not locked in a proprietary database.
6Full Data OwnershipTokens stay with the provider. Files stay in the user's cloud. Context stays in the user's workspace. Nothing passes through or is stored on Legionis servers.Trust at the architecture level. Users can verify ownership, export anytime, and switch providers without losing their organizational memory.

These six differentiators reinforce each other: cloud storage enables persistent memory, BYOT ensures cost control, modular provisioning drives expansion, collaborative architecture produces quality work worth remembering, and full data ownership builds the trust required for long-term adoption.

1.2 Mission

Deliver a complete AI workforce experience — 81 agents across 11 specialized teams, 9 team gateways, and 80+ skills — through a web interface that feels like commanding a real organization. Text input, voice activation, agent selection, structured team meetings — all backed by cloud storage, persistent memory, and multi-perspective collaboration. All capabilities available from Day 1.

1.3 Target Users

Primary Target: Professionals who need a full team but don't have one — or need to augment the one they have.

PersonaDescriptionPain PointWhy Legionis
Power PM (Alex)Senior PM who uses Claude Code or similar AI toolsTerminal context is messy, files scattered, no persistence across sessionsWeb UI with cloud storage = organized workspace + persistent context. Full product team on demand.
Technical VP (Jordan)VP Product with engineering background, comfortable with command-lineSingle AI tools lack multi-perspective input; no PLT simulationFull AI workforce with 81 agents, Meeting Mode, cross-functional team gateways
Product Consultant (Sam)Fractional CPO serving multiple clientsEach client is a separate context nightmare, can't share work easilyMulti-workspace, client-by-client context isolation, export capabilities
Startup Founder (Riley)Wears many hats — product, marketing, finance, opsCan't afford to hire specialists for every function; needs a full team without headcount11 teams covering every business function: @marketing for campaigns, @finance for budgets, @legal for contracts, @operations for process
Marketing Lead (Morgan)Runs content, campaigns, positioning for a growing companyContent creation is a bottleneck; needs strategic marketing support, not just copywriting@marketing gateway with 16 specialists: content strategist, SEO, CRO, paid media, email, social, PR, growth
Finance Director (Pat)Manages budgets, forecasting, investor materialsFinancial modeling takes weeks; investor decks are always last-minute@finance gateway with 9 specialists: FP&A, revenue analysis, investor relations, tax planning
Operations Manager (Casey)Owns process improvement, vendor management, program coordinationOperational gaps between teams; processes undocumented@operations gateway with 8 specialists: program management, procurement, process engineering, risk

Secondary Target (lower priority for initial launch):

PersonaDescriptionWhy Later
Legal TeamsIn-house counsel needing contract review, compliance, privacyRequires domain-specific validation; @legal team is ready but trust-building needed
Executive AssistantsSupporting C-suite with strategy prep, board materialsRequires @executive team + cross-team orchestration polish
Corporate DevelopmentM&A analysis, partnership evaluation, venture scoutingNiche use case; @corpdev team is ready for early adopters
Non-Technical PMPM who's never used CLIRequires more onboarding polish, guided workflows
Enterprise TeamLarge product org with compliance needsRequires SSO, audit logs, admin controls

1.4 Problem Statement

The problem is NOT "CLI is too hard." The real problems are:

  • Context Fragmentation: Product work happens across docs, spreadsheets, Notion, Confluence, local files. There's no unified workspace that accumulates organizational knowledge.
  • Ephemeral Sessions: Current AI tools (ChatGPT, Claude.ai) don't persist context. Every conversation starts from scratch. Product decisions made 3 months ago are forgotten.
  • No Stable References: When you move or rename a file, every reference to it breaks. Cloud storage APIs provide stable file IDs that survive reorganization — this is the foundation for compounding memory.
  • Single-Perspective AI: ChatGPT gives you one voice. Business decisions need multiple perspectives — PM, VP, PMM, BizOps, Marketing, Finance, Legal — synthesized together. That's what agent orchestration provides.
  • Functional Gaps: Small teams and founders can't afford specialists in every discipline. They need marketing strategy, financial modeling, legal review, and architecture guidance — but hiring 81 people isn't an option.
  • Legionis solves these problems with a web-based workspace that:

    1.5 Strategic Bet

    We believe professionals will pay $10-25/user/mo for an AI workforce platform that:

    The moat is context accumulation. After 3+ months of decisions, bets, feedback, and learnings stored in the user's cloud drive with stable file IDs, switching to another tool means losing all that institutional knowledge.

    Pricing (source of truth: Legionis Agent Catalog):

    TierPriceWhat's Included
    Free$0500 ops/month, platform-provided Haiku, all agents accessible
    Pro$10/user/moFull model access via BYOT (Bring Your Own Tokens), all 11 teams
    Team$7/user/moTeam-based pricing for organizations, shared workspaces
    Add-on Module+$5/user/moPremium extension team modules (individual team add-ons)
    Full Org$25/user/moEverything: all teams, all modules, priority support

    Assumptions:

    #AssumptionValidation MethodTimeline
    A-001Power users (familiar with AI tools) convert at >5% Free-to-ProMeasure conversion rate by user segment6 months post-launch
    A-002Context accumulation creates measurable switching costs after 3+ monthsTrack retention by tenure cohort9 months post-launch
    A-003ROI tracking drives Free-to-Pro conversionA/B test ROI visibility vs. hidden3 months post-launch
    A-004Agent Orchestrator performs without quality/latency degradationLoad testingLaunch + 1 month
    A-005"Your API Keys" model is preferred by target users (they have existing API contracts)User interviews, signup funnel analysis3 months post-launch
    A-006Cloud storage integration (vs. built-in storage) is preferred by target usersUser interviews, signup funnel analysis3 months post-launch
    A-007Voice input is used by >20% of power usersFeature flag usage tracking6 months post-launch
    A-008Non-product personas (marketing, finance, ops) expand addressable market by 3x+Signup persona tracking, team selection data6 months post-launch
    A-009Team-based pricing ($7/user) drives org adoption over individual ($10/user)Conversion funnel analysis per tier6 months post-launch

    We'll know we're wrong when:


    2. Technology Choices

    This section defines the technology stack and architecture decisions for Legionis. Each choice includes rationale and alternatives considered.

    2.1 Frontend

    Framework: React 18+ with TypeScript

    Choice: React 18 with TypeScript (strict mode)

    Rationale:

    Alternatives Considered:

    Meta-Framework: Next.js 16 (App Router)

    Choice: Next.js 16 with App Router

    Rationale:

    AI SDK: Vercel AI SDK v6

    Choice: Vercel AI SDK v6 (ai package) for all LLM interactions

    Rationale:

    Key APIs:

    Styling: Tailwind CSS 4

    Choice: Tailwind CSS with the @tailwindcss/typography plugin

    Rationale:

    Component Library: Radix UI Primitives + Custom Components

    Choice: Radix UI (headless) + custom-styled components

    Rationale:

    Key Components:

    State Management: Zustand + TanStack Query

    Choice: Zustand for client state, TanStack Query (React Query) for server state

    Rationale:

    Alternatives Considered:

    Markdown Rendering: react-markdown + rehype/remark plugins

    Choice: react-markdown with remark-gfm, rehype-highlight, rehype-raw

    Rationale:

    Additional rendering:

    Rich Editor: Tiptap

    Choice: Tiptap (based on ProseMirror)

    Rationale:

    Key extensions needed:

    Real-Time Streaming: Vercel AI SDK + SSE

    Choice: Vercel AI SDK v6 streaming via useChat() hook and toUIMessageStreamResponse()

    Rationale:

    Implementation:
    Client → useChat() hook sends message via POST /api/chat
    Server → streamText() generates response with tools
    Server → toUIMessageStreamResponse() converts to stream
    Client → useChat() renders tokens incrementally
    

    2.2 Backend Architecture

    Monolith on Next.js API Routes

    Choice: All backend logic runs as Next.js API routes deployed on Vercel — no separate backend service.

    Rationale:

    Key API Routes:

    RouteMethodDescription
    /api/chatPOSTMain agent/skill execution — streams LLM responses
    /api/drive/callbackGETGoogle Drive OAuth callback
    /api/drive/filesGET/POSTFile CRUD via Google Drive API
    /api/webhooks/stripePOSTStripe subscription/payment events
    /api/webhooks/clerkPOSTUser lifecycle events
    /api/usageGETUsage metering and limits
    /api/billingGET/POSTSubscription management
    /api/healthGETHealth check

    Runtime: Node.js 22 LTS

    Choice: Node.js 22 (LTS) with TypeScript

    Rationale:

    LLM Integration: Vercel AI SDK v6 with Multi-Provider Support

    Choice: Vercel AI SDK v6 (ai package) with provider adapters

    Architecture:

    User Request
    
    Prompt Assembler (compiles system prompt + agent persona + skills + context)
    Vercel AI SDK streamText() / generateText() | - Provider: @ai-sdk/anthropic, @ai-sdk/openai, or @ai-sdk/google | - Model: selected per user's BYOT configuration | - Tools: file ops, search, sub-agent spawn
    Tool Executor (handles tool_use calls against cloud storage)
    Stream Response to Client (via toUIMessageStreamResponse())

    Token Source Model — BYOT (Default) + Legionis Tokens (Convenience):

    Users choose how they pay for AI. BYOT is the default and recommended path. Legionis Tokens is a convenience alternative for teams that don't want to manage API keys.

    TierBYOT (Default)Legionis Tokens (Alternative)
    FreePlatform-provided (limited)Haiku only, 500 ops/month cap
    Pro ($10/user/mo)User connects API key — zero markupPlatform-provided — 30% service fee on provider rates
    Team ($7/user/mo)User connects API key — zero markupPlatform-provided — 30% service fee on provider rates
    Full Org ($25/user/mo)User connects API key (any provider)Platform-provided — 30% service fee on provider rates

    BYOT (Bring Your Own Tokens) — Recommended:

    Legionis Tokens — Convenience Option: Quality/Efficiency Toggle (applies to both BYOT and Managed):

    Three-position global setting controlling the cost-quality tradeoff:

    SettingBehaviorUse Case
    Maximum QualityAll agents use top-tier models (Opus/GPT-4o) regardless of SKILL.md defaultCritical strategic work, high-stakes deliverables
    Balanced (default)Each agent uses its SKILL.md-specified model (sonnet for OS, opus for Extension Teams)Daily operations — optimized by agent designers
    Maximum EfficiencyAll agents use fastest models (Haiku/GPT-4o-mini)High-volume tasks, cost-sensitive teams, quick lookups

    Implementation: applyQualityPreference() intercepts the agent's model preference before resolveModel() in provider-factory.ts. Stored as quality_preference on the workspaces table. Per-agent model overrides available as a post-launch enhancement (Week 15).

    Prompt Caching: Anthropic's prompt caching remains beneficial for all users — skill templates, rules, and agent personas get cached, reducing API costs whether BYOT or Managed.

    Prompt Assembler Architecture

    The Prompt Assembler is the core translation layer between the compiled agent/skill definitions and the Vercel AI SDK.

    +---------------------------------------------+
    
    Prompt Assembler
    1. DETECT intent (skill, agent, gateway)
    2. LOAD compiled personas from JSON
    - Agent persona files (81 agents)
    - Skill definitions (80+ skills)
    - Rule files (relevant subset)
    - User's context files (@file refs)
    3. ASSEMBLE system prompt
    - Agent Identity Protocol (if agent)
    - Skill template (if skill)
    - Relevant rules (not all -- selected)
    - User context (decisions, bets, etc.)
    4. CONFIGURE tools via AI SDK tool()
    - File operations (Read, Write, Edit)
    - Search operations (Glob, Grep)
    - Skill invocation (nested)
    - Sub-agent spawn
    5. INVOKE via AI SDK
    - streamText() or generateText()
    - Provider selected per BYOT config
    - Tools enabled
    6. PROCESS tool calls
    - Execute against cloud storage
    - Return results to model
    - Continue until complete
    7. STREAM response to client
    - toUIMessageStreamResponse()
    - Tool call notifications inline
    - Final response with ROI
    +---------------------------------------------+

    Skill Loading Strategy:

    Agent Orchestrator Architecture

    The Agent Orchestrator manages agent spawning, tool execution, and response synthesis.

    Single-Agent Orchestration

    User: "@pm create a PRD for authentication"
    
    Orchestrator detects @agent syntax
    Constructs agent prompt via Prompt Assembler: - Agent Identity Protocol (emoji, name, response rules) - Agent persona (compiled from SKILL.md) - Relevant skills available to agent - User's context files - Task description
    Calls streamText() with agent's system prompt + tools - Agent can use tools (Read, Write, Edit, Glob, Grep) - Agent can invoke skills (nested skill execution)
    Streams agent response back to user's chat - With attribution (emoji + display name) - With ROI display
    Logs interaction to context/interactions/

    Multi-Agent Orchestration (Parallel + Meeting Mode)

    User: "@plt should we prioritize webhooks or SDK?"
    
    Gateway skill detects PLT invocation
    Determines agent composition (e.g., VP Product, Dir PM, Dir PMM, BizOps)
    Spawns N agents IN PARALLEL - Each agent gets same prompt + their persona - Each runs independently via separate generateText() calls - Promise.all() waits for all agents
    Meeting Mode Assembly: - Individual responses shown with attribution - Points of alignment extracted - Points of tension extracted - Synthesis generated (by orchestrator using a final generateText() call)
    Aggregate ROI calculated
    Full Meeting Mode response streamed to client

    Key Design Decisions:

    2.3 Infrastructure

    Repository: Next.js Monolith

    Choice: Single Next.js application with colocated API routes

    Structure:

    legionis/
    +-- src/
    |   +-- app/                    # Next.js App Router pages
    |   |   +-- (auth)/             # Auth pages (sign-in, sign-up)
    |   |   +-- (dashboard)/        # Main app (workspace, chat, settings)
    |   |   +-- api/                # API routes (the backend)
    |   |   |   +-- chat/           # Agent/skill execution endpoint
    |   |   |   +-- drive/          # Google Drive proxy routes
    |   |   |   +-- webhooks/       # Stripe, Clerk webhooks
    |   |   |   +-- usage/          # Usage metering
    |   |   |   +-- billing/        # Subscription management
    |   |   |   +-- health/         # Health check
    |   |   +-- layout.tsx          # Root layout
    |   +-- components/             # React components
    |   +-- lib/                    # Core libraries
    |   |   +-- agent/              # Agent runtime (AI SDK wrappers)
    |   |   +-- db/                 # Drizzle schema + queries
    |   |   +-- drive/              # Google Drive client
    |   |   +-- prompt/             # Prompt compilation + caching
    |   |   +-- stripe/             # Stripe helpers
    |   |   +-- utils/              # Shared utilities
    |   +-- tools/                  # Custom AI SDK tool definitions
    |   +-- personas/               # Compiled agent personas (JSON)
    |   +-- middleware.ts           # Clerk auth middleware
    +-- os-source/                  # Git submodules
    |   +-- product-org-os/         # PUBLIC: 13 agents, 61 skills
    |   +-- extension-teams/        # PRIVATE: 68 agents, 34 knowledge packs
    +-- scripts/
    |   +-- compile-prompts.ts      # SKILL.md -> compiled persona JSON
    |   +-- seed-skills.ts          # Seed skill metadata into DB
    |   +-- migrate.ts              # DB migration runner
    +-- drizzle/                    # Migration files
    +-- package.json
    

    Rationale:

    Hosting: Vercel (Single Deployment)

    Choice: Vercel Pro plan for the entire application

    Rationale:

    Scaling Strategy:

    Database: PostgreSQL via Neon

    Choice: PostgreSQL 17 hosted on Neon

    Rationale:

    ORM: Drizzle ORM

    Rationale:

    Schema Overview (key tables):

    TablePurposeKey Columns
    usersAuth, profileid, email, name, tier, created_at
    workspacesUser/team workspaceid, owner_id, name, storage_path
    conversationsChat threadsid, workspace_id, title, created_at
    messagesChat messagesid, conversation_id, role, content, tokens_in, tokens_out
    documentsGenerated filesid, workspace_id, path, type, skill_used, created_at
    usage_eventsBilling meteringid, user_id, operation_type, model, tokens, cost, timestamp
    context_entriesDecisions, bets, etc.id, workspace_id, type, content, metadata
    api_keysEncrypted BYOT keysid, user_id, provider, encrypted_key, created_at
    subscriptionsStripe subscription stateid, user_id, stripe_id, tier, status

    Object Storage: Cloudflare R2

    Choice: Cloudflare R2

    Rationale:

    Storage Structure (per workspace):
    workspaces/{workspace_id}/
    +-- context/
    |   +-- decisions/
    |   +-- bets/
    |   +-- feedback/
    |   +-- learnings/
    |   +-- interactions/
    |   +-- portfolio/
    |   +-- documents/
    +-- deliverables/       # PRDs, roadmaps, presentations
    +-- uploads/            # User-uploaded files
    +-- .metadata.json      # Workspace metadata
    

    Search: Typesense Cloud

    Choice: Typesense Cloud

    Rationale:

    Use Cases:

    Authentication: Clerk

    Choice: Clerk

    Rationale:

    Payments: Stripe

    Choice: Stripe Billing + Stripe Checkout

    Rationale:

    Billing Architecture:
    +------------------------------------------+
    
    Billing Service
    1. Subscription Management
    - Free: No Stripe subscription
    - Pro: $10/user/mo
    - Team: $7/user/mo (per seat)
    - Add-on: +$5/user/mo
    - Full Org: $25/user/mo (per seat)
    2. Usage Tracking
    - Count operations per user/month
    - Free tier: enforce 500 ops cap
    3. Webhook Processing
    - payment_succeeded -> activate
    - payment_failed -> grace period
    - subscription_canceled -> downgrade
    +------------------------------------------+

    Stripe Products Configured (test mode):

    Monitoring & Observability

    Choice: Sentry (errors) + PostHog (product analytics) + Better Stack (logs/uptime)

    ToolPurposeCost
    SentryError tracking, performance monitoring, session replay$26/mo (Team)
    PostHogProduct analytics, feature flags, A/B testing, session recordingsFree up to 1M events
    Better StackLog aggregation, uptime monitoring, status page$24/mo

    Custom Telemetry (built in-house):

    2.4 P0 Architecture Requirements (Pre-M0 Blockers)

    Following the Architecture Team review (2026-01-29), the following 8 items are P0 blockers that must be addressed before M0 development begins.

    Implementation Details: See architecture-spec-m0.md for full technical specifications, code examples, and validation criteria.

    2.4.1 API Key Encryption

    User-provided LLM API keys (for the Your API Keys model) must be encrypted at rest using envelope encryption with KMS. Plaintext keys must never be stored or logged.

    Owner: Security Architect | Risk if unaddressed: Data breach

    2.4.2 Row-Level Security (RLS) Enforcement

    PostgreSQL RLS policies must enforce multi-tenant data isolation on all workspace-scoped tables. Cross-tenant access must be impossible at the database level.

    Owner: Data Architect + Security Architect | Risk if unaddressed: Data leakage between tenants

    2.4.3 Prompt Injection Mitigation

    Input sanitization, sandboxed context injection, output validation, and rate limiting must prevent prompt injection attacks via user-provided files and context.

    Owner: Security Architect + AI Architect | Risk if unaddressed: System compromise

    2.4.4 Connection Pool Configuration

    Neon PostgreSQL connection pooling must be configured with appropriate pool sizes per phase (20 -> 50 -> 100 connections) and timeout settings.

    Owner: Chief Architect + Data Architect | Risk if unaddressed: Performance degradation under load

    2.4.5 API Versioning Strategy

    URL path versioning (/v1/resource) with 6-month deprecation windows for breaking changes. Critical for future Enterprise API tier.

    Owner: API Architect | Risk if unaddressed: Breaking changes for API consumers

    2.4.6 SSE Event Type Contract

    Streaming response events must have defined types for tokens, tool calls, agent lifecycle, errors, and completion. Clients must be able to distinguish event types.

    Owner: API Architect | Risk if unaddressed: Frontend integration issues

    2.4.7 Prompt Versioning System

    Skill templates, agent personas, and rules must support semantic versioning, A/B testing, instant rollback, and per-version metrics tracking.

    Owner: AI Architect | Risk if unaddressed: Slow prompt iteration, no rollback capability

    2.4.8 Distributed Tracing

    Request IDs must propagate across agent spawns to enable debugging of multi-agent sessions. Full trace trees must be queryable in logs.

    Owner: Cloud Architect | Risk if unaddressed: Cannot debug PLT or multi-agent issues


    2.5 Agent Roster

    Legionis provides 81 agents organized across 11 specialized teams, with 9 team gateways for automatic routing.

    Product Org (Core) — 13 Agents, 2 Gateways

    The core team, providing comprehensive product management capabilities. One of eleven equal department teams.

    AgentEmojiRole
    Product Manager📝Requirements, PRDs, user stories, delivery
    VP Product📈Vision, portfolio, strategic decisions
    Director PM📋Roadmaps, prioritization, team management
    Director PMM📣GTM, positioning, competitive response
    Product Marketing Manager🎯Messaging, campaigns, launch execution
    CPO👑Enterprise strategy, org design
    BizOps🧮Financial analysis, KPIs, business cases
    Competitive Intelligence🔭Competitor analysis, win/loss, market intel
    Product Operations⚙️Launch readiness, process, tooling
    UX Lead🎨User research, design, usability
    Value Realization💰Customer outcomes, adoption, churn
    BizDev🤝Partnerships, market expansion
    Product Mentor🎓Career development, PM coaching

    Gateways: @product (single/multi-agent routing), @plt (Product Leadership Team meetings)

    Design Team — 7 Agents

    AgentEmojiRole
    Director of Design🎨Design leadership, systems, standards
    UI Designer🖼️Components, interfaces, layouts
    Visual Designer🎭Branding, graphics, visual identity
    Interaction Designer👆UX flows, prototypes, patterns
    User Researcher👤Research, usability testing, personas
    Motion Designer🎬Animation, transitions, micro-interactions
    Design Coach🖌️Design career development

    Gateway: @design

    Architecture Team — 7 Agents

    AgentEmojiRole
    Chief Architect🏗️System architecture, technical strategy
    API Architect🔌API design, integrations, contracts
    Data Architect📊Data modeling, schemas, databases
    Security Architect🔐Security review, auth, threat modeling
    Cloud Architect☁️Infrastructure, deployment, scaling
    AI Architect🤖AI/ML architecture, LLM patterns, RAG
    Architecture Coach🔧Architecture career development

    Gateway: @architecture

    Marketing Team — 16 Agents

    AgentEmojiRole
    CMO🎙️Marketing strategy, brand, org design
    Director of Marketing📢Campaign strategy, team leadership
    Content Strategist✍️Content strategy, editorial calendar
    Copywriter✏️Messaging, landing pages, copy
    SEO Specialist🔍Organic search, keywords
    CRO Specialist📈Conversion optimization, A/B tests
    Paid Media Manager💰Ads, media buying, campaigns
    Email Marketer📧Email campaigns, sequences, automation
    Social Media Manager📱Social media, community
    Growth Marketer🚀Growth strategy, acquisition loops
    Market Researcher🔬Market sizing, surveys, analysis
    Video Producer🎥Video content, production
    PR/Comms Specialist📣PR, communications, press
    Presentation Designer📑Slide decks, pitch materials
    Infographic Designer📊Data visualization, infographics
    Marketing Coach🎤Marketing career development

    Gateway: @marketing

    Finance Team — 9 Agents

    AgentEmojiRole
    CFO💰Financial strategy, capital allocation
    Director of Finance💼Financial planning, budgets
    FP&A Analyst📉Forecasting, variance analysis
    Revenue Analyst💵Revenue modeling, unit economics
    Investor Relations🏦Fundraising, investor materials
    Financial Controller🧾Reporting, audit, controls
    Treasury Analyst💳Cash flow, working capital
    Tax Specialist📋Tax planning, R&D credits
    Finance Coach🏫Finance career development

    Gateway: @finance

    Legal Team — 8 Agents

    AgentEmojiRole
    General Counsel⚖️Legal strategy, risk governance
    Director Legal Affairs📂Legal operations, team management
    Contracts Counsel📜Contract review, vendor agreements
    Privacy Counsel🛡️GDPR, CCPA, data protection
    IP Counsel💡Patents, trade secrets, licensing
    Compliance OfficerSOC2, ISO, regulations
    Employment Counsel👔Employment law, policies
    Legal Coach📚Legal career development

    Gateway: @legal

    Operations Team — 8 Agents

    AgentEmojiRole
    COO🏢Operational strategy, org design
    Director of Operations🔄Process improvement, management
    Program Manager📋Cross-functional programs
    Project Manager📊Project planning, execution
    Procurement Specialist🛒Vendor management, RFPs
    Process Engineer⚙️Process mapping, automation
    Risk Manager🛡️Enterprise risk, BCP/DR
    Operations Coach🎓Operations career development

    Gateway: @operations

    Executive Team — 2 Agents (+ Shared C-Levels)

    AgentEmojiRole
    CEO🎯Enterprise strategy, vision, board prep
    Executive Coach🎓Leadership development

    Gateway: @executive (also routes to CPO, CFO, COO, CMO, CIO, General Counsel as needed)

    Corp Dev Team — 5 Agents

    AgentEmojiRole
    Head of Corp Dev🏛️Corp dev strategy, deal pipeline
    M&A Analyst🔍Acquisitions, due diligence, valuation
    Strategic Partnerships🤝Alliances, JVs, partnerships
    Corporate Venture💎CVC, startup investments
    Corp Dev Coach🎓Corp dev career development

    Gateway: @corpdev

    IT Governance Team — 6 Agents

    AgentEmojiRole
    CIO💻IT strategy, COBIT governance
    Director of IT🖥️IT operations, ITIL
    IT Security Policy🔒NIST CSF, CIS Controls
    Enterprise Systems🏢ERP/CRM, SaaS portfolio
    Data Governance📊DAMA, data quality, MDM
    IT Coach🎓IT career development

    Gateway: @it

    Summary

    MetricCount
    Total Agents81
    Teams11
    Team Gateways9
    OS Gateways2
    Total Gateways11
    Skills80+
    Knowledge Packs34

    2.6 Design System & Brand

    Color Palette

    Legionis uses a stone-based dark palette with warm amber accents:

    TokenHexUsage
    stone-900#1c1917Primary background (dark mode)
    stone-800#292524Card backgrounds, panels
    stone-700#44403cBorders, dividers
    stone-600#57534eMuted text, secondary UI
    stone-400#a8a29eBody text
    stone-200#e7e5e4Primary text
    stone-50#fafaf9High-emphasis text
    amber-600#d97706Primary accent (buttons, links, active states)
    gold-500#f59e0bSecondary accent (highlights, badges)

    Typography

    RoleFontWeight
    HeadingsSpace Grotesk600 (Semi-Bold), 700 (Bold)
    BodyInter400 (Regular), 500 (Medium)
    Code / TechnicalJetBrains Mono400 (Regular)

    Logo

    The Formation L — a geometric "L" mark representing formation, structure, and the legion concept. Used as favicon, app icon, and brand mark.

    Design Principles

  • Dark-first: Dark mode is the primary experience (stone-900 base), light mode is secondary
  • Warm industrial: Stone palette with amber accents evokes professionalism without coldness
  • Information density: Power users want dense UIs — maximize content per viewport
  • Keyboard-first: Every action should be accessible via keyboard shortcuts

  • 2.7 Architecture Decisions Summary

    DecisionChoiceKey Rationale
    Monolith vs MicroservicesMonolith (Next.js API routes)Single deployment, shared types, zero API contract drift, lower ops cost
    Serverless vs ContainersServerless (Vercel functions)Auto-scaling, no container management, pay-per-use at scale
    Edge vs OriginOrigin (with CDN for static)LLM API calls require server; edge unnecessary for launch scale
    SSE vs WebSocketAI SDK streaming (SSE under the hood), WebSocket for presence laterAI SDK handles streaming natively; WebSocket only when needed
    SQL vs NoSQLSQL (PostgreSQL)Transactional integrity for billing, well-structured domain model
    ORM vs Raw SQLORM (Drizzle)Type safety with minimal abstraction, lightweight
    Self-hosted vs ManagedManaged (Neon, R2, Typesense Cloud)Minimize ops overhead for small team
    LLM SDKVercel AI SDK v6Multi-provider support (BYOT), native streaming, built for Next.js

    2.8 Infrastructure Cost Estimate

    Note: See architecture-stack.md for fully researched and verified pricing from official sources (January 2026).

    ServiceLaunchGrowth (1K users)Scale (5K users)Source
    Vercel (app + API)$20/mo$20/mo$20/mo[Vercel Pricing](https://vercel.com/pricing)
    Neon (database)$19/mo$19-69/mo$69/mo[Neon Pricing](https://neon.com/pricing)
    Cloudflare R2 (storage)<$1/mo<$1/mo$3/mo[R2 Pricing](https://developers.cloudflare.com/r2/pricing/)
    Typesense Cloud (search)$40/mo$60/mo$100/mo[Typesense Pricing](https://cloud.typesense.org/pricing)
    Clerk (auth)$25/mo$25-100/mo$25-825/mo[Clerk Pricing](https://clerk.com/pricing)
    Sentry$29/mo$29/mo$29/mo[Sentry Pricing](https://sentry.io/pricing/)
    PostHog$0/mo$0/mo$0/mo[PostHog Pricing](https://posthog.com/pricing)
    Better Stack$29/mo$29/mo$29/mo[Better Stack Pricing](https://betterstack.com/pricing)
    Infrastructure Total~$162/mo~$280/mo~$475/mo

    Key Insight: By eliminating the separate backend service (Railway ~$50-200/mo), total infrastructure cost drops by ~$50-200/mo vs. the v2.1 architecture. The Vercel monolith approach is significantly cheaper.

    Cloud storage APIs (Google Drive, OneDrive, Dropbox) are free — they use quota/rate limit models, not pay-per-use. This is a major cost advantage for the cloud-storage-first architecture.

    Your API Keys Cost Model: With the Your API Keys model, the platform has zero LLM API costs for paid tiers. Users pay their own LLM providers directly. This eliminates the COGS risk entirely and makes unit economics straightforward: infrastructure cost / number of users.

    Free Tier COGS: For free tier users (platform-provided Haiku), estimated COGS is ~$0.50/user/month at 500 ops cap with Haiku-only routing.


    2.9 Cloud Storage Integration (Core Feature)

    Legionis is cloud-storage-first — users connect their existing Google Drive, OneDrive, or Dropbox rather than uploading files to a proprietary storage system.

    Why This Matters

  • Stable File IDs: Cloud providers assign permanent IDs to files. When a skill creates context/decisions/DR-2026-001.md, we store the cloud file ID. Future references resolve via ID, not path. The user can rename or reorganize and all context references remain valid.
  • No Vendor Lock-In: Documents live in the user's cloud storage. They can access them outside Legionis, share them via normal Drive/OneDrive sharing, and export by simply... not exporting (files are already theirs).
  • Zero Sync Conflicts: No desktop agent means no "which version is correct?" problems. The cloud storage IS the source of truth.
  • OAuth Flow

    1. User signs up (email or social login via Clerk)
    
  • User clicks "Connect Storage" -> Google Drive (primary), OneDrive, or Dropbox
  • OAuth consent screen (we request minimal scopes: file read/write in a specific folder)
  • User selects or creates a "Legionis Workspace" folder
  • Backend creates workspace structure in that folder
  • User is ready to use skills and agents
  • Workspace Structure (in User's Cloud Storage)

    Legionis Workspace/              <- User-selected or created folder
    +-- context/                         <- Organizational memory
    |   +-- decisions/
    |   +-- bets/
    |   +-- feedback/
    |   +-- learnings/
    |   +-- interactions/
    |   +-- portfolio/
    |   +-- documents/
    +-- deliverables/                    <- Generated PRDs, roadmaps, etc.
    +-- .workspace.json                  <- Metadata
    

    API Costs

    ProviderAPI CostRate Limits
    Google DriveFREE12,000 queries/day (default)
    Microsoft OneDriveFREEThrottled above 10K requests/10min
    DropboxFREERate limited per app

    All three providers use quota-based models, not pay-per-call. This is a significant cost advantage.


    2.10 External Tool Integration Architecture

    Legionis agents can connect to external professional tools to perform real operations — creating Jira tickets, posting Slack messages, querying analytics, reviewing contracts, and more. This is a force multiplier: agents don't just advise, they act.

    Architecture: Hybrid OAuth

    Users click "Connect [Tool]" → standard OAuth 2.0 flow → Legionis stores encrypted tokens → agents call tool APIs directly using stored credentials. The OS integration templates (15 templates, 47 platforms) inform what API calls agents make; the platform provides the authenticated HTTP client.

    User clicks "Connect Jira" in Settings → Connections
    
    OAuth 2.0 Authorization Code flow
    Legionis stores encrypted tokens in tool_connections table
    Agent needs to create Jira ticket →
    Platform checks: user has Jira connected? |--- YES → Execute API call with stored tokens → Return result to agent |--- NO → Graceful fallback: "Here are the tickets to create manually: [list]"

    Why Hybrid OAuth (not MCP in production):

    Integration Categories (15 Templates, ~47 Platforms)

    CategoryTemplateTeam(s)PlatformsAuth Type
    Project Managementproject-management.mdOperations, ProductJira, Asana, Monday.com, LinearOAuth2 / API key
    Process & Collaborationprocess-collaboration.mdOperationsMiro, Lucidchart, Notion, ConfluenceOAuth2
    Designfigma.mdDesignFigmaAPI key (PAT)
    Code & Repositorygithub-arch.mdArchitectureGitHubOAuth2
    Analyticsanalytics.mdMarketingGA4, Amplitude, Mixpanel, PostHog, HeapService acct / API key
    SEOseo-tools.mdMarketingAhrefs, Semrush, Google Search Console, MozAPI key / Service acct
    Email Marketingemail-platform.mdMarketingMailchimp, SendGrid, HubSpot, Klaviyo, Customer.ioAPI key / OAuth2
    Accountingaccounting.mdFinanceXero, QuickBooks Online, FreshBooks, SageOAuth2 (complex)
    SaaS Metricssaas-metrics.mdFinanceStripe Billing, ChartMogul, Baremetrics, ProfitWellAPI key
    Contract Managementcontract-management.mdLegalDocuSign CLM, PandaDoc, Ironclad, JuroOAuth2 / JWT
    Compliancecompliance-platforms.mdLegalVanta, Drata, OneTrust, TrustArcAPI key / OAuth2
    CRM & Deal Trackingcrm-deal-tracking.mdCorp DevSalesforce, HubSpot, Pipedrive, DealCloudOAuth2 (complex)
    Data & Researchdata-research.mdCorp DevPitchBook, Crunchbase, CB Insights, Apollo.io, Hunter.ioAPI key
    ITSMitsm.mdIT GovernanceServiceNow, Jira Service Management, FreshserviceOAuth2 (complex)
    Identity & Accessidentity-access.mdIT GovernanceOkta, Microsoft Entra ID, Google Workspace AdminOAuth2 (admin consent)

    Agent-Integration Mapping

    Every team benefits from at least one integration category:

    TeamIntegration CategoriesKey Workflows
    ProductProject Mgmt, CommunicationPRD → auto-create Jira stories; share decisions to Slack
    DesignFigmaDesign review with real component data; brand consistency checks
    ArchitectureGitHubSecurity review against actual code; PR analysis; issue creation
    MarketingAnalytics, SEO, Email, CommunicationCampaign stats, funnel analysis, keyword research, A/B test results
    FinanceAccounting, SaaS MetricsFinancial health review, revenue modeling, cash flow analysis
    LegalContract Mgmt, ComplianceContract review, audit preparation, compliance posture monitoring
    OperationsProject Mgmt, Process & CollaborationSprint health, cross-project dependencies, SOP management
    Corp DevCRM, Data & ResearchM&A pipeline, comparable analysis, partnership tracking
    IT GovernanceITSM, Identity & AccessIncident analysis, access reviews, security policy audit

    Graceful Degradation

    Agents ALWAYS work without integrations. Connections enhance, never gate, agent capability.

    Integration ConnectedAgent Behavior
    YESAgent calls API directly: "I created PROJ-101, PROJ-102, and PROJ-103 in your Jira backlog."
    NOAgent produces text deliverable: "Here are the user stories ready for your project tracker: [table]. Next Steps (Manual): Create these in Jira."
    Expired tokenAgent detects 401, notifies: "Your Jira connection has expired. Reconnect in Settings → Connections." Falls back to text output.

    In-chat amber nudge when an unconnected tool would help: "I can create these Jira tickets directly if you connect Jira in Settings → Connections."

    Security Model

    Settings UX: Connections Page

    Dedicated settings page (Settings → Connections) with marketplace-style grid:

    Rollout Plan

    WaveTimelineIntegrationsPlatforms
    Wave 1Weeks 11-12 (post-launch)Project Mgmt, Communication, CodeJira, Linear, Slack, GitHub
    Wave 2Week 12Design, MarketingFigma, GA4, Mailchimp/SendGrid/HubSpot, Search Console
    Wave 3Weeks 13-14Finance, Legal, IT, Corp Dev, KnowledgeXero/QBO, Stripe, DocuSign/PandaDoc, Vanta/Drata, ServiceNow/JSM, Okta/Entra, Salesforce/HubSpot CRM, PitchBook/Crunchbase, Notion/Confluence, Miro

    Tool integrations are not a launch blocker. The graceful fallback pattern means launch works perfectly with zero connected tools.


    2.11 Expected User Journey

    First 5 Minutes (Time to First Value)

    0:00 - User lands on legionis.ai
    0:30 - User clicks "Get Started Free"
    1:00 - User signs up with Google (one-click via Clerk)
    1:30 - User clicks "Connect Google Drive"
    2:00 - User grants OAuth permissions (pre-scoped to single folder)
    2:30 - User selects/creates workspace folder
    3:00 - Workspace initialized with context structure
    3:30 - User sees main interface (chat panel, file browser, team selector)
    4:00 - User types /prd my first product idea
    5:00 - PRD generated, saved to Drive, visible in file browser

    TIME TO VALUE: ~5 minutes

    Week 1 (Habit Formation)

    DayActivityContext Accumulated
    1Creates first PRD with @pm1 document, 1 interaction
    2Makes a pricing decision with /decision-record1 decision
    3Asks @marketing for positioning help1 marketing deliverable
    4Gets @finance to review budget assumptions1 financial analysis
    5Uses @plt for a strategic discussion1 multi-agent session
    7Uses /context-recall pricing — sees all past decisionsAha moment: context persists across teams

    Month 1 (Value Realization)

    Month 3+ (Switching Cost Established)


    2.11 Input Methods (CLI-Style UX)

    Legionis is designed for power users who appreciate CLI-style interaction — not a dumbed-down GUI that hides the system's capabilities.

    Primary Input: Text Command Bar

    The main input is a text field that accepts:

    SyntaxActionExample
    /skill-nameInvoke skill/prd authentication feature
    @agent-nameSpawn agent@pm review this PRD
    @team-gatewayRoute to team@marketing plan the launch campaign
    @file.mdReference file@pm based on @research.md create a PRD
    Natural languageIntelligent routing"Help me decide on pricing" -> routes to BizOps

    Autocomplete: Typing / shows a searchable skill palette (Cmd+K style). Typing @ shows agents organized by team, with recent agents prioritized.

    Secondary Input: Voice Activation (Phase 1+)

    Voice input for hands-free operation:

    Use Cases:

    Tertiary Input: Team & Agent Selector UI

    Visual panel showing available teams and their agents:

    +----------------------------------------------+
    
    TEAMS
    +----------------------------------------------+
    > Product Org (13) > Design (7)
    > Architecture (7) > Marketing (16)
    > Finance (9) > Legal (8)
    > Operations (8) > Executive (2+)
    > Corp Dev (5) > IT Governance (6)
    +----------------------------------------------+
    PRODUCT ORG
    📝 PM 📈 VP Product
    📣 Dir PMM 📋 Dir PM
    🧮 BizOps 🔭 Competitive Intel
    🎨 UX Lead 💰 Value Realization
    ⚙️ ProdOps 🤝 BizDev
    👥 PLT (Team) 🏛️ Product (Gateway)
    +----------------------------------------------+

    Keyboard Navigation

    ShortcutAction
    Cmd+KOpen skill palette
    Cmd+Shift+AOpen agent/team selector
    Cmd+EnterSubmit message
    Cmd+/Focus input
    EscCancel / close panels
    Cmd+1-9Switch between recent conversations

    Why This Approach

  • Power users expect it: Our target users are comfortable with Claude Code, terminal-based tools, and keyboard shortcuts. They don't want wizard-style GUIs.
  • Efficiency: Typing /prd is faster than clicking through menus. Typing @marketing routes to the right specialist instantly.
  • Discoverability via autocomplete: The skill palette and team selector provide discoverability without hiding capabilities behind nested menus.
  • Flexibility: Users can mix input methods — type a command, click an agent, voice a follow-up.

  • 3. User Stories & Acceptance Criteria

    3.1 Core Features (Launch)

    US-001: Skill Execution

    As a professional using Legionis, I want to invoke any of the 80+ skills via /skill-name syntax in a chat interface, So that I can generate documents, analyses, and deliverables without using a CLI.

    Acceptance Criteria:

    Performance: Skill execution p95 < 5 seconds


    US-002: Agent Personas

    As a professional, I want to interact with any of the 81 agents via @agent-name or /agent-name syntax, So that I can get domain-specific advice from specialists across every business function.

    Acceptance Criteria:

    Performance: Agent response p95 < 10 seconds


    US-003: Context Layer Management

    As a professional, I want to save and recall organizational context (decisions, bets, feedback, learnings), So that my decisions compound over time and I never lose institutional knowledge.

    Acceptance Criteria:


    US-004: Document Intelligence

    As a professional, I want to create, update, and find documents using natural language, So that I can manage my documentation efficiently.

    Acceptance Criteria:


    US-005: File Explorer

    As a professional, I want to browse, organize, and manage my workspace files through a visual file explorer, So that I can navigate my documentation intuitively.

    Acceptance Criteria:


    US-006: Authentication & Workspace

    As a new user, I want to sign up, create a workspace, and start using agents immediately, So that I can evaluate the product with minimal friction.

    Acceptance Criteria:


    US-007: Billing & Subscription

    As a professional evaluating Legionis, I want to upgrade from Free to a paid tier seamlessly, So that I can unlock full model access and team features when I see value.

    Acceptance Criteria:


    US-015: Connect Your AI (Your API Keys)

    As a paid tier user, I want to connect my own LLM API credentials, So that I can use my existing API contracts, control costs directly, and maintain data governance.

    Acceptance Criteria:

    Security Requirements: Tier Availability: Pro (Anthropic only), Team (Anthropic only), Full Org (multi-provider)

    Performance: Key validation < 5 seconds


    US-016: Team-Based Agent Selector

    As a user exploring Legionis's capabilities, I want to browse all 11 teams and their agent members in a visual selector, So that I can discover which agents are available and route my request to the right specialist.

    Acceptance Criteria:

    Performance: Agent selector load < 200ms


    US-017: Token Usage Transparency

    As a user on any tier, I want to see input/output token counts for each interaction, So that I can understand my usage and manage API costs (for paid tiers with BYOT).

    Acceptance Criteria:


    US-018: Conversation Persistence

    As a professional using Legionis daily, I want to save, load, list, rename, and delete conversations, So that I can return to previous work and organize my interactions.

    Acceptance Criteria:


    US-019: Legionis Tokens (Managed Token Plan)

    As a user who doesn't want to manage API keys, I want to use Legionis-provided AI tokens with transparent pricing, So that I can start using Legionis immediately without external account setup.

    Acceptance Criteria:

    Billing: Stripe metered billing via Usage Records API. Daily aggregation of usage_events reported to Stripe.


    US-020: Quality/Efficiency Model Routing

    As a user who wants to control the cost-quality tradeoff, I want to set a global model quality preference, So that I can optimize for either the best output quality or the lowest cost.

    Acceptance Criteria:

    Performance: Quality preference lookup adds < 1ms to request pipeline (single DB column read, cached per session).


    US-021: External Tool Connections

    As a professional using Legionis alongside other work tools, I want to connect my Jira, Slack, GitHub, and other tools so agents can use them, So that agents can perform real operations in my existing systems instead of producing manual action items.

    Acceptance Criteria:

    Security: OAuth tokens encrypted with same envelope encryption as API keys. Minimum-viable scopes per service. All external API calls logged for audit.

    Performance: OAuth flow round-trip < 10 seconds. Tool API calls < 5 seconds p95.


    3.2 Agent Orchestration Features (Launch)

    US-008: Agent Delegation

    As a professional, I want to delegate work to agents using @agent syntax, So that agents can work autonomously (reading files, using skills) and return completed deliverables.

    Acceptance Criteria:

    Performance: Agent delegation p95 < 15 seconds (includes file I/O + LLM calls)


    US-009: Auto-Routing

    As a professional, I want to ask questions without specifying which agent to use, So that the system routes my question to the right domain expert automatically.

    Acceptance Criteria:


    US-010: Interaction Logging

    As a professional, I want to see a history of all agent interactions, skill invocations, and their outcomes, So that I can track what my AI workforce has done and reference past work.

    Acceptance Criteria:


    3.3 Multi-Agent Orchestration Features (Launch)

    US-011: PLT Sessions (Meeting Mode)

    As a VP of Product, I want to invoke @plt should we prioritize webhooks or SDK? and get multi-perspective input from VP Product, Director PM, Director PMM, and BizOps, So that I can make strategic decisions with cross-functional input without scheduling a meeting.

    Acceptance Criteria:

    Performance: PLT session p95 < 60 seconds (for 3-agent parallel session)


    US-012: Team Gateways

    As a professional, I want to invoke @marketing plan the product launch campaign or @finance build the revenue model and have the system route to the right specialists, So that complex cross-functional work is orchestrated automatically across any business function.

    Acceptance Criteria:


    US-013: Sub-Agent Spawning

    As a PM agent working on a PRD, I want to spawn a UX Lead sub-agent for user research insights or a Security Architect for threat modeling, So that I can incorporate cross-domain expertise into my deliverables.

    Acceptance Criteria:


    US-014: Meeting Mode Rendering

    As a user viewing a multi-agent response, I want to see each agent's perspective clearly separated and attributed, So that I can understand individual viewpoints before reading the synthesis.

    Acceptance Criteria:


    4. Non-Functional Requirements

    4.1 Performance SLAs

    OperationTarget (p95)Maximum (p99)DegradedBlocker
    Skill execution<5s<8s>8s>15s
    Inline agent response<10s<15s>15s>30s
    Agent delegation<15s<20s>20s>45s
    PLT session (3 agents)<60s<90s>90s>120s
    File explorer load<1s<2s>2s>5s
    Document preview render<500ms<1s>1s>3s
    Search results<200ms<500ms>500ms>2s
    Auth (login/signup)<3s<5s>5s>10s

    4.2 Security

    RequirementImplementationPhase
    Data isolationWorkspace-scoped storage paths, row-level security in PostgreSQLM0
    Encryption at restR2 default encryption (AES-256), Neon default encryptionM0
    Encryption in transitTLS 1.3 for all connectionsM0
    AuthenticationClerk with JWT validation on every API routeM0
    AuthorizationTier-based access control (model gating, operation caps)M0
    RBACClerk Organizations (Owner/Editor/Viewer)Launch
    SSO/SAMLClerk Enterprise SSOEnterprise tier
    Audit logsAll user actions logged with timestamp, user, action, resourceLaunch
    Penetration testingAnnual third-party pen testPost-launch
    SOC 2 Type IIVanta compliance automationEnterprise tier

    4.3 Scalability

    DimensionLaunchGrowth (1K users)Scale (5K users)
    Concurrent users505002,000
    Operations/day5005,00020,000
    Storage per workspace50MB-500MB500MB-5GB5GB-50GB
    Total storage25GB2.5TB100TB
    API requests/second1050200
    Database connections2050100

    4.4 Accessibility

    RequirementStandardPhase
    Keyboard navigationWCAG 2.1 AALaunch
    Screen reader supportARIA labels on all interactive elementsLaunch
    Color contrast4.5:1 minimum (WCAG AA)Launch
    Focus indicatorsVisible focus rings on all interactive elementsLaunch
    Responsive designFunctional on 768px+ viewport (tablet and desktop)Launch
    Mobile experienceRead-only document viewing on mobilePost-launch

    4.5 Reliability

    MetricTarget
    Uptime (monthly)>99.5% (launch), >99.9% (scale)
    Data durability99.999999999% (11 nines, R2 default)
    Recovery Point Objective (RPO)<1 hour
    Recovery Time Objective (RTO)<4 hours
    Backup frequencyDaily (database), continuous (object storage)


    5. Success Metrics

    Launch Metrics

    MetricTargetRed Flag
    All 80+ skills functional100%<95%
    All 81 agents functional81/81<81
    All 11 gateways functional11/11<11
    Skill execution time (p95)<5s>8s
    Agent delegation time (p95)<15s>20s
    PLT session time (p95)<60s>90s
    Context save/recall reliability>99%<95%
    Document generation success rate>95%<90%
    Agent spawn success rate>95%<90%
    Meeting Mode attribution accuracy100%<100%
    Onboarding completion rate>40%<25%

    Growth Metrics (6 months post-launch)

    MetricTargetRed Flag
    Free-to-Pro conversion>5%<3%
    Monthly churn (Pro tier)<8%>12%
    NPS>40<30
    Free users2,000<1,000
    Pro users ($10/mo)250<100
    Team users ($7/mo)100<30
    Full Org users ($25/mo)25<10
    MRR$5K+<$2K
    Extension team usage (non-product)>40% of sessions<20%

    Cost Metrics (Token Source Model)

    MetricTargetRed Flag
    Free tier COGS per user<$0.50/mo>$1/mo
    Infrastructure cost per paid user<$5/mo>$10/mo
    BYOT: API key setup success rate>95%<85%
    Managed Tokens: gross margin on token revenue>25% (after Stripe fees)<20%
    Managed Tokens: average token spend per user[TBD — monitor post-launch]<$5/mo (too low to sustain)
    BYOT vs Managed adoption split60/40 BYOT-favored<30% BYOT (undermines USP story)
    Quality/Efficiency toggle adoption>50% users change from Balanced<10% (feature unused)


    6. Risks & Mitigations

    6.1 Overwhelming UX (80+ Skills, 81 Agents Day 1)

    Risk: Users face 80+ skills and 81 agents on Day 1, feel overwhelmed, and churn before discovering value.

    Probability: High | Impact: High

    Mitigations:

  • Team-based organization: Agents organized into 11 teams — users browse teams, not a flat list of 81 agents
  • Guided onboarding: First-run wizard recommends a starting team based on user's role
  • Skill categories: Group skills by V2V phase with visual hierarchy (most-used prominent)
  • Smart suggestions: After first skill use, suggest next logical skill ("You wrote a PRD — want to add user stories?")
  • Searchable skill palette: Cmd+K palette with fuzzy search, descriptions, and examples
  • Progressive disclosure: Show "Starter Skills" by default, "All Skills" behind a toggle
  • Gateway-first approach: Encourage users to use @marketing or @finance — let the gateway route to the right agent
  • 6.2 Token Source Adoption Risk

    Risk: Users resist providing their own API keys, expecting the platform to handle LLM costs.

    Probability: Medium | Impact: Medium (mitigated by Legionis Tokens)

    Mitigations:

  • Legionis Tokens available from launch: Users who don't want to manage API keys can opt into Managed Tokens at 30% service fee — eliminates the friction entirely
  • Clear value proposition for BYOT: Emphasize benefits — existing contracts, volume discounts, zero markup, full cost control
  • Easy onboarding: Two-card choice during onboarding: "Bring Your Own Keys" (recommended) vs "Use Legionis Tokens" (simpler)
  • Free tier exists: Users can try with platform-provided Haiku before committing
  • Transparent comparison: Show side-by-side cost for BYOT vs Managed (e.g., "Claude Sonnet: $3/$15 per MTok with BYOT vs $3.90/$19.50 with Legionis Tokens")
  • Switchable: Users can switch between BYOT and Managed at any time in Settings → AI Configuration
  • Quality/Efficiency toggle: Available for both token sources — gives users direct control over spend regardless of token source
  • 6.3 Agent Orchestrator Complexity

    Risk: Building the orchestrator (especially parallel spawning + Meeting Mode) takes longer than planned and delays launch.

    Probability: High | Impact: High

    Mitigations:

  • Proven architecture: Orchestrator design validated in CLI plugin — port, don't reinvent
  • Sequential fallback: If parallel spawning has issues, run agents sequentially (slower but functional)
  • Max 4 parallel agents: Hard limit prevents API rate limit issues
  • Depth limit: Sub-agent spawning limited to depth 2 to prevent runaway complexity
  • Timeboxed debugging: If orchestrator issues persist after 2 weeks, launch with sequential-only and iterate
  • 6.4 LLM Rate Limits

    Risk: LLM API rate limits prevent concurrent agent spawning, especially for PLT sessions with 3-4 parallel agents.

    Probability: Medium | Impact: High

    Mitigations:

  • Request queuing: Queue agent spawns with backoff if rate limited
  • Staggered spawning: Stagger parallel agent starts by 500ms to avoid burst
  • API tier upgrade: Upgrade API tier at scale (negotiate with provider sales)
  • Model fallback: If Opus rate limited, fall back to Sonnet for that agent
  • Per-user concurrency limit: Max 1 PLT session at a time per user
  • 6.5 Competition from AI Platforms

    Risk: Anthropic, OpenAI, or others build similar multi-agent workforce features directly into their platforms.

    Probability: Low-Medium | Impact: High

    Mitigations:

  • Methodology is the moat: We're not wrapping an LLM — we're embedding a workforce methodology. The 81 specialized agents, team structures, and domain-specific knowledge packs are our IP
  • Context accumulation: Organizational memory compounds over months. Generic AI platforms don't persist context across sessions
  • Multi-agent orchestration: 11 team gateways with Meeting Mode is architectural complexity generic platforms are unlikely to build
  • ROI tracking: Built-in time-savings tracking creates self-justifying value — unique to our product
  • Speed to market: First-mover advantage in the AI workforce platform space
  • 6.6 Free Tier Abuse

    Risk: Users create multiple free accounts to avoid paying, or bots abuse free tier operations.

    Probability: Medium | Impact: Medium

    Mitigations:

  • Rate limiting: Max 50 operations/day on Free tier (prevents burst abuse)
  • Email verification: Require email verification before first skill invocation
  • Device fingerprinting: Detect multiple accounts from same device/IP
  • Captcha on signup: reCAPTCHA v3 for automated bot prevention
  • 7-day context retention: Free tier context expires after 7 days, discouraging long-term free usage

  • 7. Open Questions & Dependencies

    Open Questions

    #QuestionOwnerNeeded ByImpact if Unresolved
    OQ-001~~Should we build the POC in-house or partner with a dev shop?~~ RESOLVED: Building in-house (Yohay + Claude Code + Cursor)VP ProductPre-launchResolved
    OQ-002What is the beta strategy — closed or open beta?Dir PMMPre-launchAffects user acquisition plan
    OQ-003~~How do we handle CLI plugin updates — does the SaaS automatically get plugin updates?~~ RESOLVED: Git submodules (product-org-os + extension-teams) with compile stepDir PMPre-launchResolved
    OQ-004What happens when a user exceeds fair use on paid tiers?BizOpsPost-launchRevenue vs. UX tradeoff
    OQ-005Should we support offline/local mode for Enterprise customers?VP ProductEnterprise tierEnterprise deal blocker
    OQ-006~~How do we handle prompt injection attacks in user-provided context files?~~ RESOLVED: See Section 2.4.3Security ArchitectPre-launchResolved
    OQ-007~~What is the Team tier pricing and when does it ship?~~ RESOLVED: $7/user/mo at launchBizOpsPre-launchResolved
    OQ-008Which extension team modules are included in base Pro vs. require add-on?BizOpsPre-launchAffects perceived value
    OQ-009~~Should we offer platform-provided tokens as an alternative to BYOT?~~ RESOLVED: Yes — Legionis Tokens at 30% markup as opt-in convenience option. BYOT remains default.PMPre-launchResolved
    OQ-010~~How should users control model quality vs cost?~~ RESOLVED: 3-tier global toggle (Quality/Balanced/Efficiency). Per-agent override in Week 15.PMWeek 5Resolved
    OQ-011~~How do tool integrations work in the SaaS product (MCP vs OAuth vs hybrid)?~~ RESOLVED: Hybrid OAuth — standard OAuth flows, direct API calls, OS templates inform operations. See Section 2.10.PMPost-launchResolved
    OQ-012Metered billing vs pre-paid credits for Legionis Tokens?BizOpsWeek 5Affects UX and cash flow. Recommendation: metered billing for MVP (Stripe native), pre-paid credits post-launch.
    OQ-013Which integrations should be available at launch vs post-launch?Dir PMPre-launchCurrent plan: all post-launch (Weeks 11-14). Graceful fallback works without any.

    External Dependencies

    DependencyProviderRisk LevelMitigation
    Claude API availabilityAnthropicMediumRetry logic, graceful degradation, status page monitoring
    Claude API pricing changesAnthropicMediumModel routing flexibility, multi-model support ready via AI SDK
    Clerk service availabilityClerkLowSession caching, JWT validation works offline for 24h
    Stripe webhook reliabilityStripeLowIdempotent webhook handlers, manual reconciliation fallback
    R2 storage availabilityCloudflareLowMulti-region replication, local cache for hot files
    Typesense Cloud availabilityTypesenseLowPostgreSQL full-text search as fallback
    Vercel function limitsVercelLowMonitor function duration limits (60s on Pro); upgrade to Enterprise if PLT sessions hit ceiling

    Internal Dependencies

    DependencyOwnerNeeded ByStatus
    Product Org OS plugin v3 stable releasePlugin teamM0Complete
    Skill template finalization (80+ skills)Dir PMM0Complete
    Agent persona files (81 agents)Dir PMM0Complete
    Rule files finalizedDir PMM0Complete
    Extension Teams (68 agents, 9 teams)Dir PMM0Complete
    Compiled persona JSONBuild scriptM0Complete (compile-prompts.ts)
    Brand guidelines and design systemDesignM0Complete (stone + amber palette)
    GTM launch planDir PMMPre-launchIn progress


    8. Launch Feature Summary

    Full Capability from Day 1

    All features available at launch — no phased rollout:

    Core Platform:

    Agent Orchestration: Business Infrastructure: External Tool Integrations (post-launch, Weeks 11-14): Performance Targets:

    9. Launch Readiness Checklist

    Architecture Readiness (Pre-Development)

    MUST be true before development begins:

  • ✓ API key encryption implemented (Section 2.4.1)
  • ✓ RLS policies enforced on all workspace-scoped tables (Section 2.4.2)
  • ✓ Prompt injection mitigation strategy implemented (Section 2.4.3)
  • ✓ Connection pool configuration completed (Section 2.4.4)
  • ✓ SSE event type contract specified (Section 2.4.6)
  • Gate Owner: Chief Architect

    Launch Readiness

    MUST be true to launch:

    Gate Owner: Director of Product Management


    10. Appendix

    A. Technology Stack Summary

    LayerTechnologyVersion
    Frontend FrameworkNext.js (React 18+)16
    LanguageTypeScript5.x (strict)
    AI SDKVercel AI SDKv6
    StylingTailwind CSS4.x
    ComponentsRadix UI (headless)Latest
    State (client)Zustand5.x
    State (server)TanStack Query5.x
    Markdownreact-markdown + rehype/remarkLatest
    EditorTiptap (ProseMirror)2.x
    StreamingVercel AI SDK (SSE under the hood)Native
    RuntimeNode.js22 LTS
    API LayerNext.js API Routes(integrated)
    API SpecOpenAPI3.1
    DatabasePostgreSQL (Neon)17
    ORMDrizzleLatest
    Object StorageCloudflare R2S3-compat
    SearchTypesense CloudLatest
    AuthClerkLatest
    PaymentsStripe BillingLatest
    LLMAnthropic / OpenAI / Google (via AI SDK)Multi-provider
    HostingVercelPro
    Error TrackingSentryLatest
    AnalyticsPostHogLatest
    Logs/UptimeBetter StackLatest

    B. Glossary

    TermDefinition
    V2VVision to Value — the 6-phase operating system for product organizations
    SkillA templated AI capability (e.g., /prd, /decision-record)
    AgentAn AI persona with domain expertise (e.g., PM, CFO, CMO)
    TeamA group of related agents organized by business function (e.g., Marketing Team, Finance Team)
    GatewayA multi-agent routing protocol (@product, @plt, @marketing, @finance, etc.)
    Meeting ModePresentation format showing individual agent voices before synthesis
    Context LayerPersistent organizational memory (decisions, bets, feedback, learnings)
    OperationA single skill invocation, agent spawn, or gateway session
    BYOTBring Your Own Tokens — users connect their own LLM API keys
    COGSCost of Goods Sold — primarily LLM API costs (zero for paid tiers with BYOT)
    Prompt AssemblerServer-side component that compiles LLM prompts from skill templates, rules, and context
    Agent OrchestratorServer-side component that manages agent spawning, tool execution, and response synthesis
    Extension TeamSpecialist agent teams beyond the core Product Org (Design, Marketing, Finance, etc.)


    Document Status: Active Next Review: Pre-launch Gate Escalation: If any gate fails twice, escalate to VP Product for strategic review


    11. Change Log

    VersionDateAuthorChanges
    1.02026-01-28Dir PMInitial PRD release
    1.12026-01-29Dir PMAdded Section 2.4 (P0 Architecture Requirements) based on Architecture Team review. Added Pre-M0 Gate. Resolved OQ-006. Renumbered sections 2.5->2.6, 2.6->2.7.
    1.22026-01-29Dir PMRefactored Section 2.4 to requirements-only format (implementation details moved to architecture-spec-m0.md). Added US-015 (Bring Your Own Tokens) for Phase 1.
    2.02026-01-30Dir PMMajor strategic update: (1) Reframed target user as power users, not non-CLI users. (2) Added cloud storage integration as core feature (Section 2.8). (3) Added user journey (Section 2.9). (4) Added input methods / CLI-style UX (Section 2.10). (5) Updated infrastructure costs with verified pricing. (6) Updated COGS estimate. (7) Added assumptions A-006, A-007.
    2.12026-01-30Dir PMSimplified structure: (1) Removed milestone references — full capability at launch. (2) Changed to Your API Keys model. (3) Collapsed phased delivery into single launch. (4) Updated cost model to reflect Your API Keys.
    3.02026-02-17Dir PMPositioning & architecture update: (1) Reframed from "Product Org OS web platform" to general-purpose AI workforce platform. (2) Expanded agent roster from 13 to 81 agents across 11 teams with 9 team gateways. (3) Updated pricing to team-based model: Pro $10/user, Team $7/user, Add-on +$5/user, Full Org $25/user. (4) Eliminated separate Hono backend — all API logic runs as Next.js API routes on Vercel. (5) Updated Next.js 14 -> 16, added Vercel AI SDK v6 throughout. (6) Removed Railway from infrastructure (~$50-200/mo savings). (7) Added 4 new target personas (Startup Founder, Marketing Lead, Finance Director, Operations Manager). (8) Added Section 2.5 (Agent Roster) with full 81-agent breakdown by team. (9) Added Section 2.6 (Design System & Brand) with stone/amber palette. (10) Added US-016 (Team Selector), US-017 (Token Transparency), US-018 (Conversation Persistence). (11) Updated all success metrics, launch checklist, and feature summary to reflect 81 agents / 11 gateways / 80+ skills. (12) Resolved OQ-001, OQ-003, OQ-007.