一键导入
tdd
Implement changes using Test-Driven Development (Red-Green-Refactor). Use for bug fixes, new features, or any code change that should have test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement changes using Test-Driven Development (Red-Green-Refactor). Use for bug fixes, new features, or any code change that should have test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Kandev release & versioning conventions — single SemVer across npm, Homebrew, GitHub release. Use when cutting a release, debugging release artifacts, or answering questions about version channels.
Review changed code for quality, security, and architecture compliance. Use after implementing features or before opening PRs.
Diagnose Kandev bugs, running-instance issues, UI/browser failures, and runtime behavior. Use when the user reports unexpected behavior, asks to investigate, asks to add logs/instrumentation, or when a fix needs root-cause evidence before implementing. Triage first, gather evidence safely, then hand off to /fix or /tdd for code changes.
Write and run web E2E tests (Playwright) using TDD — locations, patterns, commands, and debugging.
Ensures UI feature work ships with desktop and mobile parity, responsive behavior, and mobile Playwright E2E coverage. Use when implementing, planning, reviewing, or testing any new feature, page, component, workflow, form, dialog, sidebar, navigation, dashboard, or visual UI change; if work touches frontend or user-facing UI, this skill must run even when user mentions only desktop or says "new feature".
Create a committed implementation plan from a feature spec. Explores the codebase, designs the approach, and produces docs/plans/<feature>/plan.md plus individual task files. Use after writing a spec and before implementing.
| name | tdd |
| description | Implement changes using Test-Driven Development (Red-Green-Refactor). Use for bug fixes, new features, or any code change that should have test coverage. |
Implement code changes using strict Red-Green-Refactor. Iron law: no production code without a failing test first.
Wrote code before a test? Delete it. Start over from a failing test.
/e2e — Use when the change needs a Playwright E2E test instead of a unit test./verify — Run after completing all TDD cycles to ensure everything passes across the monorepo.Skip for: pure UI components (we don't test React components), config files, generated code.
For UI rendering bugs, prefer extracting or using a pure helper and testing that helper. Add Playwright only when the behavior is truly visual or integration-level. Avoid adding React component tests just to assert DOM output; that does not match this project's testing convention.
apps/backend/): test file next to source as *_test.go. Run:
cd apps/backend && go test -v -run TestName ./internal/path/to/package/...
apps/web/lib/): test file next to source as *.test.ts. Run:
cd apps && pnpm --filter @kandev/web test -- --run path/to/file.test.ts
apps/web/e2e/): delegate to /e2e for Playwright tests.Choose the right level:
/e2e.Prefer state/output assertions over interaction assertions. Mock only slow, nondeterministic, or external boundaries; use real implementations or fakes when they keep the test deterministic.
For bug fixes, use the Prove-It Pattern: reproduce the bug with a failing test before changing production code. A fix without a regression test is not complete unless the change is explicitly untestable and you say why.
describe/it blocks (TS), remove duplicationIn tests, prefer DAMP over DRY: each test should read like a small specification. Shared helpers are fine when they remove noise, but not when they hide the scenario.
Return to step 1 for the next behavior or edge case. Continue until the feature or fix is complete.
Run /verify to ensure all formatters, linters, typechecks, and tests pass across the monorepo.
Don't test implementation details:
Don't test mock behavior:
*-mock test ID, mock return value), you're testing the mock, not the code. Test real behavior or don't mock it.Don't add test-only methods to production code:
destroy(), reset(), _testHelper() that only tests call — put these in test utilities, not production classes.Mock minimally and understand dependencies:
Don't use incomplete mocks:
Never swallow errors in tests:
try/catch that silently ignores failures in test helpers or setup — these hide real failures.Don't repeat unchanged passing commands for reassurance: