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.
curl -O https://raw.githubusercontent.com/zwl467135974/lumina/master/.agents/skills/lumina_testing/SKILL.mdgit clone --depth 1 https://github.com/zwl467135974/luminaWrote 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.
[](https://agentmods.dev/skills/zwl467135974/lumina/lumina_testing)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00042 | $0.01155 |
| Opus 5.5 | $0.00017 | $0.00462 |
| Sonnet 5.5 | $0.00008 | $0.00231 |
| Haiku 4.5 | $0.00004 | $0.00115 |
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 2mo 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.
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 数据库层
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.
- 2mo ago First seen · 136 lines · 42 tokens per session scan A 572bface1b18
lumina_testing is a skill published in the GitHub repository zwl467135974/lumina (91 stars, last pushed 1mo 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.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.
lumina_testing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| lumina_testingzwl467135974/lumina | Skill | 91 | 1mo ago | Apache-2.0 | A | 42 | Claude Code, Codex |
| test-masterJeffallan/claude-skills | Skill | 12k | 7d ago | MIT | A | 104 | Claude Code |
| migrate-xunit-to-xunit-v3dotnet/skills | Skill | 5.8k | yesterday | MIT | A | 149 | Claude Code |
| go-testingGentleman-Programming/gentle-ai | Skill | 8.4k | yesterday | MIT | A | 26 | Claude Code, Codex |
| principle-test-behavior-not-implementationmichael-denyer/pstack-claude | Skill | 4.1k | yesterday | MIT | A | 50 | Claude Code |
| dart-testdartsim/dart | Skill | 1.2k | yesterday | BSD-2-Clause | A | 18 | Claude Code, Codex |
| test-generatorrshankras/claude-code-apple-skills | Skill | 864 | 2d ago | MIT | A | 33 | Claude Code |