一键导入
kb-tdd-workflow
Domain logic for TDD methodology — injected into agents that implement code using test-driven development. Not invoked directly.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Domain logic for TDD methodology — injected into agents that implement code using test-driven development. Not invoked directly.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Grep-based reverse dependency analysis — injected into planner, reviewer, and deep-review agents. Computes which files are affected by changes to a set of seed files. Not invoked directly.
This skill should be used when the user asks to "brainstorm", "refine an idea", "flesh out a feature", "define requirements". Guides interactive refinement of rough ideas into concise, actionable feature specifications. Focuses on the "what" and architecture — never the "how".
This is the default skill for all development work. It orchestrates the entire development lifecycle from idea to merge-ready code, coordinating multiple agents for brainstorming, planning, implementation, review, documentation, and final approval. Use this for any development task that is non-trivial and could benefit from structured planning, parallel execution, and rigorous review or require more than 3 lines of code changed.
Retrieves authoritative, up-to-date technical documentation, API references, configuration details, and code examples for any developer technology. Use this skill whenever answering technical questions or writing code that interacts with external technologies. This includes libraries, frameworks, programming languages, SDKs, APIs, CLI tools, cloud services, infrastructure tools, and developer platforms. Common scenarios: - looking up API endpoints, classes, functions, or method parameters - checking configuration options or CLI commands - answering "how do I" technical questions - generating code that uses a specific library or service - debugging issues related to frameworks, SDKs, or APIs - retrieving setup instructions, examples, or migration guides - verifying version-specific behavior or breaking changes Prefer this skill whenever documentation accuracy matters or when model knowledge may be outdated.
Implement tasks using TDD. Accepts a plan or specific task description. Runs implementer agents in parallel where possible.
Design intelligence for UI/UX — injected into the frontend-planner agent. Provides BM25-searchable database of 67 styles, 161 color palettes, 57 font pairings, 160 animated component patterns, 161 industry rules, plus framework-agnostic design guidelines. Not invoked directly.
| name | kb-tdd-workflow |
| description | Domain logic for TDD methodology — injected into agents that implement code using test-driven development. Not invoked directly. |
| user-invocable | false |
| disable-model-invocation | true |
Test-driven development produces better-designed, more maintainable code by writing tests before implementation. The critical skill is choosing the right test level — not defaulting to unit tests with mocks.
verify(repo).save(any()) proves a method was called, not that the right thing was persisted. Assert on outcomes: query the database, check the HTTP response, verify the event payload. If you can only assert that a mock was invoked, you're testing wiring, not behavior.@NotBlank on their name field, test the validation framework once, not 20 times.Choose the test level based on what the code does, not on convention or habit.
@Query methods, complex joins, constraint validation, cascades. These are the most bug-prone code in any project and the most dangerous to mock. Use Testcontainers, @DataJpaTest, in-memory databases, or test containers.@WebMvcTest/@SpringBootTest, supertest, httptest, TestClient, etc.E2E tests are defined at the feature level by the planner (see Feature-Goal Tests in the plan), not per-task. They run in a dedicated final-wave task after all implementation is merged.
These produce noise without catching bugs. Delete them if they exist; don't write new ones.
@NotBlank rejects blank strings, @Valid triggers validation, Spring Security enforces @PreAuthorize. The framework is tested by its own test suite. Only test YOUR validation logic (custom validators, conditional rules, business constraints).helper.doThing() calls service.doThing() verifies nothing useful.whenever(repo.save(any())).thenAnswer { it.arguments[0] } followed by verify(repo).save(any()). You've tested that Mockito works, not that your code works. If you need to test persistence, hit a real database.If every controller has 5-10 tests like "returns 403 for VIEWER role", you have N_endpoints * M_roles nearly identical tests. Replace with:
Never skip steps. Never write implementation before a failing test exists.
For planners: Define test cases in the plan with their level: [unit], [integration], [e2e]. Use the selection heuristics above — don't default to [unit]. Repository methods, controller endpoints, event listeners, and schedulers should be [integration] by default.
For implementers: Implement tests one at a time through the cycle. Each test drives the next increment of design.
Use Obvious Implementation by default — write the real implementation when the solution is clear. Fall back to Fake It (hardcoded values, then generalize) when the problem is genuinely uncertain or you keep hitting unexpected failures.
Break the feature into discrete, testable behaviors. Each behavior becomes one test case. Order from simplest to most complex — degenerate/base cases first, then complexity.
Start with the simplest behavior. Write a single test that:
Run the test. Confirm it fails for the right reason (not a syntax error or import issue).
Do NOT write the next test yet. Each test drives the next design decision.
Write the code to make the test pass. Never write more production code than current tests require.
With the test green, improve: remove duplication, extract methods, improve naming, simplify logic. Run tests after every change.
Back to Step 2. Cycle: one test → pass → refactor → next test.
Tests must be fast, isolated, deterministic, self-validating, and descriptively named. Follow Arrange-Act-Assert (AAA).
Cover: happy paths, edge cases (empty, null, boundary), error cases, state transitions. Test through public APIs — not private internals.
When you see the same test structure repeated with different inputs, use parameterized tests instead of copy-pasting:
@ParameterizedTest with @MethodSource or @CsvSource@pytest.mark.parametrizetest.eachrstestRule of thumb: if you're about to write a third test with the same structure but different data, parameterize.
Check the project for existing test infrastructure before creating tests:
jest.config, vitest.config, pytest.ini, build.gradle, pom.xml, go.mod, Cargo.toml, etc.)__tests__, test/, tests/, spec/, src/test/)package.json, Makefile, etc.playwright.config, cypress.config, e2e/, tests/e2e/)If .claude/devline.local.md exists, check for test_framework override.
In parallel pipelines: only test files in your task, mock other tasks' dependencies, ensure tests run independently. Cross-task integration tests belong in a dedicated task.
Always run the full test suite after implementation. Report: passed/failed/skipped counts, failure details, coverage changes if available.
Zero tolerance for failures. The feature branch starts green. Every test failure is signal — either your code is wrong, your change is incomplete, or the test needs updating to reflect intentionally changed behavior. Never dismiss failures as "pre-existing" or "unrelated."
references/framework-patterns.md — Language-specific TDD patterns (JS/TS, Python, Go, Java, Rust, etc.)references/advanced-tdd.md — Integration testing patterns, E2E strategies, mocking boundaries, anti-patterns