aaa-and-naming
A good test reads like a specification. Two habits get you most of the way: a consistent three-phase body (AAA) and a name that states the behavior, not the method.
$ npx -y skills add vanara-agents/skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
A good test reads like a specification. Two habits get you most of the way: a consistent three-phase body (AAA) and a name that states the behavior, not the method.
Agent definition
aaa-and-naming.mdArrange-Act-Assert and Test Naming
A good test reads like a specification. Two habits get you most of the way: a consistent three-phase body (AAA) and a name that states the behavior, not the method.
Arrange-Act-Assert (AAA)
Structure every test in three visually separated phases:
it('caps the cart total at the configured maximum', () => {
// Arrange — set up inputs, fixtures, doubles
const cart = makeCart({ items: 5, unitPrice: 100 });
const maxTotal = 400;
// Act — invoke exactly ONE behavior
const total = cart.totalWithCap(maxTotal);
// Assert — verify the observable outcome
expect(total).toBe(400);
});Why it works:
- **One Act per test.** If you need two actions, you probably have two tests. A single Act
keeps failures unambiguous — you know exactly what broke.
- **Assertions only in Assert.** An assertion buried in Arrange hides setup failures as
behavior failures.
- **No logic in tests.** Loops, conditionals, and try/catch in a test are a smell; they can
hide bugs in the test itself. Prefer table-driven cases or parameterized tests instead.
Given-When-Then
The same shape, phrased for behavior-driven tests: *Given* a context, *When* an action occurs, *Then* an outcome is observed. Map Given→Arrange, When→Act, Then→Assert.
Naming tests
A test name should let a reader understand the requirement **without reading the body**. State the scenario and the expected outcome.
**Weak (restates the method):**
test('applyDiscount')
test('test refund')
test('works')**Strong (states the behavior):**
test('subtracts a percentage discount and rounds to two decimals')
test('throws RangeError when the discount exceeds 100 percent')
test('returns empty array when no markets match the query')
test('falls back to substring search when Redis is unavailable')A useful template: **`<does X> when <condition Y>`** or **`<verb> <expected> given <state>`**.
One behavior per test
When a test fails, its name plus its single Act should tell you what's broken without debugging. Resist the "mega test" that arranges a huge world and asserts twenty things — the first failure masks the rest, and the name can't describe what it covers. Split by behavior.
Multiple assertions are fine — if they describe one behavior
// OK: these three assertions all describe "creates an open order"
expect(order.id).toBeDefined();
expect(order.status).toBe('open');
expect(order.createdAt).toBeInstanceOf(Date);The guideline is *one logical concept per test*, not literally one `expect`.
Read more
Arrange-Act-Assert and Test Naming
A good test reads like a specification. Two habits get you most of the way: a consistent three-phase body (AAA) and a name that states the behavior, not the method.
Arrange-Act-Assert (AAA)
Structure every test in three visually separated phases:
it('caps the cart total at the configured maximum', () => {
// Arrange — set up inputs, fixtures, doubles
const cart = makeCart({ items: 5, unitPrice: 100 });
const maxTotal = 400;
// Act — invoke exactly ONE behavior
const total = cart.totalWithCap(maxTotal);
// Assert — verify the observable outcome
expect(total).toBe(400);
});Why it works:
- **One Act per test.** If you need two actions, you probably have two tests. A single Act
keeps failures unambiguous — you know exactly what broke.
- **Assertions only in Assert.** An assertion buried in Arrange hides setup failures as
behavior failures.
- **No logic in tests.** Loops, conditionals, and try/catch in a test are a smell; they can
hide bugs in the test itself. Prefer table-driven cases or parameterized tests instead.
Given-When-Then
The same shape, phrased for behavior-driven tests: *Given* a context, *When* an action occurs, *Then* an outcome is observed. Map Given→Arrange, When→Act, Then→Assert.
Naming tests
A test name should let a reader understand the requirement **without reading the body**. State the scenario and the expected outcome.
**Weak (restates the method):**
test('applyDiscount')
test('test refund')
test('works')**Strong (states the behavior):**
test('subtracts a percentage discount and rounds to two decimals')
test('throws RangeError when the discount exceeds 100 percent')
test('returns empty array when no markets match the query')
test('falls back to substring search when Redis is unavailable')A useful template: **`<does X> when <condition Y>`** or **`<verb> <expected> given <state>`**.
One behavior per test
When a test fails, its name plus its single Act should tell you what's broken without debugging. Resist the "mega test" that arranges a huge world and asserts twenty things — the first failure masks the rest, and the name can't describe what it covers. Split by behavior.
Multiple assertions are fine — if they describe one behavior
// OK: these three assertions all describe "creates an open order"
expect(order.id).toBeDefined();
expect(order.status).toBe('open');
expect(order.createdAt).toBeInstanceOf(Date);The guideline is *one logical concept per test*, not literally one `expect`.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Other agents on vanara-agents-skills.
- AGENT
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination, filtering, error envelopes, versioning, and idempotency. Produces a reviewable API contract plus an OpenAPI snippet, not
Open agent - review-notes
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the contract-breakers first. Severity legend: **CRITICAL** (breaks clients / data risk), **HIGH** (real bug or inconsistency), **MEDIUM** (maintainability),
Open agent - contract-and-openapi
The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.
Open agent - design-checklist
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting rules last. Every box is a place real APIs go wrong in production.
Open agent - versioning-and-evolution
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without breaking**, and version explicitly when you must break.
Open agent - pr-comment-template
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.
Open agent

