diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 8650277..3600f0a 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -2,5 +2,5 @@ "name": "base44", "version": "0.0.1", "description": "Base44 SDK skills for Claude Code - CLI operations and JavaScript/TypeScript SDK development", - "skills": ["./skills/base44-cli/", "./skills/base44-sdk/"] + "skills": ["./skills/base44-cli/", "./skills/base44-sdk/", "./skills/base44-troubleshooter/"] } diff --git a/skills/base44-troubleshooter/SKILL.md b/skills/base44-troubleshooter/SKILL.md new file mode 100644 index 0000000..175d9af --- /dev/null +++ b/skills/base44-troubleshooter/SKILL.md @@ -0,0 +1,87 @@ +--- +name: base44-troubleshooter +description: Troubleshoot production issues using backend function logs. Use when investigating app errors, debugging function calls, or diagnosing production problems in Base44 apps. +--- + +# Troubleshoot Production Issues + +## Prerequisites + +Verify authentication before fetching logs: + +```bash +npx base44 whoami +``` + +If not authenticated or token expired, instruct user to run `base44 login`. + +## Fetching Function Logs + +Must be run from the project directory (where `base44/.app.jsonc` exists). + +```bash +npx base44 logs [options] +``` + +**Options**: +| Option | Description | +|--------|-------------| +| `--function ` | Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions | +| `--since ` | Show logs from this time (ISO format) | +| `--until ` | Show logs until this time (ISO format) | +| `--level ` | Filter by log level: `log`, `info`, `warn`, `error`, `debug` | +| `-n, --limit ` | Results per page (1-1000, default: 50) | +| `--order ` | Sort order: `ASC` \| `DESC` (default: DESC) | +| `--json` | Output raw JSON | + +**Examples**: + +```bash +# All recent logs +npx base44 logs + +# Errors only +npx base44 logs --level error + +# Specific function +npx base44 logs --function myFunction + +# Multiple functions +npx base44 logs --function createOrder,processPayment + +# Time range +npx base44 logs --since 2024-01-01T00:00:00Z --until 2024-01-02T00:00:00Z + +# Last 10 errors for a specific function +npx base44 logs --function myFunction --level error --limit 10 +``` + +## Troubleshooting Flow + +### 1. Confirm Project Context + +Make sure you're in a Base44 project directory: + +```bash +cat base44/.app.jsonc +``` + +### 2. Check Recent Errors + +```bash +npx base44 logs --level error +``` + +### 3. Drill Into a Specific Function + +If you know which function is failing: + +```bash +npx base44 logs --function --level error +``` + +### 4. Analyze the Logs + +- Look for stack traces and error messages in the output +- Check timestamps to correlate with user-reported issues +- Use `--json` for structured output when you need to parse details