
prod-debug
by acambitsis
SKILL.md
name: prod-debug description: Debug production issues using MCP servers (Sentry, Convex, Stripe). Use when investigating errors, checking production data, analyzing payment failures, or troubleshooting user-reported issues.
Production Debugging with MCP Servers
Debug production issues systematically using the available MCP servers.
Core Principle: Follow the Data
Production debugging follows a consistent pattern: identify → correlate → trace
- Identify the issue (usually starts with an error or user report)
- Correlate across systems (find the user, find related records)
- Trace the data flow (what happened and in what order)
MCP Server Roles
| Server | Primary Use | Key Insight |
|---|---|---|
| Sentry | Error detection | What went wrong, who was affected |
| Convex | Application state | Current data state, audit trails |
| Stripe | Payment data | Payment status, customer records |
Debugging Workflow
Step 1: Start with Sentry
Sentry is typically the entry point—it captures errors with context.
Goals:
- Find the error and its stack trace
- Extract user identifiers (email, userId) from event context
- Understand when and how often it occurred
Principle: Sentry events often contain enough context to identify the affected user. Look in event tags, user context, and breadcrumbs.
Step 2: Query Convex for State
Once you have user context, query Convex to understand the application state.
Goals:
- Find the user record and related data
- Check audit trails (transaction logs, status changes)
- Verify data consistency across related tables
Principles:
- User email is the universal correlator—start there
- Audit/transaction tables show what happened over time
- Status fields show current state; timestamps show progression
- Internal error tables may have details not shown to users
Access modes:
- Use
./scripts/mcp-convex-readonly.shfor safe prod access - Use
./scripts/mcp-convex-devonly.shfor dev work with full access
Step 3: Check Stripe if Payment-Related
For issues involving purchases, credits, or billing:
Goals:
- Find the customer by email
- Check payment intent status and any failure reasons
- Verify webhook events were processed
Principles:
- Stripe customer email should match Convex user email
- Payment amounts in Stripe are in cents (minor currency units)
- Failed payments have decline codes explaining why
- If credits weren't added, check if the webhook was received
Common Debugging Patterns
Pattern: User Reports Missing Data
- Find user in Convex by email
- Check the relevant data table for their records
- Look at audit/transaction tables for history
- Check Sentry for any errors during the operation
Pattern: Background Job Failed
- Find the error in Sentry
- Get the job/record ID from error context
- Query Convex for the record's current status
- Check internal error tables for detailed failure info
- Verify any refunds or rollbacks occurred
Pattern: Payment Not Reflected
- Find customer in Stripe by email
- Check payment intent status (succeeded? failed?)
- If succeeded, check Convex transaction logs for the purchase
- If missing, check Sentry for webhook processing errors
Pattern: Intermittent Errors
- Search Sentry for the error pattern
- Look at frequency and affected users
- Check if it correlates with specific data states
- Review Convex logs around error timestamps
Key Principles
-
Email is the universal key — Users are identifiable by email across all systems
-
Audit trails tell the story — Transaction/log tables show what happened, not just current state
-
Timestamps reveal sequence — Compare timestamps across systems to understand order of operations
-
Internal errors have more detail — User-facing errors are sanitized; internal tables have raw details
-
Webhooks are the integration point — Issues with external services often manifest as webhook failures
-
Read-only by default — Use read-only mode for prod debugging to prevent accidental modifications
Quick Reference
Find a user: Query by email (indexed in both Convex and Stripe)
Check credit state: Look at balance table + recent transactions
Trace a grading: Essay → Grade record → Status + timestamps → Error table if failed
Trace a payment: Stripe payment intent → Convex transaction log → Credit balance
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です