Skip to content
Skills Library
Programming · Planning

angular-structure

/angular-structure

Angular enterprise architecture: folder structure, feature slices, signals, standalone components, control flow, @defer, zoneless, NgRx SignalStore, httpResource, typed forms, SSR/hydration, Vitest/Playwright, Tailwind, Nx. Use when scaffolding an Angular project, reviewing its structure, choosing state management or data fetching, or making architectural decisions in an Angular/TypeScript codebase.

Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
21
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Angular enterprise architecture: folder structure, feature slices, signals, standalone components, control flow, @defer, zoneless, NgRx SignalStore, httpResource, typed forms, SSR/hydration, Vitest/Playwright, Tailwind, Nx. Use when scaffolding an Angular project, reviewing its structure, choosing state management or data fetching, or making architectural decisions in an Angular/TypeScript codebase.

Original author description

Angular enterprise architecture: folder structure, feature slices, signals, standalone components, control flow, @defer, zoneless, NgRx SignalStore, httpResource, typed forms, SSR/hydration, Vitest/Playwright, Tailwind, Nx. Use when scaffolding an Angular project, reviewing its structure, choosing state management or data fetching, or making architectural decisions in an Angular/TypeScript codebase.

How it works

  1. Load on demand
  2. 1) High-Level Structure
  3. 2) Core App Wiring
  4. Summary Table
  5. Recommended Stack (2026)
Original SKILL.md headings · 151 lines, 685 words
SKILL.md preview
---
name: angular-structure
description: "Angular enterprise architecture: folder structure, feature slices, signals, standalone components, control flow, @defer, zoneless, NgRx SignalStore, httpResource, typed forms, SSR/hydration, Vitest/Playwright, Tailwind, Nx. Use when scaffolding an Angular project, reviewing its structure, choosing state management or data fetching, or making architectural decisions in an Angular/TypeScript codebase."
license: MIT
metadata:
  author: Marwen Amamou | amamoumarwen@gmail.com
  version: "1.0.0"
---

# Angular Enterprise Architecture Guidelines (2026)

Feature-first, enterprise-grade Angular architecture that scales across teams and codebases. Assumes **TypeScript strict**, modern tooling (**esbuild + Vite**, Angular 21+), and emphasizes **feature isolation**, **signals-first reactivity**, **performance**, and **operability**.

## Load on demand

The core rules in this file always apply. Read a reference below **only when the task needs it**:

| Topic | File |
| :-- | :-- |
| 3) Shared Layer (Stateless & Reusable) | [references/3-shared-layer-stateless-reusable.md](references/3-shared-layer-stateless-reusable.md) |
| 4) Feature Slices (DDD-style) | [references/4-feature-slices-ddd-style.md](references/4-feature-slices-ddd-style.md) |
| 5) Signals — Reactivity Model | [references/5-signals-reactivity-model.md](references/5-signals-reactivity-model.md) |
| 6) New Control Flow Syntax | [references/6-new-control-flow-syntax.md](references/6-new-control-flow-syntax.md) |
| 7) Deferrable Views (`@defer`) | [references/7-deferrable-views-defer.md](references/7-deferrable-views-defer.md) |
| 8) Data Fetching | [references/8-data-fetching.md](references/8-data-fetching.md) |
| 9) State Management Strategy | [references/9-state-management-strategy.md](references/9-state-management-strategy.md) |
| 10) Routing | [references/10-routing.md](references/10-routing.md) |
| 11) Forms | [references/11-forms.md](references/11-forms.md) |
| 12) Styling | [references/12-styling.md](references/12-styling.md) |
| 13) Performance | [references/13-performance.md](references/13-performance.md) |
| 14) Security & Compliance | [references/14-security-compliance.md](references/14-security-compliance.md) |
| 15) Server-Side Rendering & Hydration | [references/15-server-side-rendering-hydration.md](references/15-server-side-rendering-hydration.md) |
| 16) Testing | [references/16-testing.md](references/16-testing.md) |
| 17) Build Tools | [references/17-build-tools.md](references/17-build-tools.md) |
| 18) Tooling & Governance | [references/18-tooling-governance.md](references/18-tooling-governance.md) |
| 19) CI/CD & Quality Gates | [references/19-ci-cd-quality-gates.md](references/19-ci-cd-quality-gates.md) |
| 20) API Boundary & Models | [references/20-api-boundary-models.md](references/20-api-boundary-models.md) |
| 21) Example: Users Feature | [references/21-example-users-feature.md](references/21-example-users-feature.md) |
| 22) Layout Pattern | [references/22-layout-pattern.md](references/22-layout-pattern.md) |

---

## 1) High-Level Structure

```
src/
  app/
    app.component.ts              # root component (thin shell)
    app.config.ts                 # application providers
    app.routes.ts                 # top-level route definitions
    core/                         # singleton services, guards, interceptors
      auth/
        auth.service.ts
        auth.guard.ts
        auth.interceptor.ts
      error/
        global-error-handler.ts
      layout/
        header.component.ts
        sidebar.component.ts
        footer.component.ts
    shared/                       # reusable & stateless UI/utilities
      ui/                         # presentational components (buttons, cards, table)
      directives/                 # generic directives
      pipes/                      # generic pipes
      utils/                      # pure TS helpers
      styles/                     # design tokens, mixins, global CSS
    features/                     # domain-driven feature slices
      users/
        user-list/
          user-list.component.ts
        user-detail/
          user-detail.component.ts
        user-form/
          user-form.component.ts
        data-access/
          users.service.ts
          users.store.ts
          users.model.ts
        users.routes.ts
  environments/
    environment.ts
    environment.prod.ts
  assets/
  styles/
    tokens.css
    globals.css
  main.ts                         # app bootstrap
```

