spartan
Skill13 starsChanged 44 days agoMITView on GitHub
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".
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- spartan-ng/spartanedited, first seen Oct 8, 2026
- ynfra/ynosloptheir own version, first seen Aug 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- spartan-ng/spartan★ 3k85% same
Wrote their own version · 1
- ynfra/ynoslop★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .junie/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- angular-developerSkill
- brainstormingSkill
- code-reviewSkill
- create-a-skillSkill
- create-e2e-testsSkill
- diagnosing-bugsSkill
- frontend-designSkill
- git-stack-rewriteSkill
- grill-meSkill
- grill-with-styleSkill
- handoverSkill
- implement-planSkill
- ng-accessibilitySkill
- ng-data-accessSkill
- ng-formsSkill
- ng-migrateSkill
- ng-performanceSkill
- ng-prototypeSkill
- ng-refactorSkill
- ng-review-architectureSkill
- ng-review-style-guideSkill
- ng-securitySkill
- ng-signal-storeSkill
- ng-stylingSkill
- ng-testingSkill
- ng-verify-featureSkill
- test-driven-developmentSkill
- unslopSkill
- update-skills-directorySkill
- update-skillsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
All CLI commands run through the workspace's runner.
- Distinctive: line 38
Before generating any code, gather the project context:
- Very specific: line 57
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).
- Very specific: line 63
Use existing components first: Check installedComponents, then availableComponents.
- Distinctive: line 75
Read the rule file before doing the related work:
- Very specific: line 89
references/cli.md: - every generator (init, ui, ui-theme, healthcheck, info, migrate-*), with Nx and Angular CLI invocations. - Very specific: line 143
Get context: Run @spartan-ng/cli:info --json.
- Very specific: line 145
Check what is installed: Do not re-add anything in installedComponents.
- Very specific: line 146
Find the component: Use the MCP tools or https://www.spartan.ng/components/<name> for the API and examples (references/mcp.md).
- Very specific: line 151
Compose correctly: Import the *Imports const (e.g.
- Very specific: line 156
Verify: After bigger changes or upgrades, run @spartan-ng/cli:healthcheck to catch deprecated patterns and fix imports.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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):pnpm exec 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:
pnpm exec nx g @spartan-ng/cli:info --json # Nx
ng g @spartan-ng/cli:info --json # Angular CLIThis 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 references/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>. Seereferences/mcp.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. Seereferences/styling.md.
Critical rules
Read the rule file before doing the related work:
references/styling.md- thehlm()util, semantic color tokens, layout-only classes,gap-*overspace-*,size-*, dark mode, no manual z-index on overlays.references/forms.md- compose forms withhlmField(label, control, error, description) andhlmFieldSet/hlmFieldLegendon native<fieldset>/<legend>; option sets (2-7 choices) usehlm-toggle-group.references/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.references/icons.md- icons are<ng-icon name="lucide...">; register withprovideIcons; no manual sizing classes inside components - use thesizeinput.references/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.references/cli.md- every generator (init,ui,ui-theme,healthcheck,info,migrate-*), with Nx and Angular CLI invocations.references/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).references/customization.md- theming via thehlm-tailwind-preset.css, CSS variables, theui-themegenerator, and extending copied Helm components.references/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 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
| Need | Component(s) |
| Action / button | button (hlmBtn), button-group |
| Text/number input | input, textarea, input-otp, input-group, native-select |
| Choice input | select, combobox, autocomplete, radio-group, checkbox, switch, slider |
| Toggle 2-7 options | toggle-group |
| Form layout/validation | field, label |
| Data display | chart, table, card, badge, avatar, kbd, item |
| Navigation | sidebar, navigation-menu, breadcrumb, tabs, pagination |
| Overlays | dialog, sheet, alert-dialog, popover, hover-card, tooltip |
| Menus | dropdown-menu, context-menu, menubar, command |
| Feedback | sonner (toasts), alert, progress, skeleton, spinner |
| Layout/containers | card, separator, resizable, scroll-area, accordion, collapsible, aspect-ratio |
| Empty states | empty |
| Dates | calendar, date-picker |
| Icons | icon (@ng-icons) |
| Typography | typography |
Workflow
- Get context. Run
@spartan-ng/cli:info --json. If the project is not set up, run:init, then add components with:ui(the first:uirun createscomponents.json). - Check what is installed. Do not re-add anything in
installedComponents. - Find the component. Use the MCP tools or
https://www.spartan.ng/components/<name>for the API and examples (references/mcp.md). Never guess selectors - confirm them. - Add it.
pnpm exec nx g @spartan-ng/cli:ui --name=<component>(Nx) orng g @spartan-ng/cli:ui --name=<component>(Angular CLI). This installs the Brain dependency and copies the Helm code. Omit--nameto get an interactive multiselect. - Compose correctly. Import the
*Importsconst (e.g.HlmDialogImports) or the individual classes from the import alias, add them to the standalone component'simports, and follow the composition rules. - Register icons. Any
<ng-icon>you use must be passed toprovideIcons(...)(seereferences/icons.md). - Verify. After bigger changes or upgrades, run
@spartan-ng/cli:healthcheckto catch deprecated patterns and fix imports. - Theme/customize. Edit the copied Helm files and the CSS variables; do not fork Brain.
Quick reference
# Initialize (creates components.json, wires Tailwind + preset)
pnpm exec nx g @spartan-ng/cli:init
ng g @spartan-ng/cli:init
# Project context as JSON
pnpm exec nx g @spartan-ng/cli:info --json
# Add components (interactive, or pass --name)
pnpm exec nx g @spartan-ng/cli:ui
pnpm exec nx g @spartan-ng/cli:ui --name=dialog
# Generate theme variables
pnpm exec nx g @spartan-ng/cli:ui-theme
# Scan + auto-fix deprecated APIs/imports after an upgrade
pnpm exec nx g @spartan-ng/cli:healthcheck --autoFixDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

