validate-profile-coverage.sh 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. # Check if all agents are in appropriate profiles
  3. set -e
  4. echo "🔍 Checking profile coverage..."
  5. echo ""
  6. # Get all agent IDs
  7. agents=$(jq -r '.components.agents[].id' registry.json)
  8. errors=0
  9. for agent in $agents; do
  10. # Get agent category
  11. category=$(jq -r ".components.agents[] | select(.id == \"$agent\") | .category" registry.json)
  12. # Check which profiles include this agent
  13. in_developer=$(jq -r ".profiles.developer.components[] | select(. == \"agent:$agent\")" registry.json 2>/dev/null || echo "")
  14. in_business=$(jq -r ".profiles.business.components[] | select(. == \"agent:$agent\")" registry.json 2>/dev/null || echo "")
  15. in_full=$(jq -r ".profiles.full.components[] | select(. == \"agent:$agent\")" registry.json 2>/dev/null || echo "")
  16. in_advanced=$(jq -r ".profiles.advanced.components[] | select(. == \"agent:$agent\")" registry.json 2>/dev/null || echo "")
  17. # Validate based on category
  18. case $category in
  19. "development")
  20. if [[ -z "$in_developer" ]]; then
  21. echo "❌ $agent (development) missing from developer profile"
  22. errors=$((errors + 1))
  23. fi
  24. if [[ -z "$in_full" ]]; then
  25. echo "❌ $agent (development) missing from full profile"
  26. errors=$((errors + 1))
  27. fi
  28. if [[ -z "$in_advanced" ]]; then
  29. echo "❌ $agent (development) missing from advanced profile"
  30. errors=$((errors + 1))
  31. fi
  32. ;;
  33. "content"|"data")
  34. if [[ -z "$in_business" ]]; then
  35. echo "❌ $agent ($category) missing from business profile"
  36. errors=$((errors + 1))
  37. fi
  38. if [[ -z "$in_full" ]]; then
  39. echo "❌ $agent ($category) missing from full profile"
  40. errors=$((errors + 1))
  41. fi
  42. if [[ -z "$in_advanced" ]]; then
  43. echo "❌ $agent ($category) missing from advanced profile"
  44. errors=$((errors + 1))
  45. fi
  46. ;;
  47. "meta")
  48. if [[ -z "$in_advanced" ]]; then
  49. echo "❌ $agent (meta) missing from advanced profile"
  50. errors=$((errors + 1))
  51. fi
  52. ;;
  53. "essential"|"standard")
  54. if [[ -z "$in_full" ]]; then
  55. echo "❌ $agent ($category) missing from full profile"
  56. errors=$((errors + 1))
  57. fi
  58. if [[ -z "$in_advanced" ]]; then
  59. echo "❌ $agent ($category) missing from advanced profile"
  60. errors=$((errors + 1))
  61. fi
  62. ;;
  63. esac
  64. done
  65. echo ""
  66. if [[ $errors -eq 0 ]]; then
  67. echo "✅ Profile coverage check complete - no issues found"
  68. exit 0
  69. else
  70. echo "❌ Profile coverage check found $errors issue(s)"
  71. exit 1
  72. fi