Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
653d66e
ci: add contributor guidelines, agent skills and commit message checks
erkamyaman Sep 28, 2026
8930547
ci: match the commit rules to the repository history
erkamyaman Sep 30, 2026
c68906f
ci: run the commit message check in warn-only mode
erkamyaman Sep 30, 2026
0dd1c92
ci: make the skills check work from any checkout path
erkamyaman Sep 30, 2026
322577e
ci: keep the git hooks from staging work you left out
erkamyaman Sep 30, 2026
9a38893
docs: point the contributor guides and skills at the docs site
erkamyaman Sep 30, 2026
f79f407
docs: add a security policy and a code of conduct
erkamyaman Sep 30, 2026
fcaaa75
ci: route issues, reviews and sponsorship through GitHub
erkamyaman Sep 30, 2026
4410d18
ci: label pull requests by area and group release notes by label
erkamyaman Sep 30, 2026
c2ee7eb
docs: recognize contributors with all-contributors
erkamyaman Sep 30, 2026
11164b7
ci: ask pull requests to update the docs with the code
erkamyaman Sep 30, 2026
0dcbf2a
ci: ask for the setup in bug reports and the docs impact in feature r…
erkamyaman Sep 30, 2026
018d064
fix(ci): check git prefixes in pull request titles and restage files …
erkamyaman Sep 30, 2026
33079f4
Merge remote-tracking branch 'upstream/main' into ci/contributor-guid…
erkamyaman Sep 30, 2026
48fed0f
ci: check skill references into apps/ now that the docs site exists
erkamyaman Sep 30, 2026
9a9f64d
docs: describe the git hooks and pull request checks in development s…
erkamyaman Sep 30, 2026
8b9e6fd
ci: use Angular-style labels in the templates, labeler and release notes
erkamyaman Sep 30, 2026
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
43 changes: 43 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"files": ["README.md"],
"imageSize": 100,
"commit": false,
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "santoshyadavdev",
"name": "Santosh Yadav",
"avatar_url": "https://avatars.githubusercontent.com/u/11923975?v=4",
"profile": "https://santoshyadav.dev",
"contributions": ["code", "maintenance"]
},
{
"login": "erkamyaman",
"name": "erKam",
"avatar_url": "https://avatars.githubusercontent.com/u/88717125?v=4",
"profile": "https://erkamyaman.dev",
"contributions": ["code"]
},
{
"login": "abiramcodes",
"name": "Abiram",
"avatar_url": "https://avatars.githubusercontent.com/u/131433061?v=4",
"profile": "https://www.abikb.xyz/",
"contributions": ["code"]
},
{
"login": "Kaap10",
"name": "Vardhman Gupta",
"avatar_url": "https://avatars.githubusercontent.com/u/112063624?v=4",
"profile": "https://kaap10.github.io/portfolio",
"contributions": ["code"]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "angular-devtools",
"projectOwner": "santoshyadavdev"
}
11 changes: 11 additions & 0 deletions .claude/agents/a11y-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: a11y-reviewer
description: Audits the devtools panel and the demo app for accessibility and visual consistency with axe, contrast checks and keyboard walkthroughs. Use before a pull request that changes UI, or when asked to review a page.
tools: Read, Grep, Glob, Bash
---

You review accessibility and visual consistency. You don't edit files; you report.

Follow the browser checks in the `devtools-verify` skill: run axe on each page in dark and light color schemes, check horizontal overflow at 1280px and 360px, and walk every interactive element with the keyboard (focus visible, arrow keys in trees and lists, `Escape` closes popups and clears search). Check text contrast by hand where axe can't (gradients, text over images) and compare each page against `docs/contributing/ui-guidelines.md`.

Report findings ranked by user impact, each with the page, the element, what fails (rule or measured contrast), and a concrete fix. Say which pages you checked and how.
18 changes: 18 additions & 0 deletions .claude/agents/devtools-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: devtools-reviewer
description: Reviews a change or pull request against this repository's coding standards, commit guidelines and data-collection rules. Use before opening a pull request or when asked to review a diff.
tools: Read, Grep, Glob, Bash
---

You review changes to the Angular devtools. You don't edit files; you report.

Check the diff against:

