一键导入
test-fixing
Fix failing tests, prevent regressions when modifying logic, and maintain test coverage. Cooper uses Vitest for unit tests and Playwright for E2E tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix failing tests, prevent regressions when modifying logic, and maintain test coverage. Cooper uses Vitest for unit tests and Playwright for E2E tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Evaluate code quality and suggest refactoring opportunities before committing. Ensure Cooper's codebase stays clean and maintainable.
Build comprehensive task context before making changes. Track constraints, dependencies, and execution order across multi-file work in Cooper's Electron architecture.
Define patterns for integrating with the Copilot SDK in Cooper. Cover session management, model switching, tool execution, event handling, and agent support.
Define and enforce IPC communication patterns between Cooper's main process, preload bridge, and renderer. Ensure all cross-process communication follows the secure, typed preload bridge pattern.
Create atomic commits with descriptive messages. Maintain clean git history for the Cooper project.
Decompose tasks into sub-tasks, assess risk, and create implementation checklists before starting work on Cooper features.
| name | test-fixing |
| description | Fix failing tests, prevent regressions when modifying logic, and maintain test coverage. Cooper uses Vitest for unit tests and Playwright for E2E tests. |
Fix failing tests, prevent regressions when modifying logic, and maintain test coverage. Cooper uses Vitest for unit/component tests and Playwright for E2E tests.
Before making changes, run the relevant test suite:
# Unit/component tests
npm test
# Specific test file
npx vitest run tests/components/MyComponent.test.tsx
# E2E tests (requires build first)
npm run test:e2e
After every significant modification:
npm test for unit/component testsnpm run test:e2e for E2EFix the code, not the test — unless the test itself is wrong.
Test file conventions:
tests/components/<Component>.test.tsxtests/integration/<feature>.test.tstests/e2e/<flow>.spec.tsTest patterns:
import { describe, it, expect, vi } from 'vitest';
describe('ComponentName', () => {
it('should handle expected behavior', () => {
// Arrange → Act → Assert
});
});
vitest.config.ts)playwright.config.ts)vi.fn() for renderer component teststests/ directory (not co-located)npm test exits 0)