TMRW Venture Factory

TOMORROW INC

Launch 1000 Ships โ€” Idea โ†’ Product โ†’ Company in hours

๐Ÿ“‚ Structure
๐Ÿ›  Stack
๐Ÿง  Context Files
1. Ideate
1.Edward defines venture concept
2.Agents research market + competitors
3.Generate SYSTEM_PROMPT.md
4.Define API contracts + data schemas
2. Scaffold
1.tmrw create <type> <name>
2.Terraform provisions ECS + RDS + ALB
3.GitHub repo + CI/CD auto-configured
4.Stripe + SES + RDS wired up
3. Build
1.AI agents build using context docs
2.Animesh reviews infra + deploys
3.Ronnie drives GTM + design system
4.Zach wires operational tooling
4. Launch
1.make deploy-prod
2.ECS service auto-scales
3.Lead capture + email flows live
4.Monitor via CloudWatch + /health
โŒจ TMRW CLI Commands
tmrw create microapp myappScaffold a microapp
tmrw create marketplace mympScaffold a marketplace
tmrw create saas mysaasScaffold a SaaS product
tmrw create service mysvcScaffold a service company
tmrw create api myapiScaffold an API service
tmrw create mobile myappScaffold a mobile app
tmrw create pipeline mypipeScaffold a data/ML pipeline
tmrw create fullstack myprojScaffold full-stack web app
make devStart local dev environment
make deploy-stagingDeploy to staging ECS
make deploy-prodDeploy to production ECS
make infra-upProvision AWS via Terraform
make ecs-statusCheck ECS service health
make logsTail CloudWatch logs
make scale <count>Scale ECS desired count
make rollbackRollback to previous task def

๐Ÿง  Context Engineering for "Launch 1000 Ships"

Every venture TMRW launches gets context documents that serve as the knowledge layer for both the team and AI agents. When an agent builds a feature, it loads the venture's SYSTEM_PROMPT.md + relevant architecture docs. When Animesh deploys infrastructure, the RUNBOOK.md provides exact procedures. This is how you make agentic operations reliable at scale.

# Venture: [Name]
# Type: microapp | marketplace | saas | service | api | fullstack | mobile | pipeline
# Owner: Edward Unthank / Tomorrow Inc

## Domain
What this venture does, who it serves, core value proposition.

## TMRW Stack Conventions
- Framework: Next.js 14+ (App Router) | FastAPI | Go | React Native
- Styling: TailwindCSS
- Validation: Zod schemas for all inputs
- ORM: Prisma โ†’ PostgreSQL (AWS RDS)
- Email: AWS SES (PENDING โ†’ SENT โ†’ FAILED)
- Payments: Stripe (subscriptions, checkout, portal)

## Infrastructure (ECS)
- Compute: ECS Fargate (auto-scaling)
- Load Balancer: ALB with health checks
- Registry: ECR for Docker images
- Database: RDS PostgreSQL (per-venture schema)
- DNS: Route53 โ†’ ALB โ†’ ECS
- SSL: ACM certificates (auto-renewed)

## Code Conventions
- TypeScript strict mode
- Zod schema validates before DB write
- API responses: { success, data, error }
- Health endpoint required: /health and /api/health
- Docker multi-stage builds for small images

## What NOT to Do
- Never hardcode secrets (use AWS Secrets Manager + .env)
- Never skip Zod validation on API routes
- Never deploy without staging test first
- Never modify shared Terraform without Animesh review
- Never set ECS desired count to 0 in prod
# Architecture: [Venture Name]

## Shared Infrastructure (managed by Animesh)
- AWS Account: coaip | Region: us-east-1
- ECS Cluster: tmrw-ventures (Fargate)
- ALB: tmrw-alb (shared, path/host-based routing)
- ECR: per-venture repositories
- RDS PostgreSQL (shared cluster, per-venture schema)
- SES email (verified domain)
- Route53 DNS (*.tmrwgroup.ai)
- Secrets Manager (per-venture secrets)

## ECS Service Architecture
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Route53: venture.tmrwgroup.ai           โ”‚
โ”‚              โ†“                           โ”‚
โ”‚  ALB (shared) โ†’ Target Group             โ”‚
โ”‚              โ†“                           โ”‚
โ”‚  ECS Service (Fargate)                   โ”‚
โ”‚  โ”œโ”€โ”€ Task Definition                     โ”‚
โ”‚  โ”‚   โ”œโ”€โ”€ App Container (Next.js/API)     โ”‚
โ”‚  โ”‚   โ””โ”€โ”€ Sidecar (log router, optional)  โ”‚
โ”‚  โ”œโ”€โ”€ Desired Count: 2 (prod) / 1 (stg)  โ”‚
โ”‚  โ”œโ”€โ”€ Auto-scaling: CPU/Memory targets    โ”‚
โ”‚  โ””โ”€โ”€ Health Check: /health               โ”‚
โ”‚              โ†“                           โ”‚
โ”‚  RDS PostgreSQL (venture_db schema)      โ”‚
โ”‚  Secrets Manager (API keys, DB creds)    โ”‚
โ”‚  SES (transactional email)               โ”‚
โ”‚  Stripe (payments)                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

## Deployment
GitHub push โ†’ Actions CI โ†’ Docker build โ†’ ECR push
โ†’ ECS task definition update โ†’ rolling deployment
โ†’ ALB health check passes โ†’ traffic shifts โ†’ live

