Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions skills/create-dashboard/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ description: Create observability dashboards from OTEL metrics, logs, and traces
license: Apache-2.0
metadata:
author: kopai
version: "1.0.0"
version: "1.0.1"
---

# Create Dashboard with Kopai

## Component Schema (auto-generated)

!`npx @kopai/cli dashboards schema`
!`npx @kopai/cli dashboards schema 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx @kopai/app start — If using a remote backend, check the url in your .kopairc file."`

## Available Metrics

!`npx @kopai/cli metrics discover --json`
!`npx @kopai/cli metrics discover --json 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx @kopai/app start — If using a remote backend, check the url in your .kopairc file."`
Comment on lines +14 to +18

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify CLI command naming convention and usage patterns across repo docs/skills.
rg -n -C2 'npx (`@kopai/cli`|kopai/cli)\b'
rg -n -C2 'pnpm add (`@kopai/cli`|kopai/cli)\b'
rg -n -C2 'metrics discover --json.*2>/dev/null|dashboards schema.*2>/dev/null'

Repository: kopai-app/kopai-mono

Length of output: 24950


Avoid suppressing CLI stderr and emitting non-JSON fallback on JSON path.

On Line 14 and Line 18, 2>/dev/null discards CLI diagnostics, and Line 18 emits plain-text fallback to stdout where JSON is expected (--json), breaking downstream parsing.

Proposed fix
-!`npx `@kopai/cli` dashboards schema 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start — If using a remote backend, check the url in your .kopairc file."`
+!`npx `@kopai/cli` dashboards schema || { echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start. If using a remote backend, check the url in your .kopairc file." >&2; exit 1; }`

-!`npx `@kopai/cli` metrics discover --json 2>/dev/null || echo "ERROR: Cannot connect to Kopai backend. If running locally, start it with: npx `@kopai/app` start — If using a remote backend, check the url in your .kopairc file."`
+!`npx `@kopai/cli` metrics discover --json || echo '{"error":{"message":"Cannot connect to Kopai backend","remediation":["If running locally, start it with: npx `@kopai/app` start","If using a remote backend, check the url in your .kopairc file."]}}'`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/create-dashboard/SKILL.md` around lines 14 - 18, Remove the stderr
suppression and the plain-text fallback that breaks JSON parsing: in the `npx
`@kopai/cli` dashboards schema` and `npx `@kopai/cli` metrics discover --json`
invocations, delete `2>/dev/null` and stop echoing an error string to stdout;
instead let the CLI emit its diagnostics to stderr and on failure either exit
non‑zero or emit a valid JSON error object (e.g. {"error": "..."} ) to stdout so
downstream JSON parsing of `--json` remains valid. Ensure the changes touch the
two command lines shown (`npx `@kopai/cli` dashboards schema` and `npx `@kopai/cli`
metrics discover --json`) so errors are visible on stderr and no plain-text
fallback is printed to stdout.


## Rules

Expand Down
2 changes: 1 addition & 1 deletion skills/create-dashboard/tile.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kopai/create-dashboard",
"version": "0.1.0",
"version": "1.0.1",
"private": false,
"summary": "Create observability dashboards from OTEL metrics, logs, and traces using Kopai. Use when building metric visualizations, monitoring views, KPI panels, or when the user wants to see their telemetry data in a dashboard — even if they don't say \"dashboard\" explicitly. Also use when other skills or workflows need to present telemetry data visually (e.g. after root cause analysis).",
"skills": {
Expand Down