home / skills / hoangnguyen0403 / agent-skills-standard / style-guide
This skill enforces Angular naming, file structure, and style guide best practices to improve code consistency and maintainability.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill style-guideReview the files below or copy the command above to add this skill to your agents.
---
name: Angular Style Guide
description: Naming conventions, file structure, and coding standards for Angular projects.
metadata:
labels: [angular, style, naming, structure]
triggers:
files: ['**/*.ts']
keywords: [angular style, naming convention, file structure]
---
# Angular Style Guide
## **Priority: P0 (CRITICAL)**
## Principles
- **Single Responsibility**: One component/service per file. Small functions (< 75 lines).
- **Size Limits**: Keep files under 400 lines. Refactor if larger.
- **Strict Naming**: `feature.type.ts` (e.g., `hero-list.component.ts`).
- **Barrels**: Use `index.ts` only for public APIs of specific features/libraries. Avoid deep barrel imports within the same feature.
- **LIFT**: **L**ocate, **I**dentify, **F**lat structure, **T**ry DRY.
## Naming Standards
- **Files**: `kebab-case.type.ts`
- **Classes**: `PascalCase` + `Type` suffix (`HeroListComponent`)
- **Directives**: `camelCase` selector (`appHighlight`)
- **Pipes**: `camelCase` name (`truncate`)
- **Services**: `PascalCase` + `Service` suffix (`HeroService`)
## Anti-Patterns
- **Logic in Templates**: Move complex logic to the component class or a computed signal.
- **Deep Nesting**: Avoid $>3$ levels of folder nesting.
- **Prefixing interfaces**: No `IUser`. Use `User`.
## References
- [Naming Conventions](references/naming-convention.md)
This skill provides a concise, enforceable Angular style guide focusing on naming conventions, file structure, and coding standards to keep TypeScript Angular projects consistent and maintainable. It emphasizes single responsibility, clear naming patterns, size limits, and practical anti-patterns that cause long-term friction. The guidance is framework-focused and designed to be actionable for teams and automated agents enforcing style rules.
The skill inspects file names, class and symbol names, folder depth, and file size to validate conformance to the guide. It flags deviations such as incorrect casing, missing type suffixes, deep nesting, large files, and disallowed interface prefixes. The outputs are simple recommendations and suggested refactors (e.g., rename to kebab-case, extract logic into a service or signal).
Should interfaces use an I prefix?
No. Use plain PascalCase for interfaces (User, Hero) instead of prefixing with I.
When are barrels (index.ts) appropriate?
Use index.ts only to expose a feature or library's public API. Avoid using barrels for deep, intra-feature imports that obscure origins.