Skip to content

Truc350/WebHomeStay / .agents/skills/app-debug

app-debug

Verified

Debugs EasyChatGPT app issues by reading server logs via Log Viewer API (curl) and querying databases via SSH scripts. Activates when user pastes console.easyaichat.app URLs, staging.console.easyaichat.app URLs, Log Viewer URLs containing /logs?file=, error messages, stack traces, cURL errors, or asks to debug, investigate, check conversation, or evaluate app behavior.

App Debug

NEVER use WebFetch on console URLs. Extract params from URL → call Log Viewer API via curl in Bash.

Environment detection

URL containsEnvDB scriptLog API baseAPI key env var
staging.console.stagingbash .codex/basedkit/scripts/db-staging-query.shhttps://staging.console.easyaichat.app/logs/apiSTAGING_MICROSERVICE_API_KEY
console.easyaichat.appprodbash .codex/basedkit/scripts/db-prod-query.shhttps://console.easyaichat.app/logs/apiPROD_MICROSERVICE_API_KEY
localhostlocalbash .codex/basedkit/scripts/db-local-query.shhttp://localhost/logs/apiMICROSERVICE_API_KEY

Read key: grep {VAR_NAME} .env | cut -d= -f2 → append ?api_key={KEY} to all API calls.

Routing

Conversation URL (/workspaces/{ws}/conversations?handle={handle}#{number}) → DB queries: see db-queries.md

Log Viewer URL (/logs?file={id}.log&query=log-index%3A{N}) → Extract file + decode log_index → call Log API below

Error/exception text → Search logs below, then DB if API-related

General debug → DB for data, Logs for errors, source code for logic

Log Viewer API

# List log files
curl -s "{BASE}/logs/api/files?api_key={KEY}"

# Read logs (newest first)
curl -s "{BASE}/logs/api/logs?file={ID}&per_page=20&direction=desc&api_key={KEY}"

# Jump to exact index (from URL log-index param) — use query param, NOT log_index
curl -s "{BASE}/logs/api/logs?file={ID}&query=log-index%3A{N}&per_page=1&api_key={KEY}"

# Search logs
curl -s "{BASE}/logs/api/logs?file={ID}&query={TERM}&api_key={KEY}"

Params: file (required), per_page (1-100), direction (asc/desc), log_index, level (error/warning/info/debug), query.

Response per entry: index, level, datetime, message, context, full_text.

Which file to check

IssueFile pattern
Exceptions, cURL errorslaravel-{date}
Chat/AI responseschat_flow-{date}, bot_function-{date}
Webhookswebhook_log-{date}, messenger_log, zalo_log, instagram_log
Scheduled tasksschedule-{date}
Performanceperformance-{date}
Workflowsworkflow_log-{date}

DB queries

See db-queries.md for SQL templates.

Schema

See schema.md for table structures and relationships.

Safety

  • DB scripts: read-only (SELECT only), block-db-write.cjs hook enforces this
  • Always SUBSTRING() on payload/response columns
  • Log API: read-only
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall