Agent Skills
Coding agents default to whatever testing patterns are most common on the internet: beforeEach + let, fixture.whenStable(), fixture.componentInstance, vi.mock(), and brittle spy objects.
The angular-testing skill encodes the Pragmatic Angular Testing approach from this cookbook so your coding agents write, fix, and review Angular tests the right way from the start.
Installationโ
Install just the angular-testing skill:
npx skills add marmicode/skills --skill angular-testing
Or install the full Marmicode Skills collection (which also includes the Charted Coding test-first approach):
npx skills add marmicode/skills
What It Teaches Your Agentโ
The skill keeps your agent aligned with the principles and recipes in this cookbook:
- The Widest Narrow Test: uses real child components, real services, and real stores by default, replacing only slow, complex, or non-deterministic boundaries (Beyond Unit vs. Integration).
- Fakes over Mocks: fakes adapters you own (e.g. HTTP repositories) instead of
vi.mock(),vi.spyOn(...).mockReturnValue(), or mocking third-party libraries (Fake It Till You Mock It & How to Cook a Fake). - Through the DOM, without the Fixture: mounts components with Angular
bindings(inputBinding,outputBinding,twoWayBinding), ignores the returned fixture, and interacts through accessible locators (page.getByRole,page.getByLabelText) with retrying assertions (Vitest Browser Mode). - Readable Test Design: composable setup functions (
mountX(),createX()) instead ofbeforeEach+let, object mothers for test data, literal expectations, and zero conditionals or loops. - Signals, Routing, and Time: dedicated reference guides for services, signals, resources, router/guards, and Vitest fake timers (Controlling Time in Tests).
How to Use Itโ
Once installed, the skill activates automatically whenever you ask your agent to:
- Write new tests for components, services, signals, guards, routing, or timer-based behavior.
- Fix slow or flaky tests or replace mocks and spies with fakes.
- Review existing tests: the skill includes a prioritized review rubric that flags false confidence, implementation coupling, synchronization hacks (
detectChanges,whenStable,TestBed.tick), and test design issues.
For the full SKILL.md, reference guides, and complete passing example specs, check out the marmicode/skills repository on GitHub.


