skills/utility-skills/serverless-debugging/SKILL.md
Debug serverless and edge functions where traditional logging is limited. Use when features are deployed but not triggering, logs are missing, or runtime behavior differs from expectations in Supabase Edge Functions, AWS Lambda, Cloudflare Workers, or similar platforms.
npx skillsauth add abcnuts/manus-skills serverless-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematic debugging methodology for serverless/edge functions where console.log may not appear in logs and traditional debugging tools are unavailable.
Collect evidence from ALL layers before forming hypotheses. Avoid jumping to conclusions.
Database Layer:
Code Layer:
Runtime Layer:
Environment Layer:
Evidence Checklist: See references/evidence-checklist.md for comprehensive list
Compare working vs. broken behavior to identify differences.
Key Questions:
Common Patterns:
Form specific, testable hypotheses based on evidence.
Good Hypothesis Characteristics:
Example Hypotheses:
Testing Without Logs:
Fix the root cause and verify across all layers.
Fix Implementation:
Verification:
See references/common-serverless-bugs.md for detailed catalog. Quick reference:
Type Coercion Issues:
0 === null → false (check for both)undefined === null → falseAsync/Timing Issues:
Environment Differences:
Database Issues:
When console.log doesn't work, use these alternatives:
Database-Driven Debugging:
-- Create debug log table
CREATE TABLE debug_logs (
id SERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ DEFAULT NOW(),
function_name TEXT,
checkpoint TEXT,
data JSONB
);
-- Write debug info from code
INSERT INTO debug_logs (function_name, checkpoint, data)
VALUES ('my-function', 'before-extraction', jsonb_build_object('count', message_count));
Error Response Debugging:
// Return diagnostic info in error response
return new Response(JSON.stringify({
debug: {
messageCount: messageCount,
lastExtraction: lastExtraction,
shouldExtract: shouldExtractMemories(messageCount, lastExtraction)
}
}), { status: 200 });
Code Analysis:
See references/logging-alternatives.md for more strategies.
Deployment Verification:
# Use scripts/check_deployment.py
python scripts/check_deployment.py <function-name> <local-path>
Database State Analysis:
# Use scripts/database_debugger.py
python scripts/database_debugger.py <table-name> <condition>
Type Analysis:
# Use scripts/type_analyzer.py
python scripts/type_analyzer.py <file-path> <function-name>
Symptom: Proactive memory extraction never triggered despite code being deployed.
Phase 1 Evidence:
last_extraction_at stayed at 0Phase 2 Pattern:
Phase 3 Hypothesis:
last_extraction_at is 0, not nullif (lastExtraction === null) → always false when 0messageCount - 0 >= 10 instead of messageCount >= 4Phase 4 Fix:
// Before: Only checked null
if (lastExtractionAt === null) {
return messageCount >= 4;
}
// After: Check both null AND 0
if (lastExtractionAt === null || lastExtractionAt === 0) {
return messageCount >= 4;
}
Result: Feature now works correctly, triggers after 4 messages.
references/evidence-checklist.md and gather evidence from all layersscripts/ tools to verify hypothesistools
Generate comprehensive demonstrations showing how to access projects and work across different environments (Manus terminals, personal computers, team collaboration). Use when users ask "how do I access this from another terminal/computer", "how do I share this with my team", "how do I get this on my Mac", or need clarification on Manus persistence vs GitHub usage.
development
Use when you have a spec or requirements for a multi-step task, before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
development
Use when implementing any feature or bugfix, before writing implementation code