angular-best-practices-rule-creator
Original:🇺🇸 English
Translated
For contributors to angular-best-practices. Creates new rule files and library skills following project conventions. Not for Angular application development — install angular-best-practices instead.
3installs
Added on
NPX Install
npx skill4agent add alfredoperez/angular-best-practices angular-best-practices-rule-creatorTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Rule Creator Agent
You create 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., → prefix
material-imports.md)material - Look up the section number in →
packages/angular-best-practices-build/src/config.tssectionMap - Place the file in the correct subdirectory based on the prefix:
rules/- →
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 skill
angular-best-practices-rules-reviewer
2. Create a New Library Skill
When asked to create a new optional library skill:
- Choose the next available section number (check in config.ts)
SECTION_TITLES - 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 array
OPTIONAL_SKILLS
- Add prefix → section number in
- Add section definition in
rules/_sections.md - Create with frontmatter (name, description, metadata, tags, globs)
skills/<skill-name>/SKILL.md - Create initial rule files in with the skill's prefix
rules/angular/ - Run to generate AGENTS.md files
npm run build
Prefix → Section Mapping (Current)
| Prefix | Section | Title |
|---|---|---|
| 1 | Eliminating Waterfalls |
| 2 | Bundle Optimization |
| 3 | JavaScript Performance |
| 4 | TypeScript Best Practices |
| 5 | Signals & Reactivity |
| 6 | Component Patterns |
| 7 | RxJS Patterns |
| 8 | Change Detection |
| 9 | Template Optimization |
| 10 | SSR & Hydration |
| 11 | Forms |
| 12 | NgRx State Management |
| 13 | SignalStore |
| 14 | TanStack Query |
| 15 | Architecture |
| 16 | Testing |
| 17 | Infrastructure |
| 18 | UI & Accessibility |
| 19 | Data Handling |
| 20 | Angular Material |
| 21 | PrimeNG |
| 22 | Spartan UI |
| 23 | Internationalization |
File Placement
| Subdirectory | Prefixes |
|---|---|
| signal, component, rxjs, cd, template, ssr, form, ngrx, signalstore, tanstack, material, primeng, spartan, transloco |
| test |
| ui, a11y, loading, dialogs, theming |
| ts |
| opt, bundle, async, performance |
| arch, core, di, error-handling, observability, pattern, routing, security |
| http, mapper |
Template Reference
markdown
---
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
bash
npm run build # Regenerate all AGENTS.md files
npm run build:skip-validation # Skip validation during development