lumina: Skill for Claude Code

.agents/skills/lumina_testing/SKILL.md

lumina_testing is a skill for Claude Code, Codex from zwl467135974/lumina. It costs 42 tokens per session (1,155 once invoked), scanned A, original, Apache-2.0.

A testing guide for Lumina Java applications, covering unit tests and integration tests. It explains Mockito, request context setup, transaction rollback, assertions, and tests using a real MySQL database.

In plain words
What is it for?
Use it when writing service, mapper, unit, or integration tests. Mockito creates test doubles, while integration tests check behavior with real database access; transaction rollback restores database state after a test.
Why use it?
It helps tests remain isolated and repeatable, especially in applications that track the current tenant and user. Cleaning the shared request context prevents one test from affecting another.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is zwl467135974/lumina's own configuration. It tells Claude Code and Codex how to work on lumina itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lumina configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zwl467135974/lumina. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zwl467135974/lumina/master/.agents/skills/lumina_testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/zwl467135974/lumina

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lumina_testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/zwl467135974/lumina/lumina_testing/github.svg)](https://agentmods.dev/skills/zwl467135974/lumina/lumina_testing)
Your own site
<a href="https://agentmods.dev/skills/zwl467135974/lumina/lumina_testing"><img src="https://agentmods.dev/badge/skills/zwl467135974/lumina/lumina_testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lumina_testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/zwl467135974/lumina/lumina_testing"><img src="https://agentmods.dev/badge/skills/zwl467135974/lumina/lumina_testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,155 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01155
Opus 5 $0.00021 $0.00577
Sonnet 5 $0.00008 $0.00231
Haiku 4.5 $0.00004 $0.00115

Measured 11d ago against content hash 572bface1b18, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

lumina_testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/lumina_testing/SKILL.md · 136 lines

How it starts

The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lumina 测试规范

功能概述

本技能包用于确保 Lumina 框架项目的测试代码质量,涵盖单元测试与集成测试的编写规范,包括 Mockito Mock 模式、BaseContext ThreadLocal 上下文设置、@Transactional 回滚隔离,以及基于真实 MySQL 的集成测试。

单元测试规范

基本结构

@ExtendWith(MockitoExtension.class)
class UserServiceTest {

    @Mock
    private UserMapper userMapper;

    @InjectMocks
    private UserServiceImpl userService;

    // ...
}
  • 使用 @ExtendWith(MockitoExtension.class) 替代 @SpringBootTest,避免启动容器
  • Mapper 层用 @Mock 模拟,Service 层用 @InjectMocks 自动注入
  • 禁止在单元测试中使用 @Autowired 注入真实 Bean

BaseContext 上下文设置

@BeforeEach
void setUp() {
    BaseContext.setCurrentTenantId(1L);
    BaseContext.setCurrentUserId(100L);
}

@AfterEach
void tearDown() {
    BaseContext.clear();
}
  • 每个 @BeforeEach 设置租户/用户上下文(ThreadLocal)
  • 每个 @AfterEach 必须调用 BaseContext.clear() 清理 ThreadLocal,防止线程污染
  • 忘记清理会导致后续测试的租户隔离失效

断言规范

// 正常用例
assertThat(result.getId()).isNotNull();
assertThat(result.getUsername()).isEqualTo("testuser");

// 异常用例:使用 assertThatThrownBy 验证 BusinessException
assertThatThrownBy(() -> userService.create(dto))
    .isInstanceOf(BusinessException.class)
    .hasMessageContaining("用户名已存在");

// 租户隔离验证
assertThatThrownBy(() -> userService.getById(otherTenantId))
    .isInstanceOf(BusinessException.class);
  • 正常用例:使用 AssertJ 的 assertThat 流式断言
  • 异常用例:使用 assertThatThrownBy 验证抛出的 BusinessException
  • 必须覆盖的场景:租户隔离、admin 保护、边界校验(空值/重复/越权)

集成测试规范

基类继承

class UserIntegrationTest extends BaseIntegrationTest {

    @Autowired
    private UserService userService;

    @Test
    @Transactional
    void createUserAndQuerySuccess() {
        // ...
    }
}
  • 所有集成测试继承 BaseIntegrationTest
  • BaseIntegrationTest 配置:@SpringBootTest + @ActiveProfiles("test")
  • test profile 连接本地 MySQL lumina_dev 数据库
  • 使用 @Transactional 保证测试数据自动回滚,不污染数据库

集成测试原则

  • 集成测试验证完整调用链路(Controller → Service → Mapper → DB)
  • 使用真实数据库验证 SQL 正确性、租户拦截器、权限检查
  • 每个 @Transactional 测试方法执行后自动回滚
  • 禁止在集成测试中 Mock 数据库层

Read the full file on GitHub · 136 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 136 lines · 42 tokens per session scan A 572bface1b18

Subscribe to this mod's changes

lumina_testing is a skill published in the GitHub repository zwl467135974/lumina (66 stars, last pushed 21d ago), licensed Apache-2.0. It adds 42 tokens to every session and 1,155 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.