From f023c090187b4f7c847fc11e5da37e008b8b0265 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 1 Aug 2026 11:32:14 +0000 Subject: [PATCH] :sparkles: Add testing skill with TDD workflow enforcement Minimal skill referencing mem:testing for full guidance, covering TDD Red-Green-Refactor cycle, Prove-It pattern for bug fixes, and key testing principles. AI-assisted-by: mimo-v2.5-pro --- .opencode/skills/testing/SKILL.md | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .opencode/skills/testing/SKILL.md diff --git a/.opencode/skills/testing/SKILL.md b/.opencode/skills/testing/SKILL.md new file mode 100644 index 0000000000..5ad5d04e6e --- /dev/null +++ b/.opencode/skills/testing/SKILL.md @@ -0,0 +1,57 @@ +--- +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: + +1. **RED** — Write a failing test first +2. **GREEN** — Write minimal code to pass +3. **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: + +1. `.serena/memories/testing.md` — cross-cutting testing principles, TDD workflow, anti-patterns, execution discipline +2. Module-specific testing memory for the affected module: + - `mem:common/testing` — CLJC unit tests + - `mem:frontend/testing` — CLJS unit tests, Playwright E2E + - `mem:backend/core` — JVM clojure.test conventions + +## 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