UNPKG

@rip-user/rls-debugger-mcp

Version:

AI-powered MCP server for debugging Supabase Row Level Security policies with Claude structured outputs

124 lines (85 loc) 3.56 kB
# RLS Debugger Skill - Installation This skill enhances the RLS Debugger MCP server with systematic debugging workflows, RLS pattern recognition, and best practices. ## What This Skill Provides - **Systematic debugging workflow** - Step-by-step process for analyzing RLS issues - **Common pattern recognition** - Identifies multi-tenant, role-based, and hierarchical access patterns - **Performance optimization tips** - Index recommendations and query optimization guidance - **Issue detection** - Recognizes common RLS problems and suggests fixes - **Best practices** - Security and performance guidelines ## Installation ### Global Installation (Recommended) Install once, use across all your Supabase projects: \`\`\`bash mkdir -p ~/.claude/skills cp -r examples/skills/rls-debugger ~/.claude/skills/ \`\`\` The skill will be available in all projects where you use Claude Code. ### Project-Local Installation Install for a specific project only: \`\`\`bash mkdir -p .claude/skills cp -r examples/skills/rls-debugger .claude/skills/ \`\`\` The skill will only be available in this project. ## Verification After installation, verify the skill is loaded: 1. Open Claude Code in your project 2. Ask: "What skills are available?" 3. You should see "RLS Policy Debugger" in the list ## Usage Once installed, the skill automatically activates when you mention RLS debugging topics: \`\`\` "Debug why user abc-123 can't access the orders table" "Show me common RLS patterns for multi-tenant applications" "Analyze the policy logic for my documents table" \`\`\` Claude will automatically use the systematic workflow and best practices defined in this skill. ## Requirements This skill works best with: - The rls-debugger MCP server installed and configured - Environment variables set (SUPABASE_URL, SUPABASE_SERVICE_KEY, ANTHROPIC_API_KEY) - A Supabase project with RLS policies to debug ## What You'll Get With this skill, Claude will: 1. **Follow a systematic workflow** instead of ad-hoc debugging 2. **Recognize common patterns** in your RLS policies 3. **Provide performance tips** for complex policies 4. **Remember architectural decisions** using the memory system 5. **Suggest best practices** for security and performance ## Example Session \`\`\` You: "User can't see their documents" Claude (using this skill): 1. Asks clarifying questions (user ID, operation type) 2. Lists all policies on the documents table 3. Analyzes which policies apply 4. Identifies the root cause (e.g., missing team_members record) 5. Provides verification SQL 6. Suggests fixes with risk levels 7. Recommends saving the knowledge for future reference \`\`\` ## Updating the Skill To update after changes: \`\`\`bash # If installed globally cp -r examples/skills/rls-debugger ~/.claude/skills/ # If installed locally cp -r examples/skills/rls-debugger .claude/skills/ \`\`\` ## Troubleshooting **Skill not loading:** - Check the skill directory exists in `~/.claude/skills/rls-debugger/` or `.claude/skills/rls-debugger/` - Verify `SKILL.md` file exists in the directory - Restart Claude Code **Skill not activating:** - Mention RLS or debugging explicitly in your prompt - Try: "Using the RLS debugger skill, analyze..." **MCP server not found:** - Verify rls-debugger MCP server is installed - Check `.mcp.json` configuration - Run: `claude mcp list` to see installed servers ## Learn More See the main README.md for: - MCP server installation instructions - Environment variable configuration - Tool documentation and examples