Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming.

MITAuto-check passedTesting & QA

Install Unit Test

skills CLI
$ npx skills add OriginProtocol/origin-dollar --skill unit-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OriginProtocol/origin-dollar unit-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OriginProtocol/origin-dollar.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/unit-test .claude/skills/unit-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unit-test
GitHub stars
153
Token cost
~1.6k tokens
SKILL.md length
561 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming.

  • Works in 6 steps: Directory layout → Inheritance chain → Shared setup contract → …
  • The user asks for unit tests
  • SKILL.md covers 1. Directory layout, 2. Inheritance chain, 3. Shared setup contract and 4. Concrete test naming, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Unit Test is an agent skill from OriginProtocol/origin-dollar. Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming. Use when the user asks for unit tests, Foundry tests, concrete tests, or fuzz tests.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing. The repository describes itself as: OUSD and OETH are stablecoins that passively accrue yield while you are holding it. The licence is MIT.

When your agent uses it

  • The user asks for unit tests
  • Tasks that involve Unit testing

Example prompts

  • “/unit-test”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Directory layout
  2. Inheritance chain
  3. Shared setup contract
  4. Concrete test naming
  5. Fuzz tests
  6. Foundry config expectations

What it can do on your machine

Read from SKILL.md and the folder at commit ae82163. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unit Test loads about 1.6k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 561 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OriginProtocol/origin-dollar at commit ae82163, republished under its MIT licence (© OriginProtocol). 561 words, ~1,566 tokens.

