Initial import: 10 Radix skills across 3 categories
Kategoriserer danske regnskabs-/ERP-skills, ERP-data-afstemnings-
skill og to devops-workflows (gitea-issue-agent, kanban-workflows)
som Radix-medlemmers AI-agenter kan dele.
Struktur:
skills/<kategori>/<skill-navn>/SKILL.md
skills/<kategori>/<skill-navn>/{references,templates,scripts}/
Indekseret af index.json (genereret af scripts/rebuild_index.py).
Kør `python3 scripts/rebuild_index.py --check` i CI for at fange
synkroniseringsfejl.
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env bash
|
||||
# Verify the Gitea issue agent is wired up end to end.
|
||||
#
|
||||
# Exits 0 on success. Prints OK / FAIL lines for each step.
|
||||
# Run after every env or plugin change.
|
||||
#
|
||||
# Does NOT need a real token in the script — reads from ~/.hermes/.env.
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
ok() { echo " OK $*"; }
|
||||
bad() { echo " FAIL $*"; exit 1; }
|
||||
|
||||
echo "=== 1. Plugin files present ==="
|
||||
PLUGIN_DIR="$HOME/.hermes/plugins/gitea-issue-agent"
|
||||
for f in plugin.yaml __init__.py README.md; do
|
||||
[ -f "$PLUGIN_DIR/$f" ] && ok "$f" || bad "$PLUGIN_DIR/$f missing"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "=== 2. Plugin listed in config.yaml ==="
|
||||
grep -q "gitea-issue-agent" "$HOME/.hermes/config.yaml" \
|
||||
&& ok "config.yaml references gitea-issue-agent" \
|
||||
|| bad "gitea-issue-agent not in plugins.enabled — add it under plugins.enabled in ~/.hermes/config.yaml"
|
||||
|
||||
echo
|
||||
echo "=== 3. Plugin imports without error ==="
|
||||
python3 - <<'PY' && ok "import gitea-issue-agent OK" || bad "import failed"
|
||||
import importlib.util, sys
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"gitea_issue_agent",
|
||||
f"{__import__('os').path.expanduser('~')}/.hermes/plugins/gitea-issue-agent/__init__.py",
|
||||
)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
sys.modules["gitea_issue_agent"] = mod
|
||||
spec.loader.exec_module(mod)
|
||||
assert len(mod.SCHEMAS) >= 5, f"expected at least 5 tools, got {len(mod.SCHEMAS)}"
|
||||
PY
|
||||
|
||||
echo
|
||||
echo "=== 4. Env vars present ==="
|
||||
set +e
|
||||
. "$HOME/.hermes/.env" 2>/dev/null
|
||||
set -e
|
||||
[ -n "${GITEA_BASE_URL:-}" ] && ok "GITEA_BASE_URL=$GITEA_BASE_URL" || bad "GITEA_BASE_URL missing in ~/.hermes/.env"
|
||||
[ -n "${GITEA_TOKEN:-}" ] && ok "GITEA_TOKEN set (${#GITEA_TOKEN} chars)" || bad "GITEA_TOKEN missing in ~/.hermes/.env"
|
||||
|
||||
echo
|
||||
echo "=== 5. API connectivity ==="
|
||||
HTTP=$(curl -4 -s -o /dev/null -m 10 -w "%{http_code}" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
"$GITEA_BASE_URL/api/v1/user")
|
||||
if [ "$HTTP" = "200" ]; then
|
||||
USER=$(curl -4 -s -m 10 -H "Authorization: token $GITEA_TOKEN" \
|
||||
"$GITEA_BASE_URL/api/v1/user" | python3 -c "import sys,json; print(json.load(sys.stdin).get('login','?'))")
|
||||
ok "API reachable, authenticated as: $USER"
|
||||
else
|
||||
bad "API $GITEA_BASE_URL/api/v1/user returned HTTP $HTTP"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=== 6. At least one repo visible ==="
|
||||
N=$(curl -4 -s -m 10 -H "Authorization: token $GITEA_TOKEN" \
|
||||
"$GITEA_BASE_URL/api/v1/user/repos?limit=100" | python3 -c "import sys,json; print(len(json.load(sys.stdin)))")
|
||||
[ "$N" -gt 0 ] && ok "$N repos visible to token" || bad "no repos visible — token scope may be too narrow"
|
||||
|
||||
echo
|
||||
echo "=== 7. local tea login (optional but recommended) ==="
|
||||
if command -v tea >/dev/null 2>&1; then
|
||||
TUSER=$(tea whoami 2>/dev/null | grep -E "^[a-zA-Z0-9_-]+$" | head -1)
|
||||
[ -n "$TUSER" ] && ok "tea whoami -> $TUSER" || echo " INFO tea installed but no login yet"
|
||||
else
|
||||
echo " INFO tea not on PATH — see gitea-tea-macos-setup"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=== 8. ~/.netrc (optional but recommended) ==="
|
||||
if [ -f "$HOME/.netrc" ] && grep -q "git.radixadm.dk\|$GITEA_BASE_URL" "$HOME/.netrc"; then
|
||||
ok "~/.netrc has an entry for $GITEA_BASE_URL"
|
||||
else
|
||||
echo " INFO ~/.netrc missing — git push will use osxkeychain (may be stale)"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "All checks passed. The agent is ready to use."
|
||||
Reference in New Issue
Block a user