angular-tooling
analogjs/angular-skills
Use Angular CLI and development tools effectively for Angular v20+ projects.
What is angular-tooling?
Leverage Angular CLI for project setup, code generation, building, testing, and configuration in Angular v20+ applications. Use this skill for creating new projects, generating components/services/modules, configuring builds, running tests, and optimizing production builds.
- Create new Angular projects with customizable options (styling, routing, SSR)
- Generate components, services, directives, pipes, guards, interceptors, and other schematics
- Start development server with hot reload and configuration options
- Build applications for development and production with optimization
- Run unit and e2e tests with coverage reporting
- Configure environments, build settings, and performance budgets
How to install angular-tooling
npx skills add https://github.com/analogjs/angular-skills --skill angular-toolingHow to use angular-tooling
- 1.Run `ng new my-app` to create a new Angular v20+ project or navigate to an existing one
- 2.Use `ng generate component` (or `ng g c`) to scaffold components, services, and other artifacts
- 3.Run `ng serve` to start the development server with hot reload on localhost:4200
- 4.Execute `ng build -c production` to create an optimized production build in dist/
- 5.Run `ng test` to execute unit tests and `ng test --code-coverage` for coverage reports
- 6.Use `ng add @angular/material` or similar to install and configure Angular libraries
- 7.Modify `angular.json` to adjust build configurations, budgets, and asset paths as needed
Use cases
- Scaffolding a new Angular v20+ standalone project with routing and styling
- Generating a feature component with OnPush change detection and inline styles
- Building a production bundle with source map optimization and bundle analysis
- Running tests with code coverage to ensure component and service quality
- Adding Angular Material or SSR to an existing project via schematics
- Angular developers building v20+ applications
- Frontend engineers setting up new Angular projects
- Teams managing Angular CLI-based build pipelines
- Developers optimizing production builds and bundle sizes
angular-tooling FAQ
Use angular-tooling for standard Angular CLI projects. Don't use it for Nx workspace commands, custom Webpack configurations, or non-Angular CLI build systems like Vite standalone or esbuild direct usage.
Use `ng g c path/component-name` with flags like `--inline-template`, `--inline-style`, `--skip-tests`, or `--change-detection=OnPush`. Preview changes with `--dry-run` before applying.
Development builds include source maps and skip optimization for faster builds. Production builds use `ng build -c production` to minify, tree-shake, and apply budgets for smaller bundle sizes.
Create files in `src/environments/` (e.g., environment.ts and environment.prod.ts) with your config, then use `fileReplacements` in `angular.json` to swap them per build configuration.
Run `ng build -c production --stats-json` to generate stats, then use `npx esbuild-visualizer --metadata dist/my-app/browser/stats.json --open` to visualize bundle composition.
Full instructions (SKILL.md)
Source of truth, from analogjs/angular-skills.
name: angular-tooling description: Use Angular CLI and development tools effectively in Angular v20+ projects. Use for project setup, code generation, building, testing, and configuration. Triggers on creating new projects, generating components/services/modules, configuring builds, running tests, or optimizing production builds. Don't use for Nx workspace commands, custom Webpack configurations, or non-Angular CLI build systems like Vite standalone or esbuild direct usage.
Angular Tooling
Use Angular CLI and development tools for efficient Angular v20+ development.
Project Setup
Create New Project
# Create new standalone project (default in v20+)
ng new my-app
# With specific options
ng new my-app --style=scss --routing --ssr=false
# Skip tests
ng new my-app --skip-tests
# Minimal setup
ng new my-app --minimal --inline-style --inline-template
Project Structure
my-app/
├── src/
│ ├── app/
│ │ ├── app.component.ts
│ │ ├── app.config.ts
│ │ └── app.routes.ts
│ ├── index.html
│ ├── main.ts
│ └── styles.scss
├── public/ # Static assets
├── angular.json # CLI configuration
├── package.json
├── tsconfig.json
└── tsconfig.app.json
Code Generation
Components
# Generate component
ng generate component features/user-profile
ng g c features/user-profile # Short form
# With options
ng g c shared/button --inline-template --inline-style
ng g c features/dashboard --skip-tests
ng g c features/settings --change-detection=OnPush
# Flat (no folder)
ng g c shared/icon --flat
# Dry run (preview)
ng g c features/checkout --dry-run
Services
# Generate service (providedIn: 'root' by default)
ng g service services/auth
ng g s services/user
# Skip tests
ng g s services/api --skip-tests
Other Schematics
# Directive
ng g directive directives/highlight
ng g d directives/tooltip
# Pipe
ng g pipe pipes/truncate
ng g p pipes/date-format
# Guard (functional by default)
ng g guard guards/auth
# Interceptor (functional by default)
ng g interceptor interceptors/auth
# Interface
ng g interface models/user
# Enum
ng g enum models/status
# Class
ng g class models/product
Generate with Path Alias
# Components in feature folders
ng g c @features/products/product-list
ng g c @shared/ui/button
Development Server
# Start dev server
ng serve
ng s # Short form
# With options
ng serve --port 4201
ng serve --open # Open browser
ng serve --host 0.0.0.0 # Expose to network
# Production mode locally
ng serve --configuration=production
# With SSL
ng serve --ssl --ssl-key ./ssl/key.pem --ssl-cert ./ssl/cert.pem
Building
Development Build
ng build
Production Build
ng build --configuration=production
ng build -c production # Short form
# With specific options
ng build -c production --source-map=false
ng build -c production --named-chunks
Build Output
dist/my-app/
├── browser/
│ ├── index.html
│ ├── main-[hash].js
│ ├── polyfills-[hash].js
│ └── styles-[hash].css
└── server/ # If SSR enabled
└── main.js
Testing
Unit Tests
# Run tests
ng test
ng t # Short form
# Single run (CI)
ng test --watch=false --browsers=ChromeHeadless
# With coverage
ng test --code-coverage
# Specific file
ng test --include=**/user.service.spec.ts
E2E Tests
# Run e2e (if configured)
ng e2e
Linting
# Run linter
ng lint
# Fix auto-fixable issues
ng lint --fix
Configuration
angular.json Key Sections
{
"projects": {
"my-app": {
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/my-app",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["{ \"glob\": \"**/*\", \"input\": \"public\" }"],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
}
}
}
}
}
}
Environment Configuration
// src/environments/environment.ts
export const environment = {
production: false,
apiUrl: 'http://localhost:3000/api',
};
// src/environments/environment.prod.ts
export const environment = {
production: true,
apiUrl: 'https://api.example.com',
};
Configure in angular.json:
{
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
}
Adding Libraries
Angular Libraries
# Add Angular Material
ng add @angular/material
# Add Angular PWA
ng add @angular/pwa
# Add Angular SSR
ng add @angular/ssr
# Add Angular Localize
ng add @angular/localize
Third-Party Libraries
# Install and configure
npm install @ngrx/signals
# Some libraries have schematics
ng add @ngrx/store
Update Angular
# Check for updates
ng update
# Update Angular core and CLI
ng update @angular/core @angular/cli
# Update all packages
ng update --all
# Force update (skip peer dependency checks)
ng update @angular/core @angular/cli --force
Performance Analysis
# Build with stats
ng build -c production --stats-json
# Analyze bundle (install esbuild-visualizer)
npx esbuild-visualizer --metadata dist/my-app/browser/stats.json --open
Caching
# Enable persistent build cache (default in v20+)
# Configured in angular.json:
{
"cli": {
"cache": {
"enabled": true,
"path": ".angular/cache",
"environment": "all"
}
}
}
# Clear cache
rm -rf .angular/cache
For advanced configuration, see references/tooling-patterns.md.
Related skills
More from analogjs/angular-skills and the wider catalog.
angular-component
Create modern Angular v20+ standalone components with signals, OnPush detection, and accessibility built-in.
angular-signals
Implement synchronous, fine-grained reactive state management in Angular v20+ using signals, computed, and effects.
angular-forms
Build type-safe, reactive forms in Angular v21+ using Signal Forms API with automatic two-way binding and schema-based validation.
angular-routing
Configure routing in Angular v20+ with lazy loading, functional guards, resolvers, and signal-based parameters.
angular-http
Signal-based HTTP data fetching for Angular v20+ with resource(), httpResource(), and HttpClient.
angular-di
Implement dependency injection in Angular v20+ with inject(), tokens, and provider configuration.