From ad8e17e163e203695a0e5af45eb941d96184f929 Mon Sep 17 00:00:00 2001 From: oliver Date: Mon, 22 Jun 2026 17:02:31 -0300 Subject: [PATCH] git integration --- integrations/github-repo.json | 12 ++++++++++++ integrations/index.json | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 integrations/github-repo.json diff --git a/integrations/github-repo.json b/integrations/github-repo.json new file mode 100644 index 0000000..1de9c9d --- /dev/null +++ b/integrations/github-repo.json @@ -0,0 +1,12 @@ +{ + "name": "GitHub Repo", + "description": "Set up and sync with a GitHub repository — clone, commit, push, and manage code for your Hermes agent.", + "fields": [ + {"label": "Repository URL", "key": "repo_url", "type": "text", "placeholder": "https://github.com/your-username/your-repo.git"}, + {"label": "GitHub Username", "key": "git_user", "type": "text", "placeholder": "your-username"}, + {"label": "GitHub Password / Personal Access Token", "key": "git_pass", "type": "password", "placeholder": "ghp_xxxxxxxxxxxx"} + ], + "signup_url": "https://semrush.com", + "signup_label": "Need to drive traffic to your site? Create a Semrush account", + "prompt": "Create a Hermes agent skill named \"github_repo_setup\".\n\n## Purpose\nSet up a working GitHub repository that the Hermes agent can use to read, write, and manage code, content, or configuration files via git. The repo acts as a persistent file store and version-controlled workspace.\n\n## Credentials\n\nREPO_URL={repo_url}\nGIT_USER={git_user}\nGIT_PASS={git_pass}\n\n## Startup behaviour\n\n1. On first run, check if git is installed. If not, install it:\n apt-get update && apt-get install -y git\n Or the equivalent for the system's package manager.\n\n2. Check if the repo directory (~/repo) already exists and is a git repo.\n cd ~/repo && git status\n\n3. If ~/repo does not exist or is not a git repo:\n - Extract the repo name from REPO_URL (the part before .git).\n - If a remote git URL is provided, authenticate using GIT_USER and GIT_PASS in the URL:\n AUTH_URL=$(echo \"$REPO_URL\" | sed \"s|https://|https://$GIT_USER:$GIT_PASS@|\")\n - Clone the repo:\n git clone \"$AUTH_URL\" ~/repo\n - Set the remote origin to the AUTH_URL for future push/pull:\n git remote set-url origin \"$AUTH_URL\"\n\n4. If ~/repo exists but is not a git repo, print an error and halt.\n\n5. If ~/repo is already a valid git repo and has a remote origin:\n - Re-authenticate the remote with the provided credentials:\n AUTH_URL=$(echo \"$REPO_URL\" | sed \"s|https://|https://$GIT_USER:$GIT_PASS@|\")\n git remote set-url origin \"$AUTH_URL\"\n - Pull the latest changes:\n git pull --ff-only\n - Print the status: \"GitHub repo already set up. Latest changes pulled.\"\n\n6. After clone or pull, print the current git log (last 5 commits):\n git --no-pager log --oneline -5\n\n## Daily usage\n\nWhenever the agent needs to read, write, or edit files:\n\n### Read a file\n cat ~/repo/\n\n### Edit / write a file\n Write the new content, then:\n cd ~/repo\n git add \n git commit -m \"\"\n git push\n\n### Commit message format\n Always use conventional commits:\n - feat: \n - fix: \n - docs: \n - chore: \n - refactor: \n\n### Push discipline\n- Always pull before push:\n git pull --ff-only && git push\n- If pull fails due to divergent branches, fetch and rebase:\n git fetch origin && git rebase origin/$(git branch --show-current) && git push\n- If rebase has conflicts, abort and notify the user:\n git rebase --abort\n echo \"ERROR: Merge conflict — needs manual resolution.\"\n\n### Create a new branch\n git checkout -b \n git push -u origin \n\n### List branches\n git branch -a\n\n### Working directory discipline\n- All work goes inside ~/repo. Never write files outside ~/repo unless explicitly instructed.\n- After every batch of changes, commit and push.\n\n## Solved cases log\n\nAfter every successfully completed task that involved the GitHub repo, append to ~/repo_solutions.md:\n\n ## ()\n Goal: \n Commands: \n Gotchas: \n\nRead ~/repo_solutions.md at the start of every task — if a matching case exists, reuse it directly." +} diff --git a/integrations/index.json b/integrations/index.json index 861fa4e..e2f11f8 100644 --- a/integrations/index.json +++ b/integrations/index.json @@ -3,5 +3,6 @@ "imap-smtp-email.json", "n8n-crm.json", "nextcloud-sync.json", - "n8n-skills.json" + "n8n-skills.json", + "github-repo.json" ]