git integration
This commit is contained in:
@@ -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/<path>\n\n### Edit / write a file\n Write the new content, then:\n cd ~/repo\n git add <path>\n git commit -m \"<descriptive message>\"\n git push\n\n### Commit message format\n Always use conventional commits:\n - feat: <description>\n - fix: <description>\n - docs: <description>\n - chore: <description>\n - refactor: <description>\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 <branch-name>\n git push -u origin <branch-name>\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 ## <short title> (<date>)\n Goal: <one sentence>\n Commands: <the git commands that worked>\n Gotchas: <anything non-obvious>\n\nRead ~/repo_solutions.md at the start of every task — if a matching case exists, reuse it directly."
|
||||||
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
"imap-smtp-email.json",
|
"imap-smtp-email.json",
|
||||||
"n8n-crm.json",
|
"n8n-crm.json",
|
||||||
"nextcloud-sync.json",
|
"nextcloud-sync.json",
|
||||||
"n8n-skills.json"
|
"n8n-skills.json",
|
||||||
|
"github-repo.json"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user