소스 정보
- 저장소
- fdhhhdjd/Class-AI-Agent
- 최근 소스 활동
- 2026년 4월 18일 07:48
- 감지된 SKILL.md 언어
- 영어
- 스타
- 264
- 포크
- 165
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/fdhhhdjd/Class-AI-Agent --skill test-driven-development명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | Test-Driven Development |
| description | Write tests before code using RED-GREEN-REFACTOR cycle |
TDD transforms testing from an afterthought into the foundation of development. Tests are proof that code works correctly.
Write a test that describes expected behavior. It must fail.
describe('calculateDiscount', () => {
it('should apply 10% discount for orders over $100', () => {
const result = calculateDiscount(150);
expect(result).toBe(15);
});
});
Run: npm test → Should FAIL
Write minimal code to pass the test. No extras.
function calculateDiscount(amount) {
if (amount > 100) return amount * 0.1;
return 0;
}
Run: npm test → Should PASS
Improve code while keeping tests green.
const DISCOUNT_THRESHOLD = 100;
const DISCOUNT_RATE = 0.1;
function calculateDiscount(amount) {
if (amount <= DISCOUNT_THRESHOLD) return 0;
return amount * DISCOUNT_RATE;
}
Run: npm test → Should still PASS
it('should handle empty cart without error (bug #456)', () => {
const cart = new Cart([]);
expect(() => cart.getTotal()).not.toThrow();
expect(cart.getTotal()).toBe(0);
});
Run test → Confirms bug exists
getTotal() {
if (this.items.length === 0) return 0; // Fix
return this.items.reduce((sum, item) => sum + item.price, 0);
}
Run test → Confirms fix works
npm test # No regressions
┌─────────┐
│ E2E │ 5% — Critical user flows
│ Tests │ Full system, minutes
├─────────┤
│ Integr. │ 15% — API + DB interactions
│ Tests │ Seconds
├─────────┤
│ Unit │ 80% — Pure logic
│ Tests │ Milliseconds
└─────────┘
it('should calculate tax for California', () => {
// Arrange — Setup
const order = createOrder({ state: 'CA', subtotal: 100 });
// Act — Execute
const tax = calculateTax(order);
// Assert — Verify
expect(tax).toBe(7.25);
});
Tests should be Descriptive And Meaningful Phrases.
// ✅ DAMP — Self-contained and clear
it('should reject password without uppercase letter', () => {
const result = validatePassword('lowercase123!');
expect(result.valid).toBe(false);
expect(result.errors).toContain('Must contain uppercase letter');
});
// ❌ Too DRY — Requires reading shared context
it('should reject invalid password', () => {
expect(validate(INVALID_PASSWORD_NO_UPPER)).toBe(false);
});
// ✅ Prefer: Real or fake
const db = createTestDatabase();
const user = await userService.create(db, userData);
// ⚠️ Use sparingly: Mocks
const mockDb = { create: vi.fn().mockResolvedValue(user) };
// Pattern: should [expected behavior] when [condition]
// ✅ Good
'should return empty array when no users exist'
'should throw ValidationError when email is invalid'
'should send welcome email after registration'
// ❌ Bad
'works correctly'
'test user creation'
'handles error'
| Pattern | Problem | Solution |
|---|---|---|
| Testing internals | Breaks on refactor | Test behavior, not implementation |
| Flaky tests | Erodes trust | Use deterministic data |
| Over-mocking | False confidence | Prefer real implementations |
| Snapshot abuse | Large diffs ignored | Use sparingly |
| Shared mutable state | Tests affect each other | Reset in beforeEach |
| Testing frameworks | Wasted effort | Only test your code |