Skip to content

A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.

Shell
1.0 KB
Raw Blame
#!/usr/bin/env bash
# An unclosed source frontmatter must not become a deployable empty persona.
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FIXTURE="$(mktemp -d "${TMPDIR:-/tmp}/agency-frontmatter-closing.XXXXXX")"
trap 'rm -rf "$FIXTURE"' EXIT

cat > "$FIXTURE/unclosed.md" <<'EOF'
---
name: Broken Agent
description: This agent is missing its closing frontmatter fence
color: blue
# Identity
# Core Mission
# Critical Rules
EOF

if bash "$SCRIPT_DIR/lint-agents.sh" "$FIXTURE/unclosed.md" > "$FIXTURE/invalid.log" 2>&1; then
  echo "linter accepted an agent with no closing frontmatter fence" >&2
  exit 1
fi
grep -Fq 'missing frontmatter closing ---' "$FIXTURE/invalid.log"

cat > "$FIXTURE/valid.md" <<'EOF'
---
name: Valid Agent
description: This agent has a closing frontmatter fence
color: blue
---
## Identity
## Core Mission
## Critical Rules
EOF
bash "$SCRIPT_DIR/lint-agents.sh" "$FIXTURE/valid.md" > "$FIXTURE/valid.log" 2>&1

echo "PASS: unclosed frontmatter is rejected and a valid agent still passes"