agentleFS
polyaipolyai/adk/.claude/skills/write-tests/SKILL.md

write-tests

Skill83 starsChanged 39 days agoApache-2.0View on GitHub

Write readable tests for new or changed ADK code and show that coverage of the touched modules didn't drop. Use after implementing a feature or fix in the polyai-adk repo, or when asked to add test coverage.

76 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use close-spec, design-with-images and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 5 projects that use this

  • dzhngSkill

    design-with-images

    Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.

    Also in 5 projects that use this

  • transitive-bullshitSkill

    compare-screenshots

    Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.

    Also in 5 projects that use this

  • LucasMatuszewskiSkill

    audit-agents

    Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.

    Also in 5 projects that use this

  • wolverin0Skill

    audit-decisions

    Standardize remediation decisions, baseline-policy entries, and legal-review banners for accepted, deferred, or policy-blocked audit findings.

    Also in 4 projects that use this

  • rhnfzlSkill

    explore-unknowns

    Walk the user through mapping the unknowns of a task before, during, and after they build it, and hand them a four-quadrant map (settled ground, open decisions, taste, and landmines) they keep. Reach for this eagerly whenever a request is ambiguous or underspecified, the codebase or domain is unfamiliar, the user will "know it when they see it", a reference implementation must be understood before porting, a build-queue or architecture-changing task is about to start, a mid-build deviation needs capturing, or a finished change needs buy-in or verified understanding before merge. Trigger even when the skill is not named: "do a blindspot pass", "find my unknown unknowns", "interview me about this change", "brainstorm the approach for a task I am about to build", "help me scope this", "what am I missing here", "plan this before I build", "I know nothing about X in this codebase". When a territory profile is present it reads memory and the graph first and feeds the map into the build pipeline; without one it degrades to a plain general map. Not for trivial or mechanical tasks with clear acceptance criteria, single-fact lookups, pure debugging of a known symptom, or pure code review, those have their own tools. Do not use it to run the build itself; the map is the deliverable and implementation remains a separate task, whether it has not started or is already underway.

    Also in 5 projects that use this

  • +5 more from dzhng

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Run uv run pytest src/poly/tests/ --cov=poly --cov-report=term-missing and note the coverage of each module the change touches.

    line 12
  2. Distinctive:

    Placement: add to the existing file and class for the area:

    line 17
  3. Distinctive:

    Only create a new file or class when nothing fits.

    line 25
  4. Very specific:

    Fixtures: use real objects and the fixture projects in src/poly/tests/test_projects/.

    line 26
  5. Very specific:

    When a resource gains a field or a new resource type is added, add an example to test_projects/test_project/ as well.

    line 27
  6. Distinctive:

    Don't assert that a mock was called when you could assert on the result.

    line 30
  7. Very specific:

    Never test generated code under handlers/protobuf/ or types/.

    line 35
  8. Distinctive:

    If coverage dropped, say which lines are uncovered and why.

    line 45

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “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
SKILL.md

Write tests for an ADK change

1. Measure first

Run uv run pytest src/poly/tests/ --cov=poly --cov-report=term-missing and note the coverage of each module the change touches.

2. Write the tests

  • Placement: add to the existing file and class for the area:

    • resources_test.py for resources
    • project_test.py for project logic
    • cli_test.py for argument parsing and command output
    • tests/api/ for handlers
    • tests/call/ for voice calls
    • The *_test.py file named after the feature (metrics_test.py, rtc_test.py, …)

    Only create a new file or class when nothing fits.

  • Fixtures: use real objects and the fixture projects in src/poly/tests/test_projects/. When a resource gains a field or a new resource type is added, add an example to test_projects/test_project/ as well.
  • Mocks: mock only at the API or filesystem boundary, one @patch per test where possible. Don't assert that a mock was called when you could assert on the result.
  • Style: unittest.TestCase classes. Names read as test_<scenario>_<expected_outcome>, with one behaviour per test and a short docstring.
  • Cover: the happy path, edge cases (empty, None, missing fields), errors (ValueError for bad input), and a YAML round-trip (to_yaml_dict → from_yaml_dict) for resources.
  • Never test generated code under handlers/protobuf/ or types/.

3. Measure again

Re-run the coverage command and the full suite. Then run uv run ruff check . --fix and uv run ruff format ..

Report

The tests you added (file and class), and the before → after coverage for each touched module. If coverage dropped, say which lines are uncovered and why.

Download now (ZIP)

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.