The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Angular schematics are reusable instructions for changing project files. To create one, implement a rule that transforms a virtual file tree, register it in a collection, and define its inputs with a JSON schema. You can distribute a standalone collection or package schematics with an Angular library so its installation, generators, and migrations are available through Angular CLI commands.
How Angular schematics work
A schematic describes project transformations. Rather than editing the workspace directly as each operation runs, it stages proposed changes in a virtual file system. Angular’s authoring guide describes a Tree as a base set of files and a staging area. A Rule applies transformations to that tree, while individual Action operations represent file changes such as Create, Rename, Overwrite, and Delete. A SchematicContext carries execution context and utilities. Angular’s authoring guide
As an Amazon Associate I earn from qualifying purchases.
In the guide’s words, “A Rule object defines a function that takes a Tree, applies transformations, and returns a new Tree.” This tree-based workflow lets the schematic stage changes before they are merged into the real workspace; depending on the merge strategy, proposed changes can be accepted, ignored, or cause an exception. Angular: Authoring schematics
Choose how to distribute the schematic
| Approach | Best suited to | How it is exposed |
|---|---|---|
| Standalone collection | Internal tooling or transformations intended for custom projects | Develop and distribute a schematic collection; invoke a named schematic through Angular CLI’s collection syntax. |
| Library-packaged collection | Setup, code generation, or migrations that should accompany a library | Place schematic files in the library project and expose its collection through the library package’s package.json. |
Angular documents both standalone authoring and library integration. For a library, keeping schematics in the library project ties them to the package that needs them. Check generated paths and APIs against the Angular CLI and DevKit versions your library supports; the documentation examples do not establish compatibility with every release. Standalone authoring · Schematics for libraries
#1 Best Overall
Create a schematic collection
Set up the project
For a standalone collection, use the Schematics CLI to develop the collection. When authoring for a library, Angular recommends creating the schematic files inside the library project so they can be packaged with it. Angular: Authoring schematics · Angular: Schematics for libraries
Register named schematics
A collection’s collection.json maps schematic names to their factory entry points and descriptions, and can reference an option schema. For example, a library collection can register an ng-add schematic with a factory and schema:
Rank #2
{
"ng-add": {
"factory": "./ng-add/index#ngAdd",
"schema": "./ng-add/schema.json"
}
}
The library’s package.json then exposes the collection through its schematics field. The path and entry-point names above are documentation examples; adapt and verify them for the package layout and supported Angular/DevKit versions you use. Angular: Schematics for libraries
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Implement a rule factory
A schematic entry point exports a factory function that accepts options and returns a Rule. The rule receives a Tree, stages transformations, and returns the resulting tree. Keep file operations within this Tree-based workflow so the schematic participates in Angular’s staged change process. The exact implementation depends on what files the schematic should create or modify. Angular: Authoring schematics
Rank #3
Define and validate options
Use a schematic’s schema.json to describe caller inputs, their types, defaults, and constraints. Angular’s examples include string, boolean, and enumerated options. Add x-prompt when an interactive question is useful; schema constraints validate the resulting input. This keeps the supported interface explicit whether values come from a prompt or a CLI invocation. Angular: Schematics for libraries
Match the schematic to the CLI workflow
| Workflow | Purpose |
|---|---|
ng add |
Install or configure a library in a project. |
ng generate |
Scaffold an artifact, such as project code or files. |
ng update |
Adjust a project for a library release or breaking change. |
Choose the schematic type according to the task it performs: initialization belongs in the add workflow, reusable scaffolding in generation, and release-related project changes in update migrations. A library collection can expose these entry points through its package. Angular: Schematics for libraries
Rank #4
Run a schematic with Angular CLI
Angular CLI’s default ng generate subcommands come from the @schematics/angular collection. Workspaces can configure additional collections with the schematicCollections workspace option. A particular schematic can be invoked using collection-and-name syntax; use the collection and schematic names registered by the package you are invoking. Angular CLI: generate
For a library, exposing the collection in its package metadata makes its named entry points available to the corresponding CLI workflows. Confirm the package’s published files and supported CLI versions when preparing a collection for distribution. Angular: Schematics for libraries
Review staged changes and verify compatibility
- Keep transformations expressed as rules operating on the schematic’s
Tree. - Review the proposed tree changes and the configured merge behavior before relying on the schematic in a project workflow.
- Check collection paths, schemas, and package metadata against the Angular and DevKit versions your library supports; current documentation examples are not a version-specific compatibility guarantee.
Angular’s authoring documentation explains the virtual-tree and merge model, while its library guide shows how a package can connect collections to CLI workflows. Authoring schematics · Schematics for libraries
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




