Transform from copy-paste template to consumable product that users import and configure rather than fork.
┌─────────────────────────────────────────────────────────────┐
│ USER REPOSITORY │
├─────────────────────────────────────────────────────────────┤
│ .github/ │
│ └── governance.yml ← Single config file │
│ │
│ .github/workflows/ │
│ ├── governance-ci.yml ← Thin wrapper │
│ ├── governance-security.yml ← Calls remote workflows │
│ └── governance-quality.yml ← Minimal local footprint │
│ │
│ [Your actual project code...] │
└─────────────────────────────────────────────────────────────┘
↓ imports from ↓
┌─────────────────────────────────────────────────────────────┐
│ SYSTEM-GOVERNANCE-FRAMEWORK (This Product) │
├─────────────────────────────────────────────────────────────┤
│ .github/workflows/ │
│ ├── reusable-ci.yml ← Reusable workflows │
│ ├── reusable-security.yml ← Called remotely │
│ ├── reusable-quality.yml ← Version-pinnable │
│ └── ... │
│ │
│ .github/actions/ │
│ ├── detect-languages/ ← Composite actions │
│ ├── security-scan/ ← Reusable components │
│ └── quality-check/ ← Atomic operations │
│ │
│ scripts/ │
│ ├── install-framework.sh ← Installation CLI │
│ ├── update-framework.sh ← Upgrade mechanism │
│ └── validate-config.js ← Config validator │
│ │
│ config/ │
│ ├── schema.json ← Config validation schema │
│ ├── presets/ ← Pre-configured profiles │
│ │ ├── minimal.yml │
│ │ ├── standard.yml │
│ │ └── enterprise.yml │
│ └── defaults.yml ← Default values │
└─────────────────────────────────────────────────────────────┘
Users reference workflows from this repo, not copy them:
# User's .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
governance:
uses: 4-b100m/system-governance-framework/.github/workflows/reusable-ci.yml@v3.0.0
with:
config-path: '.github/governance.yml'
secrets: inherit
Single configuration file defines all behavior:
# User's .github/governance.yml
framework:
version: "3.0.0"
preset: "standard" # minimal | standard | enterprise
project:
languages: [python, javascript]
frameworks: [django, react]
features:
ci:
enabled: true
test-coverage: true
security:
enabled: true
codeql: true
dependency-scan: true
quality:
enabled: true
linting: true
pre-commit: true
Users pin to specific versions for stability:
uses: 4-b100m/system-governance-framework/.github/workflows/reusable-ci.yml@v3.0.0
^^^^^^^^
Built-in update mechanism with changelog review:
$ npx @sgf/cli update
Current version: v2.5.0
Latest version: v3.0.0
Changelog:
- Added TypeScript support
- Improved CodeQL performance
- BREAKING: Removed Python 2.7 support
Proceed with update? [y/N]
Features auto-disable when not applicable:
# User has Python project → Python tests run
# User has no Go code → Go workflows skip automatically
# No CodeQL token → Security scan runs in free mode
.github/workflows/reusable-*.yml)Purpose: Core workflow logic that users call remotely
Example: Reusable CI Workflow
# .github/workflows/reusable-ci.yml
name: Reusable CI Workflow
on:
workflow_call:
inputs:
config-path:
required: false
type: string
default: '.github/governance.yml'
languages:
required: false
type: string
default: 'auto'
secrets:
codecov-token:
required: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
config: $
languages: $
steps:
- uses: actions/checkout@v4
- name: Load governance config
id: load-config
uses: 4-b100m/system-governance-framework/.github/actions/load-config@v3.0.0
with:
config-path: $
- name: Detect languages
id: detect
uses: 4-b100m/system-governance-framework/.github/actions/detect-languages@v3.0.0
with:
override: $
test:
needs: setup
if: fromJSON(needs.setup.outputs.config).features.ci.enabled
uses: 4-b100m/system-governance-framework/.github/workflows/reusable-test.yml@v3.0.0
with:
languages: $
coverage: $
secrets: inherit
.github/actions/*/action.yml)Purpose: Reusable building blocks for workflows
Example: Language Detection Action
# .github/actions/detect-languages/action.yml
name: Detect Project Languages
description: Automatically detect programming languages in repository
outputs:
languages:
description: JSON array of detected languages
value: $
has-python:
description: Whether Python code detected
value: $
has-javascript:
description: Whether JavaScript code detected
value: $
runs:
using: composite
steps:
- name: Detect languages
id: detect
shell: bash
run: |
LANGUAGES=[]
if [[ -f "requirements.txt" || -f "pyproject.toml" || -f "setup.py" ]]; then
LANGUAGES=$(echo $LANGUAGES | jq '. + ["python"]')
echo "has-python=true" >> $GITHUB_OUTPUT
fi
if [[ -f "package.json" ]]; then
LANGUAGES=$(echo $LANGUAGES | jq '. + ["javascript"]')
echo "has-javascript=true" >> $GITHUB_OUTPUT
fi
echo "languages=$LANGUAGES" >> $GITHUB_OUTPUT
Config Schema (config/schema.json):
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["framework", "project"],
"properties": {
"framework": {
"type": "object",
"properties": {
"version": {
"type": "string",
"pattern": "^v?\\d+\\.\\d+\\.\\d+$",
"description": "Framework version to use"
},
"preset": {
"type": "string",
"enum": ["minimal", "standard", "enterprise"],
"default": "standard"
}
}
},
"project": {
"type": "object",
"properties": {
"languages": {
"type": "array",
"items": {
"type": "string",
"enum": ["python", "javascript", "typescript", "go", "java", "rust", "ruby", "php", "csharp", "swift"]
}
}
}
},
"features": {
"type": "object",
"properties": {
"ci": {
"$ref": "#/definitions/featureToggle"
},
"security": {
"$ref": "#/definitions/featureToggle"
},
"quality": {
"$ref": "#/definitions/featureToggle"
}
}
}
},
"definitions": {
"featureToggle": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
}
}
}
Preset Configurations:
# config/presets/minimal.yml
framework:
preset: minimal
features:
ci:
enabled: true
test-coverage: false
security:
enabled: false
quality:
enabled: true
linting: true
pre-commit: false
dependabot:
enabled: false
# config/presets/standard.yml
framework:
preset: standard
features:
ci:
enabled: true
test-coverage: true
security:
enabled: true
codeql: true
dependency-scan: true
quality:
enabled: true
linting: true
pre-commit: true
dependabot:
enabled: true
schedule: weekly
# config/presets/enterprise.yml
framework:
preset: enterprise
features:
ci:
enabled: true
test-coverage: true
parallel-jobs: 5
security:
enabled: true
codeql: true
semgrep: true
dependency-scan: true
license-check: true
security-scorecard: true
quality:
enabled: true
linting: true
pre-commit: true
super-linter: true
dependabot:
enabled: true
schedule: daily
auto-merge: patch
compliance:
enabled: true
soc2: true
gdpr: true
Tool: @sgf/cli npm package
# Install framework
npx @sgf/cli install
# Interactive setup
npx @sgf/cli init
# Update to latest
npx @sgf/cli update
# Validate configuration
npx @sgf/cli validate
# Check framework health
npx @sgf/cli doctor
Installation Script (scripts/install-framework.sh):
#!/bin/bash
set -e
VERSION=${1:-latest}
PRESET=${2:-standard}
echo "🚀 System Governance Framework Installer"
echo "========================================"
echo ""
echo "Version: $VERSION"
echo "Preset: $PRESET"
echo ""
# Detect if in git repo
if [ ! -d ".git" ]; then
echo "❌ Error: Not in a git repository"
exit 1
fi
# Create .github directory if needed
mkdir -p .github/workflows
# Download governance config
echo "📥 Downloading configuration..."
curl -sSL https://raw.githubusercontent.com/4-b100m/system-governance-framework/$VERSION/config/presets/$PRESET.yml \
-o .github/governance.yml
# Create wrapper workflows
echo "⚙️ Setting up workflows..."
cat > .github/workflows/governance-ci.yml <<'EOF'
name: Governance - CI
on:
push:
branches: [main, develop]
pull_request:
jobs:
ci:
uses: 4-b100m/system-governance-framework/.github/workflows/reusable-ci.yml@VERSION
with:
config-path: '.github/governance.yml'
secrets: inherit
EOF
sed -i "s/VERSION/$VERSION/g" .github/workflows/governance-ci.yml
# Detect project languages
echo "🔍 Detecting project languages..."
LANGUAGES=()
[[ -f "requirements.txt" ]] && LANGUAGES+=("python")
[[ -f "package.json" ]] && LANGUAGES+=("javascript")
[[ -f "go.mod" ]] && LANGUAGES+=("go")
[[ -f "pom.xml" || -f "build.gradle" ]] && LANGUAGES+=("java")
# Update config with detected languages
if [ ${#LANGUAGES[@]} -gt 0 ]; then
echo " Found: ${LANGUAGES[*]}"
# Update YAML with detected languages
# (Would use yq or similar in production)
fi
echo ""
echo "✅ Installation complete!"
echo ""
echo "Next steps:"
echo " 1. Review .github/governance.yml and customize as needed"
echo " 2. Commit the changes: git add .github && git commit -m 'chore: Add governance framework'"
echo " 3. Push to GitHub: git push"
echo ""
echo "Documentation: https://github.com/4-b100m/system-governance-framework#readme"
Semantic Versioning:
v1.x.x - Initial template versionv2.x.x - Enhanced template with analysisv3.x.x - Framework-as-Code product (this transformation)Release Process:
package.json and VERSION fileCHANGELOG.md with changesgit tag v3.0.0Compatibility Matrix:
| Framework Version | Min GitHub Actions | Supported Languages |
|---|---|---|
| v3.0.0+ | v4.0+ | Python, JS, Go, Java, Rust, Ruby, PHP, C#, Swift |
| v2.0.0-v2.9.9 | v3.0+ | Template only |
# Current state: Forked repository with copied files
# Desired state: Lightweight config + remote workflow calls
# 1. Backup existing customizations
git checkout -b backup/v2-template
# 2. Run migration script
npx @sgf/cli migrate from-template
# Migration script will:
# - Analyze current .github/ setup
# - Extract customizations to governance.yml
# - Replace local workflows with remote calls
# - Preserve custom workflows/actions
# - Create migration report
# 3. Review changes
git diff main
# 4. Test new setup
git checkout -b feature/migrate-to-v3
# ... test CI runs ...
# 5. Commit migration
git commit -m "chore: Migrate to Framework-as-Code v3"
# Simply install the framework
cd my-existing-project
npx @sgf/cli install
# Or during project creation
npx @sgf/cli init my-new-project
Free Tier (MIT License):
Pro Tier ($29/month per organization):
Enterprise Tier (Custom pricing):
Year 1:
Year 2:
Adoption:
Quality:
Growth:
Performance:
Security:
Decision: Use reusable workflows instead of GitHub App
Rationale:
Decision: Use YAML for user configuration
Rationale:
Decision: Provide both npm package and shell script
Rationale:
| Feature | SGF v3 | GitHub’s Default | Renovate | Snyk | Dependabot |
|---|---|---|---|---|---|
| Configuration | Single YAML | Multiple files | JSON | Web UI | YAML |
| Extensibility | High | Medium | Medium | Low | Low |
| Security Scanning | Multi-tool | Basic | No | Yes | Yes |
| Cost | Free + Pro | Free | Free + Pro | Paid | Free |
| Language Support | 10+ | All | All | Limited | All |
| On-premise | Yes (Enterprise) | No | Yes | Yes | No |
| Learning Curve | Medium | Low | Medium | Low | Low |
Differentiation:
.github/
actions/ # Composite actions
workflows/ # Reusable workflows
config/ # Configuration schemas & presets
scripts/ # Installation & management tools
docs/ # Product documentation
tests/ # Framework self-tests
examples/ # Example integrations
This architecture transforms the framework from a template (copy-paste) to a product (import-configure-use), enabling:
Next Steps: Begin implementation of reusable workflows and configuration system.