Agent skill

Spartan UI Angular Components

by spartan-ng in spartan-ng/spartan

Helps add, compose, debug and style spartan/ui components in Angular projects, using its Brain headless primitives and Helm styled layer through the @spartan-ng/cli generators.

MITAuto-check passedFrontend & Design

Install Spartan UI Angular Components

skills CLI
$ npx skills add spartan-ng/spartan --skill spartan -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install spartan-ng/spartan spartan --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/spartan-ng/spartan.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spartan .claude/skills/spartan && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spartan
GitHub stars
2.9k
Token cost
~2.4k tokens
SKILL.md length
752 words
Files
10
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Helps add, compose, debug and style spartan/ui components in Angular projects, using its Brain headless primitives and Helm styled layer through the @spartan-ng/cli generators.

  • Works in 4 steps: Use existing components first. Check… → Compose, do not reinvent. Build… → Use built-in variants before custom… → …
  • Adding a spartan/ui component such as a dialog or form field to an Angular app
  • SKILL.md covers Current project context, Principles, Critical rules and Key patterns, plus 3 more sections
  • Calls npx and pnpm; reaches spartan.ng

What it does

spartan/ui is an Angular UI library with two layers: Brain, accessible unstyled primitives installed from npm, and Helm, a Tailwind and class-variance-authority styled layer that the CLI copies into your project so you own it. You compose Helm directives and components onto host elements, and Helm wires up the matching Brain primitive. The skill's rule is to prefer existing components over hand-written markup.

Before generating code, the agent detects the workspace runner (npx nx g for an Nx workspace with nx.json, ng g for an Angular CLI workspace with angular.json) and runs the read-only info generator with --json. The report lists workspace type, components path, import alias, versions, icon library, the Tailwind stylesheet, and installed and available components. If components.json is missing, the project is initialized first. Rule files cover Brain versus Helm, composition, forms, icons and styling, with notes on the CLI, registry, customization and MCP docs.

When your agent uses it

  • Adding a spartan/ui component such as a dialog or form field to an Angular app
  • Fixing or restyling a Helm component that was copied into the project
  • Setting up spartan/ui in an Angular project that has no components.json
  • Building a dashboard or form from existing Helm and Brain pieces

Example prompts

  • “Set up spartan/ui in this Angular workspace.”
  • “Add a spartan component for a confirmation dialog and wire it into the settings page.”
  • “Restyle the Helm button in libs/ui to match our brand colors.”

Requirements

  • An Angular workspace, either Nx or Angular CLI
  • Tailwind CSS
  • Pre-approved tools (allowed-tools): Bash(npx nx g @spartan-ng/cli:*), Bash(pnpm nx g @spartan-ng/cli:*), Bash(ng g @spartan-ng/cli:*)

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Use existing components first. Check installedComponents, then availableComponents. Find
  2. Compose, do not reinvent. Build dashboards, forms, and dialogs from existing Helm + Brain
  3. Use built-in variants before custom styles. Buttons, badges, alerts, etc. ship variant and
  4. Use semantic colors, never raw values. bg-primary text-primary-foreground, not

What it can do on your machine

