.codex/skills/agent-debugger/SKILL.md
Debug agent issues in the AI Community Platform. Use when the user reports a problem with an agent call, tool invocation, LLM response, or needs to trace a request end-to-end. Triggers on: "debug", "trace", "why did", "what happened", "not working", "wrong response", "check logs", "investigate", "diagnose".
npx skillsauth add nmdimas/ai-community-platform agent-debuggerInstall 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.
Investigate and diagnose issues with agent calls, tool invocations, and LLM responses in the AI Community Platform.
Follow these steps in order. Stop as soon as you identify the issue.
Ask the user for (or extract from conversation):
Platform logs go to OpenSearch in daily indices: platform_logs_YYYY_MM_DD.
Admin UI: /admin/logs/trace/{trace_id} — shows full call chain.
Direct query via CLI (if admin UI not available):
# Search by trace_id
docker compose exec core php -r "
\$ch = curl_init('http://opensearch:9200/platform_logs_*/_search');
curl_setopt_array(\$ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'query' => ['term' => ['trace_id' => 'TRACE_ID_HERE']],
'sort' => [['sequence_order' => 'asc']],
'size' => 50,
]),
]);
\$r = json_decode(curl_exec(\$ch), true);
foreach (\$r['hits']['hits'] ?? [] as \$h) {
\$s = \$h['_source'];
printf(\"%s | %-8s | %-35s | %s | %s\n\",
\$s['@timestamp'] ?? '',
\$s['source_app'] ?? '',
\$s['event_name'] ?? '',
\$s['status'] ?? '',
\$s['message'] ?? '',
);
}
"
Key fields to look at:
event_name — identifies the step (e.g., core.a2a.outbound.started)status — started, completed, failederror_code — reason for failurestep_input / step_output — sanitized payload (may be truncated)duration_ms — how long each step tooksource_app / target_app — which service logged itTypical event sequence for a successful tool call:
core.invoke.tool_resolved — skill mapped to agentcore.a2a.outbound.started — HTTP request to agenthello.intent.greet_me.started — agent received requesthello.llm.call.started — agent calling LLMhello.llm.call.completed — LLM respondedhello.intent.greet_me.completed — agent returning resultcore.a2a.outbound.completed — core received responseVerify the agent's system_prompt and config in the database:
docker compose exec core php -r "
\$pdo = new PDO('pgsql:host=postgres;dbname=ai_community_platform', 'app', 'app');
\$row = \$pdo->query(\"SELECT name, config, enabled FROM agent_registry WHERE name = 'AGENT_NAME'\")->fetch(PDO::FETCH_ASSOC);
echo json_encode(\$row, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
"
Common issues:
system_prompt is empty or wrong (was overwritten by tests)enabled is falseLiteLLM proxies all LLM calls. Check its logs:
# Recent LiteLLM Docker logs
docker compose logs litellm --since 10m --tail 50
# LiteLLM UI: http://localhost:4000/ui/
# Login: admin / dev-key (check .env for LITELLM_MASTER_KEY)
What to look for:
Langfuse captures LLM traces with full input/output.
Langfuse UI: http://localhost:8086/
.env (LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY)Generation tab for token counts, latency, and costWhat to look for:
The a2a_message_audit table records every tool invocation:
docker compose exec core php -r "
\$pdo = new PDO('pgsql:host=postgres;dbname=ai_community_platform', 'app', 'app');
\$stmt = \$pdo->query(\"SELECT skill, agent, status, duration_ms, error_code, actor, created_at FROM a2a_message_audit ORDER BY created_at DESC LIMIT 10\");
foreach (\$stmt as \$row) {
printf(\"%s | %-25s | %-15s | %s | %dms | %s | %s\n\",
\$row['created_at'],
\$row['skill'],
\$row['agent'],
\$row['status'],
\$row['duration_ms'],
\$row['error_code'] ?? '-',
\$row['actor'],
);
}
"
max_tokens in the agent handler (default 200 may be too low)agent_registry.config in DB — is system_prompt set?.env.test should use _test DB)system_prompt is read from config and sent in payloadresultJson passed to the LLM includes full tool outputpostJson in A2AClient has JSON_INVALID_UTF8_SUBSTITUTE flaglocale should show UTF-8LANG env varAgentChatCommand passes $actor to a2aClient->invoke().env.test points to ai_community_platform_test DBUser (CLI / Telegram)
|
v
Core (PHP/Symfony)
|-- Logs --> OpenSearch (platform_logs_YYYY_MM_DD)
|-- A2A --> Agent (hello/knowledge/news-maker)
| |-- Logs --> OpenSearch
| |-- LLM --> LiteLLM proxy
| |-- DB --> litellm (PostgreSQL)
| |-- Callback --> Langfuse
|-- LLM --> LiteLLM proxy (for core.agent_chat)
|-- Audit --> a2a_message_audit (PostgreSQL)
|-- Traces --> Langfuse (direct POST)
| Service | URL | Credentials |
|---------|-----|-------------|
| Admin Logs | /admin/logs | Admin login |
| Trace View | /admin/logs/trace/{trace_id} | Admin login |
| Langfuse | http://localhost:8086/ | See .env |
| LiteLLM UI | http://localhost:4000/ui/ | See LITELLM_MASTER_KEY |
| OpenSearch | http://localhost:9200/ | No auth (dev) |
development
Convert a website or page with related links into a local collection of Markdown files with an index. Follows project docs conventions (ua/en bilingual structure). Uses WebFetch — no external dependencies. Triggers on: "web to docs", "website to markdown", "save docs locally", "convert site", "download docs", "fetch docs", "scrape to markdown".
documentation
Translation agent for ua/en bilingual content. Handles UI labels, help text, error messages, docs, and agent/system prompts. Finds translatable elements, detects supported languages, translates by context, maintains term consistency. Triggers on: "translate", "translation", "i18n", "missing translations", "mirror docs", "sync languages".
development
Security review agent for PHP/Symfony codebase. Performs manual-style security review with OWASP ASVS 5.0 category mapping, severity ratings, and PHP/Symfony-specific checklist. Triggers on: "security review", "security audit", "vulnerability check", "OWASP review", "pentest review", "security scan".
development
Auto-bump pipeline monitor version when builder/monitor/pipeline-monitor.sh is modified. Triggers automatically as a post-edit convention — not user-invocable directly. When any change is made to pipeline-monitor.sh, increment the patch version in the "# Version:" header comment. Triggers on: "pipeline-monitor", "monitor version", "bump monitor".