spartan
БесплатноБез исполняемых скриптовНе проверенManages spartan/ui, the Angular UI library - adding, composing, fixing, debugging, and styling UI with the Brain (headless primitives) and Helm (styled)…
от spartan-ng★ 3 018 звёзд на GitHubОб этом скилле
spartan/ui
spartan/ui is an Angular UI library on the stable 1.x line (@spartan-ng/brain, @spartan-ng/cli, @spartan-ng/mcp). Do not assume a fixed version such as 1.0 — read the
declared dependency versions for Brain, Helm, and CLI from npx nx g @spartan-ng/cli:info --json (Nx) or ng g @spartan-ng/cli:info --json (Angular CLI) (field versions; these are package.json ranges, not lockfile-resolved installs). For the latest published MCP package version, check npm (@spartan-ng/mcp).
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>(orpnpm nx g ...). - Angular CLI workspace (has
angular.json, nonx.json):ng g @spartan-ng/cli:<generator>.
Current project context
Before generating any code, gather the project context:
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-iconswhen 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
- Use existing components first. Check
installedComponents, thenavailableComponents. Find docs via the MCP server (spartan_components_list/spartan_components_get) or the live docs athttps://www.spartan.ng/components/<name>. Seemcp.md. - Compose, do not reinvent. Build dashboards, forms, and dialogs from existing Helm + Brain pieces rather than custom markup.
- Use built-in variants before custom styles. Buttons, badges, alerts, etc. ship
variantandsizeinputs - use them instead of overriding classes. - Use semantic colors, never raw values.
bg-primary text-primary-foreground, notbg-blue-500. Seerules/styling.md.
Critical rules
Read the rule file before doing the related work:
rules/styling.md- thehlm()util, semantic color tokens, layout-only classes,gap-*overspace-*,size-*, dark mode, no manual z-index on overlays.rules/forms.md- compose forms withhlmField(label, control, error, description) andhlmFieldSet/hlmFieldLegendon native<fieldset>/<legend>; option sets (2-7 choices) usehlm-toggle-group.rules/composition.md- items belong inside their group; dialogs/sheets need a title; full Card composition; tabs triggers insidehlm-tabs-list; avatar always has a fallback; useAlert/Empty/Skeleton/Badge/Separator/Spinnerinstead of custom markup.rules/icons.md- icons are<ng-icon name="lucide...">; register withprovideIcons; no manual sizing classes inside components - use thesizeinput.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 thehlm-tailwind-preset.css, CSS variables, theui-themegenerator, and extending copied Helm components.mcp.md- using the@spartan-ng/mcptools, resources, and prompts for discovery.
Key patterns
<!-- Buttons: use variant/size inputs, not custom classes -->
<button hlmBtn variant="destructive" size="lg">Delete</button>
<!-- Icon i
Установить spartan в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(npx nx g @spartan-ng/cli:*)Bash(pnpm nx g @spartan-ng/cli:*)Bash(ng g @spartan-ng/cli:*)Вложенные файлы
FAQ
Что делает скилл spartan?
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".
Как установить скилл spartan?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spartan запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic