marionettejs/marionette

A JavaScript library for structured interfaces, with explicit ownership and lifecycle. Built for agent-led development. Canonical Marionette repository; v4 history is preserved on the v4 branch.

What it solves

Marionette.js provides a structured framework for building user interfaces that is specifically optimized for "agent-led development." It solves the problem of AI coding agents inventing inconsistent ownership patterns or making architectural mistakes when generating UI code by providing strict boundaries, version-matched contracts, and built-in diagnostic tools.

How it works

The library establishes a clear separation of concerns through three primary components:

  • Views: Handle content rendering and local interactions.
  • Regions: Manage the replacement, mounting, and destruction of Views, ensuring proper cleanup of event connections and DOM removal.
  • Applications: Coordinate the overall lifetime and readiness of features.

To support AI agents, it includes TypeScript declarations, an ESLint rule to prevent private framework access, and documentation accessible via Model Context Protocol (MCP) to ensure agents have the correct API context.

Who it’s for

Developers using AI coding agents to build JavaScript interfaces, as well as teams migrating from legacy Backbone.js applications to a modern, DOM-native framework.

Highlights

  • Agent-Optimized: Includes specific tooling, diagnostic codes, and MCP-accessible documentation to help AI agents write correct code.
  • Agent-Led Structure: Enforces repeatable patterns for composing features so agents don't have to guess the architecture.
  • DOM Native: V5 requires neither jQuery nor Backbone, though it provides optional adapters for Backbone Models and Collections.
  • Automatic Cleanup: Regions automatically handle the destruction of Views and the release of event connections.

Related

  • Project
  • Project
  • Project
  • Project