TDD Guide
alirezarezvani/claude-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
Implement JUnit 5, Mockito, and AssertJ patterns with 80%+ code coverage for CIA platform unit tests
$ npx skills add Hack23/cia --skill unit-testing-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Hack23/cia unit-testing-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/unit-testing-patterns .claude/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.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/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .claude/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Hack23/cia --skill unit-testing-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Hack23/cia unit-testing-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/unit-testing-patterns .agents/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .agents/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill unit-testing-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Hack23/cia unit-testing-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/unit-testing-patterns .cursor/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .cursor/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Hack23/cia.git --path .github/skills/unit-testing-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Hack23/cia --skill unit-testing-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Hack23/cia unit-testing-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/unit-testing-patterns .gemini/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .gemini/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Hack23/cia unit-testing-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Hack23/cia --skill unit-testing-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/unit-testing-patterns .github/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .github/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Hack23/cia --skill unit-testing-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Hack23/cia unit-testing-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Hack23/cia.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/unit-testing-patterns .opencode/skills/unit-testing-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "unit-testing-patterns" agent skill from https://github.com/Hack23/cia/tree/master/.github/skills/unit-testing-patterns into .opencode/skills/unit-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "unit-testing-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
unit-testing-patternsImplement JUnit 5, Mockito, and AssertJ patterns with 80%+ code coverage for CIA platform unit tests
Unit Testing Patterns is an agent skill from Hack23/cia. Implement JUnit 5, Mockito, and AssertJ patterns with 80%+ code coverage for CIA platform unit tests
Its SKILL.md is about 1.9k 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 and Test coverage. It works with JUnit. The repository describes itself as: Citizen Intelligence Agency. Open-source intelligence platform analyzing Swedish political activities using AI and data visualization. Tracks politicians, government… The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 6a9797b. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are java and xml).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
junit.orgassertj.github.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Unit Testing Patterns loads about 1.9k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 79 words of instructions outside code blocks.
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.
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.
The full file from Hack23/cia at commit 6a9797b, republished under its Apache-2.0 licence (© Hack23). 79 words, ~1,912 tokens.
.claude/skills/unit-testing-patterns/SKILL.md (or your agent's skills folder).Write effective, maintainable unit tests using JUnit 5, Mockito, and AssertJ that achieve 80%+ code coverage.
@ExtendWith(MockitoExtension.class)
class PoliticianServiceTest {
@Mock
private PoliticianRepository repository;
@Mock
private AuditLogger auditLogger;
@InjectMocks
private PoliticianService service;
@Test
@DisplayName("Should find politician by ID when exists")
void shouldFindPoliticianById() {
// Arrange
String politicianId = "196401011234";
Politician expected = new Politician(politicianId, "John", "Doe");
when(repository.findById(politicianId)).thenReturn(Optional.of(expected));
// Act
Politician actual = service.findById(politicianId);
// Assert
assertThat(actual).isNotNull();
assertThat(actual.getId()).isEqualTo(politicianId);
assertThat(actual.getFirstName()).isEqualTo("John");
}
@Test
@DisplayName("Should throw exception when politician not found")
void shouldThrowExceptionWhenNotFound() {
// Arrange
String politicianId = "999999999999";
when(repository.findById(politicianId)).thenReturn(Optional.empty());
// Act & Assert
assertThatThrownBy(() -> service.findById(politicianId))
.isInstanceOf(ResourceNotFoundException.class)
.hasMessageContaining("Politician not found");
}
}@ParameterizedTest
@CsvSource({
"196401011234, true",
"999999999999, true",
"12345, false",
"abcdefghijkl, false",
"'', false"
})
@DisplayName("Should validate Swedish personal ID format")
void shouldValidatePersonalIdFormat(String personalId, boolean expected) {
assertThat(validator.isValidPersonalId(personalId)).isEqualTo(expected);
}
@ParameterizedTest
@ValueSource(strings = {"password", "12345678", "qwerty", "admin"})
@DisplayName("Should reject common passwords")
void shouldRejectCommonPasswords(String password) {
assertThat(passwordValidator.isWeak(password)).isTrue();
}class DatabaseTest {
@BeforeAll
static void setupClass() {
// Run once before all tests
initializeTestDatabase();
}
@BeforeEach
void setup() {
// Run before each test
clearDatabase();
}
@AfterEach
void teardown() {
// Run after each test
rollbackTransaction();
}
@AfterAll
static void teardownClass() {
// Run once after all tests
closeConnections();
}
}@Test
void shouldReturnCachedData() {
// Stub method to return specific value
when(cache.get("key")).thenReturn("value");
// Stub with argument matchers
when(repository.findByName(anyString())).thenReturn(new ArrayList<>());
// Stub with custom answer
when(service.process(any())).thenAnswer(invocation -> {
String arg = invocation.getArgument(0);
return arg.toUpperCase();
});
// Stub to throw exception
when(repository.findById("invalid"))
.thenThrow(new IllegalArgumentException("Invalid ID"));
}@Test
void shouldLogAuditEvent() {
// Arrange
Politician politician = new Politician("123", "John", "Doe");
// Act
service.create(politician);
// Verify method was called once
verify(auditLogger).log(eq("CREATE_POLITICIAN"), any(Politician.class));
// Verify exact number of calls
verify(repository, times(1)).save(politician);
// Verify never called
verify(emailService, never()).sendNotification(any());
// Verify no more interactions
verifyNoMoreInteractions(auditLogger);
}@Test
void shouldSaveWithCorrectTimestamp() {
ArgumentCaptor<Politician> captor = ArgumentCaptor.forClass(Politician.class);
service.create(new Politician("123", "John", "Doe"));
verify(repository).save(captor.capture());
Politician saved = captor.getValue();
assertThat(saved.getCreatedAt()).isCloseTo(
LocalDateTime.now(),
within(1, ChronoUnit.SECONDS)
);
}@Test
void shouldHaveCorrectProperties() {
Politician politician = service.findById("123");
// Fluent assertions
assertThat(politician)
.isNotNull()
.hasFieldOrPropertyWithValue("firstName", "John")
.hasFieldOrProperty("lastName")
.extracting("party")
.isEqualTo("S");
// Collection assertions
List<Politician> politicians = service.findAll();
assertThat(politicians)
.isNotEmpty()
.hasSize(5)
.extracting("firstName")
.contains("John", "Jane")
.doesNotContain("Invalid");
// Exception assertions
assertThatThrownBy(() -> service.delete("invalid"))
.isInstanceOf(NotFoundException.class)
.hasMessage("Politician not found")
.hasNoCause();
}<!-- pom.xml -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>src/test/java/
└── com/hack23/cia/
├── service/
│ ├── impl/
│ │ ├── PoliticianServiceTest.java
│ │ └── VotingAnalysisServiceTest.java
│ └── api/
│ └── PoliticianServiceIT.java (Integration tests)
├── util/
│ ├── DateUtilsTest.java
│ └── ValidationUtilsTest.java
└── testfoundation/
├── TestDataFactory.java
└── AbstractServiceTest.java© Hack23, 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
Just SKILL.md in .github/skills/unit-testing-patterns of Hack23/cia.
Open the folder on GitHubat commit 6a9797b
Unit Testing Patterns 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Unit Testing Patterns this skillHack23/cia | 239 | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| TDD Guidealirezarezvani/claude-skills | 28k | — | ~3.4k | Automated safety check: Pass | MIT | |
| TDD GuideLeoYeAI/openclaw-master-skills | 2.2k | — | ~1.4k | Automated safety check: Pass | MIT | |
| Interval Guided Regression Test UpdateArabelaTso/Skills-4-SE | 253 | — | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| Java Regression Test GeneratorArabelaTso/Skills-4-SE | 253 | — | ~4k | Automated safety check: Pass | Apache-2.0 | |
| Test Oracle GeneratorArabelaTso/Skills-4-SE | 253 | — | ~3.5k | Automated safety check: Pass | Apache-2.0 |
alirezarezvani/claude-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
LeoYeAI/openclaw-master-skills
Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…
ArabelaTso/Skills-4-SE
Automatically updates regression tests based on interval analysis to maintain coverage of key program intervals.
ArabelaTso/Skills-4-SE
Automatically generate regression tests for Java codebases by analyzing changes between old and new code versions.
ArabelaTso/Skills-4-SE
Generates automated test oracles to verify correct software behavior.
ArabelaTso/Skills-4-SE
Analyze existing test suites and source code to suggest additional unit tests that improve test coverage.
Hack23/cia
WCAG 2.1 AA compliance, ARIA attributes, keyboard navigation, screen reader optimization for accessible political data platforms
Hack23/cia
Advanced chart types, D3.js/Vaadin Charts patterns, political data visualization, time series analysis
Hack23/cia
AI governance, EU AI Act compliance, OWASP LLM security, responsible AI practices for GitHub Copilot agents
Hack23/cia
External API integration patterns, retry logic, circuit breakers, caching, rate limiting for government data APIs
Hack23/cia
AWS CloudWatch metrics, alarms, dashboards, log insights, and application monitoring for the CIA platform
Hack23/cia
AWS security best practices, VPC security, IAM, KMS, CloudTrail, GuardDuty for CIA platform deployment
Works with
Categories
Implement JUnit 5, Mockito, and AssertJ patterns with 80%+ code coverage for CIA platform unit tests. Unit Testing Patterns is an agent skill from Hack23/cia.
Unit Testing Patterns fits situations like: tasks that involve Unit testing; tasks that involve Test coverage.
Run `npx skills add Hack23/cia --skill unit-testing-patterns -a claude-code`. Or copy the skill folder (.github/skills/unit-testing-patterns in Hack23/cia) into .claude/skills/unit-testing-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Hack23/cia --skill unit-testing-patterns -a codex`. Or copy the skill folder (.github/skills/unit-testing-patterns in Hack23/cia) into .agents/skills/unit-testing-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Hack23/cia --skill unit-testing-patterns -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-testing-patterns, .gemini/skills/unit-testing-patterns, .github/skills/unit-testing-patterns and .opencode/skills/unit-testing-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Unit Testing Patterns is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: junit.org and assertj.github.io. This is read from the text; nothing was executed.
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.
Unit Testing Patterns is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Unit Testing Patterns: TDD Guide (alirezarezvani/claude-skills, 28k stars), TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars), Interval Guided Regression Test Update (ArabelaTso/Skills-4-SE, 253 stars) and Java Regression Test Generator (ArabelaTso/Skills-4-SE, 253 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Hack23 (a GitHub organization) maintains it in Hack23/cia, which has 239 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 6, 2026.
Source: Hack23/cia on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.