Skip to content

Commit 592ed8c

Browse files
Merge pull request #4 from penguinranch/booting
feat: Gold Standard maintenance and automation suite
2 parents 7261efc + b89da3d commit 592ed8c

45 files changed

Lines changed: 860 additions & 89 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/workflows/test-install.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,31 @@ Run this workflow to verify that `install.sh` correctly extracts the `templates/
99
## Steps
1010

1111
1. Create and enter a temporary test directory:
12+
1213
```bash
1314
mkdir -p /tmp/test-bootstrap && cd /tmp/test-bootstrap && git init
1415
```
1516

16-
// turbo
17-
2. Run the install script from the bootstrap repo (using local copy, not remote):
17+
// turbo 2. Run the install script from the bootstrap repo (using local copy, not remote):
18+
1819
```bash
1920
BOOTSTRAP_DEV=1 bash /Users/lynnwallenstein/workspace/penguinranch/bootstrap/install.sh
2021
```
2122

22-
// turbo
23-
3. Verify the expected file structure exists:
23+
// turbo 3. Verify the expected file structure exists:
24+
2425
```bash
2526
ls -la /tmp/test-bootstrap/.devcontainer/ /tmp/test-bootstrap/scripts/ /tmp/test-bootstrap/docs/decisions/ && echo "✅ Structure intact" || echo "❌ Missing files"
2627
```
2728

28-
// turbo
29-
4. Verify key files are present:
29+
// turbo 4. Verify key files are present:
30+
3031
```bash
3132
for f in AGENTS.md Makefile .editorconfig .env.example .gitattributes .gitignore .prettierrc CHANGELOG.md LICENSE CODE_OF_CONDUCT.md README.md; do [ -f "/tmp/test-bootstrap/$f" ] && echo "$f" || echo "$f MISSING"; done
3233
```
3334

34-
// turbo
35-
5. Clean up:
35+
// turbo 5. Clean up:
36+
3637
```bash
3738
rm -rf /tmp/test-bootstrap
3839
```

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/devcontainers/base:bookworm
2+
3+
# [Optional] Uncomment this section to install additional OS packages.
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends shellcheck
6+
7+
# [Optional] Uncomment if you want to install an additional version of node using nvm
8+
# ARG EXTRA_NODE_VERSION=10
9+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
10+
11+
# [Optional] Uncomment if you want to install more global node modules
12+
# RUN su node -c "npm install -g <your-package-list-here>"

.devcontainer/boot-check.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
if [ ! -f .env ]; then
5+
echo "⚠️ WARNING: .env file not found."
6+
echo "Please run './scripts/setup-env.sh' in the terminal to initialize your environment variables."
7+
else
8+
echo "✅ .env found. Exporting variables safely..."
9+
while IFS='=' read -r key value; do
10+
# Skip empty lines and comments
11+
if [[ -n "$key" && ! "$key" =~ ^# ]]; then
12+
# Trim leading/trailing whitespace
13+
key="${key#"${key%%[![:space:]]*}"}"
14+
key="${key%"${key##*[![:space:]]}"}"
15+
value="${value#"${value%%[![:space:]]*}"}"
16+
value="${value%"${value##*[![:space:]]}"}"
17+
export "$key=$value"
18+
fi
19+
done < ".env"
20+
21+
# Configure Git if found in .env
22+
if [ -n "${GIT_NAME:-}" ]; then
23+
git config --global user.name "$GIT_NAME"
24+
fi
25+
if [ -n "${GIT_EMAIL:-}" ]; then
26+
git config --global user.email "$GIT_EMAIL"
27+
fi
28+
if [ -n "${SSH_PUBLIC_KEY:-}" ]; then
29+
git config --global gpg.format ssh
30+
git config --global user.signingkey "key::${SSH_PUBLIC_KEY}"
31+
git config --global commit.gpgsign true
32+
fi
33+
34+
# Configure GitHub CLI as credential helper if token is present
35+
if [ -n "${GITHUB_TOKEN:-}" ] && command -v gh &> /dev/null; then
36+
gh auth setup-git
37+
fi
38+
fi

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "bootstrap",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": { "VARIANT": "latest" }
6+
},
7+
"forwardPorts": [3000, 9222],
8+
"features": {
9+
"ghcr.io/devcontainers/features/common-utils:2": {
10+
"configureZshAsDefaultShell": true
11+
},
12+
"ghcr.io/devcontainers/features/git:1": {},
13+
"ghcr.io/devcontainers/features/node:1": {},
14+
"ghcr.io/devcontainers/features/github-cli:1": {}
15+
},
16+
"postCreateCommand": "bash ./scripts/setup-gemini.sh",
17+
"customizations": {
18+
"vscode": {
19+
"extensions": [
20+
"esbenp.prettier-vscode",
21+
"GitHub.github-vscode-theme",
22+
"bierner.markdown-mermaid",
23+
"mechatroner.rainbow-csv",
24+
"ms-vscode.makefile-tools",
25+
"ms-azuretools.vscode-containers",
26+
"ms-azuretools.vscode-docker",
27+
"github.vscode-github-actions",
28+
"github.vscode-pull-request-github"
29+
],
30+
"settings": {
31+
"workbench.startupEditor": "none"
32+
}
33+
}
34+
},
35+
"postAttachCommand": "code README.md AGENTS.md",
36+
"containerEnv": {
37+
"GEMINI_API_KEY": "${localEnv:GEMINI_API_KEY}",
38+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
39+
},
40+
"postStartCommand": "/bin/bash ./scripts/start-container.sh"
41+
}

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Project Environment Variables
2+
# Copy to .env and fill in your details
3+
4+
# Git Configuration (for signing commits within container)
5+
GIT_NAME=
6+
GIT_EMAIL=
7+
SSH_PUBLIC_KEY=
8+
9+
# Gemini CLI API Key (for AI tooling inside the Devcontainer)
10+
# Get your key at: https://aistudio.google.com/app/apikey
11+
GEMINI_API_KEY=
12+
13+
# Add project specific secrets below

.githooks/commit-msg

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Commit message hook: enforces Conventional Commits format.
3+
# Installed automatically by `make setup`.
4+
#
5+
# Valid prefixes: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
6+
# Format: <type>[optional scope]: <description>
7+
# Examples:
8+
# feat: add user authentication
9+
# fix(api): handle null response from endpoint
10+
# docs: update README with setup instructions
11+
12+
commit_msg_file="$1"
13+
commit_msg=$(cat "$commit_msg_file")
14+
15+
# Allow merge commits and fixup/squash commits
16+
if echo "$commit_msg" | grep -qE "^(Merge|fixup!|squash!)"; then
17+
exit 0
18+
fi
19+
20+
# Validate conventional commit format
21+
pattern="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .{1,}"
22+
23+
if ! echo "$commit_msg" | head -1 | grep -qE "$pattern"; then
24+
echo "❌ Commit message does not follow Conventional Commits format."
25+
echo ""
26+
echo "Expected: <type>[optional scope]: <description>"
27+
echo "Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
28+
echo ""
29+
echo "Examples:"
30+
echo " feat: add user authentication"
31+
echo " fix(api): handle null response"
32+
echo " docs: update README with setup instructions"
33+
echo ""
34+
echo "Your message: $commit_msg"
35+
exit 1
36+
fi

.githooks/pre-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Pre-commit hook: runs lint checks before allowing a commit.
3+
# Installed automatically by `make setup`.
4+
5+
# Only lint staged files if make lint is available
6+
if make lint 2>/dev/null; then
7+
echo "✅ Lint checks passed."
8+
else
9+
echo "⚠️ Lint check failed or not configured. Skipping pre-commit lint."
10+
# Exit 0 so commits aren't blocked before the stack is configured
11+
exit 0
12+
fi

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
4+
5+
## Type of Change
6+
7+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
8+
- [ ] 🚀 New feature (non-breaking change which adds functionality)
9+
- [ ] 🧹 Chore (refactoring, formatting, dependencies)
10+
- [ ] 📖 Documentation update
11+
- [ ] 🏗 Infrastructure / Environment change
12+
13+
## How Has This Been Tested?
14+
15+
Please describe the tests that you ran to verify your changes.
16+
17+
- [ ] Local manual test
18+
- [ ] CI Automated tests (E2E, Linting, Build)
19+
20+
## Checklist
21+
22+
- [ ] My code follows the style guidelines of this project
23+
- [ ] I have performed a self-review of my own code
24+
- [ ] I have commented my code, particularly in hard-to-understand areas
25+
- [ ] I have made corresponding changes to the documentation
26+
- [ ] My changes generate no new warnings
27+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
# Maintain GitHub Actions used in this repo
4+
- package-ecosystem: 'github-actions'
5+
directory: '/'
6+
schedule:
7+
interval: 'weekly'
8+
9+
# Maintain Docker base images in the root devcontainer
10+
- package-ecosystem: 'docker'
11+
directory: '/.devcontainer'
12+
schedule:
13+
interval: 'weekly'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Devcontainer Build Validation
2+
3+
on:
4+
push:
5+
branches: [main, booting]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-root:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Build root devcontainer
17+
uses: devcontainers/ci@v0.3
18+
with:
19+
subFolder: .
20+
push: never
21+
22+
build-template:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Build template devcontainer
29+
uses: devcontainers/ci@v0.3
30+
with:
31+
subFolder: templates
32+
push: never

0 commit comments

Comments
 (0)