A
angular-best-practices-rule-creator
About angular-best-practices-rule-creator
An agent skill for adding Angular best-practice rules or optional library skills within the project's conventions. It guides file placement, section configuration, content structure, and build validation.
Key features
- 01Maps rule prefixes to sections and directories
- 02Creates rules from the project template
- 03Sets length and code-block limits
- 04Updates configuration for optional skills
- 05Builds generated AGENTS.md files
Use cases
- 01Adding a rule for an Angular best practice
- 02Creating an optional library skill and its initial rules
- 03Regenerating AGENTS.md files after configuration changes
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ alfredoperez/ angular-best-practices --skill angular-best-practices-rule-creatorAfter installing, type/angular-best-practices-rule-creatorin Claude Code to confirm it loaded.
Details
From the project READMERule Creator Agent
Creates new Angular best practice rules and optional library skills following the exact project conventions.
Capabilities
1. Create a New Rule
When asked to create a rule:
- Determine the prefix from the rule filename (e.g.,
material-imports.md→ prefixmaterial) - Look up the section number in
packages/angular-best-practices-build/src/config.ts→sectionMap - Place the file in the correct
rules/subdirectory based on the prefix:test-*→rules/testing/a11y-*,ui-*,loading-*,dialogs-*,theming-*→rules/ui/http-*,mapper-*→rules/data/ts-*→rules/typescript/opt-*,bundle-*,async-*→rules/optimization/arch-*→rules/core/- Everything else (signals, components, forms, rxjs, ngrx, material, primeng, spartan, transloco, etc.) →
rules/angular/
- Copy the template from
rules/_template.md - Fill in the frontmatter and content following these rules:
- Title: Verb + Subject (e.g., "Use Signal Inputs")
- Description: 1 sentence max
- Code blocks: 0-2 max (incorrect + correct, or just correct)
- Code per block: 3-5 lines max
- Total length: Under 50 lines (ideal 30-40)
- No installation commands, configuration dumps, or folder structures
- Validate with the
angular-best-practices-rules-reviewerskill
2. Create a New Library Skill
When asked to create a new optional library skill:
- Choose the next available section number (check
SECTION_TITLESin config.ts) - Update
packages/angular-best-practices-build/src/config.ts:- Add prefix → section number in
sectionMap - Add section title in
SECTION_TITLES - Add section impact in
SECTION_IMPACTS - Add entry in
OPTIONAL_SKILLSarray
- Add prefix → section number in
- Add section definition in
rules/_sections.md - Create
skills/<skill-name>/SKILL.mdwith frontmatter (name, description, metadata, tags, globs). Read.claude/skills/angular-best-practices-rules-reviewer/references/skill-best-practices.mdfor SKILL.md quality standards. - Create initial rule files in
rules/angular/with the skill's prefix - Run
npm run buildto generate AGENTS.md files
Prefix → Section Mapping (Current)
| Prefix | Section | Title |
|---|---|---|
async, opt-async | 1 | Eliminating Waterfalls |
bundle | 2 | Bundle Optimization |
opt, performance | 3 | JavaScript Performance |
ts | 4 | TypeScript Best Practices |
signal | 5 | Signals & Reactivity |
component | 6 | Component Patterns |
rxjs | 7 | RxJS Patterns |
cd | 8 | Change Detection |
template | 9 | Template Optimization |
ssr | 10 | SSR & Hydration |
form | 11 | Forms |
ngrx | 12 | NgRx State Management |
signalstore | 13 | SignalStore |
tanstack | 14 | TanStack Query |
arch | 15 | Architecture |
test | 16 | Testing |
core, di, error-handling, observability, pattern, routing, security | 17 | Infrastructure |
ui, a11y, loading, dialogs, theming | 18 | UI & Accessibility |
http, mapper | 19 | Data Handling |
material | 20 | Angular Material |
primeng | 21 | PrimeNG |
spartan | 22 | Spartan UI |
transloco | 23 | Internationalization |
File Placement
| Subdirectory | Prefixes |
|---|---|
rules/angular/ | signal, component, rxjs, cd, template, ssr, form, ngrx, signalstore, tanstack, material, primeng, spartan, transloco |
rules/testing/ | test |
rules/ui/ | ui, a11y, loading, dialogs, theming |
rules/typescript/ | ts |
rules/optimization/ | opt, bundle, async, performance |
rules/core/ | arch, core, di, error-handling, observability, pattern, routing, security |
rules/data/ | http, mapper |
Template Reference
---
title: Verb + Subject
impact: MEDIUM
impactDescription: Brief metric (e.g., "2-10x faster", "O(n) to O(1)")
tags: tag1, tag2
---
## Verb + Subject
One sentence explaining the rule.
**Incorrect:**
\`\`\`typescript
// 3-5 lines max
\`\`\`
**Correct:**
\`\`\`typescript
// 3-5 lines max
\`\`\`
Build Commands
npm run build # Regenerate all AGENTS.md files
npm run build:skip-validation # Skip validation during development
Comments
Markdown supported