Utility scripts for template repository management and analysis.
Analyzes any GitHub repository against this template and provides recommendations.
# Make executable
chmod +x scripts/analyze-repo
# Analyze any repository
./scripts/analyze-repo owner/repo
# Example
./scripts/analyze-repo facebook/reactText output (default):
./scripts/analyze-repo RockRunner007/templateJSON output:
OUTPUT_FORMAT=json ./scripts/analyze-repo RockRunner007/templateFor higher rate limits and checking private repos:
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
./scripts/analyze-repo owner/repoThe wrapper script automatically uses:
- Node.js if available (
node scripts/analyze-repo.js) - Falls back to Python 3 if Node.js not found (
python3 scripts/analyze-repo.py)
Requirements:
- Node.js 14+ OR Python 3.6+
- GitHub API access (no auth required for public repos)
======================================================================
Repository Analysis: owner/repo
======================================================================
🟢 Overall Compliance Score: 85/100
Category Breakdown:
documentation [████████████████████] 100/100 (50/50 points)
governance [████████████░░░░░░░░] 65/100 (15/24 points)
lifecycle [████████░░░░░░░░░░░░] 42/100 (8/19 points)
...
Recommendations for Improvement:
🔴 HIGH PRIORITY:
1. Governance: Missing governance documentation
🟡 MEDIUM PRIORITY:
1. Lifecycle: Missing lifecycle documentation
Team health monitoring:
for repo in backend frontend mobile api; do
echo "=== Checking $repo ==="
./scripts/analyze-repo myorg/$repo
doneCI/CD integration:
# .github/workflows/compliance-check.yml
- name: Check compliance
run: |
SCORE=$(OUTPUT_FORMAT=json ./scripts/analyze-repo ${{ github.repository }} | jq '.overallScore')
if [ $SCORE -lt 70 ]; then
echo "Compliance score $SCORE is below 70%"
exit 1
fiGenerate reports:
OUTPUT_FORMAT=json ./scripts/analyze-repo owner/repo > report.json
# Process with jq, python, node, etc.See docs/tools/repository-analyzer.md for:
- Detailed installation instructions
- Complete usage examples
- CI/CD pipeline integration
- Score interpretation guide
- Troubleshooting
Follow this template:
#!/bin/bash
#
# Script Name - Description
#
# Usage: ./scripts/script-name [options]
#
# Options:
# --option Description
# --help Show this help
set -e
# Implementation here- ✅ Shebang line (
#!/bin/bashor#!/usr/bin/env node) - ✅ Usage comments at top
- ✅ Make executable:
chmod +x scripts/script-name - ✅ Document in this README
- ✅ Add to docs/tools/ if complex
- Use
set -eto fail on errors - Check arguments early and show usage
- Support environment variables for configuration
- Handle errors gracefully
- Document with comments for complex logic
- Test before committing
All scripts should be executable from repository root:
# From repo root
./scripts/analyze-repo owner/repo
# From anywhere with absolute path
/path/to/repo/scripts/analyze-repo owner/repo
# Or explicitly invoke
bash scripts/analyze-repo owner/repo
node scripts/analyze-repo.js owner/repo
python3 scripts/analyze-repo.py owner/repoCommon environment variables used by scripts:
GITHUB_TOKEN- GitHub API authentication tokenOUTPUT_FORMAT- Output format (text, json)DEBUG- Enable debug outputQUIET- Suppress non-essential output
- docs/tools/repository-analyzer.md - Analyzer documentation
- Repository Root - Main template repository