一键导入
testing-patterns
Use when writing or reviewing tests, fixtures, factories, mocks, test coverage, or files named test_*, *_test, *.test.*, or *.spec.*.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing or reviewing tests, fixtures, factories, mocks, test coverage, or files named test_*, *_test, *.test.*, or *.spec.*.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Set up or bootstrap a project with the claude-code-config tooling — setup-project.sh, install-tooling.sh, the layered hooks setup, and the new-repo runbook. Use when installing this config into a repo, running the setup scripts, vendoring the make-check tooling, or bootstrapping a new project.
Create a new "Later" backlog item (Learn / Research / Do / Read) from a configurable template.
Install or update the shared MkDocs Material style layer (Ink & Indigo on warm paper) in the current project.
Prepare technical analysis for backlog refinement meetings.
Capture a quick status update and append it to today's daily log.
Prepare end-of-week review notes summarizing the full week's work activity across all sources (Git, GitHub, Jira).
| name | testing-patterns |
| description | Use when writing or reviewing tests, fixtures, factories, mocks, test coverage, or files named test_*, *_test, *.test.*, or *.spec.*. |
Apply these patterns when writing or reviewing tests.
Every test should follow the AAA pattern with clear visual separation:
def test_user_creation_with_valid_data():
# Arrange
user_data = {"email": "test@example.com", "name": "Test User"}
# Act
user = UserService.create(user_data)
# Assert
assert user.email == "test@example.com"
assert user.is_active is True
it("creates a user with valid data", () => {
// Arrange
const userData = { email: "test@example.com", name: "Test User" };
// Act
const user = UserService.create(userData);
// Assert
expect(user.email).toBe("test@example.com");
expect(user.isActive).toBe(true);
});
Test names should describe the scenario and expected outcome:
test_<unit>_<scenario>_<expected_result>"<unit> <scenario> <expected result>"Good: test_login_with_invalid_password_returns_401
Bad: test_login, test_case_1
factory_boy or custom factory functionsTestCase with automatic rollback)