SysMARA vs Internal Scaffolding Scripts

Scaffolding scripts generate code. The Capability Compiler understands your system.

The Scaffolding Script Pattern

Many engineering teams build internal scaffolding tools. These take various forms:

These tools are useful. They enforce naming conventions, reduce boilerplate, and ensure new components follow team patterns. But they share a fundamental limitation: they generate code without understanding the system.

What Scaffolding Scripts Know

A typical scaffolding script knows:

What Scaffolding Scripts Do Not Know

Scaffolding scripts are context-free generators. They produce output based on a template and inputs, with no awareness of the system they are generating into.

What the Capability Compiler Knows

SysMARA's Capability Compiler operates on the system graph — the complete, compiled representation of your architecture. When it generates code, it knows:

Entity relationships

The compiler knows that the subscription entity in the billing module references workspaces.workspace. Generated handler code includes the correct type references and validation for cross-module relationships.

Invariant requirements

The compiler knows that downgrade_subscription is constrained by cannot_downgrade_with_unpaid_invoices. Generated handler scaffolding includes a placeholder for the invariant check with a comment referencing the invariant name and severity.

Policy bindings

The compiler knows which policies govern each capability. Generated handlers include the correct authorization checks based on declared policies, not guessed from templates.

Flow context

The compiler knows if a capability is part of a flow. Generated code includes flow-step markers that the runtime uses for flow tracking and step ordering validation.

Side-by-Side: Scaffolding a New Capability

With a Plop generator

# Run the generator
npx plop capability

# Prompts:
# ? Capability name: update_seat_count
# ? Module: billing
# ? Type: mutation

# Output: generates these files from templates
# src/billing/capabilities/update-seat-count.handler.ts
# src/billing/capabilities/update-seat-count.test.ts
# src/billing/capabilities/update-seat-count.schema.ts

The generated files follow naming conventions and include standard boilerplate, but the handler body is empty. The test file has placeholder tests. The schema file has a generic input/output type. Nothing knows about the seat_allocation entity's fields, the invariants that apply, or the policies that govern access.

With the SysMARA Capability Compiler

# Define the capability in specs
# specs/billing/capabilities/update-seat-count.yaml
name: update_seat_count
module: billing
entity: seat_allocation
type: mutation
invariants:
  - seat_count_minimum_one
policies:
  - billing_admin
  - admin_full_access

# Compile
npx sysmara compile

The compiler generates handler scaffolding that includes:

Fire-and-Forget vs Regenerable

This is a critical distinction:

Scaffolding scripts are fire-and-forget

Once a scaffolding script generates code, the generated files are fully owned by the developer. The generator has no ongoing relationship with the output. If you change the template, existing generated files are unaffected. If you rename an entity, existing scaffolded code is unaware. The generated code immediately diverges from the template.

The Capability Compiler is regenerable

SysMARA's generated code is tracked with checksums in a manifest. The compiler knows which files it generated and whether they have been modified. This enables:

The Manifest

After compilation, SysMARA produces a manifest file that records:

{
  "version": "1.0.0",
  "generatedAt": "2025-01-15T10:30:00Z",
  "files": [
    {
      "path": "src/generated/billing/update-seat-count.handler.ts",
      "checksum": "sha256:a1b2c3d4...",
      "source": "specs/billing/capabilities/update-seat-count.yaml",
      "safeEditZones": [
        { "start": 15, "end": 45, "label": "business_logic" }
      ]
    }
  ]
}

Scaffolding scripts have no equivalent. Once they run, they forget.

Where Scaffolding Scripts Are Better

Area Details
Simplicity A Plop generator is a few Handlebars templates. SysMARA requires a spec layer, a compiler, and a system graph. For small projects, scaffolding scripts are dramatically simpler.
Flexibility Scaffolding scripts can generate anything — React components, Terraform modules, documentation pages. SysMARA's compiler only generates backend handler scaffolding.
No lock-in Scaffolding scripts generate standard code with no framework dependency. SysMARA's generated code depends on @sysmara/core.
Team familiarity Most teams already have some form of scaffolding. SysMARA requires learning a new spec format and compiler workflow.

Where the Capability Compiler Is Better

Area Details
System awareness The compiler reads the full system graph. It generates code that is aware of entity relationships, invariants, and policies.
Correctness Generated invariant checks and policy hooks are derived from specs, not guessed from templates. If the spec says an invariant applies, the generated code includes it.
Regeneration Specs change, the compiler regenerates. Safe edit zones preserve custom logic. Scaffolding scripts cannot do this.
Consistency Deterministic output from a compiler vs. templates that drift. Every generated handler has the same structure, guaranteed.
AI operability AI agents can modify specs and re-run the compiler. They cannot reliably modify scaffolding templates to account for system-wide concerns.

When to Use Scaffolding Scripts

When to Use the Capability Compiler