Skip to content

Check Angular code.

  1. 01const doctor = scan('angular.json');
  2. 02doctor.rules = 81; // six families
  3. 03if (hostBindings) throw 'prefer-host-bindings';
  4. 04doctor.score = 81;
  5. 05write('angular-doctor-report.md');
  6. 06// fix order: migrations → style guide → the rest
  7. 07repeat(doctor.scan).on('--scope changed');

Angular Doctor scans your Angular or Nx workspace, scores it from 0 to 100, and writes a report you can fix from.

A real scan of the sample workspace.

npx @abiramcodes/angular-doctor@latest
  • 20.19+

    Node.js

    The package requires this runtime or newer.

  • 15+

    Angular

    Angular 17+ gets every check. 15 and 16 run in compat mode.

  • 4

    Scopes

    full, changed, files, and contextual.

  • 1.5

    Per file

    An error costs 1.5 in each file. A warning costs 0.75 once. A note costs nothing.

Six families, one meter.

81 built-in checks in six categories. Each family is a kind of Angular habit the scan looks for.

  • correctness

    14

    Does the code do what it says? Control flow, subscriptions, strict mode, templates.

    prefer-take-until-destroyedtypescript-strictstrict-templates

  • performance

    14

    Angular's runtime budget. Change detection, images, zone.js, routing.

    missing-for-trackzone-jsprefer-ng-optimized-image

  • maintainability

    34

    The style guide, enforced. Naming, file sets, host bindings, lifecycle, signals.

    one-concept-per-fileprefer-host-bindingsprefer-signal-forms

  • security

    5

    Secrets and injection. Client code, env files, innerHTML, target="_blank".

    client-secretenv-fileinner-html

  • accessibility

    4

    Keyboard and screen reader. Alt text, labels, focus order, click handlers.

    img-altcontrol-missing-labelclick-without-keyboard

  • hygiene

    10

    Dead weight and drift. Unused imports and exports, file naming, project layout.

    unused-exportfile-hyphen-caseproject-layout

The report is the prescription.

When anything is found, the scan writes angular-doctor-report.md — a self-contained brief for you or your agent.

When a scan finds something, it writes a self-contained Markdown report: the score, official migrations, a fix order, and every finding with its location and, where the rule provides one, a suggested fix.

The report is written for you or your agent. Re-run with --verbose --scope changed after edits and it covers only what changed.

Error

angular-doctor/prefer-host-bindings

src/app/style-violations/host-slider.ts:8

@HostListener is backwards-compatible. Use the host option instead.

before

@HostListener('keydown', ['$event'])
updateValue(event: KeyboardEvent) {}

suggested fix

host: {
  '(keydown)': 'updateValue($event)',
}
angular-doctor-report.mdsample
# Angular Doctor report

> Self-contained findings for coding agents. Re-run `npx @abiramcodes/angular-doctor@latest --verbose` after fixes.

## Summary

- **Health score:** 81/100
- **Errors:** 9
- **Warnings:** 15
- **Infos:** 5
- **Project:** angular-doctor (angular-cli)
- **Angular:** 22.2.0
- **Scan duration:** 299ms

### angular-doctor/prefer-host-bindings (error) — 1 occurrence

- **Message:** @HostListener is backwards-compatible. Use the host option instead.
- **Suggested fix:** Move the binding into the host object of @Component or @Directive.
- **Locations:**
  - `src/app/style-violations/host-slider.ts:8:3`

Start with one command.

Every command accepts --colors default, pastel, or velvet. The full flag reference lives in the docs.

Read the command reference
  • npx @abiramcodes/angular-doctor@latest --verbose --scope changed

    Scan what git shows as changed. The command to run after an edit.

  • npx @abiramcodes/angular-doctor@latest --category security

    Print one category. The score is still the full scan.

  • npx @abiramcodes/angular-doctor@latest --json

    Print one JSON object for another tool to read.

  • npx @abiramcodes/angular-doctor@latest rules list

    List the built-in checks grouped by category.

  • npx @abiramcodes/angular-doctor@latest install

    Copy the agent skill into your project.

Run it where the code lands.

Write a GitHub Actions workflow that scans pushes to main and every pull request. Add --scope changed to report local working-tree changes, or --json to feed another job.

Set up CI
npx @abiramcodes/angular-doctor@latest ci install

Run it on your workspace.

Scan the directory you are in.

npx @abiramcodes/angular-doctor@latest
Open the docs