@sewdn/scaffold
v0.1.5
Published
Opinionated scaffolding CLI to enable AI-agents to manage TypeScript monorepos deterministically, with guided architecture. Leading by example.
Maintainers
Readme
Scaffold CLI
Stop prompting. Start scaffolding.
Scaffold is an opinionated CLI for creating TypeScript monorepos and growing them in a deterministic way. It is designed for teams and AI-assisted workflows that want structure, consistency, and architectural rails from day one.
Lead by example. Instead of starting from a blank repository and filling it with one-off instructions, this tool creates a structure, adds guidance inside that structure, and expands it through code commands plus templated code. That gives teams and coding agents a natural starting point for what belongs where, how features should grow, and how business logic should be implemented from a generic foundation.
Architecture is the new prompt.
In the age of agentic coding, the best way to control AI is not more instructions. It is better examples. Scaffold gives you a consistent monorepo project structure, explicit dependency flow, Effect-first TypeScript patterns, modular service isolation, and lots of other best practices in software engineering so agents follow the architecture instead of inventing one. As the workspace grows, its agent guidance can grow with it through dedicated skill files and synchronized instructions for the technologies that have been scaffolded in.
Scaffold also acts as an orchestrator. It does not try to replace the underlying ecosystem. Instead, it coordinates starter generators, framework CLIs, package installation commands, UI generation commands, and templated code so tools like create-starter apps, shadcn commands, bun add, and bun install work together inside one consistent architecture.
Why use Scaffold
- Deterministic output: the same command produces the same structure every time
- Orderly growth: projects expand through clear commands instead of ad hoc file creation
- Better AI guidance: the codebase becomes the instruction set
- Better reuse and modularity: agents are guided toward repeatable patterns, clearer boundaries, and reusable building blocks
- Clear boundaries: apps, services, UI packages, and modules live in predictable places
- Consistent stack choices: modern TypeScript monorepo patterns with strong architectural defaults
- More maintainable growth: complexity is kept from exploding and scales more linearly as the project grows
This is not another create-* starter. It is a control layer for agentic coding and architectural gravity for AI.
Underlying technologies
Scaffold builds on proven tools instead of replacing them. It gives them one consistent architectural shape.
- Turborepo: workspace orchestration, task pipelines, and a predictable monorepo layout
- Bun: package management and fast local workflows for generated workspaces
- TypeScript: shared types and strong boundaries across apps and packages
- Effect: a consistent model for services, errors, configuration, and async flows across the whole codebase, making reusable business logic and core services easier to share between frontend and backend while staying modular and maintainable
- ts-morph: structured TypeScript code generation and source updates, using abstract syntax trees under the hood when generated code should be inserted, registered, or transformed with syntax awareness instead of raw string replacement
- React, Tailwind CSS, shadcn/ui: the frontend UI foundation for shared presentational components, reusable UI patterns, and central project theming across multiple applications
- Vite, Next.js, TanStack, Elysia, Hono, Fastify: application and runtime building blocks that Scaffold assembles into one consistent project structure
- Dora: indexed code intelligence for exploring generated workspaces and the shared Effect reference by symbols and dependencies, not only text search
- Entire: optional Git-native agent workflow integration that captures AI sessions as searchable checkpoints linked to commits, so code ships with its context and reasoning
- Oxc: fast linting and formatting for tight local feedback loops, so both developers and AI agents can validate structure and style quickly while iterating
- bun test: fast test execution for closed feedback loops on behavior, with generated workspaces starting from scaffolded test structure that agents can extend instead of inventing from scratch
Scaffold also fits well with event modeling / EventModeler-style workflows. It does not replace domain modeling, but it gives you a deterministic way to turn a modeled structure into code, services, modules, and application boundaries that are easier for both humans and AI to extend consistently.
Because tests are scaffolded in from the start, Scaffold also gives AI agents a natural place to continue: after generating features, they can elaborate on the existing test structure, tighten assertions, and keep implementation and verification evolving together.
Supported app types
Scaffold starts with a focused set of app types that cover common product, platform, and developer-tooling use cases:
frontend-nextjs: React + Next.js applications for multi-page apps, app-router setups, and full-stack web experiencesfrontend-vite: React + Vite applications for fast SPAs and lightweight frontend surfacesfrontend-tanstack: TanStack-based applications for teams that want a strongly structured React routing / data stackcli: Effect-based command-line tools for internal tooling, automation, and operational workflowsapi-elysia: Elysia-based backend APIs with a type-safe, lightweight server runtimeapi-hono: Hono-based APIs for teams that prefer a minimal web framework with portable runtime optionsapi-fastify: Fastify-based APIs for high-performance Node server applicationsmcp-server: Model Context Protocol servers for exposing tools, prompts, and resources to AI systemsslide-deck: presentation projects for technical decks and demosdocumentation: documentation sites for product, technical, or internal docs
The point is not just to generate these stacks independently, but to shape them into one consistent workspace with shared boundaries, services, UI patterns, and testing conventions.
More integrations coming
Scaffold is designed to expand over time. The current roadmap already points toward more app and integration types, including areas such as:
- workers, cron jobs, and background processing
- GraphQL, tRPC, and websocket-oriented backends
- backend frameworks and orchestration stacks currently being explored, including Temporal, Mastra, Convex, Motia, and Booster Framework
- mobile and desktop applications
- vertical presets for domains like SaaS, ecommerce, CMS, and internal tools
- additional service packages for search, cache, analytics, notifications, storage, payments, and more
Use the same framework for your own stack
Scaffold is not only a tool for consuming predefined stacks. It is architected to be modular, servicing as a framework to support multiple opinionated stacks.
At its core, Scaffold uses a repeatable pattern:
- command-driven expansion
- deterministic stub-based and AST-based generation and expansion
- registry-oriented growth instead of scattered file edits
- consistent package and app boundaries
Because app types, services, packages, and technologies follow the same extension model, new building blocks can be added without changing the overall workflow. That makes it practical for teams to define their own opinionated stack on top of Scaffold: your preferred frontend, backend, service patterns, UI conventions, and architectural boundaries can all be encoded into the same command-driven framework.
Scaffold also grows its agent guidance alongside the code it generates. Packages, app types, services, and technologies can have dedicated skill files, and those skills are added organically as the stack evolves. When you add apps, services, and UI components through Scaffold, the agent instructions inside the workspace grow with that technology surface and stay in sync with the generated structure.
Instead of explaining the same setup over and over, you encode it once into commands, templates, and generated structure so future work starts from a guided foundation that stays consistent as the system grows.
Install
npm install -g @sewdn/scaffold
# or
bun add -g @sewdn/scaffoldThis registers the scaffold command globally.
Scaffold is enforced to run with Bun at runtime. Installing via npm is supported as a distribution channel, but the published scaffold binary will check for bun on your PATH and fail fast with an install hint if Bun is missing.
Alpha licensing
During the alpha phase, creating a new project requires a valid offline license token.
Install the token once:
scaffold license install '<token>'
scaffold license statusThe token is stored locally on your machine and checked before scaffold project and scaffold init.
How to use it
Scaffold works in two phases:
- Create the base workspace.
- Expand it with apps, services, modules, UI packages, and components.
Start a new workspace
scaffold project my-workspaceOr create the base monorepo first and add things later:
scaffold init my-workspace
cd my-workspaceAdd applications
scaffold app web --type frontend-vite
scaffold app admin --type frontend-nextjs
scaffold app api --type api-elysiaAdd packages and modules
scaffold service auth
scaffold ui dashboard
scaffold component Button --package ui-lib
scaffold module billing
scaffold package exports --type serviceCommon workflows
Create a new monorepo with web and API apps in one command:
scaffold project my-workspace --apps frontend-vite,api-elysia --app-names web,apiInitialize first, then grow step by step:
scaffold init my-workspace
cd my-workspace
scaffold app web --type frontend-vite
scaffold service auth
scaffold module billingCommand reference
Core commands:
scaffold project <name>scaffold init <name>scaffold app <name> --type <type>scaffold service <name>scaffold ui <name>scaffold component <name> --package <pkg>scaffold module <name>scaffold package <name> --type <ui|service>scaffold license install <token>scaffold license status
Use the built-in help for details and flags:
scaffold --help
scaffold project --help
scaffold app --help
scaffold service --help
scaffold license --help