LeoYeAI/agent-master-skills / skills/agentaudit-skill
agentaudit-skill
FlaggedAutomatic security gate that checks packages against a vulnerability database before installation. Use before any npm install, pip install, yarn add, or package manager operation.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 33.7 KB |
| SKILL.md | skill md | 18.0 KB |
| _meta.json | config | 297 B |
| install.sh | script | 5.7 KB |
| prompts/audit-prompt.md | markdown | 36.6 KB |
| prompts/review-prompt.md | markdown | 2.8 KB |
| references/API-REFERENCE.md | markdown | 4.1 KB |
| references/AUDIT-METHODOLOGY.md | markdown | 6.8 KB |
| references/DETECTION-PATTERNS.md | markdown | 5.9 KB |
| references/REPORT-FORMAT.md | markdown | 5.0 KB |
| references/TROUBLESHOOTING.md | markdown | 4.4 KB |
| references/TRUST-SCORING.md | markdown | 2.2 KB |
| scripts/_curl-retry.sh | script | 850 B |
| scripts/_load-key.sh | script | 1.6 KB |
| scripts/check.mjs | script | 6.3 KB |
| scripts/check.sh | script | 5.7 KB |
| scripts/gate.mjs | script | 5.2 KB |
| scripts/gate.sh | script | 4.9 KB |
| scripts/register.mjs | script | 4.7 KB |
| scripts/register.sh | script | 3.4 KB |
| scripts/rotate-key.sh | script | 2.3 KB |
| scripts/upload.mjs | script | 7.3 KB |
| scripts/upload.sh | script | 8.4 KB |
| scripts/verify.sh | script | 3.6 KB |
scripts/verify.sh
View on GitHub#!/usr/bin/env bash
# verify.sh β Verify local skill files against the AgentAudit
# Usage: ./scripts/verify.sh <package-name>
# Dependencies: curl, jq, sha256sum (or shasum on macOS)
set -euo pipefail
PACKAGE="${1:?Usage: verify.sh <package-name>}"
API_URL="https://www.agentaudit.dev/api/integrity"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
# Load retry helper
source "$SCRIPT_DIR/_curl-retry.sh"
# Detect sha256 command
if command -v sha256sum &>/dev/null; then
SHA_CMD="sha256sum"
elif command -v shasum &>/dev/null; then
SHA_CMD="shasum -a 256"
else
echo "β No sha256sum or shasum found"; exit 1
fi
# URL-encode the package name to prevent injection
ENCODED_PACKAGE=$(printf '%s' "$PACKAGE" | jq -sRr @uri)
echo "π Fetching official hashes from registry..."
HTTP_RESPONSE=$(curl_retry -sL --max-time 15 -w "\n%{http_code}" "${API_URL}?package=${ENCODED_PACKAGE}")
HTTP_CODE=$(echo "$HTTP_RESPONSE" | tail -1)
RESPONSE=$(echo "$HTTP_RESPONSE" | sed '$d')
if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then
echo "β API request failed (HTTP ${HTTP_CODE})" >&2
[ -n "$RESPONSE" ] && echo " Response: $RESPONSE" >&2
exit 1
fi
# Parse file list dynamically from API response (POSIX-compatible, no mapfile)
FILES=()
while IFS= read -r f; do
FILES+=("$f")
done < <(echo "$RESPONSE" | jq -r '.files | keys[]')
if [ ${#FILES[@]} -eq 0 ]; then
echo "β No files returned from registry for package '${PACKAGE}'" >&2
exit 1
fi
MISMATCH=0
CHECKED=0
echo ""
echo "Package: ${PACKAGE}"
echo "Repo: $(echo "$RESPONSE" | jq -r '.repo')"
echo "Commit: $(echo "$RESPONSE" | jq -r '.commit' | head -c 12)"
echo "Verified: $(echo "$RESPONSE" | jq -r '.verified_at')"
echo ""
for file in "${FILES[@]}"; do
# Sanitize: reject path traversal and absolute paths from API
if [[ "$file" == /* ]] || [[ "$file" == *..* ]] || [[ "$file" == *$'\n'* ]] || [[ "$file" == *$'\0'* ]]; then
echo "β οΈ ${file} β REJECTED (path traversal or absolute path)" >&2
continue
fi
LOCAL_PATH="${ROOT_DIR}/${file}"
# Resolve symlinks and verify path stays within ROOT_DIR
REAL_PATH=$(realpath -m "$LOCAL_PATH" 2>/dev/null || echo "$LOCAL_PATH")
if [[ "$REAL_PATH" != "${ROOT_DIR}"/* ]]; then
echo "β οΈ ${file} β REJECTED (resolves outside project root)" >&2
continue
fi
REMOTE_HASH=$(echo "$RESPONSE" | jq -r --arg f "$file" '.files[$f].sha256 // empty')
if [ -z "$REMOTE_HASH" ] || [ "$REMOTE_HASH" = "null" ]; then
echo "β οΈ ${file} β not tracked by registry"
continue
fi
if [ ! -f "$LOCAL_PATH" ]; then
echo "β ${file} β missing locally"
MISMATCH=1
continue
fi
LOCAL_HASH=$($SHA_CMD "$LOCAL_PATH" | awk '{print $1}')
CHECKED=$((CHECKED + 1))
if [ "$LOCAL_HASH" = "$REMOTE_HASH" ]; then
echo "β
${file}"
else
echo "β ${file} β HASH MISMATCH"
echo " local: ${LOCAL_HASH}"
echo " remote: ${REMOTE_HASH}"
MISMATCH=1
fi
done
echo ""
echo "Checked: ${CHECKED} files"
# Check credentials.json permissions (both locations)
for cred_path in "${ROOT_DIR}/config/credentials.json" "${XDG_CONFIG_HOME:-$HOME/.config}/agentaudit/credentials.json"; do
if [ -f "$cred_path" ]; then
PERMS=$(stat -c '%a' "$cred_path" 2>/dev/null || stat -f '%Lp' "$cred_path" 2>/dev/null)
if [ "$PERMS" != "600" ]; then
echo "β οΈ $cred_path has permissions ${PERMS}, fixing to 600"
chmod 600 "$cred_path"
fi
fi
done
if [ "$MISMATCH" -eq 0 ]; then
echo "β
All files verified β integrity OK"
exit 0
else
echo "β Integrity check FAILED β files differ from official repo"
exit 1
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |