Skip to content
/

Compose-Lang

compose-lang · darula-hpp/compose-lang · ★ 3 · last commit 2026-01-01

Turns minimal architecture specs into production code via a compiler pipeline that calls an LLM backend.

Best whenArchitecture specifications should be the code generator itself, not documentation that drifts from the codebase.
Skip ifQuick one-off scripts, Mission-critical systems
vs seeds
openspecproduces delta documents consumed by a human-…
Primitive shape 7 total
Commands 7
00

Summary

Compose-Lang — Summary

Compose-Lang is an LLM-assisted compiler that turns minimal architecture specification files (.compose) into production code. It introduces a three-keyword DSL (model, feature, guide) that acts as the source-of-truth for code generation, eliminating the drift between documentation and implementation by making architecture the code generator itself. The compose build CLI command drives a traditional compiler pipeline (Lexer → Parser → Semantic Analyzer → IR) and then delegates code generation to an LLM backend, producing framework-specific output for Next.js, React, Vue, and other targets. Reproducible builds are achieved via LLM response caching — the same .compose input always produces the same output as long as the cache is present. The project ships a VSCode extension for syntax highlighting and code intelligence, completing the IDE integration story.

Unlike seeds such as spec-kit or openspec — which layer workflow and artifact management on top of an existing coding agent — Compose-Lang replaces the agent's freeform prompt-to-code loop with a compiler abstraction: the human writes specs, the compiler decides what code to generate, and incremental export maps track which symbols changed so only affected files are regenerated. This positions it closest to openspec's "architecture-first" philosophy but differs architecturally: openspec manages delta documents consumed by a coding agent, while Compose-Lang is itself the code generator and does not delegate to an interactive agent session.

01

Overview

Compose-Lang — Overview

Origin

Compose-Lang was created by the darula-hpp GitHub organization, first published in late 2025. It is written in JavaScript/Node.js with an accompanying VSCode extension. The project targets multi-developer teams who need reproducible, version-controlled code generation from architecture specifications.

Philosophy

The core manifesto is that architecture IS the code generator — architecture cannot drift from reality because the same spec file that is committed to git is what produces the running application. The README states:

"Write architecture specs → LLM generates code → Version control both. Architecture IS the code generator (can't drift). Read 50-line .compose file instead of 50-file codebase."

The language is deliberately minimal: three keywords and plain English descriptions. The belief is that LLMs handle natural language better than complex DSLs, so extra syntax is waste.

Explicit Antipatterns

The README explicitly warns against using Compose-Lang for:

  • Quick one-off scripts or prototypes (use Cursor/Copilot instead)
  • Solo short-term projects
  • Complex algorithmic logic
  • Mission-critical systems (banking, healthcare, flight control)
  • Edge-case-heavy domains where 100% control is needed

Target Use Cases

  • Multi-developer teams maintaining apps over time
  • CRUD apps, internal tools, MVPs
  • Iterative development (adding features incrementally)
  • Framework migrations (regenerate for new tech stack)
  • Architecture documentation that cannot go stale

Known Limitations (self-documented)

  • No automated drift detection between generated code and export symbols
  • No model version pinning (LLM provider updates can break reproducibility)
  • LLMs struggle with complex domain logic
  • Sweet spot is ~10-20 guides per file; quality degrades beyond that
  • Perfect determinism is not guaranteed (cache mitigates but doesn't eliminate)
02

Architecture

Compose-Lang — Architecture

Distribution

  • npm package with compose binary (via package.json#bin)
  • Install: npm install + npm link (local development mode, no npm publish found)
  • VSCode extension: shipped as .vsix file (compose-lang-0.1.0.vsix) in vscode-compose/

Required Runtime

  • Node.js (exact version constraint not specified)
  • LLM provider API key (supports OpenAI-compatible endpoints)

Repository Structure

compose-lang/
├── cli/
│   ├── index.js          # CLI entry point, routes to subcommands
│   └── commands/
│       ├── build.js      # Compile .compose to code
│       ├── dev.js        # Watch mode for development
│       ├── init.js       # Initialize new project
│       ├── project.js    # Project management
│       ├── run.js        # Run generated project
│       ├── clean.js      # Clean generated artifacts
│       └── eject.js      # Eject from Compose (export raw code)
├── compiler/             # Compiler pipeline (Lexer → Parser → Semantic Analyzer → IR)
├── language/             # Language definition and parser
├── language-server/      # LSP implementation for IDE support
├── vscode-compose/       # VSCode extension (.vsix)
├── examples/             # Example .compose projects
├── composedocs/          # Documentation
├── docs/                 # Additional docs
├── scripts/              # Build/tooling scripts
├── SYNTAX.md             # Language reference
├── ROADMAP.md            # Planned features
└── package.json          # `bin: { compose: ./cli/index.js }`

Compiler Pipeline

.compose files → Lexer → Parser → Semantic Analyzer → IR (Intermediate Representation)
                                                          ↓
                                               LLM Code Generation Backend
                                                          ↓
                                              Framework-specific output
                                              (Next.js, React, Vue, etc.)

Target AI Tools

  • Any LLM provider with OpenAI-compatible API (the compiler calls the LLM directly)
  • Not a Claude Code / Codex plugin — operates independently of agent harnesses
  • The vscode-compose extension integrates with the VS Code IDE

Config Files

  • jsconfig.json — JavaScript project config
  • Project-level config files (specific paths not documented in public README)
03

Components

Compose-Lang — Components

CLI Commands (7 subcommands)

Name Purpose
compose init Initialize a new Compose project, scaffolding .compose file structure
compose build Compile .compose specs to framework-specific code via LLM
compose dev Watch mode — rebuild incrementally as .compose files change
compose project Project management operations (list, configure targets)
compose run Build then run the generated application
compose clean Remove generated code artifacts
compose eject Export generated code without Compose dependency (escape hatch)

Language Primitives (3 keywords)

Keyword Purpose
model Declares data structures with typed fields (text, number, bool, image, etc.) and constraints (unique, required)
feature Describes user-facing functionality, business rules, UI, integrations in plain English
guide Adds implementation details and constraints to steer LLM generation

Compiler Components

Component Purpose
compiler/ Full compiler pipeline: Lexer, Parser, Semantic Analyzer, IR generator
language/ Language grammar and parser implementation
language-server/ LSP (Language Server Protocol) for IDE integration

VSCode Extension

Component Purpose
vscode-compose Syntax highlighting, code completion, error diagnostics for .compose files
snippets/ Code snippets for common patterns
syntaxes/ TextMate grammar for .compose syntax coloring

Export Maps

A key runtime component: export maps track all symbols defined in .compose files so the dev and build commands can determine which generated files need regeneration when a spec changes (incremental compilation).

LLM Cache

Response cache commits LLM outputs to git alongside .compose files. Same input + same cache = same output, enabling reproducible builds.

Scripts (count: varies)

Located in scripts/ directory — purpose is build tooling and test helpers; not Claude Code hooks.

05

Prompts

Compose-Lang — Prompts

Compose-Lang is a compiler framework; it does not ship agent skill/command prompt files. The "prompts" are the .compose DSL files themselves, which are fed to the LLM as structured input. Two representative examples follow.

Example 1 — Data Model Specification (from SYNTAX.md)

model User:
  email: text (unique)
  name: text
  avatar: image
  role: "admin" | "member" | "guest"
  createdAt: timestamp

model Todo:
  title: text
  completed: bool
  dueDate: date?
  assignee: User?

Prompting technique: Strongly-typed schema declaration. Types constrain the LLM's output space, acting as a typed prompt rather than free-form natural language. The ? suffix and (unique) constraint annotations serve as generation guardrails.

Example 2 — Feature + Guide Specification (from README.md)

# 1. model - Data structures
model User:
  email: text
  role: "admin" | "member"

# 2. feature - What users can do  
feature "Authentication":
  - Email/password signup
  - Password reset

# 3. guide - Implementation details (added as you develop)
guide "Security":
  - Rate limit login: 5 attempts per 15 min
  - Use bcrypt cost factor 12
  - Store sessions in Redis

Prompting technique: Progressive refinement. feature provides high-level behavioral intent (analogous to a user story), while guide adds implementation constraints that narrow the LLM's choices. The author adds guide blocks incrementally as they develop — a staged prompt injection pattern that mirrors "few-shot prompting with context accumulation."

Example 3 — Multi-Feature Specification (from README.md)

feature "Task Management":
  - Create tasks with title, description, due date
  - Assign to team members
  - Mark as complete
  - Delete tasks

feature "Theme":
  - Modern, clean aesthetic
  - Blue/indigo color scheme
  - Dark mode support
  - Card-based layout

guide "Authentication":
  - Use JWT for sessions
  - Hash passwords with bcrypt cost 12

Prompting technique: Domain decomposition. Each feature block is a sub-prompt that the compiler can independently route to the LLM backend, enabling parallel or incremental generation per feature. The compiler's IR ensures cross-feature references resolve correctly.

Compiler-Level Prompt Construction

The internal compiler (compiler/) constructs the actual LLM prompts from the IR, combining:

  1. The target framework context (Next.js, React, Vue)
  2. The model schema as typed context
  3. The feature descriptions as behavioral requirements
  4. The guide blocks as implementation constraints
  5. Export map context for @ references to existing code
09

Uniqueness

Compose-Lang — Uniqueness

Differs from Seeds

Compose-Lang occupies a category none of the 11 seed frameworks inhabit: it is a DSL compiler that is itself the code generator, rather than an agent harness that augments an existing AI coding tool. Openspec is the closest conceptual relative — both treat a spec document as the canonical source of truth — but openspec produces delta documents that a human-driven coding agent applies, whereas Compose-Lang's compiler directly generates code by calling an LLM backend without a human agent session in the loop. Superpowers and BMAD-METHOD add behavioral Iron Laws to an interactive Claude Code session; Compose-Lang bypasses interactive sessions entirely. Taskmaster-AI manages task decomposition for agents; Compose-Lang manages code generation for compilers. The compose eject command is a distinctive escape hatch not present in any seed: it lets users abandon the framework without losing their codebase.

Positioning

Compose-Lang targets the "architecture-first" philosophy at a lower level of abstraction than other frameworks. Instead of telling an agent "here is what to build," it constructs the prompt from a typed IR and produces deterministic (cached) outputs. The v0.2.0 self-described limitations are honest: no drift detection, no model pinning, quality degrades past 20 guides. This is a research/early-product-stage framework, not production-hardened.

Observable Failure Modes

  1. Cache invalidation: If the LLM provider updates their model, cached responses from the old model may be inconsistent with new regenerations, causing partial-codebase drift.
  2. Guide overflow: Past ~20 guides per file, output quality degrades. No guardrail prevents writing more.
  3. No validation step: The compiler generates code but has no mechanism to verify it compiles, passes tests, or matches the spec intent. The human must review all output.
  4. Lock-in: Generated code tightly couples to the .compose spec. Significant refactoring of business logic requires rewriting guides and rebuilding.
  5. Single-LLM bottleneck: All generation goes through one LLM call per feature; complex cross-feature dependencies may produce inconsistent code if the LLM context window doesn't include all relevant models.
04

Workflow

Compose-Lang — Workflow

Development Phases

Phase Command Artifact Produced
1. Initialize compose init .compose project scaffold
2. Specify Edit .compose files model, feature, guide declarations
3. Build compose build Framework-specific generated code
4. Develop compose dev Incremental rebuilds on spec change
5. Run compose run Running application
6. Eject (optional) compose eject Raw code without Compose dependency

Artifacts Per Phase

Phase Input Output
Specify Human-written architecture intent .compose files (committed to git)
Build .compose + export maps Generated source files (Next.js, React, Vue, etc.)
Cache LLM responses Cache files (committed to git for reproducibility)
Eject Generated code Standalone code, no Compose required

Approval Gates

There are no interactive approval gates in the standard workflow. The process is:

  1. Human writes .compose spec
  2. Human runs compose build
  3. LLM generates code
  4. Human reviews generated code in IDE

Incremental Compilation Logic

Export maps track which .compose symbols changed between builds. Only files depending on changed symbols are regenerated, not the entire project. This reduces LLM API calls and makes large projects practical.

@ References

Compose files support @ syntax to reference existing code. The LLM translates these references into the target language — useful for migrating existing codebases incrementally.

06

Memory Context

Compose-Lang — Memory & Context

State Storage

Compose-Lang's state is entirely file-based and git-committed:

State Type Location Persistence
Architecture specifications *.compose files Project-level, committed to git
LLM response cache Cache files (path not documented) Project-level, committed to git
Export maps Tracked symbols per .compose file Project-level, regenerated on build
Generated code Target framework source files Project-level, potentially gitignored

Reproducibility Mechanism

The LLM cache is the primary memory mechanism. By committing cache files to git:

  • Same team member, same machine → identical output
  • Different team member, different machine → identical output (cache hit)
  • Cache miss (new feature/guide added) → fresh LLM call, result cached

Context Compaction

Not applicable — Compose-Lang is not a conversational agent framework. Context is the .compose spec files themselves, not a running session history.

Cross-Session Handoff

Built into the git workflow: .compose files and cache files are version-controlled, so any team member or any machine can pick up where another left off by checking out the repository.

Export Map (Dependency Tracking)

The export map is Compose-Lang's primary "working memory" for incremental builds:

  • Tracks all exported symbols (models, features, guides) and their relationships
  • On compose dev or compose build, compares current export map to last build
  • Only regenerates files whose dependencies changed
  • Prevents unnecessary LLM calls and keeps costs predictable

Memory Type

file-based — all state lives in .compose files and cache files committed to git. No database, no vector store, no session memory.

07

Orchestration

Compose-Lang — Orchestration

Multi-Agent

No. Compose-Lang is a compiler, not an agent orchestration system. There are no subagents, no spawning, no parallel workers.

Orchestration Pattern

none — the compiler is a sequential pipeline:

  1. Parse .compose files
  2. Build IR
  3. Call LLM for each code generation unit
  4. Write output files

There is potential for parallelism at the feature-generation level (each feature block could be compiled independently), but the public documentation does not describe parallel LLM calls.

Isolation Mechanism

none — code generation happens in-place in the project directory. No git worktrees, no containers, no sandboxing.

Execution Mode

one-shot (for compose build) or event-driven (for compose dev which watches for .compose file changes and triggers incremental rebuilds).

Multi-Model

No. The compiler calls a single LLM provider. The provider can be configured (OpenAI-compatible API endpoint), but there is no role-based model routing.

Consensus Mechanism

None.

Prompt Chaining

Yes, in a limited sense: the compiler constructs a multi-part prompt from the IR (model context + feature description + guide constraints), and the output of one compiler stage (IR) feeds the input of the next (LLM prompt construction). This is intra-build prompt chaining within the compiler, not cross-agent chaining.

Cross-Tool Portability

Low — the compose CLI is the only interface. The framework does not integrate with Claude Code, Codex, or any agent harness. The VSCode extension adds IDE support but the core workflow is CLI-only.

08

Ui Cli Surface

Compose-Lang — UI & CLI Surface

Dedicated CLI Binary

Yes. The binary is compose, registered via package.json#bin: { compose: ./cli/index.js }.

Subcommands (7): init, build, dev, project, run, clean, eject

The CLI is not a thin wrapper around Claude/Codex — it is the primary runtime that drives compilation.

Local Web Dashboard

No web dashboard.

VSCode Extension

Yes. The vscode-compose directory ships a complete VSCode extension:

  • Syntax highlighting for .compose files (TextMate grammar in syntaxes/)
  • Code snippets for model, feature, guide blocks
  • Language server integration (LSP via language-server/) for diagnostics
  • Package as .vsix file: compose-lang-0.1.0.vsix

The extension provides IDE-level editing support but does not replace the CLI for compilation.

Observability

No audit log, no dashboard. The dev watch mode provides console output of rebuild events, but there is no structured logging or session history.

Install Interface

Development mode only: npm install && npm link. No published npm package found in public documentation.

Related frameworks

same archetype · same primary tool · same memory type

Harness (revfactory) — Team-Architecture Factory ★ 3.6k

Generates domain-specific agent teams and their skills from a natural language domain description, using one of 6 pre-defined…

Superpowers ★ 207k

Enforces spec-first, TDD, and subagent-reviewed development as mandatory automatic workflows rather than optional practices.

Spec Kit ★ 106k

Turns a natural-language feature description into a complete, versioned, AI-executable specification pipeline installable for 30+…

OpenSpec ★ 51k

Adds a lightweight spec layer so AI coding assistants and humans agree on what to build before any code is written.

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Taskmaster AI ★ 27k

Converts a PRD into a dependency-ordered JSON task graph that AI coding agents execute one task at a time, eliminating context…