[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7516ZA88ESAAY3JWXBNA56K":3,"skill-same:01M7516ZA88ESAAY3JWXBNA56K":45},{"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":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7516ZA88ESAAY3JWXBNA56K","backend-security-patterns",null,"Combined backend protocols for authentication (Clerk JWT verification) and PII-safe observability. Use when handling auth on the server, verifying Clerk webhooks via `svix`, scoping metadata via `publicMetadata`\u002F `privateMetadata`, or sanitizing logs to keep emails, tokens, and request bodies out of telemetry.","chrisbarrantes\u002Fmandrel","chrisbarrantes","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4534419?v=4","01M7511VXT2H7WE09JE4ZMBESG","Chris Barrantes","01M7511VYGPFHQCE9HNVKES0QN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fsecurity\u002Fbackend-security-patterns\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: backend-security-patterns\ndescription:\n  Combined backend protocols for authentication (Clerk JWT verification) and\n  PII-safe observability. Use when handling auth on the server, verifying\n  Clerk webhooks via `svix`, scoping metadata via `publicMetadata`\u002F\n  `privateMetadata`, or sanitizing logs to keep emails, tokens, and request\n  bodies out of telemetry.\nvendor: clerk\n---\n\n# Skill: Backend Security Patterns\n\n## Policy Capsule\n\n- Verify Clerk JWTs on the server or in middleware on every protected route; never trust client-asserted auth state.\n- Protect sensitive routes with Clerk's middleware helper so unauthenticated requests are redirected before hitting application logic.\n- Verify Clerk webhook signatures with the `svix` library before parsing payloads.\n- Store user state in `publicMetadata` (client-readable) or `privateMetadata` (server-only); never invent a parallel user store.\n- Never log raw request bodies, headers, or user objects that may contain PII (emails, DOB, IPs, Stripe tokens, passwords, JWTs).\n- Log entities by opaque ID only — e.g. `{ event: 'user_created', userId: user.id }`.\n- For Clerk-flow telemetry, log the Clerk user ID or session ID — never the email, name, or metadata payload.\n- Sanitize user input before including it in error logs so payloads cannot smuggle PII through the error path.\n\nCombined protocols for authentication (Clerk) and PII-safe observability in\nbackend services.\n\n## 1. Authentication (Clerk)\n\n### Core Principles\n\n- **Security First:** Never trust the client. Always verify JWTs on the server\n  or in middleware.\n- **Zero-Boilerplate Auth:** Use Clerk's built-in components (`\u003CSignIn>`,\n  `\u003CSignUp>`, `\u003CUserButton>`) to maintain UI consistency and security standards.\n- **Metadata Management:** Store application-specific user state in\n  `publicMetadata` (read-only by client) or `privateMetadata` (server-only).\n\n### Technical Standards\n\n- **Middleware:** Protect sensitive routes using Clerk's middleware helper so\n  non-authenticated users are redirected before hitting application logic.\n- **Webhooks:** Verify Clerk webhooks using the `svix` library to ensure\n  requests originate from Clerk.\n- **Session Tokens:** Use short-lived sessions and handle expired tokens\n  gracefully.\n\n### Best Practices\n\n- **OAuth Providers:** Prefer standard social logins (Google, GitHub) to reduce\n  user friction.\n- **Customization:** Use Clerk's theme API to align auth components with the\n  project's styling system.\n- **Multi-tenant:** Use Clerk Organizations for applications requiring teams or\n  workspaces.\n\n## 2. Telemetry & PII Logging\n\n### Rules\n\n- NEVER log raw request bodies, headers, or user objects that might contain PII\n  (Emails, DOB, IP Addresses, Stripe Tokens, Passwords, JWTs).\n- Log entities by opaque ID only (e.g.,\n  `logger.info({ event: 'user_created', userId: user.id })`).\n- For errors, log `error.message` and a safe contextual stack trace, but\n  sanitize any user input that caused the error before logging.\n- When instrumenting Clerk flows specifically, log the Clerk user ID or session\n  ID — never the email, name, or metadata payload.\n","# Skill: Backend Security Patterns\n\n## Policy Capsule\n\n- Verify Clerk JWTs on the server or in middleware on every protected route; never trust client-asserted auth state.\n- Protect sensitive routes with Clerk's middleware helper so unauthenticated requests are redirected before hitting application logic.\n- Verify Clerk webhook signatures with the `svix` library before parsing payloads.\n- Store user state in `publicMetadata` (client-readable) or `privateMetadata` (server-only); never invent a parallel user store.\n- Never log raw request bodies, headers, or user objects that may contain PII (emails, DOB, IPs, Stripe tokens, passwords, JWTs).\n- Log entities by opaque ID only — e.g. `{ event: 'user_created', userId: user.id }`.\n- For Clerk-flow telemetry, log the Clerk user ID or session ID — never the email, name, or metadata payload.\n- Sanitize user input before including it in error logs so payloads cannot smuggle PII through the error path.\n\nCombined protocols for authentication (Clerk) and PII-safe observability in\nbackend services.\n\n## 1. Authentication (Clerk)\n\n### Core Principles\n\n- **Security First:** Never trust the client. Always verify JWTs on the server\n  or in middleware.\n- **Zero-Boilerplate Auth:** Use Clerk's built-in components (`\u003CSignIn>`,\n  `\u003CSignUp>`, `\u003CUserButton>`) to maintain UI consistency and security standards.\n- **Metadata Management:** Store application-specific user state in\n  `publicMetadata` (read-only by client) or `privateMetadata` (server-only).\n\n### Technical Standards\n\n- **Middleware:** Protect sensitive routes using Clerk's middleware helper so\n  non-authenticated users are redirected before hitting application logic.\n- **Webhooks:** Verify Clerk webhooks using the `svix` library to ensure\n  requests originate from Clerk.\n- **Session Tokens:** Use short-lived sessions and handle expired tokens\n  gracefully.\n\n### Best Practices\n\n- **OAuth Providers:** Prefer standard social logins (Google, GitHub) to reduce\n  user friction.\n- **Customization:** Use Clerk's theme API to align auth components with the\n  project's styling system.\n- **Multi-tenant:** Use Clerk Organizations for applications requiring teams or\n  workspaces.\n\n## 2. Telemetry & PII Logging\n\n### Rules\n\n- NEVER log raw request bodies, headers, or user objects that might contain PII\n  (Emails, DOB, IP Addresses, Stripe Tokens, Passwords, JWTs).\n- Log entities by opaque ID only (e.g.,\n  `logger.info({ event: 'user_created', userId: user.id })`).\n- For errors, log `error.message` and a safe contextual stack trace, but\n  sanitize any user input that caused the error before logging.\n- When instrumenting Clerk flows specifically, log the Clerk user ID or session\n  ID — never the email, name, or metadata payload.\n",{"name":5,"vendor":24,"description":7},"clerk","main","22b1847659cc2a98f4fb8c24858f2199d91fda66",".agents\u002Fskills\u002Fstack\u002Fsecurity\u002Fbackend-security-patterns","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes","2026-05-27 08:16:47",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add chrisbarrantes\u002Fmandrel --skill backend-security-patterns",{"tool":37,"command":38},"bunx","bunx skills add chrisbarrantes\u002Fmandrel --skill backend-security-patterns",{"tool":40,"command":41},"pnpm","pnpm dlx skills add chrisbarrantes\u002Fmandrel --skill backend-security-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fsecurity\u002Fbackend-security-patterns\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M75171YZD373TXY5ZWJNXGS9","no-capsule-skill","Fixture without a Policy Capsule section.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002Ftests\u002Forchestration\u002Ffixtures\u002Fskill-capsule\u002Fno-capsule-skill\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"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},"01M7516WFQMKD2NGFMDNFG6C4A","vitest","Writes fast, isolated unit and integration tests with Vitest. Use when each test must run on file-save without shared state — `vi.mock()` for external deps, `vi.spyOn()` for call monitoring, AAA structure, and edge-case coverage for null\u002Fundefined\u002Fboundary inputs.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fqa\u002Fvitest\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7516T8FX7B0B0D510EE2FAP","playwright","Robust E2E browser testing with Playwright. Use when writing browser-driven tests — leverage auto-waiting (no `waitForTimeout`), prefer user-visible locators (`getByRole`, `getByText`, `getByLabel`) over CSS\u002FXPath, reuse `storageState` for auth, and enable trace-on-first-retry for CI debugging.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fqa\u002Fplaywright\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7516PHY868BJXHHZJ0FRYSX","playwright-bdd","Wires Gherkin `.feature` files to Playwright via the `playwright-bdd` library. Use when running BDD scenarios on a Playwright runtime — pairs with the `gherkin-authoring` skill (scenario prose) and the `playwright` skill (browser conventions). Drives execution by tag expression with trace-first debugging and Playwright-native sharding.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fqa\u002Fplaywright-bdd\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7516KEGSBBFJXRZWYBKYM4P","lighthouse-baseline","Codifies the capture-and-check baseline pattern for long-running quality signals (Lighthouse scores, bundle size, p95 latency, runtime memory). Use when wiring a new metric that needs a baseline file, paired :capture \u002F :check npm scripts, a tolerance-bounded gate, and a weekly refresh cadence — the goal is a hard CI signal that ratchets only with intent.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fqa\u002Flighthouse-baseline\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7516F8N9CS5AP3BT958B62P","gherkin-authoring","Authors `.feature` files that stay business-readable, translate cleanly from PRD acceptance criteria, and reuse a shared step-definition library. Use when writing or editing scenarios — the SSOT enforcement rules live in `.agents\u002Frules\u002Fgherkin-standards.md`; this skill shows authors how to apply them.","https:\u002F\u002Fgithub.com\u002Fchrisbarrantes\u002Fmandrel\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fstack\u002Fqa\u002Fgherkin-authoring\u002FSKILL.md",[],[]]