- `docs/contributing/coding-standards.md`: TypeScript and Angular rules, and the page-side rules (debug APIs, stable ids, no DOM writes, `pageId`, expiry, cheap pushes, safe serialization).
- `docs/contributing/ui-guidelines.md` for anything under `app/`.
- `docs/contributing/commit-message-guidelines.md` for commit messages and the pull request title.
- Tests: every behavior change has one, and agent tools changed together with their tests and descriptions.
- Generated output: `extension/ui` rebuilt and committed when `app/` changed.
- Docs: when the diff touches the docs site (apps/docs) or `README.md`, check it against the `devtools-docs` skill. When the diff changes behaviour, an option, a UI label or an agent tool and no page in `apps/docs` changed, flag it (unless the pull request has the `no-docs` label and says why).

Verify claims by reading the code, and run `pnpm test:devtools` and the `ngc` template check when in doubt. Report only real problems, ranked by impact, each with file:line, what is wrong, why it matters and a concrete fix.
12 changes: 12 additions & 0 deletions .claude/agents/inspector-engineer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: inspector-engineer
description: Owns how inspectors collect data from the running app and serve it to the panel and to agents. Use for new inspectors, wrong or noisy data, unstable ids, tabs overwriting each other, heavy polling, and new MCP tools.
---

You are the inspector engineer for the Angular devtools.

Follow the `devtools-inspector` skill and the "Reading data from the page" section of `docs/contributing/coding-standards.md`. Read Angular through its debug APIs and check every field you rely on against `node_modules/@angular/core/fesm2022`. Keep ids stable with `WeakMap`s, never write to the app's DOM, send `pageId` with every report, expire and forget pages on the server, and skip unchanged pushes.

Put new logic in its own module and keep edits to `overlay.ts` and `devframe.ts` small. Add jsdom tests with a fake `ng` for every collector change and keep `pnpm test:devtools` green.

Return a short summary: what was wrong, what you changed (file:line), the tests you added, and anything left undone.
12 changes: 12 additions & 0 deletions .claude/agents/ui-engineer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: ui-engineer
description: Builds and restyles pages in the devtools panel (app/) so they match the design system, work with the keyboard and pass axe. Use for new inspector pages, UI polish, dropdowns, toolbars, empty states and theme changes.
---

You are the UI engineer for the Angular devtools panel.

Follow the `devtools-ui` skill and `docs/contributing/ui-guidelines.md`. Use the theme variables and SCSS mixins, the shared `app-select` dropdown and the page anatomy (intro, sticky toolbar, list or tree with a detail panel, loading, error, empty and no-match states). Headings start at `h2`.

Don't change RPC names, data shapes or behavior. If the data a page shows is wrong, stop and report it for the inspector engineer instead of working around it in the template.

Before you finish, run the checks in the `devtools-verify` skill that apply to UI (format, `ngc` template check, the axe and 360px audit on the pages you touched) and list what you ran. Return a short summary of what changed, per file.
34 changes: 34 additions & 0 deletions .claude/skills/devtools-commit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: devtools-commit
description: Write commit messages and pull request titles and descriptions for this repository, following this project's commit format and scopes. Use whenever you commit, split work into commits, or open or update a pull request.
---

# Commits and pull requests

The rules are in `docs/contributing/commit-message-guidelines.md`. Summary:

```
<type>(<scope>): <short summary>

<body: why the change is needed, old vs new behavior, imperative tense, 20+ characters; required for feat, fix, perf, refactor>

<footer: Fixes #123 | BREAKING CHANGE: ... | DEPRECATED: ...>
```

- Types: `feat`, `fix`, `perf`, `refactor`, `test`, `docs`, `style`, `build`, `ci`, `chore`, `revert`.
- Scopes: `hub`, `ui`, `popup`, `overlay`, `components`, `signals`, `injectors`, `router`, `forms`, `store`, `pipes`, `http`, `analog`, `mcp`, `extension`, `vite`, `demo`, `docs` (the docs site in `apps/docs`), `release`, `deps`. Leave the scope out for cross-cutting changes.
- Summary: imperative, lowercase first letter, no period, header under 100 characters.

## Pull requests

