github-backup/docs/16-hermes-git-workflow.md

Edit Back to List

Hermes Git Workflow — How to Commit Your Own Changes

This document explains how Hermes should persist significant changes to the GitHub repo. The GCE server (/srv/easier-hermes) is NOT a git clone of this repo — they are separate. Hermes must use the GitHub API to push changes from the server.


When to Commit

Commit to GitHub whenever: - Config changes that should survive a restart - Significant decisions not captured in vault log - New skill or SOP created - Operational setup changes (cron, tool toggles, mode defaults) - Anthony updates standing decisions

Do NOT commit: - Raw vault content (notes, transcripts, client data) — stays on server - Secrets or credentials — never - Session-specific temp files - The live config.yaml directly — update config.yaml.template instead


How to Commit (GitHub API via terminal)

GITHUB_TOKEN must be stored in /srv/easier-hermes/data/.env. If missing, notify Anthony immediately — do not skip.

Check token

grep GITHUB_TOKEN /srv/easier-hermes/data/.env

Create new file

source /srv/easier-hermes/data/.env
CONTENT=$(printf '%s' "$(cat /tmp/newfile.md)" | base64 -w0)
curl -s -X PUT \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Content-Type: application/json" \
  https://api.github.com/repos/easiermarketing/easier-hermes/contents/docs/FILENAME.md \
  -d "{\"message\":\"Your commit message\",\"content\":\"$CONTENT\"}"

Update existing file (get SHA first)

source /srv/easier-hermes/data/.env
SHA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/easiermarketing/easier-hermes/contents/docs/FILENAME.md \
  | python3 -c "import json,sys; print(json.load(sys.stdin)['sha'])")
CONTENT=$(printf '%s' "$(cat /tmp/updatedfile.md)" | base64 -w0)
curl -s -X PUT \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Content-Type: application/json" \
  https://api.github.com/repos/easiermarketing/easier-hermes/contents/docs/FILENAME.md \
  -d "{\"message\":\"Update FILENAME\",\"content\":\"$CONTENT\",\"sha\":\"$SHA\"}"

Commit Message Format

Pattern: verb + what. Short and specific.

Good: "Set free mode as permanent default" Good: "Add COO pulse decision log" Bad: "update", "changes", "fix stuff"


What Goes Where

Type Repo location
Decisions docs/ — new numbered doc
Config changes deployment/config/config.yaml.template
Soul/behaviour deployment/vault-template/SOUL.md
Skill docs docs/skills/

GitHub Token Setup (Anthony — one-time)

Create a fine-grained PAT at https://github.com/settings/personal-access-tokens/new - Repo: easiermarketing/easier-hermes - Permission: Contents (read + write)

Store it:

echo 'GITHUB_TOKEN=ghp_...' >> /srv/easier-hermes/data/.env

Until set: Hermes notifies Anthony in Slack with content ready to paste, asks to set up token.


Self-Commit SOP

After any significant change: 1. Write content to /tmp/file.md on server 2. Check GITHUB_TOKEN available 3. If yes: commit via API above 4. If no: post content to Slack #int-agentops, ask Anthony to set up token 5. Log outcome in vault/log.md