testing
GitHub规范 Penpot 项目的测试驱动开发流程与最佳实践。涵盖单元测试、E2E 测试及 Bug 修复验证,要求遵循 TDD 工作流并阅读模块特定的测试指南,确保行为变更均有对应测试覆盖。
触发场景
安装
npx skills add penpot/penpot --skill testing -g -y
SKILL.md
Frontmatter
{
"name": "testing",
"description": "Enforce TDD workflow and testing best practices for Penpot. Use when implementing features, fixing bugs, or modifying behavior. Reads testing memory for full guidance."
}
Testing Skill
Enforces test-driven development and Penpot testing conventions.
When to Use
- Implementing new logic or behavior
- Fixing any bug (reproduction test required)
- Modifying existing functionality
- Adding edge case handling
Skip: Pure configuration changes, documentation updates, or static content with no behavioral impact.
Workflow
Follow TDD (Red → Green → Refactor) whenever practical:
- RED — Write a failing test first
- GREEN — Write minimal code to pass
- REFACTOR — Clean up while tests stay green
For bug fixes, use the Prove-It Pattern: write a test that reproduces the bug, confirm it fails, implement the fix, confirm it passes.
Required Reading
Before writing any test, read:
.serena/memories/testing.md— cross-cutting testing principles, TDD workflow, anti-patterns, execution discipline- Module-specific testing memory for the affected module:
mem:common/testing— CLJC unit testsmem:frontend/testing— CLJS unit tests, Playwright E2Emem:backend/testing— JVM clojure.test conventionsmem:exporter/testing— exporter unit tests
Key Rules
- Every behavior change needs a test
- Test state, not interactions
- DAMP over DRY — tests are specifications; duplication is OK if each test is self-contained and readable
- Prefer Real > Fake > Stub > Mock
- Arrange-Act-Assert structure
- One assertion per concept
- Never pipe test output to filters — redirect to file first
- Register new test files in the module's runner/entrypoint
Verification
After completing implementation:
- Every new behavior has a test
- All tests pass for touched modules
- Bug fixes include a reproduction test
- Lint/formatter passes
版本历史
-
2ce202c
当前 2026-08-29 06:38
拆分后端测试内存至 backend/testing,更新 skill 引用路径并新增 exporter/testing 必读项。
- 2dcf1a8 2026-08-20 19:20


