angular-patterns
Skill9 starsChanged 8 days agoMITView on GitHub
Angular structure, component, and state-management conventions to apply when writing or reviewing Angular code. Load before implementing or reviewing any angular.json-based feature.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-debugSkill
- comprehension-workflowSkill
- dev-cleanupSkill
- dotnet-conventionsSkill
- python-conventionsSkill
- github-actions-cicdSkill
- npm-debugSkill
- structural-searchSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Default to standalone components.
- Very specific: line 16
Use the OnPush change detection strategy by default for performance.
- Very specific: line 17
Use @defer blocks for lazy-loading heavy or below-the-fold components [web:67].
- Distinctive: line 23
Use dashes to separate words in descriptive names, dots to separate the descriptive name from the type suffix [web:68].
- Very specific: line 27
All UI code (TS, HTML, styles) lives under src/.
- Distinctive: line 29
Prefer feature-based folder structure over type-based (group by feature, not by "components/services/pipes" folders).
- Distinctive: line 33
Use signals or RxJS consistently within a given module — check the existing pattern in the codebase before introducing a new one.
- Very specific: line 34
Avoid subscribing manually in components when the async pipe or a signal-based approach suffices.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Angular Patterns
Components
- Default to standalone components; use NgModules only when shared configuration across many components genuinely requires it [web:70][web:59].
- One component (TS + template + style) per file trio, sharing the same base name (
[name].component.ts/.html/.css) [web:59]. - Limit files to ~400 lines; if a component grows past that, split responsibilities [web:59][web:68].
- Limit individual functions/methods to ~75 lines [web:68].
- Use the
OnPushchange detection strategy by default for performance; only fall back to default detection when the component genuinely needs it [web:67]. - Use
@deferblocks for lazy-loading heavy or below-the-fold components [web:67].
Naming
- kebab-case for file names,
feature.type.tspattern (e.g.,user-profile.component.ts) [web:68][web:70]. - PascalCase for classes/interfaces, camelCase for properties and methods [web:70].
- Use dashes to separate words in descriptive names, dots to separate the descriptive name from the type suffix [web:68].
Structure
- All UI code (TS, HTML, styles) lives under
src/; config and scripts live outsidesrc/[web:59]. - One empty line between third-party imports and application imports [web:68].
- Prefer feature-based folder structure over type-based (group by feature, not by "components/services/pipes" folders).
State Management
- Use signals or RxJS consistently within a given module — check the existing pattern in the codebase before introducing a new one.
- Avoid subscribing manually in components when the
asyncpipe or a signal-based approach suffices; manual subscriptions require explicit unsubscription (e.g.,takeUntilDestroyed).
When Reviewing
Flag standalone-vs-NgModule inconsistency, missing OnPush where clearly beneficial, and manual subscriptions without cleanup, ahead of pure naming nits.
Does 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.