Download SKILL.mdSave it as .claude/skills/unit-test/SKILL.md (or your agent's skills folder).
name
unit-test
description
Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming. Use when the user asks for unit tests, Foundry tests, concrete tests, or fuzz tests.

Unit Test

Generate Foundry unit tests for a specific contract following this repository's established directory layout, inheritance chain, setup order, and test naming rules.

1. Directory layout

text
contracts/tests/unit/<category>/<ContractName>/
├── shared/
│   └── Shared.sol
├── concrete/
│   ├── FunctionA.t.sol
│   ├── FunctionB.t.sol
│   └── ViewFunctions.t.sol
└── fuzz/
    ├── FunctionA.fuzz.t.sol
    └── FunctionB.fuzz.t.sol

Rules:

  • one file per public or external state-changing function
  • view and pure functions may be grouped in ViewFunctions.t.sol
  • admin and setter functions may be grouped in Admin.t.sol or Config.t.sol

2. Inheritance chain

text
forge-std/Test
  └─ Base
       └─ Unit_Shared_Test
            ├─ Unit_Concrete_<Contract>_<Feature>_Test
            └─ Unit_Fuzz_<Contract>_<Feature>_Test

Base owns shared actors, constants, and IERC20 external token refs. All typed contract/proxy/mock state variables are declared in each Shared.t.sol file (not in Base). This keeps Base lightweight so changes don't invalidate the entire Forge cache.

Interface-only testing

Tests must interact with contracts through interfaces, not concrete implementations. See contracts/tests/README.md for full details.

Available interfaces:

InterfaceFileUsed for
IVaultcontracts/interfaces/IVault.solAll vault contracts
IOTokencontracts/interfaces/IOToken.solAll rebasing tokens (OUSD, OETH, OETHBase, OSonic)
IWOTokencontracts/interfaces/IWOToken.solAll wrapped tokens (WOETH, WOETHBase, WOETHPlume, WOSonic, WrappedOusd)
IProxycontracts/interfaces/IProxy.solAll proxy instances
Strategy interfacescontracts/interfaces/strategies/Per-strategy interfaces (ICurveAMOStrategy, ISonicStakingStrategy, etc.)

Key rules:

  • import interfaces, not concrete contracts
  • declare state variables with interface types
  • deploy with vm.deployCode instead of new (except mocks), and always reference artifact paths through tests/utils/Artifacts.sol (e.g. vm.deployCode(Vaults.OUSD, abi.encode(address(usdc)))); add the entry to the relevant sub-library if it does not exist yet
  • reference events from the interface: emit IVault.CapitalPaused();
  • access struct return values by field name: vault.withdrawalQueueMetadata().claimable
Product-specific vault types
ProductTokenVaultArtifacts reference
OUSDOUSDOUSDVaultVaults.OUSD
OETHOETHOETHVaultVaults.OETH
OSonicOSonicOSVaultVaults.OS
OETHBaseOETHBaseOETHBaseVaultVaults.OETH_BASE

Add the entry to tests/utils/Artifacts.sol if it does not exist yet.

Never use OETHVault for Sonic tests.

3. Shared setup contract

shared/Shared.sol should keep setup in this order:

solidity
function setUp() public virtual override {
    super.setUp();
    vm.warp(7 days);
    _deployMockContracts();
    _deployContracts();
    _configureContracts();
    _fundInitialUsers();
    label();
}

Key rules:

  • deploy implementations with vm.deployCode, then proxies with vm.deployCode(Proxies.IG_PROXY); all artifact paths (including the proxy) come from tests/utils/Artifacts.sol — never inline a "contracts/...sol:Name" string in a test file
  • initialize proxies via proxy.initialize(impl, governor, initData)
  • cast proxies to interface types: ousd = IOToken(address(ousdProxy))
  • use vm.startPrank(governor) for config blocks
  • put labels at the end
  • gotcha: vm.deployCode loads from compiled artifacts; always run forge build contracts/ before forge test after modifying contract source

Mocks:

  • test-only mocks belong under tests/mocks/
  • existing production mocks under contracts/mocks/ should usually be extended in place
Show full SKILL.md (209 more words)Show less

4. Concrete test naming

File and contract naming:

text
concrete/RebaseOptIn.t.sol
Unit_Concrete_<ContractName>_RebaseOptIn_Test

Function naming patterns:

  • test_<function>()
  • test_<function>_<behavior>()
  • test_<function>_RevertWhen_<condition>()
  • test_<function>_emits<EventName>()

Casing rules:

  • function, behavior, and condition stay camelCase
  • RevertWhen is the only PascalCase token in the test name

Use exact revert strings with vm.expectRevert("...").

Emit events from interfaces, not concrete contracts:

solidity
vm.expectEmit(true, true, true, true);
emit IVault.EventName(arg1, arg2);

5. Fuzz tests

Contract name pattern:

text
Unit_Fuzz_<ContractName>_<Feature>_Test

Function pattern:

solidity
/// @notice Plain-English property description
function testFuzz_<function>_<property>(...) public { ... }

Rules:

  • always prefer bound() over vm.assume()
  • use assertEq for exact math
  • use assertApproxEqAbs where rounding is expected
  • focus on strong properties rather than sheer volume

Typical ranges in this repo:

  • USDC: bound(amount, 1, 1e12)
  • OUSD: bound(amount, 1e12, 100e18)
  • basis points: bound(bps, 1, 5000)
  • bounded yield: bound(yield_, 1, 3e5)

6. Foundry config expectations

Match the repository's fuzz configuration in contracts/foundry.toml when relevant. Keep tests deterministic and consistent with existing suite conventions.

Output expectations

When implementing tests:

  • use interface-only imports; no concrete contract imports except mocks
  • deploy contracts with vm.deployCode, not new (mocks are fine with new), and reference all artifact paths through tests/utils/Artifacts.sol — no inline "contracts/...sol:Name" strings
  • mirror the existing local test style before inventing new patterns
  • prefer coverage that matches real business logic paths over cosmetic line coverage
  • add both concrete and fuzz coverage when the function has stateful logic or arithmetic properties
  • keep new helpers in Shared.sol rather than duplicating setup across test files

© OriginProtocol, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/unit-test of OriginProtocol/origin-dollar.

Open the folder on GitHubat commit ae82163

Compare with similar skills

Unit Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unit Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unit Test this skillOriginProtocol/origin-dollar153—~1.6kAutomated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
Testing OpenLogi UIAprilNEA/OpenLogi23k—~1.1kAutomated safety check: PassApache-2.0
Go Testingcxuu/golang-skills1701 repos~1.3kAutomated safety check: PassApache-2.0
Contractssamchon/nestia2.2k—~1.3kAutomated safety check: PassMIT
Cohesion Over TestabilityEpicenterHQ/epicenter4.8k—~2kAutomated safety check: PassCustom licence

Similar skills

  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • Testing OpenLogi UI

    AprilNEA/OpenLogi

    Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.

    23k GitHub stars~1.1k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Go Testing

    cxuu/golang-skills

    A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

    170 GitHub starsUsed in 1 repo~1.3k tokens
    Testing & QAAuto-check passed
  • Contracts

    samchon/nestia

    Defines self-acknowledgments for production declarations and tests.

    2.2k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Cohesion Over Testability

    EpicenterHQ/epicenter

    Collapse test-shaped production boundaries while preserving behavior and coverage.

    4.8k GitHub stars~2k tokensUpdated today
    Testing & QAAuto-check passed
  • JS-in-HTML Testing

    liaohch3/claude-tap

    Tests JavaScript embedded in an HTML file in two layers: pytest checks of the logic ported to Python, and Playwright runs in a real browser for the DOM.

    3.3k GitHub stars~924 tokensUpdated 15 days ago
    Testing & QAAuto-check passed

More from OriginProtocol/origin-dollar

  • Fork Test

    OriginProtocol/origin-dollar

    Generate Foundry fork tests for contracts that need real on-chain integration coverage.

    153 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Organize Test

    OriginProtocol/origin-dollar

    Reorganize Foundry test files (.t.sol) for readability and consistency without changing semantics.

    153 GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Smoke Test

    OriginProtocol/origin-dollar

    Generate Foundry smoke tests that validate deployment health using DeployManager/Resolver against real on-chain state with pending governance applied.

    153 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Commit

    OriginProtocol/origin-dollar

    Handle git commits with auto-staging, targeted pre-commit formatting, and Conventional Commit messages.

    153 GitHub stars~850 tokensUpdated yesterday
    Auto-check: warnings
  • Talos Action Development

    OriginProtocol/origin-dollar

    Develop, modify, review, and maintain standalone Talos actions in contracts/tasks/actions, including chain guardrails, contract bindings, transaction safety, schedules, action catalogues, and Talos…

    153 GitHub stars~896 tokensUpdated yesterday
    Auto-check passed
  • Verify Deployment PR

    OriginProtocol/origin-dollar

    Verifies a POST-EXECUTION mainnet (or other network) smart-contract deployment PR for this repo: confirms every deployed contract is listed in the PR description, that the on-chain verified source…

    153 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check: notes

Categories

Questions about Unit Test

What does Unit Test do?

Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming. Unit Test is an agent skill from OriginProtocol/origin-dollar. Generate Foundry unit tests for a contract using this repository's conventions, structure, and naming.

When should I use Unit Test?

Unit Test fits situations like: the user asks for unit tests; tasks that involve Unit testing.

How do I install Unit Test in Claude Code?

Run `npx skills add OriginProtocol/origin-dollar --skill unit-test -a claude-code`. Or copy the skill folder (.codex/skills/unit-test in OriginProtocol/origin-dollar) into .claude/skills/unit-test in your project. Claude Code loads it when a task matches its description.

How do I install Unit Test in Codex?

Run `npx skills add OriginProtocol/origin-dollar --skill unit-test -a codex`. Or copy the skill folder (.codex/skills/unit-test in OriginProtocol/origin-dollar) into .agents/skills/unit-test in your project. Codex loads it when a task matches its description.

Can I use Unit Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OriginProtocol/origin-dollar --skill unit-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unit-test, .gemini/skills/unit-test, .github/skills/unit-test and .opencode/skills/unit-test in your project.

What does Unit Test need to run?

SKILL.md names no scripts, command-line tools or credentials: Unit Test is instructions for the agent only.

Does Unit Test access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unit Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unit Test use?

Unit Test is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unit Test use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Unit Test?

Skills that share tags, products or a category with Unit Test: TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), Testing OpenLogi UI (AprilNEA/OpenLogi, 23k stars), Go Testing (cxuu/golang-skills, 170 stars) and Contracts (samchon/nestia, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unit Test?

OriginProtocol (a GitHub organization) maintains it in OriginProtocol/origin-dollar, which has 153 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 6, 2026.

Source: OriginProtocol/origin-dollar on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.