一键导入
test-writer
Write unit test and scenario test case documents. Use when API specs exist in logos/resources/api/ but logos/resources/test/ is empty.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write unit test and scenario test case documents. Use when API specs exist in logos/resources/api/ but logos/resources/test/ is empty.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design technical architecture and select technology stack. Use when product design exists in logos/resources/prd/2-product-design/ but logos/resources/prd/3-technical-plan/1-architecture/ is empty.
Model business scenarios as detailed sequence diagrams with API calls. Use when architecture exists in 3-technical-plan/1-architecture/ but 3-technical-plan/2-scenario-implementation/ is empty. Scenarios must be complete user action paths, NOT single API calls.
Create product design specifications including feature specs and page designs. Use when requirements exist in logos/resources/prd/1-product-requirements/ but logos/resources/prd/2-product-design/ is empty.
UI/UX design intelligence. 67 styles, 96 palettes, 57 font pairings, 25 charts, 13 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
Write change proposals with impact analysis following OpenLogos delta workflow. Use when the project lifecycle is active and source code or methodology documents need modification.
Execute delta merges by generating MERGE_PROMPT.md from change proposals. Use when an approved change proposal needs to be applied to the codebase.
| name | test-writer |
| description | Write unit test and scenario test case documents. Use when API specs exist in logos/resources/api/ but logos/resources/test/ is empty. |
Based on sequence diagrams, API specifications, and DB constraints, design unit test cases and scenario test cases for each business scenario. Applicable to all project types (API services, CLI tools, frontend applications, libraries, etc.), this is a mandatory prerequisite step before code generation.
logos/resources/prd/3-technical-plan/2-scenario-implementation/ contains sequence diagrams (required)logos/resources/api/ contains API specifications (read if present, skip if absent — non-API projects may not have these)logos/resources/database/ contains DB DDL (read if present, skip if absent)logos/resources/prd/1-product-requirements/ contains requirements documents (for tracing acceptance criteria)Cannot be skipped: Regardless of project type, Step 3a (this Skill) must be executed.
Read the following files to establish complete context:
logos/resources/prd/3-technical-plan/2-scenario-implementation/)logos/resources/api/) — if presentlogos/resources/database/) — if presentConfirm the following for the current scenario:
Extract unit test cases from three categories of sources:
Inspect requestBody and parameters for each API endpoint:
type → Type error cases (passing incorrect types)format (email, uuid, date-time) → Format validation casesminLength / maxLength → Boundary value cases (exactly at limit, exceeding by 1)required → Required field missing casesenum → Enumeration value cases (valid values + invalid values)minimum / maximum → Numeric range casesInspect constraints for each related table:
UNIQUE → Duplicate insertion casesNOT NULL → Null value insertion casesCHECK → Constraint violation casesFOREIGN KEY → Referencing non-existent record casesDEFAULT → Default value verification when no value is providedExtract single-point business logic from sequence diagram Step descriptions and EX exception cases:
Format for each unit test case:
| Field | Description |
|---|---|
| ID | UT-{scenario-number}-{sequence}, e.g., UT-S01-01 |
| Description | What behavior is being tested |
| Source | Constraint origin (e.g., auth.yaml → register → email: format:email) |
| Preconditions | State required before the test |
| Input | Specific input values |
| Expected Output | Expected return value or error message |
Extract scenario test cases from two categories of sources:
Treat the complete Step 1 → Step N sequence from the sequence diagram as an end-to-end code call chain:
Expand each EX exception case into a scenario test case:
Format for each scenario test case:
| Field | Description |
|---|---|
| ID | ST-{scenario-number}-{sequence}, e.g., ST-S01-01 |
| Description | What scenario flow is being tested |
| Covered Steps | Which sequence diagram Steps are covered (e.g., Step 1→6) or which EX (e.g., EX-2.1) |
| Preconditions | State and data required before the test |
| Operation Sequence | Ordered list of operations following Step sequence |
| Expected Result | Final state (return value + database state + side effects) |
Reverse-validate whether test cases cover all critical constraints:
required field in the API has at least 1 UT caseUNIQUE / CHECK constraint in the DB has at least 1 UT caseIf any items are uncovered, add supplementary cases or explain the reason to the user.
Extract each GIVEN/WHEN/THEN acceptance criterion from the Phase 1 requirements document, assign a traceability ID to each, and link it to the test case IDs that cover that criterion.
{scenario-number}-AC-{two-digit-sequence}, e.g., S01-AC-01, S01-AC-02openlogos verify parses this traceability table and links AC → test case ID → execution result across three layers to generate a complete acceptance traceability report.
Output the test case specification document in Markdown format, organized by scenario.
Guide the user to the next step based on project type:
logos/resources/test/{scenario-number}-test-cases.md (e.g., S01-test-cases.md)UT-{scenario-number}-{sequence} / ST-{scenario-number}-{sequence}# {scenario-number}: {scenario-name} — Test Cases
## 1. Unit Test Cases
### 1.1 {group-name} (Source: {constraint-origin})
| ID | Description | Source | Preconditions | Input | Expected Output |
|----|-------------|--------|---------------|-------|-----------------|
| UT-S01-01 | ... | ... | ... | ... | ... |
## 2. Scenario Test Cases
### 2.1 Happy Path: {scenario-name}
| ID | Description | Covered Steps | Preconditions | Operation Sequence | Expected Result |
|----|-------------|---------------|---------------|--------------------|-----------------|
| ST-S01-01 | ... | Step 1→6 | ... | ... | ... |
### 2.2 Exception Paths
| ID | Description | Covered EX | Preconditions | Trigger Condition | Expected Result |
|----|-------------|------------|---------------|-------------------|-----------------|
| ST-S01-02 | ... | EX-2.1 | ... | ... | ... |
## 3. Coverage Validation
- [x] Phase 1 normal acceptance criteria: fully covered
- [x] Phase 1 exception acceptance criteria: fully covered
- [x] EX exception cases: fully covered
- [x] API required fields: fully covered
- [x] DB UNIQUE/CHECK constraints: fully covered
## 4. Acceptance Criteria Traceability
| AC ID | Acceptance Criterion | Covered By |
|-------|----------------------|------------|
| S01-AC-01 | Normal: Fresh project initialization — create complete directory structure | ST-S01-01 |
| S01-AC-02 | Normal: Confirm when explicit project name differs from config file | ST-S01-02 |
| S01-AC-03 | Exception: Project already initialized — display error message | ST-S01-03, UT-S01-05 |
Test case IDs (UT-S01-01, ST-S01-01) serve as a binding contract between design documents and runtime:
openlogos verify maps execution results back to test case specifications via IDs, automatically determining acceptanceSee logos/spec/test-results.md for the detailed JSONL format definition and reporter code templates for each language.
openlogos verify to report incomplete resultsThe following prompts can be copied directly for AI use:
Design test cases for meDesign unit tests and scenario tests for S01Design test cases for all P0 scenariosCheck the test coverage for S01