Files
coralogix__cx-cli/scripts/sync-shared-references.sh
orimazar f6e2ce2134 AICE-244 | Add AI-Center commands + skill (AI v3) (#160)
Re-opens the work from #159 (that PR was closed and its branch
force-pushed to purge accidentally-committed `graphify-out/` local
files, which blocks GitHub from reopening it — so this is a fresh PR
with identical, cleaned content).

## What
`cx ai-center` — AI Center (GenAI) configuration commands over the AI v3
REST API (`/mgmt/openapi/5/ai/...`): `applications`, `evaluations`,
`custom-evaluations`, `coverage`, `model-pricing` — mirroring the
`ws-ai-mcp` AI Center tool surface — plus the `cx-ai-center` skill
(config commands + the GenAI-span DataPrime query library).

## History
- All review feedback from #159 (bot + Yoav) is already applied; see
#159 for the full discussion/resolved threads.
- Validated end-to-end against real eu2 AI Center data; unit + wiremock
+ `#[ignore]`d e2e tests; `verify-skills` green.
- Branch history was re-baselined on master to fully purge the
`graphify-out/` files (now gitignored).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Pj6ieK81Qdk1YfcJwqNraV

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 11:54:26 +03:00

93 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Copies shared reference files from skills/shared/ into each consuming skill's
# references/ directory. Run this after editing any file in skills/shared/.
#
# Usage: scripts/sync-shared-references.sh
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SHARED_DIR="$REPO_ROOT/skills/shared"
SKILLS_DIR="$REPO_ROOT/skills"
COPIED=0
ERRORS=0
copy_refs() {
local skill="$1"
shift
local files=("$@")
local skill_dir="$SKILLS_DIR/$skill"
local refs_dir="$skill_dir/references"
if [ ! -d "$skill_dir" ]; then
echo "ERROR: skill directory not found: $skill_dir"
ERRORS=$((ERRORS + 1))
return
fi
mkdir -p "$refs_dir"
for ref_file in "${files[@]}"; do
local src="$SHARED_DIR/$ref_file"
local dst="$refs_dir/$ref_file"
if [ ! -f "$src" ]; then
echo "ERROR: shared file not found: $src"
ERRORS=$((ERRORS + 1))
continue
fi
cp "$src" "$dst"
echo " copied $ref_file -> $skill/references/"
COPIED=$((COPIED + 1))
done
}
# cx-telemetry-querying: all shared references
copy_refs "cx-telemetry-querying" \
"dataprime-reference.md" \
"promql-guidelines.md" \
"logs-querying.md" \
"spans-querying.md" \
"metrics-querying.md" \
"rum-querying.md" \
"rum-fields.md"
# cx-ai-center: DataPrime + spans references for GenAI span analysis
copy_refs "cx-ai-center" \
"dataprime-reference.md" \
"spans-querying.md"
# cx-dashboards: query language and data-source references
copy_refs "cx-dashboards" \
"dataprime-reference.md" \
"promql-guidelines.md" \
"logs-querying.md" \
"spans-querying.md"
# cx-alerts: DataPrime syntax and data-source references for alert conditions (logs, metrics, spans)
copy_refs "cx-alerts" \
"dataprime-reference.md" \
"logs-querying.md" \
"promql-guidelines.md" \
"spans-querying.md"
# cx-coding-agents: all query-language and telemetry-pillar references (agents use logs, spans, and metrics)
copy_refs "cx-coding-agents" \
"dataprime-reference.md" \
"logs-querying.md" \
"spans-querying.md" \
"promql-guidelines.md" \
"metrics-querying.md"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Synced $COPIED file(s)"
if [ "$ERRORS" -gt 0 ]; then
echo "FAILED: $ERRORS error(s)"
exit 1
fi