CLI to generate structured architecture policies for AI coding agents. Scope: Svelte 5 (frontend only). No scaffolding.
- Runtime: Bun + TypeScript
- UI: React Ink (CLI)
- Routing: Commander
- Validation: Valibot
- Policy First:
policy.mdis the official interface for AI agents. - Pure Core: Logic (Composer, Renderer) must remain pure; no I/O outside
Writer. - Declarative: Constraints are defined in patterns and merged by the composer.
UI (Ink) → State (Wizard) → Core (Composer) → Markdown (Renderer) → File (Writer)
TemplateRegistry: Managed repository for base patterns (FSD, Flat, Atomic, etc.)PolicyComposer: Core logic merging base + fragments →PolicyObject.MarkdownRenderer: TransformsPolicyObjectinto structured, agent-readable MD.TokenEstimator: Simple heuristic to calculate token cost.
src/
├── bin.ts # CLI Entry point
├── commands/ # Command actions (init, generate, validate, etc.)
├── core/ # Pure logic: registry, composer, renderer, token
├── schema/ # Valibot schemas (source of truth for policy structure)
└── ui/ # Wizard screens and Ink componentsui → hooks → state → services → types
- Circular imports: FORBIDDEN
- Cross-feature: via public-api (index.ts) only