Agent skill

Manage Corpus Tests

by ballerina-nutcracker in ballerina-nutcracker/ballerina

“Creating/updating corpus tests”

— description from SKILL.md by ballerina-nutcracker
Apache-2.0Auto-check passedTesting & QA

Install Manage Corpus Tests

skills CLI
$ npx skills add ballerina-nutcracker/ballerina --skill manage-corpus-tests -a claude-code

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

GitHub CLI
$ gh skill install ballerina-nutcracker/ballerina manage-corpus-tests --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/ballerina-nutcracker/ballerina.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/manage-corpus-tests .claude/skills/manage-corpus-tests && 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
manage-corpus-tests
GitHub stars
120
Token cost
~1.1k tokens
SKILL.md length
637 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
Apache-2.0

At a glance

  • SKILL.md covers Test philosophy: corpus tests…, Test markers, Updating corpus tests and Validating corpus tests
  • Calls git and go

About this skill

Manage Corpus Tests is a skill in ballerina-nutcracker/ballerina (120 stars). Its SKILL.md is about 1.1k tokens. Licence: Apache-2.0.

What it can do on your machine

Read from SKILL.md and the folder at commit 4b649aa. 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

    Shell commands in SKILL.md call:

    • git
    • go

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Manage Corpus Tests loads about 1.1k tokens when it runs. Until then it costs about 13 tokens; SKILL.md has 637 words of instructions outside code blocks.

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

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 ballerina-nutcracker/ballerina at commit 4b649aa, republished under its Apache-2.0 licence (© ballerina-nutcracker). 637 words, ~1,110 tokens.

