基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Miosa-osa/canopy --skill tdd-enforcer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Evaluate retrieval and generation quality in RAG pipelines. Separate scoring for retrieval (recall, precision, MRR) and generation (faithfulness, relevance, completeness). End-to-end pipeline assessment with bottleneck identification. Triggers on: "eval rag", "rag evaluation", "retrieval evaluation", "rag quality", "rag metrics"
Design binary pass/fail LLM-as-Judge evaluators. Structured prompt engineering for evaluation: criteria definition, rubric construction, few-shot calibration, and bias mitigation. Produces a ready-to-deploy judge prompt with scoring instructions. Triggers on: "judge prompt", "llm judge", "evaluator prompt", "scoring prompt", "grading rubric"
Language Agent Tree Search - Monte Carlo planning - 92.7% on HumanEval
| name | tdd-enforcer |
| description | Enforces Test-Driven Development discipline with RED-GREEN-REFACTOR cycle |
| trigger | always |
| priority | 2 |
Enforces strict Test-Driven Development discipline. You cannot prompt your way into TDD discipline - you need forcing functions that make TDD the path of least resistance.
This skill activates when:
Before writing ANY implementation code:
Understand the requirement
Write the test FIRST
// The test must:
// - Define expected behavior
// - Be specific and focused
// - FAIL when run (no implementation yet)
Run the test - confirm it FAILS
Write MINIMUM code to pass
Run the test - confirm it PASSES
Before writing any feature code, verify:
BLOCK implementation if:
# Jest
npm test -- --coverage
# Vitest
npx vitest run --coverage
# Playwright (E2E)
npx playwright test
# Unit tests with coverage
go test -cover -coverprofile=coverage.out ./...
# View coverage
go tool cover -html=coverage.out
# pytest with coverage
pytest --cov=. --cov-report=html
## Task: Add user authentication
### 1. RED: Write failing test
```typescript
// auth.test.ts
describe('authenticateUser', () => {
it('should return token for valid credentials', async () => {
const result = await authenticateUser('user@test.com', 'password123');
expect(result.token).toBeDefined();
expect(result.expiresIn).toBe(3600);
});
it('should throw error for invalid credentials', async () => {
await expect(
authenticateUser('user@test.com', 'wrong')
).rejects.toThrow('Invalid credentials');
});
});
// auth.ts
export async function authenticateUser(email: string, password: string) {
const user = await findUserByEmail(email);
if (!user || !verifyPassword(password, user.passwordHash)) {
throw new Error('Invalid credentials');
}
return {
token: generateToken(user),
expiresIn: 3600
};
}
## Integration with Hooks
### Pre-commit Hook
```bash
#!/bin/bash
# Block commits without test coverage
# Get changed files
changed_files=$(git diff --cached --name-only --diff-filter=ACM)
# Check for test files
for file in $changed_files; do
if [[ $file =~ \.(ts|js|go|py)$ ]] && [[ ! $file =~ (test|spec) ]]; then
# Implementation file - check for corresponding test
test_file="${file%.*}.test.${file##*.}"
if ! git diff --cached --name-only | grep -q "$test_file"; then
echo "ERROR: No test file for $file"
echo "TDD requires tests FIRST. Add $test_file"
exit 1
fi
fi
done