Introducing a new way to review your PRs.

Read the announcement

spartan-ng / spartan

Cutting-edge tools powering Angular full-stack development.

View on GitHub

18 documents · Updated Nov 23, 2026

overview

Knowledge Base updated: 2026-11-22

Spartan knowledge base

Orientation

Spartan is an Angular component ecosystem: Brain provides accessible headless primitives, while Helm packages styled, Tailwind-oriented components built around those primitives.

The Nx-backed CLI generates, migrates, and maintains Spartan integrations in consuming workspaces. The registry supplies component metadata and theme choices used by tooling.

The repository also contains a documentation application, Storybook and integration-test surfaces, an MCP server for repository-aware tooling, and an Angular tRPC integration package. Package-local source and generator templates are the critical implementation state; the documentation app hosts the public presentation layer.

System map

flowchart TD
  CLI[libs/cli] --> Generated[Consumer Angular workspace]
  CLI --> Brain[libs/brain]
  CLI --> Helm[libs/helm]
  CLI --> Registry[libs/registry]
  Helm --> Brain
  Registry --> CLI
  Docs[apps/documentation] --> Brain
  Docs --> Helm
  Docs --> Registry
  Storybook[apps/storybook] --> Brain
  Storybook --> Helm
  MCP[libs/mcp] --> Docs
  MCP --> Brain
  MCP --> Helm
  TRPC[libs/trpc] --> Generated
  Tests[Integration and smoke tests] --> CLI
  Tests --> Storybook
flowchart LR
  Request[Generator invocation] --> Select[Select supported UI library]
  Select --> Resolve[Resolve dependencies and versions]
  Resolve --> Templates[Apply Brain, Helm, and utility templates]
  Templates --> Workspace[Update Angular workspace]
  Maintain[Maintenance generators] --> Workspace

Glossary

  • Brain — Spartan's headless Angular primitive layer, focused on state, semantics, and accessibility.
  • Helm — Styled, application-facing Angular components that layer Tailwind-oriented presentation over Brain primitives.
  • HLM — The hlm-* naming convention used by Helm directives, components, and utilities.
  • Brn — The brn-* naming convention used by Brain primitives.
  • Registry — Distributable component, style, and theme metadata consumed by Spartan tooling.

Codebase-wide invariants

  • Helm styling composes with, rather than replaces, Brain behavior; Helm packages import and wrap Brain primitives (libs/helm/**, libs/brain/**).
  • Public package APIs are maintained through package entry points rather than consumers importing arbitrary internal files (for example libs/…/index.ts).
  • CLI-generated UI artifacts must remain aligned with their library implementations through template counterparts under libs/cli/src/generators/ui/libs/**.
  • Accessibility state is surfaced through native attributes and primitive/component bindings, with focused coverage in *.spec.ts files such as hlm-input-a11y.spec.ts and hlm-select-aria-invalid.spec.ts.
  • Documentation presentation and server behavior are separated in the documentation application’s client routes and Nitro/tRPC server routes (apps/documentation/**).

Routing table