AI-Analyse a Failure
Pipeline around ai-analyzeLogs: fetch the relevant log text, then ask the configured AI provider for a root cause + suggested fix. ai-analyzeLogs takes the log text (not a deploymentId) plus an aiId and a context.
Follow the ai-assist skill (${CLAUDE_PLUGIN_ROOT}/skills/ai-assist/SKILL.md), Step 3, for the analyze step. The log text comes from the read-logs skill (§1 runtime logs, §3 build logs, §5 hand-off to AI triage).
Arguments
Format: [deployment-id|app-name-or-id|compose-name-or-id] (optional)
- Deployment id → analyse that build log (
context: "build"). - App / compose name or id → fetch its current runtime log (
context: "runtime"); for a failed build, fetch the most recent errored deployment's build log instead. - No argument →
deployment-allCentralized, list recentstatus: errorrows, ask which to analyse.
Parse from "$ARGUMENTS".
Process
Verify AI is configured —
mcp__plugin_dokploy-dev_dokploy__ai-getEnabledProviders.- If the array is empty: tell the user no AI provider is enabled, offer
/dokploy-dev:debug <id>(manual decision tree), and point at theai-assistskill to wire one up. Stop. - Else: take the
aiIdof an enabled provider.
- If the array is empty: tell the user no AI provider is enabled, offer
Fetch the log text (this is the
logsargument):- Build failure →
deployment-readLogs { deploymentId, tail: 1000 }→context: "build". - App runtime →
application-readLogs { applicationId, tail: 500, since: "2h" }→context: "runtime". - Compose runtime → enumerate containers and concatenate each container's
compose-readLogs { composeId, containerId, tail }(or run/dokploy-dev:compose-logsfirst) →context: "runtime". - Truncate very large logs before sending (provider context limits).
- Build failure →
Run the analysis:
mcp__plugin_dokploy-dev_dokploy__ai-analyzeLogs → { aiId: "<enabled provider id>", logs: "<text from step 2>", context: "build" | "runtime" }Present the result:
## AI Analysis: <resource name> **Context:** build | runtime **Provider:** <providerName>/<model> ### Root cause <ai-analyzeLogs root cause> ### Suggested fix <ai-analyzeLogs suggested fix> ### Verify before applying - Cross-check against the raw log (`/dokploy-dev:logs <id>` or `/dokploy-dev:compose-logs <name>`). - The model only sees the log you sent it, not the codebase — trust the log if they conflict.Offer follow-up:
- "Apply this fix? I can update env / build type / Dockerfile and redeploy."
- "Want the full decision tree? Run
/dokploy-dev:debug <id>."
Example Usage
/dokploy-dev:analyze
/dokploy-dev:analyze web-frontend
/dokploy-dev:analyze my-compose-stack
/dokploy-dev:analyze <deploymentId>