- Pull requests are squash merged; the title becomes the commit on `main`, so it must follow the header format.
- A `commit-msg` hook (`scripts/commit-message.mjs`, enabled by `pnpm install`) warns about a bad message as you commit; CI checks the title and every commit in the pull request and, for now, reports problems as warnings. Run `pnpm commit:check` before pushing, and fix flagged messages with `git commit --amend` or a reword rebase.
- Address review feedback with fixup commits (`docs/contributing/using-fixup-commits.md`).
- One feature per pull request, with its tests (including agent tool tests when tools change).
- Rebuild and commit `extension/ui` when `app/` changed.
- Fill in `.github/PULL_REQUEST_TEMPLATE.md`: what changed and why, how it was verified (see the `devtools-verify` skill), screenshots for UI changes.
- Don't add AI attribution lines to commits or pull requests unless the maintainers ask for them.

## Splitting work

Group commits by area (the scope), keep each one building and passing tests where practical, and put generated output (`extension/ui`, lockfile) in the commit that needs it.
53 changes: 53 additions & 0 deletions .claude/skills/devtools-inspector/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: devtools-inspector
description: Add or fix how an inspector collects data, from the page-side overlay through the devframe server to the panel and the MCP tools. Use for new inspectors, wrong or noisy data, unstable selection, tabs overwriting each other, heavy polling, and new agent tools.
---

# Inspector data pipeline

Every inspector follows the same path:

```
app page (overlay.ts + <area>-collector.ts)
-> rpc.call('push-<area>', { pageId, ... })
-> devframe.ts: per-page Map, shared state '<area>', expiry, forget-<area>-page
-> panel page (app/src/pages/<area>.ts) via rpc.sharedState('<area>')
-> agent tools (ctx.agent.registerTool) and MCP resources
```

Read `docs/contributing/coding-standards.md` ("Reading data from the page") before you start.

## Page side (`packages/ng-devtools/src`)