Read from SKILL.md and the folder at commit d09b75c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(npx nx g @spartan-ng/cli:*)
    • Bash(pnpm nx g @spartan-ng/cli:*)
    • Bash(ng g @spartan-ng/cli:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • spartan.ng

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spartan UI Angular Components loads about 2.4k tokens when it runs. Until then it costs about 119 tokens; SKILL.md has 752 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~119
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from spartan-ng/spartan at commit d09b75c, republished under its MIT licence (© spartan-ng). 752 words, ~2,368 tokens.

Download SKILL.mdSave it as .claude/skills/spartan/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
spartan
description
Manages spartan/ui, the Angular UI library - adding, composing, fixing, debugging, and styling UI with the Brain (headless primitives) and Helm (styled) layers. Provides project context, component APIs, and usage examples. Applies when working with spartan/ui, @spartan-ng/brain, @spartan-ng/helm, the @spartan-ng/cli generators, or any Angular project with a components.json file. Also triggers for "spartan init", "add a spartan component", or "set up spartan/ui".
allowed-tools
Bash(npx nx g @spartan-ng/cli:*), Bash(pnpm nx g @spartan-ng/cli:*), Bash(ng g @spartan-ng/cli:*)
user-invocable
false

spartan/ui

spartan/ui is an Angular UI library. It uses a two-layer architecture:

  • Brain (@spartan-ng/brain) - accessible, unstyled primitives (Angular directives/components), installed from npm. This is the behavior and accessibility layer.
  • Helm (@spartan-ng/helm) - the styled layer (Tailwind + class-variance-authority). Helm code is copied into the user's project by the CLI so they own and can customize it.

You compose Helm directives/components onto host elements; Helm wires up the matching Brain primitive under the hood. Always prefer existing components over hand-written markup.

All CLI commands run through the workspace's runner. Detect it from the project:

  • Nx workspace (has nx.json): npx nx g @spartan-ng/cli:<generator> (or pnpm nx g ...).
  • Angular CLI workspace (has angular.json, no nx.json): ng g @spartan-ng/cli:<generator>.

Current project context

Before generating any code, gather the project context:

bash
npx nx g @spartan-ng/cli:info --json     # Nx
ng g @spartan-ng/cli:info --json         # Angular CLI

This is read-only and prints JSON with:

  • workspaceType - nx | angular-cli (decides which runner to use above).
  • config.componentsPath - where Helm components are copied (e.g. libs/ui).
  • config.importAlias - the import prefix for Helm, default @spartan-ng/helm.
  • config.generateAs - library | entrypoint (Nx layout choice).
  • versions - Angular, Angular CDK, Tailwind, @spartan-ng/brain, @spartan-ng/cli.
  • iconLibrary - @ng-icons when present.
  • tailwindCssFile - the global stylesheet that imports the preset.
  • installedComponents - components already present (do not re-add these).
  • availableComponents - everything the CLI can generate.

If components.json does not exist, the project is not set up yet - run @spartan-ng/cli:init first (it installs dependencies and the theme). components.json itself is created when you add the first component with ui (see cli.md).

Principles

  1. Use existing components first. Check installedComponents, then availableComponents. Find docs via the MCP server (spartan_components_list / spartan_components_get) or the live docs at https://www.spartan.ng/components/<name>. See mcp.md.
  2. Compose, do not reinvent. Build dashboards, forms, and dialogs from existing Helm + Brain pieces rather than custom markup.
  3. Use built-in variants before custom styles. Buttons, badges, alerts, etc. ship variant and size inputs - use them instead of overriding classes.
  4. Use semantic colors, never raw values. bg-primary text-primary-foreground, not bg-blue-500. See rules/styling.md.

Critical rules

Read the rule file before doing the related work:

  • rules/styling.md - the hlm() util, semantic color tokens, layout-only classes, gap-* over space-*, size-*, dark mode, no manual z-index on overlays.
  • rules/forms.md - compose forms with hlmField (label, control, error, description) and hlmFieldSet / hlmFieldLegend on native <fieldset>/<legend>; option sets (2-7 choices) use hlm-toggle-group.
  • rules/composition.md - items belong inside their group; dialogs/sheets need a title; full Card composition; tabs triggers inside hlm-tabs-list; avatar always has a fallback; use Alert/Empty/Skeleton/Badge/Separator/Spinner instead of custom markup.
  • rules/icons.md - icons are <ng-icon name="lucide...">; register with provideIcons; no manual sizing classes inside components - use the size input.
  • rules/brain-vs-helm.md - the two-layer model (one headless library, Brain, plus the styled Helm layer); when to reach for Brain directly vs Helm, and how composition works via directives.
  • cli.md - every generator (init, ui, ui-theme, healthcheck, info, migrate-*), with Nx and Angular CLI invocations.
  • registry.md - the Brain-npm + Helm-copy-in distribution model, components.json, and the fixed component catalog (the shipped CLI uses no remote or custom registry).
  • customization.md - theming via the hlm-tailwind-preset.css, CSS variables, the ui-theme generator, and extending copied Helm components.
  • mcp.md - using the @spartan-ng/mcp tools, resources, and prompts for discovery.
Show full SKILL.md (256 more words)Show less

Key patterns

html
<!-- Buttons: use variant/size inputs, not custom classes -->
<button hlmBtn variant="destructive" size="lg">Delete</button>

<!-- Icon in a button: ng-icon -->
<button hlmBtn size="icon" variant="ghost">
	<ng-icon name="lucideTrash" />
</button>

<!-- Loading state: compose a spinner, there is no isLoading input -->
<button hlmBtn [disabled]="loading()">
	@if (loading()) {
	<hlm-spinner />
	} Save
</button>

<!-- Layout: gap, not space-* ; size-* when width == height -->
<div class="flex items-center gap-2">
	<span hlmBadge variant="secondary">beta</span>
</div>

Component selection

NeedComponent(s)
Action / buttonbutton (hlmBtn), button-group
Text/number inputinput, textarea, input-otp, input-group, native-select
Choice inputselect, combobox, autocomplete, radio-group, checkbox, switch, slider
Toggle 2-7 optionstoggle-group
Form layout/validationfield, label
Data displaychart, table, card, badge, avatar, kbd, item
Navigationsidebar, navigation-menu, breadcrumb, tabs, pagination
Overlaysdialog, sheet, alert-dialog, popover, hover-card, tooltip
Menusdropdown-menu, context-menu, menubar, command
Feedbacksonner (toasts), alert, progress, skeleton, spinner
Layout/containerscard, separator, resizable, scroll-area, accordion, collapsible, aspect-ratio
Empty statesempty
Datescalendar, date-picker
Iconsicon (@ng-icons)
Typographytypography

Workflow

  1. Get context. Run @spartan-ng/cli:info --json. If the project is not set up, run :init, then add components with :ui (the first :ui run creates components.json).
  2. Check what is installed. Do not re-add anything in installedComponents.
  3. Find the component. Use the MCP tools or https://www.spartan.ng/components/<name> for the API and examples (mcp.md). Never guess selectors - confirm them.
  4. Add it. npx nx g @spartan-ng/cli:ui --name=<component> (Nx) or ng g @spartan-ng/cli:ui --name=<component> (Angular CLI). This installs the Brain dependency and copies the Helm code. Omit --name to get an interactive multiselect.
  5. Compose correctly. Import the *Imports const (e.g. HlmDialogImports) or the individual classes from the import alias, add them to the standalone component's imports, and follow the composition rules.
  6. Register icons. Any <ng-icon> you use must be passed to provideIcons(...) (see rules/icons.md).
  7. Verify. After bigger changes or upgrades, run @spartan-ng/cli:healthcheck to catch deprecated patterns and fix imports.
  8. Theme/customize. Edit the copied Helm files and the CSS variables; do not fork Brain.

Quick reference

bash
# Initialize (creates components.json, wires Tailwind + preset)
npx nx g @spartan-ng/cli:init
ng g @spartan-ng/cli:init

# Project context as JSON
npx nx g @spartan-ng/cli:info --json

# Add components (interactive, or pass --name)
npx nx g @spartan-ng/cli:ui
npx nx g @spartan-ng/cli:ui --name=dialog

# Generate theme variables
npx nx g @spartan-ng/cli:ui-theme

# Scan + auto-fix deprecated APIs/imports after an upgrade
npx nx g @spartan-ng/cli:healthcheck --autoFix

© spartan-ng, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files in skills/spartan of spartan-ng/spartan.

  • SKILL.md
  • cli.md
  • customization.md
  • mcp.md
  • registry.md
  • rules/brain-vs-helm.md
  • rules/composition.md
  • rules/forms.md
  • rules/icons.md
  • rules/styling.md

Open the folder on GitHubat commit d09b75c

Compare with similar skills

Spartan UI Angular Components next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spartan UI Angular Components compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spartan UI Angular Components this skillspartan-ng/spartan2.9k—~2.4kAutomated safety check: PassMIT
Preline UI Components via MCPhtmlstreamofficial/preline6.5k—~2.9kAutomated safety check: PassCustom licence
Frontend UI FunctionalvictorGPT/vibeusage130—~939Automated safety check: PassMIT
Integrating shadcn/ui Componentsgoogle-labs-code/stitch-skills8.5k4 repos~2.3kAutomated safety check: NotesApache-2.0
Chakra UI v3 Refactor and Reviewchakra-ui/chakra-ui41k—~2.8kAutomated safety check: PassMIT
Activepieces Design Systemactivepieces/activepieces25k—~3.6kAutomated safety check: PassCustom licence

Similar skills

  • Preline UI Components via MCP

    htmlstreamofficial/preline

    Adds Preline UI components and blocks to HTML files by querying the Preline MCP server, with rules for exact slugs and for clarifying vague requests.

    6.5k GitHub stars~2.9k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Frontend UI Functional

    victorGPT/vibeusage

    A skill your agent uses when building or refactoring functional React/Vite/Tailwind UI pages, templates, or component libraries that need consistent structure, tokenized styling, accessibility…

    130 GitHub stars~939 tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Integrating shadcn/ui Components

    google-labs-code/stitch-skills

    Official

    Guides finding, installing, customizing and wiring up shadcn/ui components in a project, with MCP tools for the component catalog and registries.

    8.5k GitHub starsUsed in 4 repos~2.3k tokens
    Frontend & DesignAuto-check: notes
  • Reviews and converts UI code to Chakra UI v3, producing a critique, rewritten code or both, from plain HTML, Tailwind, CSS Modules or styled-components.

    41k GitHub stars~2.8k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Activepieces Design System

    activepieces/activepieces

    Design system for Activepieces (open-source AI automation platform, "open source replacement for Zapier").

    25k GitHub stars~3.6k tokensUpdated today
    Frontend & DesignAuto-check passed
  • UI/UX Design System Advisor

    Galaxy-Dawn/claude-scholar

    Turns a vague UI request into a concrete design system with style, palette, typography and layout guidance from a search script, plus stack-specific implementation advice.

    5.7k GitHub starsUsed in 1 repo~1.1k tokens
    Frontend & DesignAuto-check passed

Questions about Spartan UI Angular Components

What does Spartan UI Angular Components do?

Helps add, compose, debug and style spartan/ui components in Angular projects, using its Brain headless primitives and Helm styled layer through the @spartan-ng/cli generators. spartan/ui is an Angular UI library with two layers: Brain, accessible unstyled primitives installed from npm, and Helm, a Tailwind and class-variance-authority styled layer that the CLI copies into your project so you own it. You compose Helm directives and components onto host elements, and Helm wires up the matching Brain primitive.

When should I use Spartan UI Angular Components?

Spartan UI Angular Components fits situations like: adding a spartan/ui component such as a dialog or form field to an Angular app; fixing or restyling a Helm component that was copied into the project; setting up spartan/ui in an Angular project that has no components.json; building a dashboard or form from existing Helm and Brain pieces.

How do I install Spartan UI Angular Components in Claude Code?

Run `npx skills add spartan-ng/spartan --skill spartan -a claude-code`. Or copy the skill folder (skills/spartan in spartan-ng/spartan) into .claude/skills/spartan in your project. Claude Code loads it when a task matches its description.

How do I install Spartan UI Angular Components in Codex?

Run `npx skills add spartan-ng/spartan --skill spartan -a codex`. Or copy the skill folder (skills/spartan in spartan-ng/spartan) into .agents/skills/spartan in your project. Codex loads it when a task matches its description.

Can I use Spartan UI Angular Components in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add spartan-ng/spartan --skill spartan -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spartan, .gemini/skills/spartan, .github/skills/spartan and .opencode/skills/spartan in your project.

What does Spartan UI Angular Components need to run?

Going by SKILL.md and its folder, Spartan UI Angular Components needs the command-line tools its instructions call (npx and pnpm). Our summary lists: An Angular workspace, either Nx or Angular CLI; Tailwind CSS. Its frontmatter pre-approves these tools: Bash(npx nx g @spartan-ng/cli:*), Bash(pnpm nx g @spartan-ng/cli:*), Bash(ng g @spartan-ng/cli:*).

Does Spartan UI Angular Components access the network?

SKILL.md names 1 domain. In commands or code: spartan.ng; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Spartan UI Angular Components safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spartan UI Angular Components use?

Spartan UI Angular Components is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spartan UI Angular Components use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Spartan UI Angular Components?

Skills that share tags, products or a category with Spartan UI Angular Components: Preline UI Components via MCP (htmlstreamofficial/preline, 6.5k stars), Frontend UI Functional (victorGPT/vibeusage, 130 stars), Integrating shadcn/ui Components (google-labs-code/stitch-skills, 8.5k stars) and Chakra UI v3 Refactor and Review (chakra-ui/chakra-ui, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spartan UI Angular Components?

spartan-ng (a GitHub organization) maintains it in spartan-ng/spartan, which has 2,934 GitHub stars. The repository was last updated on October 8, 2026.

Source: spartan-ng/spartan on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.