[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72CJ857314HCC8A99T4K0D2":3,"skill-same:01M72CJ857314HCC8A99T4K0D2":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M72CJ857314HCC8A99T4K0D2","testing-rules",null,"Apply test quality rules during implementation and review: meaningful assertions, isolation and coverage.","1aGh\u002Fmaude","1aGh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17166964?v=4","01M72CAQDBB0YG724KFT7WEYRF","Michal Dovrtel","01M72CAQDXC32AWQRZYNJXXDC4",3,"MIT","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Ftesting-rules\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: testing-rules\ndescription: \"Apply test quality rules during implementation and review: meaningful assertions, isolation and coverage.\"\nuser-invocable: false\n---\n\n# Testing Rules\n\nFollow [host conventions](..\u002F..\u002FHARNESS.md) for Claude Code or Codex.\n\nHard-stop rules for test file quality. These are non-negotiable.\n\nThis skill reads `boundaries` from `.ai\u002Fworkflows.config.json` — every service \u002F system listed under `boundaries.realtime`, `boundaries.video`, `boundaries.api`, `boundaries.db`, `boundaries.auth`, `boundaries.telemetry`, `boundaries.payments` is treated as a **no-mock zone**. Skip the skill with `skills.testingRules.enabled: false`.\n\n## Iron Law — TDD process\n\n```\nNO PRODUCTION CODE WITHOUT A FAILING TEST FIRST\n```\n\n**Core principle:** If you didn't watch the test fail, you don't know it tests the right thing.\n\n### Red → Green → Refactor\n\n1. **RED — Write failing test.** One behavior, clear name, real code (no mocks unless unavoidable). State what *should* happen, not what *does*.\n2. **Verify RED — Watch it fail.** Mandatory. Run the test. Confirm it fails for the *expected reason* (feature missing), not typos. Test passes immediately? You're testing existing behavior. Fix or delete the test.\n3. **GREEN — Minimal code.** Simplest implementation to pass. No \"while I'm here\" features, no premature abstraction. YAGNI.\n4. **Verify GREEN — Watch it pass.** Mandatory. Test passes, other tests still pass, output pristine.\n5. **REFACTOR — Clean up.** Remove duplication, improve names, extract helpers. Keep tests green. Don't add behavior.\n\n### When to apply\n\n- ✅ New features, bug fixes, refactoring, behavior changes\n- ⚠️ Exceptions (ask first): throwaway prototypes, generated code, config files\n- ❌ \"Skip TDD just this once\" = rationalization. Stop.\n\n### Bug fix integration\n\nBug found? **Write failing test reproducing it.** Then fix. Test proves fix and prevents regression. Never fix bugs without a test. This applies to the `\u002Fflow:bug-fix` flow — the RCA document identifies root cause, but the fix starts with a failing test.\n\n### Red flags — STOP and start over\n\n- Code written before test\n- Test added \"later\"\n- Test passes immediately (didn't see it fail)\n- \"Keep it as reference, write tests first\" (you'll adapt it)\n- \"Already spent X hours, deleting is wasteful\" (sunk cost)\n- \"Tests after achieve same goals\" (no — tests-after answer \"what does this do?\", tests-first answer \"what should this do?\")\n\n### Why order matters\n\nTests written *after* code pass immediately. Passing immediately proves nothing — might test the wrong thing, test implementation instead of behavior, miss edge cases. Test-first forces you to see the test fail, proving it actually tests something. Tests-after are biased by your implementation; tests-first force edge case discovery before implementing.\n\n### Pre-checkpoint checklist\n\nBefore marking task done in `\u002Fflow:execute`:\n\n- [ ] Every new function has a test\n- [ ] Watched each test fail before implementing\n- [ ] Each test failed for the expected reason\n- [ ] Wrote minimal code to pass\n- [ ] All tests pass; output pristine\n- [ ] Tests use real code (mocks only if unavoidable)\n- [ ] Edge cases and errors covered\n\nCan't check all boxes? You skipped TDD. Start over.\n\n## Rules\n\n1. **No `any` type in test files.** All test variables, mocks, and parameters must have explicit types. Using `any` defeats type-safe testing.\n\n2. **No `.skip()` without a linked issue.** Every skipped test must include a comment linking to an issue with the reason and re-enable condition:\n\n   ```typescript\n   \u002F\u002F TODO: re-enable after fixing #123\n   it.skip('should handle edge case', () => { ... });\n   ```\n\n3. **No snapshot tests without justification.** Snapshot tests are fragile and often mask real changes. If used, include a comment explaining why snapshot was chosen over explicit assertions.\n\n4. **Colocate test files.** Either next to source (`module.ts` → `module.test.ts`) or in a `__tests__\u002F` directory under the source dir. Never in a separate top-level `tests\u002F` directory disconnected from source.\n\n5. **One assertion concept per test.** Each test verifies one behavior. Multiple assertions OK if they verify the same concept (e.g. checking multiple properties of one return value). Unrelated behaviors must be split.\n\n6. **No mocking of declared boundaries.** Every service in `boundaries.*` is a no-mock zone:\n   - `boundaries.realtime` — sync engines (Yjs, Liveblocks, Partykit, Y-WebSocket, Automerge…). Use in-memory providers or a real test instance. Mocks mask migration and conflict-resolution regressions.\n   - `boundaries.db` — schemas, migrations, RLS policies. Use a real test database (Docker, tmpfs Postgres, SQLite-in-memory). ORM mocks hide schema drift.\n   - `boundaries.api` — internal RPC layers (tRPC, gRPC, GraphQL gateway). Test the procedure, not a stub of it.\n   - `boundaries.auth` — session token storage, JWT claims, RLS context. Mocks here hide privilege escalation bugs.\n   - `boundaries.video`, `boundaries.payments`, `boundaries.telemetry` — use sandbox \u002F test mode of the real provider when feasible. Mock only when the provider has no sandbox.\n\n7. **Cross-platform shared logic lives in shared packages.** Tests for shared logic (hooks, state, types) run on the shared package, never duplicated per app. Duplicated tests in `apps\u002Fweb\u002F`, `apps\u002Fmobile\u002F`, etc. drift; the shared package is the single source of truth. `scenario-runner` subagent verifies rendered behavior across platforms — unit tests verify logic.\n\n## Rationale\n\n- **No `any`** → Tests catch type regressions, which they can't with `any`.\n- **No unlinked `.skip()`** → Skipped tests accumulate silently. Linking to issues creates accountability.\n- **No unjustified snapshots** → Snapshots breaking on every change train developers to blindly update them, losing their value.\n- **Colocation** → Tests near source are easier to find, update, maintain.\n- **One concept per test** → When a test fails, the failure message should tell you exactly what's wrong.\n- **No boundary mocking** → Real boundary behavior is the only test that catches integration regressions.\n- **Cross-platform shared logic** → Duplication leads to drift; shared package is the source of truth.\n","# Testing Rules\n\nFollow [host conventions](..\u002F..\u002FHARNESS.md) for Claude Code or Codex.\n\nHard-stop rules for test file quality. These are non-negotiable.\n\nThis skill reads `boundaries` from `.ai\u002Fworkflows.config.json` — every service \u002F system listed under `boundaries.realtime`, `boundaries.video`, `boundaries.api`, `boundaries.db`, `boundaries.auth`, `boundaries.telemetry`, `boundaries.payments` is treated as a **no-mock zone**. Skip the skill with `skills.testingRules.enabled: false`.\n\n## Iron Law — TDD process\n\n```\nNO PRODUCTION CODE WITHOUT A FAILING TEST FIRST\n```\n\n**Core principle:** If you didn't watch the test fail, you don't know it tests the right thing.\n\n### Red → Green → Refactor\n\n1. **RED — Write failing test.** One behavior, clear name, real code (no mocks unless unavoidable). State what *should* happen, not what *does*.\n2. **Verify RED — Watch it fail.** Mandatory. Run the test. Confirm it fails for the *expected reason* (feature missing), not typos. Test passes immediately? You're testing existing behavior. Fix or delete the test.\n3. **GREEN — Minimal code.** Simplest implementation to pass. No \"while I'm here\" features, no premature abstraction. YAGNI.\n4. **Verify GREEN — Watch it pass.** Mandatory. Test passes, other tests still pass, output pristine.\n5. **REFACTOR — Clean up.** Remove duplication, improve names, extract helpers. Keep tests green. Don't add behavior.\n\n### When to apply\n\n- ✅ New features, bug fixes, refactoring, behavior changes\n- ⚠️ Exceptions (ask first): throwaway prototypes, generated code, config files\n- ❌ \"Skip TDD just this once\" = rationalization. Stop.\n\n### Bug fix integration\n\nBug found? **Write failing test reproducing it.** Then fix. Test proves fix and prevents regression. Never fix bugs without a test. This applies to the `\u002Fflow:bug-fix` flow — the RCA document identifies root cause, but the fix starts with a failing test.\n\n### Red flags — STOP and start over\n\n- Code written before test\n- Test added \"later\"\n- Test passes immediately (didn't see it fail)\n- \"Keep it as reference, write tests first\" (you'll adapt it)\n- \"Already spent X hours, deleting is wasteful\" (sunk cost)\n- \"Tests after achieve same goals\" (no — tests-after answer \"what does this do?\", tests-first answer \"what should this do?\")\n\n### Why order matters\n\nTests written *after* code pass immediately. Passing immediately proves nothing — might test the wrong thing, test implementation instead of behavior, miss edge cases. Test-first forces you to see the test fail, proving it actually tests something. Tests-after are biased by your implementation; tests-first force edge case discovery before implementing.\n\n### Pre-checkpoint checklist\n\nBefore marking task done in `\u002Fflow:execute`:\n\n- [ ] Every new function has a test\n- [ ] Watched each test fail before implementing\n- [ ] Each test failed for the expected reason\n- [ ] Wrote minimal code to pass\n- [ ] All tests pass; output pristine\n- [ ] Tests use real code (mocks only if unavoidable)\n- [ ] Edge cases and errors covered\n\nCan't check all boxes? You skipped TDD. Start over.\n\n## Rules\n\n1. **No `any` type in test files.** All test variables, mocks, and parameters must have explicit types. Using `any` defeats type-safe testing.\n\n2. **No `.skip()` without a linked issue.** Every skipped test must include a comment linking to an issue with the reason and re-enable condition:\n\n   ```typescript\n   \u002F\u002F TODO: re-enable after fixing #123\n   it.skip('should handle edge case', () => { ... });\n   ```\n\n3. **No snapshot tests without justification.** Snapshot tests are fragile and often mask real changes. If used, include a comment explaining why snapshot was chosen over explicit assertions.\n\n4. **Colocate test files.** Either next to source (`module.ts` → `module.test.ts`) or in a `__tests__\u002F` directory under the source dir. Never in a separate top-level `tests\u002F` directory disconnected from source.\n\n5. **One assertion concept per test.** Each test verifies one behavior. Multiple assertions OK if they verify the same concept (e.g. checking multiple properties of one return value). Unrelated behaviors must be split.\n\n6. **No mocking of declared boundaries.** Every service in `boundaries.*` is a no-mock zone:\n   - `boundaries.realtime` — sync engines (Yjs, Liveblocks, Partykit, Y-WebSocket, Automerge…). Use in-memory providers or a real test instance. Mocks mask migration and conflict-resolution regressions.\n   - `boundaries.db` — schemas, migrations, RLS policies. Use a real test database (Docker, tmpfs Postgres, SQLite-in-memory). ORM mocks hide schema drift.\n   - `boundaries.api` — internal RPC layers (tRPC, gRPC, GraphQL gateway). Test the procedure, not a stub of it.\n   - `boundaries.auth` — session token storage, JWT claims, RLS context. Mocks here hide privilege escalation bugs.\n   - `boundaries.video`, `boundaries.payments`, `boundaries.telemetry` — use sandbox \u002F test mode of the real provider when feasible. Mock only when the provider has no sandbox.\n\n7. **Cross-platform shared logic lives in shared packages.** Tests for shared logic (hooks, state, types) run on the shared package, never duplicated per app. Duplicated tests in `apps\u002Fweb\u002F`, `apps\u002Fmobile\u002F`, etc. drift; the shared package is the single source of truth. `scenario-runner` subagent verifies rendered behavior across platforms — unit tests verify logic.\n\n## Rationale\n\n- **No `any`** → Tests catch type regressions, which they can't with `any`.\n- **No unlinked `.skip()`** → Skipped tests accumulate silently. Linking to issues creates accountability.\n- **No unjustified snapshots** → Snapshots breaking on every change train developers to blindly update them, losing their value.\n- **Colocation** → Tests near source are easier to find, update, maintain.\n- **One concept per test** → When a test fails, the failure message should tell you exactly what's wrong.\n- **No boundary mocking** → Real boundary behavior is the only test that catches integration regressions.\n- **Cross-platform shared logic** → Duplication leads to drift; shared package is the source of truth.\n",{"name":5,"description":7,"user-invocable":20},"main","cfde9d2b169e4b418a5c5efb35297cc575dc764c","plugins\u002Fflow\u002Fskills\u002Ftesting-rules",0,"https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude","https:\u002F\u002Fmaude.sh","https:\u002F\u002Fgithub.com\u002F1aGh","www.iagh.cz","2026-11-13 20:38:15",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add 1aGh\u002Fmaude --skill testing-rules",{"tool":39,"command":40},"bunx","bunx skills add 1aGh\u002Fmaude --skill testing-rules",{"tool":42,"command":43},"pnpm","pnpm dlx skills add 1aGh\u002Fmaude --skill testing-rules","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Ftesting-rules\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M72CJCVNC5JB3M36ES649CTY","workflow-state","Read and update workflow state when planning, executing, completing, pausing or resuming project work.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fworkflow-state\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M72CJAJBZT2RHE97ND8EFTA3","ui-rules","UI hard-stop rules and audit method: WCAG 2.1 AA accessibility, responsive layout and motion.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fui-rules\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M72CJ6N80HW2WRS8BV4QSS4V","security-rules","Apply application and AI security checks to code reviews, implementation and threat-driven validation.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fsecurity-rules\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M72CJ4C41Q4E1WDTFMKYFX3Q","scenario","Author or run cross-platform UI scenarios with selectors, screenshots, platform coverage and result reports.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fscenario\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M72CJ1QYX752BM7G12250YJR","question-protocol","Batch necessary questions from workflow participants, collect user answers and route them to the requester.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquestion-protocol\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M72CHYXD666BK85AM6SH97QV","quality-gates","Resolve project quality commands, scoped checks, gate failures and validation fallbacks from workflow config.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquality-gates\u002FSKILL.md",[],[]]