**Philosophy**
- Organize by **feature/domain**, not by technical layer.
- Keep **shared** stateless and UI-only; keep **data-access** inside the owning feature.
- Prefer **co-location**: tests, styles, stories next to implementation.
- **Standalone components** are the default — no `NgModule` for new code.

> **Nx Monorepo**: For large orgs, extract features into domain libraries (`packages/products/feat-product-list`, `packages/products/data-access`) and enforce module boundaries via tags (`type:feature`, `type:shared`, `scope:products`).

---

## 2) Core App Wiring

- **Bootstrap**: `app.config.ts` hosts all root providers (`provideRouter`, `provideHttpClient`, `provideZonelessChangeDetection`, etc.).
- **Routing**: Standalone routes in `app.routes.ts` with lazy-loaded feature routes.
- **Layout**: App chrome (header + sidebar + footer) lives in `core/layout/`, not in `shared` or features. Use `<router-outlet />` for content slots.
- **Errors**: Global `ErrorHandler` + error reporting (Sentry, etc.).
- **Runtime config**: Load from `/config.json` or environment files; expose via a typed service.

**Example**
```typescript
// app.config.ts
export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(appRoutes, withComponentInputBinding()),
    provideHttpClient(
      withInterceptors([authInterceptor, errorInterceptor]),
      withFetch()
    ),
    provideZonelessChangeDetection(),
    provideClientHydration(withEventReplay(), withIncrementalHydration()),
  ],
};
```

```typescript
// main.ts
bootstrapApplication(AppComponent, appConfig);
```

---

## Summary Table

| Layer | Purpose | Rules |
|---|---|---|
| **core/** | Singletons (auth, layout, error handling, interceptors) | App-wide, instantiated once |
| **shared/** | Stateless UI + generic directives/pipes/utils | No data fetching/HTTP |
| **features/** | Domain UI + data-access + local store | Export minimally, isolate dependencies |
| **environments/** | Build-time config | Non-sensitive flags only |

## Recommended Stack (2026)

| Concern | Tool |
|---|---|
| Framework | **Angular 21+** (standalone, zoneless) |
| Language | **TypeScript 5.8+ strict** |
| Reactivity | **Signals** (`signal`, `computed`, `linkedSignal`, `effect`) |
| Routing | **Standalone routes** with `loadChildren` / `loadComponent` |
| Data fetching | **httpResource** (reads) + **HttpClient** (mutations) |
| Client state | **NgRx SignalStore** (complex) / plain signals (simple) |
| Forms | **Typed Reactive Forms** (`NonNullableFormBuilder`) |
| Styling | **Tailwind CSS v4** + **Angular CDK** |
| Unit testing | **Vitest** + **TestBed** |
| E2E testing | **Playwright** |
| API mocking | **MSW** or **HttpTestingController** |
| Build | **esbuild + Vite** (Angular CLI default) |
| Monorepo | **Nx** |
| SSR | **Angular SSR** with incremental hydration |
Files in this package (21)
  • SKILL.md 7 KB
  • references/10-routing.md 2 KB
  • references/11-forms.md 1 KB
  • references/12-styling.md 1 KB
  • references/13-performance.md 1 KB
  • references/14-security-compliance.md 1 KB
  • references/15-server-side-rendering-hydration.md 1 KB
  • references/16-testing.md 1 KB
  • references/17-build-tools.md 1 KB
  • references/18-tooling-governance.md 1 KB
  • references/19-ci-cd-quality-gates.md 1 KB
  • references/20-api-boundary-models.md 1 KB
  • references/21-example-users-feature.md 1 KB
  • references/22-layout-pattern.md 1 KB
  • references/3-shared-layer-stateless-reusable.md 1 KB
  • references/4-feature-slices-ddd-style.md 1 KB
  • references/5-signals-reactivity-model.md 2 KB
  • references/6-new-control-flow-syntax.md 1 KB
  • references/7-deferrable-views-defer.md 1 KB
  • references/8-data-fetching.md 2 KB
  • references/9-state-management-strategy.md 2 KB

Versions

The database has no other skills named angular-structure.

Database snapshot: 13.11.2026 · package version a43cdfeb3ed0 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100angular
    Use when building, refactoring, or debugging Angular (v20/21+): standalone components, signals, zoneless change detection, @if/@for/@defer control flow, inject() DI, resource()/httpResource(), RxJS interop, NgRx SignalStore, ng CLI. NOT React (that is react), NOT Next.js (that…
  • 100web-state-ngrx-signalstore
    NgRx SignalStore patterns for Angular state management. Use when managing client state with Angular Signals, composing store features, handling entities, or integrating RxJS effects.
  • 90angular-architecture
    Use this skill when the user says 'Angular structure', 'Angular architecture', 'Angular folder', 'Angular standalone', 'Angular signals', 'Angular clean arch', 'Angular feature', 'Angular project layout', 'NgModule vs standalone', or when structuring an Angular application…
  • 100angular-state-management
    Implement application state with Angular Signals, computed derivations, and NgRx Signal Store. Use when implementing reactive state with signal(), computed(), effect(), or @ngrx/signals in Angular.
  • 90angular-developer
    Generates Angular code and provides architectural guidance. Trigger when creating projects, components, services, or HTTP communication, or for best practices on reactivity (signals, linkedSignal, resource, httpResource), queries and content projection, forms, dependency…
  • 100angular-architect
    Use when building Angular 17+ applications with standalone components or signals. Invoke for enterprise apps, RxJS patterns, NgRx state management, performance optimization, advanced routing.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.