test-writer

test-writer is a skill for Claude Code, Codex from miniidealab/openlogos. It costs 0 tokens per session (3,066 once invoked), scanned A, original, Apache-2.0.

A test-planning guide that turns product scenarios, API specifications, database rules, and requirements into unit and scenario test cases.

In plain words
What is it for?
It is for planning tests for API services, command-line tools, front-end applications, and libraries. It covers field validation, database constraints, business rules, and complete user scenarios.
Why use it?
It helps decide what to test before code is written, including normal and error paths. This reduces the chance that input rules, database restrictions, or acceptance conditions are missed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/miniidealab/openlogos/test-writer
Any agent
npx skills add miniidealab/openlogos --skill test-writer
Clone the repo
git clone --depth 1 https://github.com/miniidealab/openlogos

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/miniidealab/openlogos/test-writer.svg)](https://agentmods.dev/skills/miniidealab/openlogos/test-writer)
Your own site
<a href="https://agentmods.dev/skills/miniidealab/openlogos/test-writer"><img src="https://agentmods.dev/badge/skills/miniidealab/openlogos/test-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,066 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.03066
Opus 5 $0.00000 $0.01533
Sonnet 5 $0.00000 $0.00613
Haiku 4.5 $0.00000 $0.00307

Measured 5d ago against content hash d94cf0359075, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-writer 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 5d 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.

examples/flowtask/logos/skills/test-writer/SKILL.md · 248 lines

How it starts

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

Skill: Test Writer

基于时序图、API 规格和 DB 约束,为每个业务场景设计单元测试用例和场景测试用例。适用于所有项目类型(API 服务、CLI 工具、前端应用、库等),是代码生成前的必要前置步骤。

触发条件

  • 用户要求设计测试用例或测试方案
  • 用户提到 "Phase 3 Step 3"、"Step 3a"、"测试先行"、"测试设计"
  • 已有场景时序图,需要在写代码前设计测试
  • 用户指定某个场景编号(如 S01)需要设计测试

前置依赖

  • logos/resources/prd/3-technical-plan/2-scenario-implementation/ 中包含场景时序图(必需
  • logos/resources/api/ 中包含 API 规格(有则读取,无则跳过——非 API 项目可能没有)
  • logos/resources/database/ 中包含 DB DDL(有则读取,无则跳过)
  • logos/resources/prd/1-product-requirements/ 中包含需求文档(用于追溯验收条件)

不可跳过:无论项目类型如何,Step 3a(本 Skill)都必须执行。

核心能力

  1. 从 API 字段约束(类型、格式、长度、枚举)中提取单元测试用例
  2. 从 DB 约束(UNIQUE、CHECK、NOT NULL、FK)中提取单元测试用例
  3. 从业务规则和 EX 异常用例中的单点错误处理提取单元测试用例
  4. 从时序图 Step 序列提取场景测试用例(主路径)
  5. 从 EX 异常用例提取场景测试用例(异常路径)
  6. 从 Phase 1/2 验收条件反向校验测试覆盖完整性

执行步骤

Step 1: 加载场景上下文

读取以下文件建立完整上下文:

  • 场景时序图(logos/resources/prd/3-technical-plan/2-scenario-implementation/
  • API YAML(logos/resources/api/)—— 如果存在
  • DB DDL(logos/resources/database/)—— 如果存在
  • Phase 1 需求文档(验收条件)
  • Phase 2 产品设计文档(交互级验收条件)

确认当前场景的:

  • Step 数量:时序图中有多少个 Step
  • EX 数量:有多少个异常用例
  • API 端点:涉及哪些端点及其字段约束
  • DB 表:涉及哪些表及其约束

Step 2: 设计单元测试用例

从三类来源提取单元测试用例:

2a: API 字段约束

逐个检查 API 端点的 requestBodyparameters

  • type → 类型错误用例(传入错误类型)
  • format(email、uuid、date-time)→ 格式校验用例
  • minLength / maxLength → 边界值用例(刚好达到、超出 1 位)
  • required → 必填缺失用例
  • enum → 枚举值用例(合法值 + 非法值)
  • minimum / maximum → 数值范围用例
2b: DB 约束

逐个检查相关表的约束:

  • UNIQUE → 重复插入用例
  • NOT NULL → 空值插入用例
  • CHECK → 违反检查条件的用例
  • FOREIGN KEY → 引用不存在记录的用例
  • DEFAULT → 不传值时默认值验证
2c: 业务规则

从时序图 Step 说明和 EX 异常用例中提取单点业务逻辑:

  • 权限检查(未登录、无权限)
  • 状态机转换(只有特定状态才能执行操作)
  • 限流 / 频控规则
  • 数据计算逻辑(金额计算、折扣规则)

每个单元测试用例格式

字段 说明
ID UT-{场景编号}-{序号},如 UT-S01-01
描述 测试什么行为
来源 约束出处(如 auth.yaml → register → email: format:email
前置条件 测试前需要的状态
输入 具体输入值
预期输出 期望的返回值或错误信息

Step 3: 设计场景测试用例

从两类来源提取场景测试用例:

3a: 主路径(时序图 Step 序列)

将时序图的完整 Step 1 → Step N 视为一次端到端代码调用链:

Read the full file on GitHub · 248 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. 5d ago First seen · 248 lines · 0 tokens per session scan A d94cf0359075

Subscribe to this mod's changes

test-writer is a skill published in the GitHub repository miniidealab/openlogos (71 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,066 tokens. 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.

Related

Other skills, from other repositories

tdd-workflow

Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.

affaan-m/ECC · 43 tokens

testing

Testing workflow and quality standards for writing and running tests. Use when: (1) Writing new tests, (2) Adding a new feature that needs tests, (3) Modifying logic that has existing tests, (4) Before claiming a task is complete.

iOfficeAI/AionUi · 55 tokens

testing-patterns

Testing patterns and principles. Unit, integration, mocking strategies.

vudovn/ag-kit · 16 tokens

testing

Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.

latitude-dev/latitude-llm · 41 tokens

detect-flaky-tests

Detects flaky Go tests by analyzing GitHub Actions workflow runs across the last 7 days and all PRs — covering both the run-tests job (unit/integration) and the e2e-test job (gVisor and microVM lanes). For each newly-detected flaky test or infra issue, opens a GitHub issue with full evidence and a draft fix PR. Does…

agent-substrate/substrate · 102 tokens

test-pyramid

Analyze the repo's unit and E2E tests and propose rebalancing toward a test pyramid — which E2E tests (or assertions inside them) can be covered by unit tests, which unit-level gaps genuinely need E2E coverage, and where coverage is duplicated. Use when the user asks about test pyramid, test rebalancing, "should this…

kubernetes-sigs/agent-sandbox · 104 tokens