Files
Evan Purkhiser d65bd23b67 feat(dist): build and publish per-agent plugin distributions (#158)
This repository is the single source of truth for skills and routing metadata,
but it is not itself an installable plugin, and each assistant (Claude Code,
Cursor, Codex, Grok) expects the plugin in a different on-disk shape. No plugin
ecosystem can consume a zip or release asset; all install from a git ref. So a
GitHub Actions workflow builds each agent's distribution from this repository
and deploys it to a dedicated repository whose root is exactly that agent's
plugin, which a marketplace points at as getsentry/plugin-<agent>.

Each agent has a `plugin-src/<agent>/` dir with its manifests, README, and a
`build.sh` that assembles the dist tree from shared repo content. Claude, Cursor,
and Grok consume the plugin at the repo root; Codex requires it under
`plugins/sentry/` and rejects the `disable-model-invocation` field the skill
tree relies on, so its build strips that field and emits a per-skill
`agents/openai.yaml` (see `hide-skills.py`). MCP config is built from the repo's
`mcp.json` source of truth: inline in Claude's manifest, and a file for the
others.

Cross-repo writes use a short-lived token from a dedicated GitHub App scoped to
contents:write on the plugin repos; the default GITHUB_TOKEN cannot push to
other repositories.

The root `.claude-plugin/`, `.cursor-plugin/`, and `.mcp.json` are retained so
existing installs that consumed the plugin from this repo's root keep working;
their READMEs announce removal on or after 2026-07-11.
2026-06-12 13:39:38 -04:00

27 lines
879 B
Bash
Executable File

#!/usr/bin/env bash
#
# validate.sh — Validate the built Grok distribution before publishing.
#
# Grok has no published JSON Schema. We always run structural checks (the two
# manifests are valid JSON and the marketplace catalog is present), and when the
# `grok` CLI is available (local dev) we additionally run its native
# `grok plugin validate`. CI runners do not have the grok CLI, so the structural
# checks are the gate there.
#
# Usage: validate.sh <TARGET_DIR> (a tree produced by build.sh)
set -euo pipefail
TARGET_DIR="${1:?usage: validate.sh <TARGET_DIR>}"
for f in "$TARGET_DIR/plugin.json" "$TARGET_DIR/.grok-plugin/marketplace.json"; do
[ -f "$f" ] || { echo "missing required file: $f" >&2; exit 1; }
jq empty "$f"
done
if command -v grok >/dev/null 2>&1; then
grok plugin validate "$TARGET_DIR"
fi
echo "Validated Grok dist at $TARGET_DIR."