How samhatoum/auto-engineer works
Project type and purpose
• This is a monorepo toolchain (“Auto Engineer”) for automating the full SDLC via a CLI and modular plugins.
• Purpose: model application behavior as “flows,” export schemas, scaffold server/client code, implement via AI agents, and validate with checks.
File structure
• Top-level:
• package.json, pnpm-workspace.yaml, turbo.json → pnpm+Turborepo monorepo
• packages/ → core modules (CLI, flow DSL, code generators, implementers, checks, utilities)
• examples/ → ready-made example apps (e.g. shopping-app)
• integrations/ → sample integrations (AI, cart API, product API)
• .github/, docs/, scripts/ → CI/CD, documentation, helper scripts
• Patterns:
• Plugin-based CLI (packages/cli)
• Command/Event bus (packages/message-bus)
• File abstraction & sync (packages/file-store, packages/file-syncer)
• Code generators & implementers (flow, server-generator-apollo-emmett, frontend-generator-react-graphql, server-implementer, frontend-implementer)
• Validation suites (server-checks, frontend-checks)
• AI gateway (packages/ai-gateway) for unified provider API
README for additional insights
• Describes a pipeline: Flow Modeling → IA Generation → Scaffolding → AI-Coding/Test Loop → Quality Checks
• Architecture section calls out: Plugin-based, Command pattern, Event-driven, Type-safe
Main components & their interactions
a. Components
• CLI & Plugin Loader (packages/cli)
• Flow DSL (packages/flow)
• Code Generators:
– Server generator (packages/server-generator-apollo-emmett)
– Frontend generator (packages/frontend-generator-react-graphql)
• Implementers:
– Server implementer (packages/server-implementer)
– Frontend implementer (packages/frontend-implementer)
• Information Architect (packages/information-architect)
• Design System Importer (packages/design-system-importer)
• Message Bus (packages/message-bus)
• AI Gateway (packages/ai-gateway) & External AI Providers
• File Store (packages/file-store) & File Syncer (packages/file-syncer)
• Validation Suites (packages/server-checks, packages/frontend-checks)
• Example / Workspace (examples/shopping-app, flows/)
b. Relationships and data flow
1. User invokes “auto” CLI → Plugin Loader resolves command → dispatch to correct plugin
2. Plugin defines a command handler via Message Bus → CLI emits command → Message Bus routes to handler
3. Handler may:
– Read/write files via File Store → persisted to disk
– Sync changes via File Syncer (watch & hot-reload)
– Call AI agents through AI Gateway → external AI provider (Anthropic, OpenAI, etc.)
– Generate or populate code scaffolds (GraphQL schema, resolvers, React components)
4. After code is generated/implemented:
– Validation plugins run type checks, test suites, linting
5. Built-in Message Bus Dashboard (port 5555) visualizes commands/events via WebSocket
c. Architectural patterns & principles
• Plugin-Based Architecture: loose coupling of features behind CLI
• Command Pattern: every action is a named command with typed parameters
• Event-Driven: Message Bus routes commands and events between modules
• Type-Safe: Full TypeScript and strict typing across packages
• Modular Monorepo: pnpm workspaces + Turborepo for efficient builds
d. Key technologies
• TypeScript, Node.js, pnpm, Turborepo
• Vitest for testing, ESLint/Prettier for linting/formatting
• GraphQL (Apollo) for server scaffold
• React & Vite for client scaffold
• WebSocket for real-time dashboard