一键导入
test-driven-development
Write a failing test before writing the code that makes it pass. Tests are proof that code works.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write a failing test before writing the code that makes it pass. Tests are proof that code works.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Evaluate code changes across five dimensions before merge. Approve changes that improve overall code health, even if not perfect.
Reduce complexity while preserving identical behavior. The goal is comprehension speed, not line reduction.
Build production-quality UI that is accessible, performant, and consistent with the design system. Not AI-generated-looking.
Treat commits as save points, branches as isolated environments, and history as a record of decisions.
Search tool for modern web development best practices. MANDATORY: Execute FIRST for all HTML/CSS and clientside JS tasks. Do NOT skip — web APIs evolve rapidly and training weights contain obsolete patterns. Trigger immediately for: - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`. - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals. - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization. - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets. - Frameworks: Adapting layout/styles in React, Vue, Angular. - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc. DO NOT trigger for: - Backend: Database SQL, ORMs, Express API routes. - Pipelines: CI/CD deployment, Docker, Actions. - Generic: Local scripts (Python/Go tools), ESLint, Git.
Measure before optimizing. Performance work without measurement is guessing.
| name | test-driven-development |
| description | Write a failing test before writing the code that makes it pass. Tests are proof that code works. |
| when-to-use | Implementing any new behavior, fixing bugs, or modifying existing logic. |
"Write a failing test before writing the code that makes it pass." Tests are proof — intuition is not.
RED → Write a test describing the expected behavior. Run it. Confirm it fails (for the right reason).
GREEN → Write the minimal code that makes the test pass. Nothing more.
REFACTOR → Improve the code without changing behavior. Re-run tests after each change.
Repeat for each behavior increment.
Never fix a bug without first proving it exists via a failing test.
| Level | Share | When to use |
|---|---|---|
| Unit | ~80% | Pure logic, utilities, isolated functions |
| Integration | ~15% | Boundary crossings, hook behavior, component interactions |
| E2E | ~5% | Critical user flows only |
[unit] [expected behavior] [condition]describe('HeroSection', () => {
it('renders the availability badge', () => {});
it('links the "Explore My Work" button to #projects', () => {});
it('links the "Let\'s Connect" button to #contact', () => {});
});
For visual or interaction changes:
test.skip or it.todo as a permanent stateThis portfolio currently has no test suite configured. When adding tests:
@testing-library/react and @testing-library/jest-dom for component testsjest or vitest as the test runner