agentleFS
angularangular/angular-cli/AGENTS.md

angular-cli

AGENTS.md27k starsChanged 2 years agoMITView on GitHub

This is the source code for the Angular CLI and related build tooling. This guide outlines standard practices for AI agents working in this repository. - NEVER use or fallback to os.tmpdir(). Bazel executes tests in hermetic sandboxes and sets TEST_TMPDIR to an isolated, sandboxed directory. Using os.tmpdir() can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox. - Unit & Integration Tests: - Run all unit and integration tests: pnpm bazel test //packages/... - Run a…

  • Reads credentials

We split this AGENTS.md into the rules it gives an agent

16 rules. About 0 are common, 1 is distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use pnpm for package management.

    line 9
  2. Very specific:

    Use pnpm bazel test //target to run tests.

    line 10
  3. Very specific:

    Always use the node: protocol for Node.js built-in imports (e.g., node:fs, node:path, node:assert).

    line 28
  4. Very specific:

    Prefer named imports (e.g., import { mkdtemp } from 'node:fs') or default imports (import fs from 'node:fs') instead of namespace imports …

    line 29
  5. Very specific:

    Use type-only imports (import type { ...

    line 30
  6. Very specific:

    Prefer ECMAScript private fields (#field) over TypeScript private keywords for encapsulated state.

    line 32
  7. Very specific:

    NEVER: use or fallback to os.tmpdir().

    line 53
  8. Very specific:

    Run all unit and integration tests: pnpm bazel test //packages/...

    line 55
  9. Very specific:

    Run a specific unit test target (e.g., pnpm bazel test //packages/angular/build:test).

    line 56
  10. Very specific:

    Run a specific builder integration test target (e.g., pnpm bazel test //packages/angular/build:library_integration_tests or pnpm bazel test …

    line 57
  11. Very specific:

    Run tests without sharding when isolating or debugging: use --config=no-sharding with a specific test target (e.g., pnpm bazel test …

    line 61
  12. Very specific:

    Do not use this flag when running broad test suites (such as //packages/...), as executing tests without sharding takes significantly …

    line 64
  13. Very specific:

    Run subset of E2E tests: pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="<filter>"

    line 66
  14. Very specific:

    Use the gh CLI (GitHub CLI) for creating and managing pull requests.

    line 70
  15. Very specific:

    When addressing review feedback, ALWAYS use fixup commits (git commit --fixup <commit>) instead of amending existing commits.

    line 72
  16. Distinctive:

    Only use fixup commits for changes that directly belong to the target commit.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

This is the source code for the Angular CLI and related build tooling. This guide outlines standard practices for AI agents working in this repository.

Environment

  • Use pnpm for package management.
  • Use pnpm bazel test //target to run tests.

Key Documentation

  • Developer Guide: definitive guide for building, debugging, and running test targets.
  • Contributing Guide: general contribution workflows and guidelines.
  • Commit Guidelines: format for commit messages and PR titles.

Building

  • Make a local build of all packages:
    pnpm build --local

Coding Practices

  • Imports:
    • Always use the node: protocol for Node.js built-in imports (e.g., node:fs, node:path, node:assert).
    • Prefer named imports (e.g., import { mkdtemp } from 'node:fs') or default imports (import fs from 'node:fs') instead of namespace imports (import * as fs).
    • Use type-only imports (import type { ... }) when importing types to avoid runtime side-effects.
  • Classes:
    • Prefer ECMAScript private fields (#field) over TypeScript private keywords for encapsulated state.

Testing

  • Temporary Directories (TEST_TMPDIR):
    • Tests in this repository only run in Bazel. ALWAYS use process.env['TEST_TMPDIR'] and assert that it is set:
      import assert from 'node:assert';
      import { mkdtemp } from 'node:fs/promises';
      import { join } from 'node:path';
      
      describe('...', () => {
        let tempRoot: string;
      
        beforeAll(async () => {
          const baseTmpDir = process.env['TEST_TMPDIR'];
          assert(baseTmpDir, 'TEST_TMPDIR is not set');
          tempRoot = await mkdtemp(join(baseTmpDir, 'angular-cli-test-'));
        });
      });
    • NEVER use or fallback to os.tmpdir(). Bazel executes tests in hermetic sandboxes and sets TEST_TMPDIR to an isolated, sandboxed directory. Using os.tmpdir() can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox.
  • Unit & Integration Tests:
    • Run all unit and integration tests: pnpm bazel test //packages/...
    • Run a specific unit test target (e.g., pnpm bazel test //packages/angular/build:test). Note that package :test targets may exclude builder integration tests (such as specs under **/builders/**/tests/**).
    • Run a specific builder integration test target (e.g., pnpm bazel test //packages/angular/build:library_integration_tests or pnpm bazel test //packages/angular/build:application_integration_tests).
    • Query all test targets: pnpm bazel query "tests(//packages/...)"
    • Find the exact test target for a specific spec file (using its workspace-relative path, which Bazel resolves as a source file target): pnpm bazel query "kind(jasmine_test, rdeps(//packages/..., <relative/path/to/file_spec.ts>))"
    • Focus specific tests when debugging: use fdescribe() and fit(). NEVER commit focused tests to the repository.
    • Run tests without sharding when isolating or debugging: use --config=no-sharding with a specific test target (e.g., pnpm bazel test //packages/angular/build:library_integration_tests --config=no-sharding). This disables test sharding (--test_sharding_strategy=disabled) and flaky test retries (--flaky_test_attempts=1). This is especially useful when isolating test runs or debugging with focused tests (fit/fdescribe) to avoid empty shard failures and unnecessary re-runs. Do not use this flag when running broad test suites (such as //packages/...), as executing tests without sharding takes significantly longer.
  • End-to-End Tests:
    • Run subset of E2E tests: pnpm bazel test //tests:e2e_node22 --config=e2e --test_filter="<filter>"

Pull Requests

  • Use the gh CLI (GitHub CLI) for creating and managing pull requests.
  • Fixup Commits:
    • When addressing review feedback, ALWAYS use fixup commits (git commit --fixup <commit>) instead of amending existing commits. This preserves commit history during review and allows reviewers to easily see incremental changes.
    • Only use fixup commits for changes that directly belong to the target commit. Unrelated changes must be made in a separate commit with their own commit message, not as a fixup commit.
    • Fixup commits are automatically squashed when merging with pnpm ng-dev pr merge or optionally when rebasing with pnpm ng-dev pr rebase <pr>.
  • Use pnpm ng-dev pr commands:
    • pnpm ng-dev pr rebase <pr>: Rebase a PR branch on its target branch and optionally squash fixup commits.
    • pnpm ng-dev pr merge <pr>: Merge an approved PR into its targeted branches.

Download now (ZIP)

Trending

Quiet since September.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the angular/angular-cli repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about angular/angular-cli

The biggest 5 of 74 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 74

Talked about on Stack Overflow, YouTube, GitHub and Hacker News (74 times).

On Stack Overflow · 30

25 more on Stack Overflow

On YouTube · 23

18 more on YouTube

On GitHub · 16

11 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.