From harness-claude
Scaffolds Angular components, services, guards, pipes via ng generate; configures angular.json defaults; authors and applies custom schematics for team code consistency.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Use ng generate, configure angular.json defaults, and author custom schematics for consistent code generation across a team
Provides Angular CLI commands for v20+ projects: setup with ng new, code generation for components/services/guards/pipes, dev server with ng serve, builds with ng build, testing, configuration.
Generates Angular code and provides architectural guidance for projects, components, services, reactivity with signals, forms, dependency injection, routing, SSR, ARIA accessibility, animations, Tailwind styling, testing, and CLI tooling.
Guides modern Angular 17+ development: standalone components, signals, new control flow, RxJS, DI, routing, forms. Consults patterns.md for creation, sharp_edges.md for diagnosis, validations.md for review.
Share bugs, ideas, or general feedback.
Use ng generate, configure angular.json defaults, and author custom schematics for consistent code generation across a team
angular.json to set project-wide defaults (standalone, OnPush, flat file structure)ng generate component <name> (shorthand: ng g c <name>) to scaffold components. Add flags for common options: --standalone, --change-detection OnPush, --skip-tests, --flat.angular.json under projects.<name>.schematics so flags are applied automatically without typing them every time.ng generate @angular/core:standalone to migrate an NgModule-based project to standalone components. Run the migration in three phases (convert, remove modules, switch bootstrap).ng update to update Angular and its dependencies with automatic migration schematics. Always run ng update @angular/core @angular/cli together.ng generate environments to scaffold environment files in Angular 15+.ng add @angular/material), which runs its own ng-add schematic for automatic setup.@angular-devkit/schematics package. A schematic receives a Tree (virtual file system) and SchematicContext and returns a Rule.# Common generation commands
ng generate component features/products/product-list --standalone --change-detection OnPush
ng generate service core/services/auth
ng generate guard core/guards/auth --functional
ng generate pipe shared/pipes/truncate --standalone
ng generate directive shared/directives/highlight --standalone
ng generate resolver features/products/product --functional
ng generate interceptor core/interceptors/auth --functional
# Generate with alias shortcuts
ng g c features/dashboard --standalone
ng g s services/cart
ng g p shared/pipes/format-bytes --standalone --flat
// angular.json — set schematic defaults for the project
{
"projects": {
"my-app": {
"schematics": {
"@schematics/angular:component": {
"standalone": true,
"changeDetection": "OnPush",
"style": "scss",
"flat": false
},
"@schematics/angular:directive": {
"standalone": true
},
"@schematics/angular:pipe": {
"standalone": true
},
"@schematics/angular:guard": {
"functional": true
},
"@schematics/angular:interceptor": {
"functional": true
}
}
}
}
}
# Angular version upgrade
ng update @angular/core@17 @angular/cli@17
# Migrate to standalone
ng generate @angular/core:standalone
# Phase 1: Convert components/directives/pipes to standalone
# Phase 2: Remove unnecessary NgModules
# Phase 3: Switch to bootstrapApplication
# Apply NgRx schematics
ng generate @ngrx/schematics:store AppState --root --module app.module.ts
ng generate @ngrx/schematics:feature products --module features/products/products.module.ts
// Custom schematic — basic structure
// schematics/my-feature/index.ts
import {
Rule,
SchematicContext,
Tree,
url,
apply,
template,
move,
mergeWith,
} from '@angular-devkit/schematics';
import { strings } from '@angular-devkit/core';
export function myFeature(options: { name: string; path: string }): Rule {
return (tree: Tree, context: SchematicContext) => {
const templateSource = apply(
url('./files'), // template files directory
[
template({
...strings, // dasherize, classify, camelize, etc.
...options,
name: options.name,
}),
move(options.path),
]
);
return mergeWith(templateSource)(tree, context);
};
}
angular.json structure overview:
angular.json
└── projects
└── <project-name>
├── architect
│ ├── build — build config (outputPath, assets, fileReplacements)
│ ├── serve — dev server config (port, proxy, open)
│ ├── test — test runner config (karma/jest)
│ └── lint — eslint config
└── schematics — default options for ng generate
fileReplacements for environments:
"configurations": {
"production": {
"fileReplacements": [
{ "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" }
]
}
}
Proxy configuration for dev server: Create proxy.conf.json and reference it in angular.json under serve.options.proxyConfig:
{ "/api": { "target": "http://localhost:3000", "secure": false, "changeOrigin": true } }
Custom schematic templates: Files in the files/ directory use EJS-style template syntax for file name and content interpolation:
files/
__name@dasherize__.component.ts.template
__name@dasherize__.component.html.template
<% classify(name) %> in the file content becomes MyFeature. The strings helper from @angular-devkit/core provides camelize, classify, dasherize, underscore, and capitalize.
ng add schematics: Third-party packages run setup logic on install (ng add @angular/material). They can modify angular.json, package.json, and source files automatically. Review the schematic's changes in git diff before committing.
Migration schematics: Angular major version migrations run as schematics that automatically update APIs, rename symbols, and transform code patterns. Running ng update without --force performs a dry-run first, showing what would change.
https://angular.dev/tools/cli/schematics