Codex gen-ut for ShardingSphere Java Unit Tests and Branch Coverage
Give Codex a ShardingSphere Java target class and Maven module. The skill maps branches owned by the class before updating its tests, checks whether parameterized cases belong together, and accounts for any requested numeric coverage target.
中文Install in Codex
Codex and a ShardingSphere checkout containing the skill. Running tests also requires the repository's JDK and a working Maven environment.
- In a ShardingSphere checkout containing the pinned source, confirm `.codex/skills/gen-ut/SKILL.md` and the adjacent `code-implementation` skill are present. Keep the repository layout intact.
- Open the repository root in Codex and give `$gen-ut` the fully qualified class name. If the picker does not list the skill, ask Codex to read `.codex/skills/gen-ut/SKILL.md` and `AGENTS.md` explicitly in the same task.
Example task
In a local ShardingSphere practice branch, select a routing-rule class with an existing unit test. Ask Codex: ‘$gen-ut, use the Java file I have open. First report its fully qualified name, Maven module, and the rule-present and rule-absent branches. After confirmation, update only the corresponding Test file.’What to check
The branch map identifies both cases and their assertions. After confirmation, changes stay within the matching test file and any required test resources. Report the Maven result or the reason the command could not run.
Original SKILL.md on GitHub · Updated
Frequently asked question
Does gen-ut require a new test class?
Look for `<TargetClassName>Test` first. Extend an existing matching test class and create one only when there is no match.