[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79BP5VFVMQ2ABMH6KR1SVXH":3,"skill-same:01M79BP5VFVMQ2ABMH6KR1SVXH":53},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M79BP5VFVMQ2ABMH6KR1SVXH","testing-patterns",null,"Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions and provides evidence templates.","sahil-kaushik1\u002FAuditing-Workflow","sahil-kaushik1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F143880923?v=4","01M79BEEK3947RQYD3WC00K9W3","Sahil Kaushik","01M79BEEKVHPFPTNBDB0GFXBHE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: testing-patterns\ndescription: Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions and provides evidence templates.\nallowed-tools: Read, Bash, Grep, Glob\n---\n\n# Testing Patterns Skill\n\n## Purpose\n\nGuide consistent and effective testing. Routes to existing test patterns and provides evidence templates for Linear.\n\n## When This Skill Applies\n\nInvoke this skill when:\n\n- Writing new unit tests\n- Creating integration tests\n- Setting up test fixtures with RLS\n- Running test suites\n- Packaging test evidence for Linear\n\n## Critical Rules\n\n### ❌ FORBIDDEN Patterns\n\n```typescript\n\u002F\u002F FORBIDDEN: Direct Prisma calls in tests (bypass RLS)\nconst user = await prisma.user.findUnique({ where: { user_id } });\n\n\u002F\u002F FORBIDDEN: Shared test state (causes flaky tests)\nlet sharedUser: User;\nbeforeAll(() => { sharedUser = createUser(); });\n\n\u002F\u002F FORBIDDEN: Hard-coded IDs (test pollution)\nconst userId = \"user-123\";\n\n\u002F\u002F FORBIDDEN: Missing cleanup (leaky tests)\nit(\"creates user\", async () => {\n  await prisma.user.create({ data: userData });\n  \u002F\u002F No cleanup!\n});\n```\n\n### ✅ CORRECT Patterns\n\n```typescript\n\u002F\u002F CORRECT: Use RLS context helpers\nconst user = await withSystemContext(prisma, \"test\", async (client) => {\n  return client.user.findUnique({ where: { user_id } });\n});\n\n\u002F\u002F CORRECT: Isolated test state per test\nbeforeEach(() => {\n  const testUser = createTestUser();\n});\n\n\u002F\u002F CORRECT: Unique identifiers\nconst userId = `user-${crypto.randomUUID()}`;\nconst email = `test-${Date.now()}@example.com`;\n\n\u002F\u002F CORRECT: Proper cleanup\nafterEach(async () => {\n  await withSystemContext(prisma, \"test\", async (client) => {\n    await client.user.deleteMany({ where: { email: { contains: \"test-\" } } });\n  });\n});\n```\n\n## Test Directory Structure\n\n```\n__tests__\u002F\n├── unit\u002F              # Fast, isolated tests\n│   ├── components\u002F    # React component tests\n│   ├── lib\u002F           # Library function tests\n│   ├── services\u002F      # Service layer tests\n│   └── user\u002F          # User helper tests\n├── integration\u002F       # API and database tests\n├── database\u002F          # Database helper tests\n├── e2e\u002F               # End-to-end tests (Playwright)\n├── payments\u002F          # Payment flow tests\n└── setup.ts           # Global test setup\n```\n\n## Configuration Files\n\n- **Jest Config**: `jest.config.js`\n- **Test Setup**: `__tests__\u002Fsetup.ts`\n- **Playwright Config**: `playwright.config.ts`\n\n## RLS-Aware Testing\n\n### Setting Up Test Context\n\nAlways use RLS context helpers in tests:\n\n```typescript\nimport { withUserContext, withSystemContext } from \"@\u002Flib\u002Frls-context\";\nimport { prisma } from \"@\u002Flib\u002Fprisma\";\n\ndescribe(\"User payments\", () => {\n  const testUserId = \"test-user-123\";\n\n  beforeEach(async () => {\n    \u002F\u002F Create test user with RLS context\n    await withSystemContext(prisma, \"test\", async (client) => {\n      await client.user.create({\n        data: {\n          user_id: testUserId,\n          email: `test-${Date.now()}@example.com`,\n          first_name: \"Test\",\n          last_name: \"User\",\n        },\n      });\n    });\n  });\n\n  it(\"should only see own payments\", async () => {\n    const payments = await withUserContext(\n      prisma,\n      testUserId,\n      async (client) => {\n        return client.payments.findMany();\n      },\n    );\n    \u002F\u002F RLS ensures only this user's payments returned\n    expect(payments.every((p) => p.user_id === testUserId)).toBe(true);\n  });\n});\n```\n\n### Test Isolation\n\nUse unique identifiers to prevent test pollution:\n\n```typescript\nconst uniqueEmail = `test-${Date.now()}@example.com`;\nconst uniqueUserId = `user-${crypto.randomUUID()}`;\n```\n\n## Test Commands\n\n```bash\n# Run all unit tests\nyarn test:unit\n\n# Run integration tests\nyarn test:integration\n\n# Run specific test file\nyarn jest __tests__\u002Funit\u002Fcomponents\u002Fmy-component.test.tsx\n\n# Run tests matching pattern\nyarn jest --testNamePattern=\"should handle\"\n\n# Run with coverage\nyarn test:unit --coverage\n\n# Run E2E tests\nyarn test:e2e\n```\n\n## Common Patterns\n\n### Component Testing\n\n```typescript\nimport { render, screen, fireEvent } from \"@testing-library\u002Freact\";\nimport { MyComponent } from \"@\u002Fcomponents\u002Fmy-component\";\n\ndescribe(\"MyComponent\", () => {\n  it(\"renders correctly\", () => {\n    render(\u003CMyComponent \u002F>);\n    expect(screen.getByRole(\"button\")).toBeInTheDocument();\n  });\n\n  it(\"handles click events\", async () => {\n    const onClickMock = jest.fn();\n    render(\u003CMyComponent onClick={onClickMock} \u002F>);\n\n    fireEvent.click(screen.getByRole(\"button\"));\n    expect(onClickMock).toHaveBeenCalledTimes(1);\n  });\n});\n```\n\n### API Route Testing\n\n```typescript\nimport { GET } from \"@\u002Fapp\u002Fapi\u002Fmy-route\u002Froute\";\nimport { NextRequest } from \"next\u002Fserver\";\n\ndescribe(\"GET \u002Fapi\u002Fmy-route\", () => {\n  it(\"returns 200 with data\", async () => {\n    const request = new NextRequest(\"http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmy-route\");\n    const response = await GET(request);\n\n    expect(response.status).toBe(200);\n    const data = await response.json();\n    expect(data).toHaveProperty(\"success\", true);\n  });\n});\n```\n\n### Mocking Prisma\n\n```typescript\njest.mock(\"@\u002Flib\u002Fprisma\", () => ({\n  prisma: {\n    user: {\n      findUnique: jest.fn(),\n      create: jest.fn(),\n    },\n  },\n}));\n```\n\n## Evidence Template for Linear\n\nWhen completing test work, attach this evidence block:\n\n```markdown\n**Test Execution Evidence**\n\n**Test Suite**: [unit\u002Fintegration\u002Fe2e]\n**Files Changed**: [list files]\n\n**Test Results:**\n\n- Total Tests: [X]\n- Passed: [X]\n- Failed: [0]\n- Skipped: [X]\n\n**Coverage** (if applicable):\n\n- Statements: X%\n- Branches: X%\n- Functions: X%\n- Lines: X%\n\n**Commands Run:**\n\n\\`\\`\\`bash\nyarn test:unit --coverage\n\\`\\`\\`\n\n**Output:**\n[Paste relevant test output]\n```\n\n## Pre-Push Validation\n\nAlways run before pushing:\n\n```bash\nyarn ci:validate\n```\n\nThis runs:\n\n- Type checking\n- ESLint\n- Unit tests\n- Format check\n\n## Authoritative References\n\n- **Jest Config**: `jest.config.js`\n- **Test Setup**: `__tests__\u002Fsetup.ts`\n- **RLS Context**: `lib\u002Frls-context.ts`\n- **CI Validation**: `package.json` scripts\n","# Testing Patterns Skill\n\n## Purpose\n\nGuide consistent and effective testing. Routes to existing test patterns and provides evidence templates for Linear.\n\n## When This Skill Applies\n\nInvoke this skill when:\n\n- Writing new unit tests\n- Creating integration tests\n- Setting up test fixtures with RLS\n- Running test suites\n- Packaging test evidence for Linear\n\n## Critical Rules\n\n### ❌ FORBIDDEN Patterns\n\n```typescript\n\u002F\u002F FORBIDDEN: Direct Prisma calls in tests (bypass RLS)\nconst user = await prisma.user.findUnique({ where: { user_id } });\n\n\u002F\u002F FORBIDDEN: Shared test state (causes flaky tests)\nlet sharedUser: User;\nbeforeAll(() => { sharedUser = createUser(); });\n\n\u002F\u002F FORBIDDEN: Hard-coded IDs (test pollution)\nconst userId = \"user-123\";\n\n\u002F\u002F FORBIDDEN: Missing cleanup (leaky tests)\nit(\"creates user\", async () => {\n  await prisma.user.create({ data: userData });\n  \u002F\u002F No cleanup!\n});\n```\n\n### ✅ CORRECT Patterns\n\n```typescript\n\u002F\u002F CORRECT: Use RLS context helpers\nconst user = await withSystemContext(prisma, \"test\", async (client) => {\n  return client.user.findUnique({ where: { user_id } });\n});\n\n\u002F\u002F CORRECT: Isolated test state per test\nbeforeEach(() => {\n  const testUser = createTestUser();\n});\n\n\u002F\u002F CORRECT: Unique identifiers\nconst userId = `user-${crypto.randomUUID()}`;\nconst email = `test-${Date.now()}@example.com`;\n\n\u002F\u002F CORRECT: Proper cleanup\nafterEach(async () => {\n  await withSystemContext(prisma, \"test\", async (client) => {\n    await client.user.deleteMany({ where: { email: { contains: \"test-\" } } });\n  });\n});\n```\n\n## Test Directory Structure\n\n```\n__tests__\u002F\n├── unit\u002F              # Fast, isolated tests\n│   ├── components\u002F    # React component tests\n│   ├── lib\u002F           # Library function tests\n│   ├── services\u002F      # Service layer tests\n│   └── user\u002F          # User helper tests\n├── integration\u002F       # API and database tests\n├── database\u002F          # Database helper tests\n├── e2e\u002F               # End-to-end tests (Playwright)\n├── payments\u002F          # Payment flow tests\n└── setup.ts           # Global test setup\n```\n\n## Configuration Files\n\n- **Jest Config**: `jest.config.js`\n- **Test Setup**: `__tests__\u002Fsetup.ts`\n- **Playwright Config**: `playwright.config.ts`\n\n## RLS-Aware Testing\n\n### Setting Up Test Context\n\nAlways use RLS context helpers in tests:\n\n```typescript\nimport { withUserContext, withSystemContext } from \"@\u002Flib\u002Frls-context\";\nimport { prisma } from \"@\u002Flib\u002Fprisma\";\n\ndescribe(\"User payments\", () => {\n  const testUserId = \"test-user-123\";\n\n  beforeEach(async () => {\n    \u002F\u002F Create test user with RLS context\n    await withSystemContext(prisma, \"test\", async (client) => {\n      await client.user.create({\n        data: {\n          user_id: testUserId,\n          email: `test-${Date.now()}@example.com`,\n          first_name: \"Test\",\n          last_name: \"User\",\n        },\n      });\n    });\n  });\n\n  it(\"should only see own payments\", async () => {\n    const payments = await withUserContext(\n      prisma,\n      testUserId,\n      async (client) => {\n        return client.payments.findMany();\n      },\n    );\n    \u002F\u002F RLS ensures only this user's payments returned\n    expect(payments.every((p) => p.user_id === testUserId)).toBe(true);\n  });\n});\n```\n\n### Test Isolation\n\nUse unique identifiers to prevent test pollution:\n\n```typescript\nconst uniqueEmail = `test-${Date.now()}@example.com`;\nconst uniqueUserId = `user-${crypto.randomUUID()}`;\n```\n\n## Test Commands\n\n```bash\n# Run all unit tests\nyarn test:unit\n\n# Run integration tests\nyarn test:integration\n\n# Run specific test file\nyarn jest __tests__\u002Funit\u002Fcomponents\u002Fmy-component.test.tsx\n\n# Run tests matching pattern\nyarn jest --testNamePattern=\"should handle\"\n\n# Run with coverage\nyarn test:unit --coverage\n\n# Run E2E tests\nyarn test:e2e\n```\n\n## Common Patterns\n\n### Component Testing\n\n```typescript\nimport { render, screen, fireEvent } from \"@testing-library\u002Freact\";\nimport { MyComponent } from \"@\u002Fcomponents\u002Fmy-component\";\n\ndescribe(\"MyComponent\", () => {\n  it(\"renders correctly\", () => {\n    render(\u003CMyComponent \u002F>);\n    expect(screen.getByRole(\"button\")).toBeInTheDocument();\n  });\n\n  it(\"handles click events\", async () => {\n    const onClickMock = jest.fn();\n    render(\u003CMyComponent onClick={onClickMock} \u002F>);\n\n    fireEvent.click(screen.getByRole(\"button\"));\n    expect(onClickMock).toHaveBeenCalledTimes(1);\n  });\n});\n```\n\n### API Route Testing\n\n```typescript\nimport { GET } from \"@\u002Fapp\u002Fapi\u002Fmy-route\u002Froute\";\nimport { NextRequest } from \"next\u002Fserver\";\n\ndescribe(\"GET \u002Fapi\u002Fmy-route\", () => {\n  it(\"returns 200 with data\", async () => {\n    const request = new NextRequest(\"http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fmy-route\");\n    const response = await GET(request);\n\n    expect(response.status).toBe(200);\n    const data = await response.json();\n    expect(data).toHaveProperty(\"success\", true);\n  });\n});\n```\n\n### Mocking Prisma\n\n```typescript\njest.mock(\"@\u002Flib\u002Fprisma\", () => ({\n  prisma: {\n    user: {\n      findUnique: jest.fn(),\n      create: jest.fn(),\n    },\n  },\n}));\n```\n\n## Evidence Template for Linear\n\nWhen completing test work, attach this evidence block:\n\n```markdown\n**Test Execution Evidence**\n\n**Test Suite**: [unit\u002Fintegration\u002Fe2e]\n**Files Changed**: [list files]\n\n**Test Results:**\n\n- Total Tests: [X]\n- Passed: [X]\n- Failed: [0]\n- Skipped: [X]\n\n**Coverage** (if applicable):\n\n- Statements: X%\n- Branches: X%\n- Functions: X%\n- Lines: X%\n\n**Commands Run:**\n\n\\`\\`\\`bash\nyarn test:unit --coverage\n\\`\\`\\`\n\n**Output:**\n[Paste relevant test output]\n```\n\n## Pre-Push Validation\n\nAlways run before pushing:\n\n```bash\nyarn ci:validate\n```\n\nThis runs:\n\n- Type checking\n- ESLint\n- Unit tests\n- Format check\n\n## Authoritative References\n\n- **Jest Config**: `jest.config.js`\n- **Test Setup**: `__tests__\u002Fsetup.ts`\n- **RLS Context**: `lib\u002Frls-context.ts`\n- **CI Validation**: `package.json` scripts\n",{"name":5,"description":7,"allowed-tools":24},"Read, Bash, Grep, Glob","main","39a25d63191d67efe43cdce5b7507069e2307f0f",".claude\u002Fskills\u002Ftesting-patterns","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1","https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Te4TcrpgcN4j8DsYqVdjPl4QXVbs5XXo\u002Fview?usp=drive_link","Web3 security researcher \u002F developer","2026-10-18 15:17:21",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add sahil-kaushik1\u002FAuditing-Workflow --skill testing-patterns",{"tool":39,"command":40},"bunx","bunx skills add sahil-kaushik1\u002FAuditing-Workflow --skill testing-patterns",{"tool":42,"command":43},"pnpm","pnpm dlx skills add sahil-kaushik1\u002FAuditing-Workflow --skill testing-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"README.md","REFERENCE","参考文档",1574,"https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting-patterns\u002FREADME.md",[54,60,66,72,79,86],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M79BSEAG0SS9CC2EN1S51K2X","stripe-patterns","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsync\u002Frendertrust\u002F.claude\u002Fskills\u002Fstripe-patterns\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M79BSBAZXQBWCPKYJP38A35B","payment-patterns","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsync\u002Fkeryk-ai\u002F.claude\u002Fskills\u002Fpayment-patterns\u002FSKILL.md",[],[],{"skillNo":67,"name":5,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79BS8PKZXFGBNQBS2GHNXZW","Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Ftesting-patterns\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79BS3PR92A4QNEJAFNDKB2G","team-coordination","Agent Teams orchestration patterns for multi-agent SAFe workflows. Use when spawning agent teams, coordinating teammates, enforcing quality gates via task dependencies, or orchestrating the 11-agent SAFe pipeline. Covers team creation, messaging, shared task lists, and SAFe gate enforcement. Do NOT use for single-agent or simple subagent workflows.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fteam-coordination\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79BRZ422QD8D5QHQMXAVPWZ","task-compilation","Compile broad audit goals into structured proof obligations with 9 mandatory fields. Used after decomposition by the Threat Modeler agent.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Ftask-compilation\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79BRV2MK2AJZBNSE2BETP28","storage-layout-analysis","Proxy patterns, slot collisions, upgrade safety. Used during decomposition to identify storage-related vulnerabilities in upgradeable contracts.","https:\u002F\u002Fgithub.com\u002Fsahil-kaushik1\u002FAuditing-Workflow\u002Fblob\u002Fmain\u002F.gemini\u002Fskills\u002Fstorage-layout-analysis\u002FSKILL.md",[],[]]