Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs: add angular-contributor-helper skill
Adds a skill that helps contributors work on the Angular framework by checking their work against contribution guidelines and flagging issues. Includes reference docs for commit conventions, coding standards, building and testing, Bazel, public API surface, and fixup commits.
  • Loading branch information
erkamyaman committed Apr 16, 2026
commit 039bc29af27ac8a6839d07d4333a38fadcbe9f78
1 change: 1 addition & 0 deletions skills/dev-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The Angular skills are designed to help coding agents create applications aligne

- **`angular-developer`**: Generates Angular code and provides architectural guidance. Useful for creating components, services, or obtaining best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling, testing, or CLI tooling.
- **`angular-new-app`**: Creates a new Angular app using the Angular CLI. Provides important guidelines for effectively setting up and structuring a modern Angular application.
- **`angular-contributor-helper`**: Helps contributors work on the Angular framework source code. Provides references for commit conventions, coding standards, building and testing, Bazel, public API surface, and fixup commits.

## Using Agent Skills

Expand Down
45 changes: 45 additions & 0 deletions skills/dev-skills/angular-contributor-helper/SKILL.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: angular-contributor-helper
description: Helps Angular contributors work on the Angular framework source code. Trigger when writing fixes, refactors, or improvements, opening issues, preparing branches, writing code that follows Angular internal conventions, running tests, and preparing PRs.
license: MIT
metadata:
author: Copyright 2026 Google LLC
version: '1.0'
---

# Angular Contributor Guidelines

1. Always read the relevant source files before making changes. Understand the existing patterns, naming conventions, and architecture of the package you're working in.

2. Before opening an issue or PR, search the issue tracker and existing PRs to check if someone has already reported or addressed the same thing.

3. Always ask before committing. Do not commit unless the user explicitly asks.

## Codebase Structure

The Angular monorepo has its packages under `packages/` and documentation under `adev/`. List the `packages/` directory to see all available packages. Each package typically has `src/`, `test/`, `BUILD.bazel`, and a `public_api.ts` or `index.ts` for its public API surface.

## Contributing Workflow

When helping an Angular contributor, consult the following references, check their work against the guidelines, and flag any issues:

- **Commit Messages**: Remind the contributor to follow the strict commit message format. Read [commit-message-guidelines.md](references/commit-message-guidelines.md)
- **Building and Testing**: Guide the contributor through prerequisites, building the repo, running tests, and formatting. Read [building-and-testing.md](references/building-and-testing.md)
- **Public API Surface**: If the change affects public API, let the contributor know about golden file updates. Read [public-api-surface.md](references/public-api-surface.md)
- **Coding Standards**: Remind the contributor of Angular's API design, naming, TypeScript practices, and testing style. Read [coding-standards.md](references/coding-standards.md)
- **Building with Bazel**: Help the contributor with Bazel commands, debugging tests, and diagnosing build issues. Read [building-with-bazel.md](references/building-with-bazel.md)
- **Fixup Commits**: When addressing review feedback, guide the contributor on using fixup commits. Read [fixup-commits.md](references/fixup-commits.md)

## PR Quality Expectations

When helping a contributor prepare a PR, remind them of the Angular team's minimum expectations ([full guidelines](https://github.com/angular/angular/blob/main/CONTRIBUTING.md)):