Download SKILL.mdSave it as .claude/skills/manage-corpus-tests/SKILL.md (or your agent's skills folder).
name
manage-corpus-tests
description
Creating/updating corpus tests

Test philosophy: corpus tests are primary, Go unit tests are the exception

Prefer a corpus .bal test over a Go unit test for everything reachable from Ballerina source. A corpus test runs the full compiler → BIR → interpreter pipeline, so it catches compiler, BIR, and runtime issues — a Go unit test that calls a native helper directly only exercises the runtime. If you cannot write a corpus test for a scenario, that scenario generally cannot happen in the real world.

Corpus tests also count toward native Go coverage: the coverage harness runs ./corpus/... under -coverpkg=./lib/stdlibs/..., so the interpreter executing native code during a corpus run is measured. You do not need Go unit tests to hit a coverage target — drive the native code from .bal instead.

Write a Go unit test only for code that genuinely cannot execute through Ballerina, and keep it minimal:

  • Defensive type/arity guards. The type checker guarantees extern argument types and arity, so a wrong-type or missing-argument fallback can never be hit from .bal (passing the wrong type is a compile error — see any *-e.bal @error argument type mismatch). Codebase convention is to not write these guards at all: extern args use x, _ := args[i].(T), not if !ok { return error }.
  • Nil guards on values that are never nil when they arrive from Ballerina (e.g. a *decimal.Decimal argument).
  • Interface-contract paths the runtime never triggers (e.g. a transform.Transformer ErrShortDst branch when x/text sizes its own buffers).

When a unit test is justified, say why it is unreachable from Ballerina in a comment so the exception is auditable.

Remove dead code rather than test it. Any Go code that can never execute through Ballerina (an unused helper, a wrong-type error branch the compiler already rejects) is redundant even when a unit test covers it — delete the code and the test. The exemption is only for genuine edge-case / error-handling branches that can be reached with a malformed but well-typed value (bad charset name, malformed date string, out-of-range offset) — cover those from .bal.

Show full SKILL.md (307 more words)Show less

Test markers

  • corpus tests use the following comments as markers
    • @output <expected output>
      • Test harness parses the file top to bottom extracting the expected output and compares it against stdout.
      • Generally it is a good idea to put this right next to the print function call
    • @error
      • Test harness validates that each frontend error covers one of these markers
        • For errors that are covered by multiple lines it is sufficient to have one marker in one of those lines
      • IMPORTANT: Test harness doesn't validate error messages
    • @panic
      • When there is a runtime panic, test harness validates that the top stack frame location (file:line) matches this annotation

Updating corpus tests

  • In order to update golden files used for tests, run the tests with --update flag.
    • example: go test ./corpus --update
    • golden stage files for a .bal are produced by several packages — regenerate across ./ast/... ./semantics/... ./desugar/... ./bir/... ./corpus/ to cover ast/cfg/desugared/bir/integration goldens.
    • Standard-library tests live under corpus/lib/ (a sibling of corpus/bal/, discovered separately) and have no per-stage goldens at all — only corpus/integration/lib/**.txtar, via the TestLibIntegration driver in corpus/integration_test.go. The per-stage drivers never see them -- corpus/lib/ sits outside corpus/bal/, so stage discovery does not reach it and those test files are untouched. TestLibIntegration runs the full pipeline per test and validates its @output/@error/@panic markers.
  • You will get test failures for any file that got updated.
  • Then use git diff on all updated golden files to confirm changes match with the expectations
  • Watch for unrelated drift. --update may rewrite goldens for files you never touched (some stages have non-deterministic ordering, e.g. const/record-field iteration). After updating, git status and revert any change outside the files you added/edited (git checkout <path>) so the changeset stays scoped to your work.

Validating corpus tests

  • It is a good idea to validate output by running corpus files against the java implementation using bal run $file

© ballerina-nutcracker, Apache-2.0. 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 .agents/skills/manage-corpus-tests of ballerina-nutcracker/ballerina.

Open the folder on GitHubat commit 4b649aa

Compare with similar skills

Manage Corpus Tests 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.

Manage Corpus Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Manage Corpus Tests this skillballerina-nutcracker/ballerina120—~1.1kAutomated safety check: PassApache-2.0
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-skills1721 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 today
    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.

    172 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 2 days ago
    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 yesterday
    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 17 days ago
    Testing & QAAuto-check passed

More from ballerina-nutcracker/ballerina

  • Stdlib Readme Format

    ballerina-nutcracker/ballerina

    Authoritative format contract for lib/stdlibs/ballerina/<name/0.0.1/go1.27/README.md files.

    120 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Add Stdlib Support

    ballerina-nutcracker/ballerina

    Port a new ballerina/<name stdlib package from jBallerina to this Go-native interpreter.

    120 GitHub stars~6.3k tokensUpdated today
    Auto-check passed
  • Fill Stdlib Gap

    ballerina-nutcracker/ballerina

    Fill a gap in an existing ballerina/<name stdlib — implement a function marked Not Yet Supported, promote a Partially Supported row, or fix a behavioural divergence.

    120 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Validate Stdlib Contract

    ballerina-nutcracker/ballerina

    Validate that a ballerina/<name stdlib's Go public contract does not break the jBallerina public interface.

    120 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Run Jballerina

    ballerina-nutcracker/ballerina

    Run a given Ballerina source file with jBallerina to compare behaviour against this interpreter

    120 GitHub stars~241 tokensUpdated today
    Auto-check passed
  • Filling Subset Doc

    ballerina-nutcracker/ballerina

    A skill your agent uses when you are asked to fill in a subset doc (./doc/lang/subset.md)

    120 GitHub stars~119 tokensUpdated today
    Auto-check passed

Categories

Questions about Manage Corpus Tests

How do I install Manage Corpus Tests in Claude Code?

Run `npx skills add ballerina-nutcracker/ballerina --skill manage-corpus-tests -a claude-code`. Or copy the skill folder (.agents/skills/manage-corpus-tests in ballerina-nutcracker/ballerina) into .claude/skills/manage-corpus-tests in your project. Claude Code loads it when a task matches its description.

How do I install Manage Corpus Tests in Codex?

Run `npx skills add ballerina-nutcracker/ballerina --skill manage-corpus-tests -a codex`. Or copy the skill folder (.agents/skills/manage-corpus-tests in ballerina-nutcracker/ballerina) into .agents/skills/manage-corpus-tests in your project. Codex loads it when a task matches its description.

Can I use Manage Corpus Tests 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 ballerina-nutcracker/ballerina --skill manage-corpus-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/manage-corpus-tests, .gemini/skills/manage-corpus-tests, .github/skills/manage-corpus-tests and .opencode/skills/manage-corpus-tests in your project.

What does Manage Corpus Tests need to run?

Going by SKILL.md and its folder, Manage Corpus Tests needs the command-line tools its instructions call (git and go).

Does Manage Corpus Tests access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Manage Corpus Tests 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 Manage Corpus Tests use?

Manage Corpus Tests is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Manage Corpus Tests use?

About 1.1k tokens (SKILL.md is roughly 4.4k 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 Manage Corpus Tests?

Skills that share tags, products or a category with Manage Corpus Tests: TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars), Testing OpenLogi UI (AprilNEA/OpenLogi, 23k stars), Go Testing (cxuu/golang-skills, 172 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 Manage Corpus Tests?

ballerina-nutcracker (a GitHub organization) maintains it in ballerina-nutcracker/ballerina, which has 120 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 9, 2026.

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