一键导入
milens-tdd
Test-Driven Development with Code Intelligence — find gaps, generate test plans, implement, and verify
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test-Driven Development with Code Intelligence — find gaps, generate test plans, implement, and verify
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Code intelligence for the adapters area — symbols, dependencies, and entry points
Code intelligence for the analyzer area — symbols, dependencies, and entry points
Code intelligence for the apps area — symbols, dependencies, and entry points
Code intelligence for the docs area — symbols, dependencies, and entry points
Code intelligence MCP tools — symbol search, text grep, impact analysis, dependency graph
Code intelligence for the orchestrator area — symbols, dependencies, and entry points
| name | milens-tdd |
| description | Test-Driven Development with Code Intelligence — find gaps, generate test plans, implement, and verify |
Identify untested symbols ranked by risk, generate targeted test strategies, implement tests, and verify coverage.
| Tool | Purpose |
|---|---|
mcp_milens_test_coverage_gaps | Find untested symbols sorted by risk |
mcp_milens_test_plan | Generate mock strategy and test scenarios for a symbol |
mcp_milens_test_impact | Identify affected test files after changes |
mcp_milens_review_pr | Post-change quality check for CRITICAL issues |
CRITICAL: All milens MCP tool calls MUST include the
repoparameter set to the absolute path of the workspace root.
Start by finding symbols with no test coverage, sorted by risk (hotspots first).
mcp_milens_test_coverage_gaps({repo: "<workspaceRoot>", limit: 10})
Review the output:
For each high-risk symbol identified in Step 1, request a test plan.
mcp_milens_test_plan({name: "<symbolName>", repo: "<workspaceRoot>"})
The test plan provides:
Write test files based on the test plan output:
After writing tests, confirm which test files changed and should run.
mcp_milens_test_impact({repo: "<workspaceRoot>"})
This lists all test files affected by the current changes. Run those tests to validate.
Run the PR review to catch any CRITICAL issues before committing.
mcp_milens_review_pr({repo: "<workspaceRoot>"})
Address any CRITICAL or HIGH findings before completing the cycle.
"add tests for the resolveLinks function"
Step 1 — Find gaps:
mcp_milens_test_coverage_gaps({repo: "/home/user/project", limit: 10})
Output:
Coverage Gaps (untested exported symbols):
1. resolveLinks [function] — HIGH risk (12 dependents, 8 callers)
2. parseConfig [function] — MEDIUM risk (5 dependents)
3. formatOutput [function] — LOW risk (1 dependent)
...
Step 2 — Test plan for high-risk:
mcp_milens_test_plan({name: "resolveLinks", repo: "/home/user/project"})
Output:
Test Plan for resolveLinks:
Mock strategy: stub loadAliases, stub database queries
Tests:
1. resolves direct links between two symbols
2. handles circular dependency chain gracefully
3. returns empty array when no links found
4. throws on malformed symbol data
Setup: import SymbolLink from '@/types', mock store layer
Step 3 — Implement tests in src/__tests__/resolver.test.ts
Step 4 — Verify:
mcp_milens_test_impact({repo: "/home/user/project"})
Output:
Affected test files:
src/__tests__/resolver.test.ts (new)
src/__tests__/analyzer.test.ts (modified, re-export impact)
Step 5 — Quality:
mcp_milens_review_pr({repo: "/home/user/project"})
Output: No CRITICAL issues. 2 LOW suggestions.
test_impact) and Step 5 (review_pr) before merging. Don't skip the quality gate.| Criteria | Pass | Fail |
|---|---|---|
| Test coverage gaps | HIGH-risk symbols have tests | HIGH-risk symbols still uncovered after session |
| Test plan adherence | ≥3 scenarios implemented per symbol | Tests don't match plan scenarios |
| Test impact verification | All affected test files pass | Any test file fails |
| PR review | No CRITICAL issues | Unresolved CRITICAL issues remain |