Claude-skill-registry error-fixer

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/error-fixer" ~/.claude/skills/majiayu000-claude-skill-registry-error-fixer && rm -rf "$T"
manifest: skills/data/error-fixer/SKILL.md
source content

Error Fixer

Fetch and fix errors flagged for AI correction in the admin dashboard. Supports both JS errors (

error_reports
) and HTTP errors (
http_error_logs
).

Workflow

1. FETCH    → Get AI-flagged errors from both tables
2. ANALYZE  → Understand each error (stack trace, context, URL, status)
3. FIX      → Apply fixes using systematic debugging
4. MARK     → Mark errors as ai_fixed with notes
5. REPORT   → Summarize what was fixed

Step 1: Fetch Flagged Errors

Query both error tables using Supabase MCP:

JS Errors:

SELECT id, error_type, error_message, stack_trace, context, user_action, ai_prompt, created_at
FROM error_reports WHERE ai_status = 'flagged_for_ai'

HTTP Errors:

SELECT id, method, url, status_code, response_body, request_context, navigation_path, ai_prompt, created_at
FROM http_error_logs WHERE ai_status = 'flagged_for_ai'

Or use RPC functions:

get_errors_for_ai()
and
get_http_errors_for_ai()
.

Important: The

ai_prompt
field contains specific instructions from the admin.

Step 2: Analyze Each Error

JS Errors

  1. Read the ai_prompt - Admin's instruction
  2. Parse stack trace - File path, line number, call chain
  3. Check context -
    route
    ,
    action
    , other data
  4. Read affected file(s)

HTTP Errors

  1. Read the ai_prompt - Admin's instruction
  2. Check URL and status code - What endpoint failed and why
  3. Review response_body - Error message from server
  4. Check navigation_path - User's journey to this error
  5. Find the code - Locate fetch/API call that made this request

Step 3: Fix Using Systematic Debugging

DO NOT GUESS. Follow systematic-debugging:

  1. Understand root cause - Don't patch symptoms
  2. Find the actual source - Trace back through stack/code
  3. Make minimal fix - One change at a time
  4. Verify locally - Run build/tests after fix

Common JS Error Patterns

Error TypeCommon Fix
TypeError: Cannot read property 'x' of undefined
Add null checks, optional chaining
TypeError: x is not a function
Check imports, verify function exists
ChunkLoadError
Code splitting issue, check lazy imports
NetworkError
Add error handling, retry logic

Common HTTP Error Patterns

StatusCommon Fix
400 Bad RequestValidate request params, check payload format
401/403 UnauthorizedCheck auth token, verify RLS policies
404 Not FoundVerify endpoint exists, check URL construction
500 Server ErrorCheck Edge Function logs, fix server-side code
CORS errorsUpdate Edge Function CORS headers

Step 4: Mark as Fixed

JS Errors: Call

mark_error_ai_fixed(p_id, p_fix_notes)

HTTP Errors: Call

mark_http_error_ai_fixed(p_id, p_fix_notes)

Good fix notes examples:

  • "Added null check for user object in ProfileCard.tsx:45"
  • "Fixed RLS policy for authenticated users on topics table"
  • "Added missing CORS header to edge function"

Step 5: Report Summary

## Error Fix Summary

### JS Errors
#### Fixed (X)
- [error_type] in file.tsx:line - Brief description

#### Could Not Fix (X)
- [error_type] - Reason

### HTTP Errors
#### Fixed (X)
- [status_code] [method] /path - Brief description

#### Could Not Fix (X)
- [status_code] [method] /path - Reason

Database Schema Reference

-- error_reports (JS errors)
ai_status: 'pending' | 'flagged_for_ai' | 'ai_fixed' | 'verified'
ai_prompt: text
ai_fixed_at: timestamp
ai_fix_notes: text

-- http_error_logs (HTTP errors)
ai_status: 'pending' | 'flagged_for_ai' | 'ai_fixed' | 'verified'
ai_prompt: text
ai_fixed_at: timestamp
ai_fix_notes: text

-- RPC functions
get_errors_for_ai()              -- JS errors flagged for AI
get_http_errors_for_ai()         -- HTTP errors flagged for AI
mark_error_ai_fixed(p_id, p_fix_notes)       -- Mark JS error fixed
mark_http_error_ai_fixed(p_id, p_fix_notes)  -- Mark HTTP error fixed

Best Practices

  1. Always read ai_prompt first - Admin may have specific instructions
  2. Don't fix what you don't understand - Mark as "could not fix"
  3. Run build after fixes - Verify no new errors
  4. Write clear fix notes - Help admin understand what changed
  5. Group related errors - Multiple errors may have same root cause
  6. Check Edge Function logs - For HTTP 500 errors, use Supabase MCP
    get_logs