## Scaling
- Min: 1 task (staging), 2 tasks (production)
- Max: 10 tasks
- Target: 70% CPU, 80% memory
- Scale-in cooldown: 300s
# Agent Task โ†’ Context Loaded

"Build the landing page for VentureX"
โ†’ SYSTEM_PROMPT.md + DESIGN_SYSTEM.md + /pages examples

"Set up Stripe billing for VentureX"
โ†’ SYSTEM_PROMPT.md + API_CONTRACTS.md + Stripe docs

"Deploy VentureX to production"
โ†’ SYSTEM_PROMPT.md + ARCHITECTURE.md + RUNBOOK.md

"Scale VentureX ECS service"
โ†’ ARCHITECTURE.md + RUNBOOK.md + Terraform modules

"Add a new ML model to the pipeline"
โ†’ SYSTEM_PROMPT.md + DATA_DICTIONARY.md + EXPERIMENT_LOG.md

"Build a React Native screen"
โ†’ SYSTEM_PROMPT.md + DESIGN_SYSTEM.md + navigation config

"Create a new API endpoint"
โ†’ SYSTEM_PROMPT.md + API_CONTRACTS.md + existing routes

"Debug a failing ECS deployment"
โ†’ ARCHITECTURE.md + RUNBOOK.md + CloudWatch logs

# The Pattern:
# 1. Always load SYSTEM_PROMPT.md (venture-specific)
# 2. Add task-relevant architecture/contract docs
# 3. Add relevant source files as examples
# 4. Agent works with full context โ†’ reliable output
# Living Website: Context-Driven Auto-Updates

## Trigger Events
- New team member โ†’ agents update /team page
- New venture launched โ†’ agents update homepage + /ventures
- New content published โ†’ agents update blog/news
- Founding customer signed โ†’ agents update social proof

## How It Works
1. Event fires (webhook, DB trigger, Slack message)
2. Agent loads: SYSTEM_PROMPT.md + DESIGN_SYSTEM.md + current page
3. Agent generates updated component/content
4. PR created automatically โ†’ CI runs
5. Staging preview โ†’ auto-merge if tests pass
6. ECS rolling deploy โ†’ production updates

## ECS Advantage
- Zero-downtime deploys via rolling update
- Health check gates traffic to new version
- Instant rollback if deploy fails
โ˜ TMRW Infrastructure (ECS)
Cloud ProviderAWS (coaip)
Regionus-east-1
ComputeECS Fargate
Load BalancerALB (shared)
Container RegistryECR
DatabaseRDS PostgreSQL
DNSRoute53
EmailAWS SES
SecretsSecrets Manager
SSLACM (auto-renew)
MonitoringCloudWatch
Productiontmrwgroup.ai
Stagingstaging.tmrwgroup.ai
๐Ÿ— ECS Terraform Module
# tmrw create microapp "ventureX"
# provisions all of this via Terraform:

module "ventureX" {
  source = "./modules/ecs-venture"

  name        = "ventureX"
  domain      = "venturex.tmrwgroup.ai"
  environment = "production"

  # ECS
  cluster_arn   = aws_ecs_cluster.tmrw.arn
  cpu           = 256       # 0.25 vCPU
  memory        = 512       # 512 MB
  desired_count = 2
  max_count     = 10

  # Auto-scaling
  cpu_target    = 70
  memory_target = 80

  # ALB
  alb_arn          = aws_lb.tmrw.arn
  listener_arn     = aws_lb_listener.https.arn
  health_check_path = "/health"

  # Database
  db_schema     = "venturex_db"
  rds_cluster   = aws_rds_cluster.tmrw.id

  # Services
  ses_domain    = "tmrwgroup.ai"
  route53_zone  = aws_route53_zone.tmrw.id
  acm_cert_arn  = aws_acm_certificate.wild.arn

  # Payments
  stripe_enabled = true
}

# Output:
# โ†’ ECS service running (Fargate)
# โ†’ ALB target group + routing rule
# โ†’ ECR repository created
# โ†’ Database schema provisioned
# โ†’ DNS records pointing (A + AAAA)
# โ†’ SSL via ACM
# โ†’ CI/CD pipeline configured
# โ†’ Auto-scaling policies active
# โ†’ CloudWatch alarms set
# โ†’ Secrets Manager entries created
๐Ÿ› ECS Architecture
Edge / DNS
Route53 (*.tmrwgroup.ai) ACM SSL Certificates
โ†“
Load Balancing
ALB (shared) Host-based routing Target groups per venture Health checks
โ†“
Compute โ€” ECS Fargate Cluster
Service: tmrwgroup-site (2 tasks) Service: ventureX (2 tasks) Service: ventureY (1 task) Auto-scaling policies Rolling deployments ECR image registry
โ†“
Data + Services
RDS PostgreSQL (shared cluster) Per-venture schemas AWS SES (email) Stripe (payments) Secrets Manager CloudWatch (logs + metrics)
๐Ÿ“Š Deployment Pipeline (ECS)
๐Ÿ“
Git Push
โ†’
โœ…
CI Tests
โ†’
๐Ÿณ
Docker Build
โ†’
๐Ÿ“ฆ
ECR Push
โ†’
๐Ÿ”„
ECS Deploy
โ†’
๐ŸŒ
Live