Skip to content

docs(skills): add a write-tests skill that picks each test's layer - #14172

Merged
sandl99 merged 1 commit into
v1from
docs/14060-write-tests-skill
Nov 4, 2026
Merged

sandl99 merged 1 commit into
v1from
docs/14060-write-tests-skill

Conversation

@sandl99

@sandl99 sandl99 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Failure

No skill says which layer a new test belongs in. test-driven-development covers writing a failing test first, and test-desiderata-review audits existing tests, but neither tells an agent to choose between unit, contract, integration, and live E2E tests, to prefer tofu test scenarios over Rust tests, or to check for coverage another layer already owns. The #14060 migration repeatedly removed tests that a lower layer already covered, and live tests that injected failures a fixture could simulate.

Decision

Add a write-tests skill. It has the agent:

  1. Name the behavior and the component that owns it; the owner picks the layer.
  2. Search every layer for existing coverage, cite it instead of adding a test, and remove a higher-layer check that a change makes redundant.
  3. Choose unit, contract, integration, or live E2E, and keep live E2E tests to successful paths that need a real engine, cluster, image, model, or host.
  4. Prefer a tofu test scenario at each layer, and use Rust only for what tofu test cannot express: expected provider errors, SDK and CLI behavior, saved plans, interrupts, cancellation, state edits, a mid-test destroy, or a changed document on the same deployment.
  5. Assert a few semantic outcomes, check unchanged reconciliation directly, and show that each new assertion can fail.

references/tofu-test.md records the harness and the OpenTofu 1.12 limits found during #14060: run references only in variables, per-module run outputs, cleanup reusing the last applying run's variables, plan-time data reads, tuples versus lists, and expect_failures.

test-driven-development, AGENTS.md, and the "Write Tests" section of docs/contributing/testing.md point to the skill; testing.md gains a short list of the layers. It also drops a reference to the Spark live test that #14142 deleted.

Part of #14060.

Validation

  • Checked each path, directory, and variable the skill names against the checkout: the contract hcl/ and failures/ directories of each provider, tests/integration/hcl and rust/, tests/e2e/hcl and rust/, the harness's permit_destroy and baseline, and the contract modules' destroying.
  • cargo run -p nemoclaw-build -- fern check: 0 errors.
  • Commit hooks passed.

Add a write-tests skill that names a behavior's owner, searches every layer for existing coverage, picks unit, contract, integration, or live E2E, prefers tofu test scenarios over Rust tests, and keeps live E2E to successful paths. Point test-driven-development, AGENTS.md, and testing.md at it, and drop a stale Spark test reference.

Refs #14060

Signed-off-by: San Dang <[email protected]>
@sandl99

sandl99 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Pi coding agent 1.2.0 The session record names the Pi session format; the version comes from the active install path, not the record
Skills recorded nemoclaw-contributor-create-pr, v1 copy (complete read); test-driven-development (complete read); test-desiderata-review (partial read); safe-refactoring (partial read) Skill reads to cutoff; other skills were listed only
Instruction files recorded AGENTS.md of main (injected); AGENTS.md of v1 (complete read); WRITING.md (partial read); .github/PULL_REQUEST_TEMPLATE.md (complete read); .github/SESSION_REPORT_TEMPLATE.md (complete read) Startup injection and reads to cutoff
Tool calls partial typescript: 704 Wrapper calls, including failed calls, to cutoff; nested shell, file, and HTTP calls inside the wrapper are not counted
Session window recorded 2026-11-02T05:58Z to 2026-11-04T06:21Z First event to cutoff before publication, including idle time; the session also produced earlier pull requests
Compactions recorded 0 Complete record to cutoff; context elisions are not compactions
Models recorded claude-opus-5-5 Model change event and assistant turns; no changes
Reasoning levels recorded medium; high Thinking-level changes, in order

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@sandl99
sandl99 merged commit ef10f2d into v1 Nov 4, 2026
51 checks passed
@sandl99
sandl99 deleted the docs/14060-write-tests-skill branch November 4, 2026 06:29
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build area: e2e End-to-end tests, nightly failures, or validation infrastructure area: skills Skills, agent behaviors, prompts, or skill packaging chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch labels Nov 4, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build area: e2e End-to-end tests, nightly failures, or validation infrastructure area: skills Skills, agent behaviors, prompts, or skill packaging chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants