Agent skill

Gen Ut

by apache in apache/shardingsphere

Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage…

Apache-2.0Auto-check passedTesting & QA

Install Gen Ut

skills CLI
$ npx skills add apache/shardingsphere --skill gen-ut -a claude-code

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

GitHub CLI
$ gh skill install apache/shardingsphere gen-ut --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/apache/shardingsphere.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/gen-ut .claude/skills/gen-ut && 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
gen-ut
GitHub stars
21k
Token cost
~3k tokens
SKILL.md length
1,544 words
Files
7 (incl. scripts, references)
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage…

  • Works in 5 steps: target method and branch skeleton are… → differences are mainly input data; → assertion skeleton is consistent or… → …
  • Tasks that involve Unit testing
  • SKILL.md covers Inputs and Scope, Ownership Terms, Mandatory Rules and Workflow, plus 1 more section
  • Runs Python scripts from its folder

What it does

Gen Ut is an agent skill from apache/shardingsphere. Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage target, and pass quality gates; perform explicit merge analysis, suitability filtering, and refactor optimization for parameterized tests.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/verification.md` and `scripts/collect_quality_baseline.py`).

It sits in Testing & QA, covering Unit testing and Quality gates. It works with SQL. The repository describes itself as: Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Unit testing
  • Tasks that involve Quality gates

Example prompts

  • “/gen-ut”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. target method and branch skeleton are consistent;
  2. differences are mainly input data;
  3. assertion skeleton is consistent or differences are explicitly declared;
  4. at least three scenarios exist;
  5. no switch dispatch is required.

What it can do on your machine

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

    Ships 2 files in scripts/ (Python), which the agent can run.

    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

Gen Ut loads about 3k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 1,544 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.3k

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); the scripts in this folder are not scanned.

SKILL.md

The full file from apache/shardingsphere at commit 44e364e, republished under its Apache-2.0 licence (© apache). 1,544 words, ~3,028 tokens.

Download SKILL.mdSave it as .claude/skills/gen-ut/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
gen-ut
description
Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage target, and pass quality gates; perform explicit merge analysis, suitability filtering, and refactor optimization for parameterized tests.

Generate Unit Tests

Inputs and Scope

Require target production classes, preferably as fully-qualified names. Accept an optional module and optional test-class execution filter. Discover related tests by the exact <TargetClassName>Test convention and update them in place; create that class only when none exists.

Resolve:

  • <ResolvedTargetClasses>: requested production classes.
  • <ResolvedTestFileSet>: only related test Java files and required test resources that may be edited.
  • <ResolvedTestModules>: explicit Maven modules owning those tests.
  • <ResolvedTestClass>: focused test-class filter for execution.

Use an explicitly supplied module first. Otherwise resolve the nearest owning pom.xml from test files, then target sources. If target classes or modules cannot be resolved, return R10-INPUT_BLOCKED.

Ownership Terms

  • SUT-owned behavior: decisions, branches, state changes, calls, results, or error handling owned by the target class.
  • Collaborator-owned behavior: behavior computed by an SPI, registry, factory, parser, loader, driver, dialect, metadata option, or another dependency.
  • Testing through layers: driving or asserting collaborator-owned rules instead of mocking the result consumed by the target.
  • KEEP:<id>:<reason>: evidence for retaining an otherwise redundant candidate because removal materially harms readability or diagnosis.
  • Task scope baseline: structured pre-edit snapshot of the allowed test files and every dirty path outside them.

Mandatory Rules

MUST, SHOULD, and MAY are normative. This section is the source of R1-R15; workflow and command examples do not override it.

R1: Repository authority

Before any test write, read AGENTS.md and code-implementation/SKILL.md through EOF, then read every reference selected by that base Skill for this task through EOF, including its implementation, testing, contract, impact, removal, non-regression, and verification rules. Follow the applicable CODE_OF_CONDUCT.md sections. The base Skill owns universal implementation, testing, non-regression, verification, and completion requirements; this Skill adds target resolution, coverage, branch-map, parameterization, and scanner requirements for systematic unit-test generation. Reading either Skill does not expand the user-authorized scope, file types, Git authority, or other permissions.

R2: Test form and naming
  • Use JUnit 5 @Test for standalone scenarios.
  • Use @ParameterizedTest(name = "{0}"), @MethodSource, and Arguments for data-driven scenarios. Declare final String name first and provide at least three rows.
  • Do not use @RepeatedTest, Consumer as scenario transport, switch dispatch inside parameterized tests, or new nested transport types.
  • Follow repository test naming. A single test uniquely covering one public method is assert<MethodName>.
R3: Change boundary
  • Edit only <ResolvedTestFileSet> under src/test/java or src/test/resources.
  • Do not edit production, generated output, unrelated tests, or another file type.
  • Capture Task scope baseline after resolving the file set and before editing. Any candidate-relevant changed path outside that set is a failure, including further mutation of a path already dirty at task start. Exclude only untracked or ignored reproducible verification outputs such as Maven target/ and Python __pycache__/; they are not editable scope and must not be modified intentionally.
  • Obtain explicit approval before expanding scope. Never use destructive Git operations.
R4: Branch map
  • Before coding, enumerate target public-method branches and map each planned scenario to one branch or path.
  • Classify every trigger and assertion as SUT-owned or collaborator-owned. Isolate collaborator-owned results at the nearest stable boundary and apply R6 to decide whether to mock them.
  • Exclude Lombok-generated behavior without custom logic. Default to one test per branch or path; use R13 for additional cases.
R5: Scenario granularity
  • Keep one scenario per test and invoke the target public method once by default. Invoke it more than once only when repeated invocation is itself the scenario, such as idempotency, accumulation, or a state transition.
  • Keep the coverage-relevant invocation and its externally observable assertions in the test body. Helpers and providers must not execute target behavior.
  • For interface targets, test owned default or static methods directly. Exercise abstract contracts through concrete implementations, including when the user explicitly requests an interface-contract test.
R6: SPI, mocks, and reflection
  • Exercise interface default methods with Mockito CALLS_REAL_METHODS.
  • Obtain SPI targets through the applicable project loader and keep the resolved instance as a test-class field by default. Record a concrete reason before bypassing the loader.
  • Do not add tests for getType, getOrder, or getTypeClass unless explicitly requested.
  • Mock heavy dependencies and collaborator-owned decisions. Allow real simple values and explicitly scoped integration, contract, or E2E behavior.

Update existing related tests in place and fill missing coverage first. An explicit test-class input filters execution only; it does not replace related-test discovery. Create a new exact-name test class only when none exists.

R8: Parameterization analysis

For each target public method, record R8-CANDIDATES with the method, candidate count, decision, and evidence. A candidate is high-fit only when all are true:

  1. target method and branch skeleton are consistent;
  2. differences are mainly input data;
  3. assertion skeleton is consistent or differences are explicitly declared;
  4. at least three scenarios exist;
  5. no switch dispatch is required.

Collaborator-owned differences are not high-fit. Refactor high-fit candidates; otherwise record the concrete reason. Use KEEP only when a genuinely high-fit refactor would materially reduce readability or diagnosis.

The scanner discovers possible groups but never decides semantic high-fit. Treat its candidate count as evidence to review, not an instruction to refactor.

R9: Coverage blockers

When unreachable production code blocks coverage, report the class, path, exact line, and reason. Do not change production code within this Skill.

R10: Completion state

Use exactly one state:

  • R10-INPUT_BLOCKED: target classes or test modules cannot be resolved.
  • R10-A: scope is clean; focused tests execute at least one test; declared target coverage is met for every target and inner class; repository formatting/checkstyle gates pass; both final rule scans pass; semantic reviews and R8 decisions are complete.
  • R10-B: production dead code blocks the target and R9 evidence is complete.
  • R10-C: an out-of-scope failure is evidenced under R11.
  • R10-D: work remains; continue instead of claiming completion.

Priority is INPUT_BLOCKED > B > C > A > D. By default, cover the requested behavior and every affected SUT-owned branch. Apply a numeric CLASS, LINE, or BRANCH target only when the user states it; an explicit 100% target remains mandatory.

Show full SKILL.md (579 more words)Show less
R11: Failures

Fix in-scope failures and rerun the focused test plus mechanical rule scan. For out-of-scope failures, record command, exit code, decisive lines, and blocking file/line, then request direction. Retry transient dependency or network failures at most twice. Minimal repair checks never replace final gates.

R12: Existing full coverage

If reproducible target-class evidence is already 100%, skip coverage completion and perform only required optimization and quality work. Mark R4=N/A (triggered by R12) and retain the coverage command and report path.

R13: Necessity trimming
  • Treat equal line/branch coverage only as a duplicate candidate, never as removal proof.
  • Remove a test only when it adds no unique branch, input class, boundary, calculation path, failure mode, contract, collaborator interaction, or externally observable regression protection.
  • Remove collaborator-only tests from the target unit test and report the separate owner when coverage is needed there.
  • Remove redundant stubs, assertions, and locals that affect neither behavior nor diagnosis. Prefer Mockito defaults when the scenario permits.
  • Apply KEEP only to an otherwise redundant item retained for a concrete readability or diagnostic reason; meaningful tests need no tag.
R14: Boolean assertions

Use assertTrue/assertFalse for literal or constant expectations and assertThat(actual, is(expected)) for variable expectations. Do not use boolean assertEquals, boolean literals inside Hamcrest is, or control flow whose only purpose is selecting assertTrue versus assertFalse. Run the mechanical scan after implementation stabilizes and again immediately before delivery.

R15: Delivery gates
  • R15-A: complete the semantic R8 decision; the scanner cannot infer high-fit.
  • R15-B: confirm any metadata-accessor candidate was explicitly requested; the scanner only reports likely candidates.
  • R15-C: compare the final worktree with Task scope baseline; any candidate-relevant out-of-scope mutation fails. Ignore only reproducible, untracked or Git-ignored verification outputs.
  • R15-D: every parameterized test uses @MethodSource with at least three Arguments rows. Inspect external providers manually.
  • R15-E: the first parameter is exactly final String name.
  • R15-F: parameterized bodies contain no switch.
  • R15-G: parameterized test changes add no nested transport type.
  • R15-H: boolean assertions obey R14 without assertion-dispatch control flow.
  • R15-I: parameterized signatures and provider rows contain no Consumer; inspect external providers manually.
  • R15-J: helpers and providers do not invoke target public methods. Treat scanner results as partial evidence and inspect unresolved ownership manually.

Workflow

  1. Complete the R1 source loading, then read this Skill's verification commands through EOF.
  2. Resolve targets, related tests, editable files, modules, and input-blocked state.
  3. Create a task-specific temporary directory and capture Task scope baseline for the resolved file set.
  4. Run focused baseline coverage through the repository command wrapper, then use collect_quality_baseline.py to report coverage and mechanical risks.
  5. Decide R12; otherwise record the SUT/collaborator ownership boundary and R4 branch map.
  6. Review scanner candidates against every R8 condition and record candidate-level decisions.
  7. Check R9, then implement the smallest tests allowed by R2-R7.
  8. After each coherent edit, run the lightweight precheck, focused test, and mechanical scan.
  9. Apply R13, re-run coverage, and inspect semantic R15-A/B/D/I/J obligations.
  10. Run final coverage, repository formatting/checkstyle gates, and the two required mechanical scans.
  11. Recheck scope against the baseline and decide R10 twice before delivery.

Do not reuse a prior task's test or coverage result. Final coverage must execute tests for the effective candidate.

Output

Include:

  • R10=<state>;
  • aggregated CLASS/LINE/BRANCH counters and ratios for every target plus inner classes;
  • R8-CANDIDATES with candidate decisions and evidence;
  • branch/ownership mapping, or the R12 exemption;
  • executed commands, exit codes, and bounded log paths/summaries;
  • rule-to-evidence mapping for R1-R15;
  • blocker and next action when state is not R10-A.

Never use completion wording for R10-D.

© apache, 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

SKILL.md and 6 other files (scripts, references) in .codex/skills/gen-ut of apache/shardingsphere.

  • SKILL.md
  • agents/openai.yaml
  • references/verification.md
  • scripts/collect_quality_baseline.py
  • scripts/scan_quality_rules.py
  • tests/test_collect_quality_baseline.py
  • tests/test_scan_quality_rules.py

Open the folder on GitHubat commit 44e364e

Compare with similar skills

Gen Ut 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.

Gen Ut compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gen Ut this skillapache/shardingsphere21k—~3kAutomated safety check: PassApache-2.0
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Checkav1155/houndarr292—~366Automated safety check: PassAGPL-3.0
Hydra Devstreamband/hydra-srt146—~995Automated safety check: PassApache-2.0
Pump Testingnirholas/pump-fun-sdk1331 repos~706Automated safety check: PassCustom licence

Similar skills

  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Check

    av1155/houndarr

    Run Houndarr's full quality gate (ruff lint, ruff format check, mypy, bandit, pytest) and report results in a single table.

    292 GitHub stars~366 tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Hydra Dev

    streamband/hydra-srt

    Run HydraSRT development workflows: mix q quality gate, Elixir unit/E2E tests, native Rust tests, web Vitest/Playwright, and make dev.

    146 GitHub stars~995 tokensUpdated 21 days ago
    Testing & QAAuto-check passed
  • Pump Testing

    nirholas/pump-fun-sdk

    Multi-language test infrastructure for the Pump SDK — Rust unit/integration/security/performance tests, TypeScript Jest tests, Python fuzz tests, shell test orchestration, Criterion benchmarks, and…

    133 GitHub starsUsed in 1 repo~706 tokens
    Testing & QAAuto-check passed
  • cmux Testing Rules

    disler/learning-cmux-with-agents

    Testing rules for the cmux Swift codebase: Swift Testing as the default framework, a two-commit regression policy, and tests that check runtime behavior, not source text.

    115 GitHub stars~1.2k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed

More from apache/shardingsphere

  • Review PR

    apache/shardingsphere

    Review Apache ShardingSphere or user-authorized downstream pull requests and PR discussions from public or authorized repository evidence.

    21k GitHub stars~6.4k tokensUpdated today
    Auto-check passed
  • Code Implementation

    apache/shardingsphere

    Implement, fix, refactor, or remove repository code under required scope, non-regression, verification, and review gates.

    21k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Coding Standards

    apache/shardingsphere

    Apply Apache ShardingSphere's written coding standards when explicitly requested, or when code-implementation routes task-changed production, test, script, build, generated, or Maven POM artifacts…

    21k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Analyze Issue

    apache/shardingsphere

    Used to analyze Apache ShardingSphere community issues. An agent skill from apache/shardingsphere.

    21k GitHub stars~6.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Gen Ut

What does Gen Ut do?

Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage…. Gen Ut is an agent skill from apache/shardingsphere. Generate standard unit tests for one or more target classes in Apache ShardingSphere; cover requested behavior and every affected SUT-owned branch, enforce an explicitly requested numeric coverage target, and pass quality gates; perform explicit merge analysis, suitability filtering, and refactor optimization for parameterized tests.

When should I use Gen Ut?

Gen Ut fits situations like: tasks that involve Unit testing; tasks that involve Quality gates.

How do I install Gen Ut in Claude Code?

Run `npx skills add apache/shardingsphere --skill gen-ut -a claude-code`. Or copy the skill folder (.codex/skills/gen-ut in apache/shardingsphere) into .claude/skills/gen-ut in your project. Claude Code loads it when a task matches its description.

How do I install Gen Ut in Codex?

Run `npx skills add apache/shardingsphere --skill gen-ut -a codex`. Or copy the skill folder (.codex/skills/gen-ut in apache/shardingsphere) into .agents/skills/gen-ut in your project. Codex loads it when a task matches its description.

Can I use Gen Ut 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 apache/shardingsphere --skill gen-ut -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gen-ut, .gemini/skills/gen-ut, .github/skills/gen-ut and .opencode/skills/gen-ut in your project.

What does Gen Ut need to run?

Going by SKILL.md and its folder, Gen Ut needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Gen Ut 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 Gen Ut 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Gen Ut use?

Gen Ut 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 Gen Ut use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Gen Ut?

Skills that share tags, products or a category with Gen Ut: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Test Guard (amElnagdy/guard-skills, 1.3k stars), Check (av1155/houndarr, 292 stars) and Hydra Dev (streamband/hydra-srt, 146 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gen Ut?

apache (a GitHub organization) maintains it in apache/shardingsphere, which has 20,804 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 7, 2026.

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