angular-schematics

Installation
SKILL.md

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)]);
}
Related skills
Installs
122
GitHub Stars
6
First Seen
Apr 2, 2026