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 skills/gotgenes/pi-anthropic-auth/testingnpx skills add gotgenes/pi-anthropic-auth --skill testinggit clone --depth 1 https://github.com/gotgenes/pi-anthropic-authWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/testing)<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/testing"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/testing.svg" alt="Measured on agentmods" height="20"></a>What 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.00036 | $0.04328 |
| Opus 5 | $0.00018 | $0.02164 |
| Sonnet 5 | $0.00007 | $0.00866 |
| Haiku 4.5 | $0.00004 | $0.00433 |
Grade A, and why
testing 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 3d ago.
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 — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing
Load this skill when writing, debugging, or planning tests.
Vitest mock patterns
vi.mock and hoisting
- When using
vi.mock(), extract eachvi.fn()stub to a module-scope variable and reset it inbeforeEach—vi.restoreAllMocks()only operates onvi.spyOn()spies, not onvi.fn()instances. Use.mockReset()when the stub has no default implementation. Use.mockClear()when thevi.mock()factory provides a default implementation that tests must preserve. - When a
vi.mock()factory references a module-scopevi.fn()stub, wrap the stub declaration invi.hoisted()— Vitest hoistsvi.mock()above normal declarations, so unhoisted variables areundefinedwhen the factory runs. - When mocking a class constructor with
vi.mock(), usevi.fn()with no implementation — notvi.fn(() => ({})). Arrow-function implementations are not constructable;new MockClass()throws"is not a constructor". - When mocking
node:*built-in modules withvi.mock(), include adefaultkey mirroring the named exports — omitting it causes "No default export defined on the mock" errors. - A
vi.mock("node:*")factory that returns an object literal replaces the module: every export it omits becomesundefined, so a later call to a sibling export (lstatSync,tmpdir) throwsTypeErrorin unrelated tests in that file. To stub one export and keep the rest, spreadawait vi.importActual<typeof import("node:fs")>("node:fs")in the factory and override only the target. - Import the module-under-test with a static top-level
import, not a per-testawait import(...)— Vitest hoistsvi.mock()/vi.hoisted()above static imports, so the mock still applies. A per-test dynamic import of a module that transitively pulls heavy deps pays the transform/resolve cost inside each test'stestTimeoutwindow and can flake CI.
Typing mock functions
- When a
vi.fn()factory returns an empty array or narrow literal, annotate its return type explicitly —vi.fn((): string[] => []), notvi.fn(() => []). Without the annotation TypeScript infersnever[], and subsequentmockReturnValueOnce([...])calls fail with “not assignable tonever”. Useimport typeto pull domain types (e.g.,AgentConfig,PreloadedSkill) for the annotation. - When typing a mock field on an interface, use
Mock<specific-signature>— e.g.,Mock<() => void>,Mock<(arg: string) => Promise<void>>. Do not useReturnType<typeof vi.fn>— in Vitest v4 it expands toMock<Procedure | Constructable>, a union that TypeScript cannot call.
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.
- 3d ago First seen · 174 lines · 36 tokens per session scan A e211a2cf2bc8
testing is a skill published in the GitHub repository gotgenes/pi-anthropic-auth (227 stars, last pushed 16d ago), licensed MIT. It adds 36 tokens to every session and 4,328 once invoked, about $0.0002 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-08-30.
Other skills, from other repositories
surf
Control Chrome browser via CLI for testing, automation, and debugging. Use when the user needs browser automation, screenshots, form filling, page inspection, network/CPU emulation, DevTools streaming, or AI queries via ChatGPT/Gemini/Perplexity/Grok/AI Studio.
prose-review
Review prose written for others -- user-facing docs, prompts for other LLMs, inline comments, docstrings, and other-facing messages -- for local jargon leakage, orphaned references, missing grounding, and audience or genre misfit.
text-search
Search indexed text corpora with qmd. For indexed content, prefer qmd over grep.
repoprompt-tool-guidance-refresh
Refresh RepoPrompt tool guidance when the CLI/MCP surface changes. Tracks RepoPrompt CE (rpce-cli, the maintained target) across versions, and can diff the frozen Classic CLI (rp-cli) against CE. Uses /.pi/agent/skills/repoprompt-tool-guidance-refresh/scripts/track-rp-version.sh to capture/diff --help and -l (tool…
pi-commandcode-release
Use when preparing, validating, publishing, or documenting a pi-commandcode-provider release/deployment, including version bumps, changelog entries, npm publish, GitHub releases, tags, and release follow-up comments.
xcodebuildmcp
Build/test Xcode projects via the XcodeBuildMCP MCP server using a local CLI wrapper for pi (no MCP support). Use when the user mentions Xcode, xcodebuild, iOS builds/tests, or XcodeBuildMCP.