angular-schematics
Angular Schematics
Version: Angular 21 (2025) Tags: Schematics, Generators, CLI, Code Generation
References: Schematics Guide • @schematics/angular
Best Practices
- Create schematic
npm install -g @angular-devkit/schematics-cli
schematics schematics .:my-schematic
- Create rule
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
export function myScheme(options: any): Rule {
return (tree: Tree, context: SchematicContext) => {
tree.create(options.path + '/file.ts', 'content');
return tree;
};
}
- Use templates
import { apply, url, template } from '@angular-devkit/schematics';
export function myScheme(options: any): Rule {
const templateSource = apply(url('./files'), [
template({ ...options }),
move(options.path)
]);
return chain([mergeWith(templateSource)]);
}
More from oguzhan18/angular-ecosystem-skills
angular-tailwind
ALWAYS use when working with Angular and Tailwind CSS, Tailwind configuration, utility-first CSS, or styling Angular applications with Tailwind.
139angular-animations
>-
137rxjs
ALWAYS use when working with RxJS Observables, operators, and reactive patterns in Angular applications.
135angular-material
ALWAYS use when working with Angular Material components, CDK, or Material Design in Angular applications.
131angular-security
ALWAYS use when working with Angular Security, XSS prevention, CSRF protection, Content Security Policy, or sanitization in Angular applications.
130angular-bootstrap
ALWAYS use when working with Angular Bootstrap, ng-bootstrap, Bootstrap components in Angular, or Bootstrap 5 integration.
129