Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/future-architect/uzomuzo-oss/testing-performancegit clone --depth 1 https://github.com/future-architect/uzomuzo-ossWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01949 | $0.01949 |
| Opus 5 | $0.00975 | $0.00975 |
| Sonnet 5 | $0.00390 | $0.00390 |
| Haiku 4.5 | $0.00195 | $0.00195 |
Grade A, and why
uzomuzo-oss testing-performance.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing & Performance
Testing
- Table-Driven Tests: Use table-driven tests for testing multiple scenarios of a function.
- Sub-tests: Use
t.Run()to create sub-tests for better isolation and clearer output. - Test Coverage: Strive for high test coverage, especially for business-critical logic.
Performance Considerations
While correctness and clarity come first, performance is critical in many parts of our application.
- Pre-allocate Slices and Maps: When the size is known, pre-allocate capacity with
maketo avoid repeated allocations. - Be Mindful of Pointer vs. Value Semantics: Consider using pointers for large structs to avoid expensive copies, but don't default to them unnecessarily.
- Write Benchmarks for Hot Spots: Do not optimize prematurely. Use the
testingpackage to benchmark performance-critical functions and prove an optimization is needed.
Concurrency
- Context Propagation: Functions that may block (I/O, etc.) MUST accept a
ctx context.Contextas their first argument. - Goroutine Lifetime: Ensure every goroutine has a clear exit condition to avoid leaks. Use
sync.WaitGroupto wait for goroutines to finish. - Race Conditions: Protect shared memory with mutexes. Be mindful of data races and test with the
-raceflag.
Learned from Copilot Reviews
- Port Tests When Replacing Services: When replacing or refactoring an application service, port all existing unit tests to the new service. Untested replacement code silently loses coverage that the old tests provided.
- No Permanently Skipped Tests: Do not commit tests with
t.Skip()that have no plan for implementation. Skipped tests create a false sense of coverage and accumulate as dead code. Either implement the test (e.g., by introducing a test seam or mock) or remove it entirely. - Propagate Build Tags to Test Files: When a package uses build tags (e.g.,
//go:build cgo), test files that import it must carry the same tag — otherwiseCGO_ENABLED=0or other constrained builds fail to compile the test. - Keep Tests Network-Independent by Default: When a test would make real HTTP calls to external services (either directly or indirectly via redirect-following), gate the network path behind an explicit opt-in (env var or build tag) rather than relying on
-short. Use stub transports or generic error values sogo test ./...remains hermetic in CI and restricted-network environments. - Capture and Assert Mock/Fake Arguments: When using test fakes or mocks, capture the arguments passed to them and assert correctness — unconditional return values let tests pass even when input parsing or encoding is wrong.
- Accept Interfaces in Test-Setter Methods: When providing
SetXxxClient-style methods for test injection, accept the interface type (not the concrete type) so test fakes can be injected via the public API without accessing unexported fields. - Exercise Non-Nil Return Paths in Tests: When a function returns
nilto signal "unavailable" vs an empty collection to signal "no matches", ensure tests include at least one matching item so the result is non-nil and the test exercises actual behavior — not a vacuous early return. - Match Test Fixture IDs to Their Mapped Values: When test fixtures map one identifier to another (e.g., PURL to import path), ensure each pair is consistent — mismatched pairs make tests confusing and hide incorrect mappings.
- Cover New Control Flow Branches with Tests: When adding a new conditional branch (especially fallback paths or classification logic), add a targeted test case to the existing test suite that exercises the new path. New branches without test coverage are easy to regress silently.
- Test Nil-Map Merge Paths: When code merges results into a map that may be nil (e.g., initialized only on non-empty results), add a test where the initial map is nil and the merge path still executes — catches nil map assignment panics.
- Close Native Resource Handles in Tests: When tests create objects that hold C/native resources (e.g., tree-sitter
Analyzerwith compiled queries, CGo handles), registert.Cleanup(obj.Close)ordefer obj.Close()immediately after creation. Leaking one handle per test bloats memory across the test suite and can cause flaky failures in large test runs. - Assert Sibling Items in Multi-Input Tests: When a test asserts
wantNoResultfor one item in a multi-item input set, also assert that sibling items produce expected coupling — otherwise a regression that drops all items passes silently. - Explicit Subtest Names for Empty Inputs: When table-driven test inputs include empty strings or values that produce empty
t.Runnames, add a separatenamefield to the test struct and use it fort.Run. Empty subtest names make failures harder to identify and debug. - Split Nil Guards from Value Assertions in Test Failure Branches: When a test failure branch accesses a struct field through a potentially-nil pointer (e.g., formatting an error message with
result.Field), split the nil guard (t.Fatalfif nil) from the value assertion to prevent a panic from masking the actual regression. - Scope Test Assertions to Specific Output Regions: When testing output that contains multiple sections (e.g., summary box + detail table), scope assertions to the specific region under test — broad
strings.Containschecks can match unrelated sections and mask bugs. - Avoid Duplicate Test Coverage Across Packages: Do not duplicate unit tests in a consumer package when the function under test already has comprehensive coverage in its own package. Cross-package duplication increases maintenance cost and can drift out of sync.
- Use
filepath.Joinfor Temp File Paths in Tests: When constructing temporary file paths in tests, usefilepath.Join(t.TempDir(), "filename")instead of string concatenation with"/". String concatenation is not portable across OS/path conventions and is inconsistent withfilepath-based path construction used elsewhere in the codebase. - Use Bounded Waits in Test Poll Loops: When polling for a condition in tests (e.g., waiting for a server to respond), use
time.Afterwith a deadline andtime.Sleepfor backoff between attempts — never spin in a tight loop. Unbounded polling burns CPU and can cause CI hangs. - Match Test Case Names to Exercised Code: When naming table-driven test cases, ensure the name accurately describes the code snippet under test. A case named "decorator with arguments @pytest.mark.parametrize" must actually use
@pytest.mark.parametrize(...)— not a simplified@pytest.mark. Misleading names hide missing coverage and confuse future maintainers. - Never Call
t.Fatalfrom Non-Test Goroutines:t.Fatalandt.Fatalfmust only be called from the test goroutine. Inhttptesthandlers or other goroutines, precompute test data outside the handler or use channels to signal errors back to the test goroutine. - Read
os.PipeConcurrently When Capturing Output: When redirectingos.Stdoutto anos.Pipeto capture output in tests, start a goroutine to read from the pipe before the function under test runs. Reading only after completion can deadlock if output exceeds the OS pipe buffer size. - Mirror Production JSON Tags in Test Validation Structs: When defining test structs to unmarshal command output (JSON, CSV), ensure the struct's field tags exactly match the production output schema. Mismatched JSON tags silently leave fields at their zero value, masking regressions that would otherwise be caught by assertions.
- Use
t.CleanupWhen Replacing Process-Global State: When a test replaces process-global state (os.Stdin,os.Stdout,os.Stderr), registert.Cleanupimmediately after the replacement to guarantee restoration — even if a latert.Fatalfexits early. Also close pipe readers/writers in the cleanup to prevent file descriptor leaks. - Assert Exact Computed Values, Not Just Thresholds: When testing functions that produce computed numeric results (scores, percentages, ratios), assert the exact expected value (with a small tolerance for floats) rather than only checking threshold boundaries. Threshold-only assertions miss formula regressions that produce different-but-still-passing values.
- Assert All Expected Fields Unconditionally: When testing expected field values in table-driven tests, assert unconditionally rather than skipping when the expected value is zero/empty (e.g.,
if wantCalls > 0). Conditional skips hide regressions when the system's baseline behavior changes — always set the expected value explicitly and assert it. - Omit Unused Struct Fields in Test Fixtures: When constructing struct literals for test fixtures, only populate fields that the test actually exercises. Including unused fields (especially those with nondeterministic values like timestamps or random IDs) can introduce flaky tests and unnecessary import dependencies.
- Assert All Output Fields When Extending Structs: When adding new fields to an output struct (JSON, CSV, domain model), add corresponding assertions in existing tests for those fields — including ordering guarantees for slices. Untested pass-through fields can silently regress without detection.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 52 lines · 1,949 tokens per session scan A 59ff53d5a5c8
uzomuzo-oss testing-performance.instructions.md is an instructions file published in the GitHub repository future-architect/uzomuzo-oss (32 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,949 tokens to every session, about $0.0097 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other instructions, from other repositories
sq AGENTS.md
Instructions for neilotoole/sq, covering agents.md, about sq, key documents, common commands and conventions.
cli AGENTS.md
Instructions for planetscale/cli, covering planetscale cli — agent guide, public repository safety, concepts, flag placement and correct.
azure-sdk-for-go go-code.instructions.md
Instructions for Azure/azure-sdk-for-go: All code should follow the guidelines from the Azure Go SDK Guidelines. This document is a summary of the most important guidelines to follow when contributing to the Azure Go SDK.
gorest AGENTS.md
Instructions for pilinux/gorest, covering agents.md, project overview, build and run commands, build and tidy dependencies.
chatgpt-cli CLAUDE.md
Instructions for kardolus/chatgpt-cli, covering chatgpt-cli — release runbook, prerequisites, 1. cut the release, 2. publish the github release + binaries and 3. update the homebrew tap.
pvetui AGENTS.md
Instructions for devnullvoid/pvetui, covering agent instructions, initial setup, development workflow, quick reference and code quality standards.