Website Repo Skill
You are running the /grc-portfolio:repo skill. Your job is to create a GitHub repository for the website project and push the code.
Step 1: Locate and Validate Config
Find site-config.json:
- Check
$ARGUMENTSfor a project directory path - Check the current working directory
- Ask the user if not found
Read it and validate that status.buildComplete === true. If not, tell the user to run /grc-portfolio:build first.
Step 2: Verify Prerequisites
Check that gh CLI is installed and authenticated:
gh --version
gh auth status
If not installed, tell the user to run:
brew install gh
gh auth login
Step 3: Ask Repository Details
Ask the user:
- Repo name (suggest
projectNamefrom config) - Visibility: public or private (default: private)
Step 4: Ensure .gitignore
Check if .gitignore exists in the project directory. If not, create one:
# Dependencies
node_modules/
# Build output
dist/
# Environment variables
.env
.env.local
.env.production
# OS files
.DS_Store
Thumbs.db
# IDE
.vscode/
.idea/
# Logs
*.log
npm-debug.log*
# Lambda packages
lambda/*.zip
If it exists, verify it includes at least node_modules, dist, .env, .env.local, and .DS_Store. If any of those entries are missing, add them before staging any files — git add -A will happily stage .env.local with secrets in it otherwise.
Step 5: Initialize Git and Commit
cd <projectDir>
git init
Before staging, confirm .env* files are ignored:
git check-ignore -q .env .env.local 2>/dev/null && echo "ok: env files ignored"
If that fails (exit code 1), stop and fix .gitignore — do not run git add -A until env files are ignored.
git add -A
# Sanity check: nothing under .env* should be staged.
if git diff --cached --name-only | grep -E '^\.env(\.|$)'; then
echo "ERROR: env file staged — unstage it and fix .gitignore" >&2
exit 1
fi
git commit -m "Initial commit: scaffolded GRC portfolio website"
Step 6: Create GitHub Repo and Push
gh repo create <repoName> --<visibility> --source . --push
This creates the repo on GitHub, sets the remote, and pushes the code.
Step 7: Update Config
Get the repo URL and owner:
gh repo view --json url,owner
Update site-config.json:
- Set
github.repoNameto the repo name - Set
github.repoUrlto the full URL - Set
github.ownerto the owner login - Set
github.visibilityto public/private - Set
status.repoCreated = true
Step 8: Summary
Tell the user:
- The repo was created at
<github.repoUrl> - The code has been pushed
- Suggest running
/grc-portfolio:infranext (if not done) or/grc-portfolio:cicdto set up continuous deployment
Variables
$ARGUMENTS= arguments passed after/repo(expected: project directory path)