code-security

Enforce secure auth, validation, RLS, secrets, and XSS patterns in TypeScript, React, and Supabase apps.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill code-security-jjmendezrodriguez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-security
Source: https://github.com/jjmendezrodriguez/jm-claude-plugin/tree/main/skills/code-security
Command: npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill code-security-jjmendezrodriguez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents security vulnerabilities in TypeScript, React, and Supabase apps by enforcing secure handling of authentication, authorization, validation, secrets, and XSS-safe rendering.

Core Features & Use Cases

  • Security-first flow: Apply Authenticate → Authorize (RLS) → Validate (Zod) → Process → Log without sensitive data for every critical operation.
  • Zod validation at system boundaries: Validate and safely parse external input (request bodies, params, headers) with typed, sanitized outputs and consistent error handling.
  • Secrets management discipline: Keep Supabase keys out of frontend code by using environment variables, ensuring browser-safe anon keys and server-only service role keys.
  • Supabase RLS policy correctness: Enable RLS on user data tables and enforce least-privilege with correct USING and WITH CHECK rules.
  • React XSS prevention patterns: Avoid raw HTML rendering and unsafe attribute interpolation; sanitize trusted HTML and validate URLs.
  • Auth protection patterns: Guard routes and verify JWT server-side in Edge Functions before sensitive data access.
  • PR-ready security checklist: Catch common failures (hardcoded secrets, missing Zod validation, overly permissive RLS, sensitive logging, CORS mistakes).

Quick Start

Tell the AI to audit a specific Supabase endpoint and related React form, then produce concrete Zod schemas, RLS policy drafts, and a secrets/logging check for the changes.

Frequently Asked Questions about code-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure Supabase Row Level Security policies for user-owned data?

Supabase RLS policies are secured by enabling RLS on user tables and enforcing least-privilege with correct USING and WITH CHECK rules. This prevents unauthorized data access by restricting operations to user-owned rows.

How do I validate Edge Function request bodies and parameters in TypeScript?

Edge Function requests are validated using Zod safeParse at system boundaries. This technique safely parses external input like request bodies, params, and headers into typed, sanitized outputs with consistent error handling.

What is the correct flow for securing Supabase API endpoints and React forms?

The correct flow for securing API endpoints is Authenticate, Authorize via RLS, Validate with Zod, Process, and Log without sensitive data. Applying this sequence to every critical operation prevents common auth and validation failure modes.

How do I prevent XSS vulnerabilities when rendering HTML in React components?

XSS vulnerabilities in React are prevented by avoiding raw HTML rendering and unsafe attribute interpolation. You must sanitize trusted HTML and validate URLs before rendering them in components.

Can I use the Supabase service role key in frontend React code?

No, the Supabase service role key is strictly server-only. Secrets management discipline requires using browser-safe anon keys in frontend code and server-only service role keys via environment variables.

How do I verify JWT tokens server-side before accessing sensitive data in Edge Functions?

JWT tokens are verified server-side in Supabase Edge Functions before sensitive data access. This auth protection pattern guards routes by validating the token's authenticity and authorization level.