1000planets-site/spec-kit/scripts/ci-checks.sh
fullsizemalt 0c0938169e Initial commit: Spec Kit compliant project structure
- Set up spec-kit framework (checklist, decisions, scripts)
- Created project documentation (README, discovery questionnaire)
- Configured CI compliance checks
- Ready for discovery phase and client input

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 12:18:20 -08:00

85 lines
2.8 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
# CI checks for 1000planets.cloud marketing site
# Run this before committing or in CI pipeline
echo "🔍 Running Spec Kit compliance checks..."
# Check that required files exist
echo "📋 Checking required documentation..."
required_files=(
"README.md"
"spec-kit/README.md"
"spec-kit/checklist.md"
"spec-kit/project-plan.md"
)
for file in "${required_files[@]}"; do
if [[ ! -f "$file" ]]; then
echo "❌ Missing required file: $file"
exit 1
fi
done
echo "✅ All required documentation files present"
# Check for TODO/FIXME comments in production code
echo "🔎 Checking for unresolved TODOs..."
if find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) \
-not -path "*/node_modules/*" \
-not -path "*/.next/*" \
-not -path "*/dist/*" \
-exec grep -l "TODO\|FIXME" {} \; 2>/dev/null | grep -q .; then
echo "⚠️ Warning: Found TODO/FIXME comments in code"
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) \
-not -path "*/node_modules/*" \
-not -path "*/.next/*" \
-not -path "*/dist/*" \
-exec grep -Hn "TODO\|FIXME" {} \; 2>/dev/null || true
else
echo "✅ No unresolved TODOs found"
fi
# Check Python code compilation (if any Python files exist)
if find . -name "*.py" -not -path "*/venv/*" -not -path "*/.venv/*" | grep -q .; then
echo "🐍 Checking Python syntax..."
python3 -m compileall -q . 2>/dev/null || {
echo "❌ Python syntax errors found"
exit 1
}
echo "✅ Python syntax valid"
fi
# Check for large files
echo "📦 Checking for large files..."
large_files=$(find . -type f -size +5M -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null || true)
if [[ -n "$large_files" ]]; then
echo "⚠️ Warning: Large files found (>5MB):"
echo "$large_files"
else
echo "✅ No large files detected"
fi
# Check that decisions directory exists and has at least initial decision
echo "📝 Checking architectural decisions..."
if [[ ! -d "spec-kit/decisions" ]]; then
echo "❌ Missing spec-kit/decisions directory"
exit 1
fi
echo "✅ Decisions directory present"
# Check for sensitive data patterns
echo "🔒 Checking for sensitive data..."
sensitive_patterns="(api[_-]?key|secret|password|token|private[_-]?key)"
if find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.env*" \) \
-not -path "*/node_modules/*" \
-not -path "*/.git/*" \
-exec grep -iE "$sensitive_patterns" {} \; 2>/dev/null | grep -v "\.env\.example" | grep -q .; then
echo "⚠️ Warning: Potential sensitive data found - please review"
else
echo "✅ No obvious sensitive data patterns detected"
fi
echo ""
echo "✨ All compliance checks passed!"
echo "Ready to commit or deploy."