一键导入
tdd
Follow maina's test-driven development cycle from generated stubs through red-green-refactor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Follow maina's test-driven development cycle from generated stubs through red-green-refactor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use maina cloud for team prompt sync, hosted verification, and feedback-driven learning.
Run maina's two-stage AI code review checking spec compliance then code quality.
Generate rich codebase context using maina's 4-layer retrieval with dynamic token budgets.
First-time maina setup and configuration in any AI coding tool.
Scaffold and validate feature plans using maina's spec-first planning workflow.
Run maina's full verification pipeline on staged changes before committing code.
| name | tdd |
| description | Follow maina's test-driven development cycle from generated stubs through red-green-refactor. |
| triggers | ["write tests","test driven","tdd","test first","generate test stubs"] |
When implementing any feature or fixing any bug. Maina enforces TDD as the default development practice: tests are written before implementation, and the plan analysis checks that test tasks precede implementation tasks.
maina spec (or call the suggestTests MCP tool). This reads the current feature's plan.md and creates test files for each task, organized by test category.maina verify (or call the verify MCP tool) to confirm all deterministic checks pass on your changes.# Generate stubs from the feature plan
maina spec
# Output:
# Created test stubs:
# src/auth/__tests__/login.test.ts (5 tests)
# src/auth/__tests__/session.test.ts (4 tests)
# src/auth/__tests__/token.test.ts (3 tests)
# Red: confirm all stubs fail (use your project's test runner)
# 12 tests, 0 passed, 12 failed
# Green: implement one test at a time
# Edit src/auth/login.ts to make the first test pass
# Run only the relevant test to confirm it passes
# Continue until all tests pass
# 12 tests, 12 passed, 0 failed
# Refactor: clean up, keep tests green
# 12 tests, 12 passed, 0 failed
# Verify everything
maina verify
maina analyze command checks that test tasks (T001: Write tests for X) appear before their implementation tasks (T002: Implement X) in the plan.Result<T, E> pattern: check result.ok is false and result.error contains the expected message.maina <command>) and MCP tools when running inside an AI coding tool.