- Put collection logic in its own module (`<area>-collector.ts`) and keep `overlay.ts` changes to wiring: import, attach, push, `leave()` and the returned cleanup.
- Read Angular through the debug APIs on `window.ng` and verify each field against `node_modules/@angular/core/fesm2022` (or the library's fesm build). Known helpers:
- `element-id.ts`: stable `WeakMap` ids for elements (`elementId`, `elementById`).
- `injector-tree.ts`: `className()` strips bundler `_` prefixes, `tokenName()`, `dependenciesOf()`, environment injector walk.
- `serialize.ts`: safe, size-limited serialization.
- `router.ts` `providerOf()`: find a service through the injector resolution path.
- Never write attributes into the app's DOM. Never run app code (validators, guards) on a timer unless the user turned recording on.
- Pushes: send on change, skip unchanged payloads (compare with the last JSON), re-send every few cycles so the server doesn't expire the page, and avoid full DOM scans on a timer (cache, rescan after a `MutationObserver` signal).
- Every report carries `pageId` from `claimPageId()`. Call `forget-<area>-page` from `leave()`.

## Server side (`devframe.ts`, `rpc/`)

- Keep a `Map<pageId, report>` with `reportedAt`, drop pages older than 15 seconds in the shared expiry interval, and write the combined value into the shared state.
- Page actions that the panel triggers (restore, highlight, run) go panel -> `request-<area>-action` -> broadcast `<area>-action` to the page -> `<area>-action-result`, keyed by `requestId`, with a timeout.
- Source scans in `rpc/` enrich or stand in for live data. They must return a `kind` for anything the Dashboard counts.

## Panel side

- Subscribe with `const state = await rpc.sharedState('<area>'); apply(state.value()); state.on('updated', apply)` and remove the listener through `DestroyRef`. There is no `subscribe()` on shared state.
- Filter to the current page with the `?pageId` host parameter when the page can show several tabs; offer an "All pages" option.
- Then follow the `devtools-ui` skill for the page itself.

## Agent tools

- Describe what the tool returns, where the data comes from and what an empty answer means. Answer in markdown.
- Update descriptions in `devframe.ts` when data shapes change, and the tool list on the docs site (apps/docs/src/content/agents/tools.md). Use the `devtools-docs` skill for that edit.

## Tests

- Collector tests run in jsdom with a fake `ng` (see `__tests__/injector-tree.test.ts`, `component-tree.test.ts`, `ngrx-collector.test.ts`). Cover stable ids, dedupe, expiry and the Angular shapes you rely on.
- Server tests call the RPC handlers directly (see `http-server.test.ts`, `agent-tools.test.ts`).
- `pnpm test:devtools` must stay green.
36 changes: 36 additions & 0 deletions .claude/skills/devtools-ui/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: devtools-ui
description: Build or change any page, component or style in the devtools panel (app/). Use for new inspector pages, restyles, dropdowns, toolbars, empty states, theme or palette changes, and any UI/UX or accessibility work in the panel.
---

# Devtools panel UI

Read `docs/contributing/ui-guidelines.md` first; it is the source of truth for the theme, tokens and page anatomy. This skill is the working checklist.

## Before you write code

1. Open two recently built pages as references: `app/src/pages/di-inspector.ts` (tree + detail, keyboard, highlight) and `app/src/pages/network-inspector.ts` (toolbar, tables, forms, `app-select`).
2. Check which data the page gets and from where (`client.scope('ng-devtools').rpc.call(...)` or `rpc.sharedState(...)`). UI work must not change RPC names or data shapes; if the data is wrong, use the `devtools-inspector` skill.

## Rules

- Styles are SCSS in the component `styles` field, starting with `@use 'mixins' as m;`.
- Colors only through CSS variables (`--surface`, `--text-2`, `--accent`, ...). No hex values except brand colors on their own view (NgRx purple, Angular gradient, Analog, NativeScript, Capacitor).
- Controls are `var(--control-h)` tall. Use `app/src/ui/select.ts` for every dropdown; never a native `<select>`.
- Page structure: intro line, sticky toolbar (search with icon and `Escape` to clear, filters, count, actions), content (list or tree plus sticky detail on wide screens), and loading, error with Retry, empty and no-match states.
- Headings start at `h2` and never skip a level. Section labels use `m.label`.
- Rows are keyboard reachable (buttons or ARIA tree items with arrow keys). Selection is keyed by stable ids from the page.
- Rows that map to an element in the app call `request-page-highlight` on hover and focus, and clear it on leave and blur.
- Focus: `m.focus-ring` (use `-2px` inside scroll containers). Inputs use `m.field-focus`.
- Motion 150 to 350ms, disabled under `prefers-reduced-motion`.
- Angular: signals, `computed`, `linkedSignal`, `input`/`output`/`model`, `inject`, native control flow, `class`/`style` bindings, `host` object. No `any` in new code.
- Copy: short and plain, no em dashes, never compare with other tools.
- A new tab also needs: the `Tab` union in `app/src/types/tab.types.ts`, `allTabs` and the template switch in `app/src/app.ts`, an icon case in `tab-icon.ts`, and usually a Dashboard card.

## Changing the brand

Edit `app/src/styles/main.scss` (`$accent`) or the maps in `_palette.scss`. Never override tokens inside a page.

## Verify

Use the `devtools-verify` skill: template check with `ngc`, rebuild `extension/ui`, then the axe and 360px overflow audit on every page you touched, in the popup and at `/__devframes/`.
61 changes: 61 additions & 0 deletions .claude/skills/devtools-verify/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: devtools-verify
description: Verify a devtools change the way CI and a reviewer would, then check it in a real browser with axe. Use before saying a change is done, before committing, and before opening a pull request.
---

# Verify a change

## 1. The CI checks

Run them in this order; all must pass:

```sh
pnpm format:check
pnpm commit:check
pnpm skills:check
pnpm typecheck
pnpm test
pnpm test:devtools
pnpm build
pnpm extension:build
pnpm devtools:build-pkg
git status --porcelain -- extension/ui # must be committed when app/ changed
```

CI runs `pnpm exec nx affected -t test build` instead of the plain `pnpm test` and `pnpm build`; run it too when your change touches more than one project.

When the change affects behaviour, an option, a UI label or an agent tool, update the matching page in `apps/docs` in the same change (use the `devtools-docs` skill). When the change touches the docs site (apps/docs) or `README.md`, also run the build checks in the `devtools-docs` skill.

`pnpm typecheck` does not type-check panel templates. Also run:

```sh
NO_COLOR=1 pnpm exec ngc -p app/tsconfig.json --noEmit
```

and treat any `error TS` or `error NG` line as a failure. Strip color codes before grepping the output, or errors slip through.

## 2. Run the demos

`pnpm build` is a production build and turns the in-page launcher off. For manual checks rebuild in development mode:

```sh
pnpm build --configuration development
node dist/angular-devtools/server/server.mjs # Angular Travel on :4000
pnpm analog:dev # Analog demo on :5173
```

Open the panel through the amber launcher on the page, at `/__devframes/`, and directly at `/__devframes/ng-devtools/?view=angular#tab=<tab>`.

## 3. Browser checks

With Playwright and `@axe-core/playwright` (install them in a scratch folder, not in the repo):

- Every page you touched, in dark and light color schemes: axe reports no violations, there are no page errors, and `document.documentElement.scrollWidth <= innerWidth` at 1280px and 360px wide.
- Hub docks: clicking each rail button shows the matching view and only one frame (the rail selection and the content must match after fast switching and after a reload).
- The feature itself, with real data from the demo app (for example `/examples/<area>`).

Exclude the launcher (`#ng-devtools-popup-root`) from axe runs on demo pages; it is checked through the panel.

## 4. Report honestly

Say which checks ran and their results. If something was skipped (no browser, no build), say so.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto eol=lf
*.png binary
*.jpg binary
*.ico binary
*.zip binary
extension/ui/** linguist-generated=true
pnpm-lock.yaml linguist-generated=true
3 changes: 3 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
node "$(git rev-parse --show-toplevel)/scripts/commit-message.mjs" --file "$1" || echo "WARNING: this commit message does not follow the guidelines."
exit 0
26 changes: 26 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
root="$(git rev-parse --show-toplevel)" || exit 0
cd "$root" || exit 0

list="$(mktemp)" || exit 0
trap 'rm -f "$list"' EXIT

unstaged="$(git -c core.quotePath=false diff --name-only)"

git -c core.quotePath=false diff --cached --name-only --diff-filter=ACMR |
grep -E '\.(ts|mjs|js|json|scss|css|html|md|yml|yaml)$' |
grep -v '^extension/ui/' |
while IFS= read -r file; do
if printf '%s\n' "$unstaged" | grep -qxF -- "$file"; then
echo "pre-commit: not formatting $file because it has unstaged changes. Run pnpm format:check before you push." >&2
else
printf '%s\n' "$file"
fi
done >"$list"

[ -s "$list" ] || exit 0

tr '\n' '\0' <"$list" | xargs -0 pnpm --silent exec prettier --write --ignore-unknown >/dev/null 2>&1 ||
echo "WARNING: failed to format staged files." >&2
tr '\n' '\0' <"$list" | xargs -0 git --literal-pathspecs add --
exit 0
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @santoshyadavdev
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [santoshyadavdev]
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Bug report
description: Something in the devtools shows wrong data, breaks, or looks wrong
labels: [bug, needs triage]
body:
- type: dropdown
id: area
attributes:
label: Area
options:
- Components
- Signals
- Injectors
- Router
- Forms
- NgRx store
- Pipes
- SSR & HTTP
- Analog
- Dashboard or panel shell
- Chrome extension
- Agent tools (MCP)
- Vite plugin or setup
- Demo app
- Documentation site
validations:
required: true
- type: dropdown
id: setup
attributes:
label: Setup
description: How the devtools are mounted in your app.
options:
- Angular CLI with Express (initNgDevtoolsHub)
- Vite plugin
- Analog
- Standalone CLI (ng-devtools dev)
- Chrome extension
- MCP server (stdio or HTTP)
- Other
validations:
required: true
- type: textarea
id: what
attributes:
label: What happened
description: What you saw, and what you expected instead.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: How to reproduce
description: Steps, a minimal repository, or the page of the demo app where it happens.
validations:
required: true
- type: input
id: versions
attributes:
label: Versions
description: Angular, @santoshyadavdev/ng-devtools, browser, and Analog if used.
- type: textarea
id: extra
attributes:
label: Screenshots or logs
Loading
Loading