1. Search [existing PRs](https://github.com/angular/angular/pulls) first to avoid duplicating work.
2. Clearly describe the problem or feature. Issues require a minimal reproduction.
3. Discuss design in an issue first — PRs are not the place for design work.
4. The change should improve code quality or a feature.
5. Micro optimizations need benchmark validation.
6. Don't PR feature requests not labeled "help wanted" — they usually need design work first.
7. Changes must be well tested.
8. Sign the [CLA](https://cla.developers.google.com/about/google-individual) before sending PRs.
9. Be aware that breaking changes may block a PR due to the level of churn they cause.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Building and Testing Angular

[Full source](https://github.com/angular/angular/blob/main/contributing-docs/building-and-testing-angular.md)

## Prerequisites

- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org) (version specified in `.nvmrc`)
- [pnpm](https://pnpm.io/) (version specified in `package.json` engines field)
- On Windows: [MSYS2](https://www.msys2.org/) for Bazel, or consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)

## Development in a Container

You can use the provided [Dev Container](https://containers.dev/) configuration:

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop), [VS Code](https://code.visualstudio.com/), and the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
2. Open the repo in VS Code and run **Dev Containers: Reopen in Container** from the Command Palette.

## Getting the Sources

```shell
git clone git@github.com:<github-username>/angular.git
cd angular
git remote add upstream https://github.com/angular/angular.git
```

## Installing Dependencies

```shell
pnpm install
```

## Building

```shell
pnpm build
```

Results go in `dist/packages-dist`.

## Running Tests

Bazel is the primary build and test tool. Run all package tests before submitting a PR:

```shell
pnpm test //packages/...
```

For package-specific tests, refer to Bazel targets in each package's `BUILD.bazel`.

### Testing Against a Local Project

```shell
pnpm ng-dev misc build-and-link <path-to-local-project-root>
```

Disable CLI cache when testing local changes:

```shell
ng cache disable
```

When invoking the Angular CLI locally, use the `--preserve-symlinks` flag:

```shell
node --preserve-symlinks --preserve-symlinks-main node_modules/@angular/cli/lib/init.js serve
```

PRs can only be merged if code is properly formatted and all tests pass. CI will run affected tests even if you forget to run them locally.

## Formatting Source Code

Angular uses [prettier](https://prettier.io). CI will fail if code is not properly formatted.

```shell
pnpm ng-dev format changed [shaOrRef] # format files changed since sha/ref (default: main)
pnpm ng-dev format all # format all source code
pnpm ng-dev format files <files..> # format specific files
```

## Linting

```shell
pnpm lint
```

## IDE Support (Bazel)

- **VS Code**: Install the [Bazel extension](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel)
- **WebStorm/IntelliJ**: Install the [Bazel plugin](https://plugins.jetbrains.com/plugin/8609-bazel)
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Building Angular with Bazel

[Full source](https://github.com/angular/angular/blob/main/contributing-docs/building-with-bazel.md)

This is for developing Angular itself, not for building Angular applications with Bazel.

## Installation

Angular installs Bazel from npm via [`@bazel/bazelisk`](https://github.com/bazelbuild/bazelisk). Run Bazel with:

```shell
pnpm bazel
```

## Configuration

- `WORKSPACE` file marks the root as a Bazel project.
- `.bazelrc` contains checked-in options.
- To hide `bazel-*` symlinks, add `build --symlink_prefix=/` to `.bazelrc`.

## Building

```shell
pnpm bazel build packages/core # build a package
pnpm bazel build packages/... # build all packages
```

Use [ibazel](https://github.com/bazelbuild/bazel-watcher) for watch mode.

## Testing

```shell
pnpm test packages/core/test:test # test package in node
pnpm test packages/core/test:test_web # test package in karma
pnpm test packages/... # test all packages
pnpm test //packages/core/... # all tests for one package
```

### Test Flags

- `--config=debug`: build and launch in debug mode
- `--test_arg=--node_options=--inspect=9228`: change inspector port
- `--test_tag_filters=<tag>`: filter tests by tag

## Debugging Node Tests in Chrome DevTools

1. Open [chrome://inspect](chrome://inspect)
2. Click "Open dedicated DevTools for Node"
3. Run: `pnpm bazel test packages/core/test:test --config=debug`
4. Click "Resume script execution" to hit `debugger` statements or breakpoints

To inspect generated templates, find the component in the call stack and click the source map link.

## Debugging Node Tests in VSCode

Add to `launch.json`:

```json
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"port": 9229,
"restart": true,
"timeout": 600000,
"sourceMaps": true,
"skipFiles": ["<node_internals>/**"],
"sourceMapPathOverrides": {
"?:*/bin/*": "${workspaceFolder}/*"
},
"resolveSourceMapLocations": ["!**/node_modules/**"]
}
```

Then run `pnpm bazel test <target> --config=debug` and attach the debugger.

## Debugging Karma Tests

1. Run with `_debug` suffix: `pnpm bazel run packages/core/test:test_web_debug`
2. Open [http://localhost:9876/debug.html](http://localhost:9876/debug.html)
3. Use browser DevTools to debug (use `fit`/`fdescribe` to focus tests)

## Debugging Bazel Rules

Open external directory:

```shell
open $(pnpm -s bazel info output_base)/external
```

See subcommands:

```shell
pnpm bazel build //packages/core:package -s
```

## Diagnosing Slow Builds

Generate a profile:

```shell
pnpm bazel build //packages/compiler --profile build.profile
```

Analyze in console:

```shell
pnpm bazel analyze-profile build.profile
pnpm bazel analyze-profile build.profile --task_tree ".*" --task_tree_threshold 5000
```

Or generate an HTML report:

```shell
pnpm bazel analyze-profile build.profile --html --html_details --html_histograms
```

## Stamping

Bazel supports including version control information in built artifacts. Angular configures this via:

1. `tools/bazel_stamp_vars.js` runs `git` commands to generate versioning info.
2. `.bazelrc` registers this script as the `workspace_status_command`.

## Remote Cache

Bazel assigns a content-based hash to all action inputs as the cache key. Because builds are hermetic, it can skip executing an action if the hash is already cached. Currently only used on CI. Angular core developers can enable remote caching for local builds.

## Known Issues

### Windows

- `bazel run` only works with non-test targets. Use `bazel test` instead.
- Ensure `C:\msys64\usr\bin` is in the **system** PATH (not user PATH).

### Xcode (macOS)

If you get `Xcode version must be specified` errors:

```shell
bazel clean --expunge
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
pnpm bazel build //packages/core
```

In VSCode, add `"files.exclude": {"bazel-*": true}` to settings to avoid conflicts.
Loading
Loading