# Github Auto Backup

> Use whenever creating a new coding project or working in any git-backed project. Handles all Git/GitHub management so the user always has an off-machine backup. Interviews the user before creating a new repo, then autonomously commits, pushes, pulls, branches and syncs with conventional commit messages, pausing only for risky or irreversible actions. Triggers on "new project", "start a project",…

- **Type:** Skill
- **Install:** `agentstack add skill-olivierhijlk1-github-auto-backup-github-auto-backup`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [OlivierHijlk1](https://agentstack.voostack.com/s/olivierhijlk1)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [OlivierHijlk1](https://github.com/OlivierHijlk1)
- **Source:** https://github.com/OlivierHijlk1/github-auto-backup

## Install

```sh
agentstack add skill-olivierhijlk1-github-auto-backup-github-auto-backup
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# GitHub Auto Backup

Manage Git and GitHub for every project so the user ALWAYS has an up-to-date
copy on GitHub. Work autonomously for routine version control; pause only for
the risky actions listed below. Treat an unpushed change as an unfinished task.

## Preflight — always first

- `git --version` must exist. If git is missing, give the install command and
  **STOP** — local versioning is not possible without it.
- Check GitHub availability with `gh --version` and `gh auth status`. Do NOT
  hard-stop if gh is missing or not logged in — instead note it and let the
  interview below decide (the user may want GitHub, may want help setting it up,
  or may prefer to stay local-only).

## Starting a new project — ask first, confirm once

Do NOT create anything yet. First ask whether the user wants an off-machine
backup at all:

0. **GitHub backup?** — "Do you want this project backed up to GitHub, or keep
   it local-only for now?"
   - If they want GitHub but `gh` is missing or not authenticated, offer to help
     connect: guide them through installing `gh` and running `gh auth login`.
     If they would rather not right now, fall back to local-only.
   - **Local-only path:** skip the GitHub questions. Just confirm the default
     branch and a stack-based `.gitignore`, then `git init`, add `.gitignore`
     (+ optional license/README), and make the initial commit. Tell them you can
     connect GitHub anytime later (see "Connecting GitHub later").

If they DO want GitHub, ask these, proposing sensible defaults so they can just
say "ok":

1. **Visibility** — public or private? (default: private)
2. **Repo name** — propose one based on the folder name.
3. **Account / organization** — which owner? (default: personal account)
4. **`.gitignore` / license / README** — propose a `.gitignore` based on the
   detected stack; ask which license (if any) and whether to generate a README.
5. **Default branch** — (default: main)

Then summarize the choices in a short list and **confirm ONCE**. Only after the
user says yes:

1. `git init -b ` and add the chosen `.gitignore` (always exclude
   `.env`, `*.key`, secrets, `node_modules/`, build output), license and README.
2. Make the initial commit.
3. Create the GitHub repo with the chosen visibility:
   ```
   gh repo create / -- --source=. --remote=origin --push
   ```
4. Report the repo URL.

## Connecting GitHub later

If a local-only project should later get a remote (the user asks, or you remind
them), make sure `gh` is authenticated, then run the same `gh repo create`
command above with `--source=.` to publish the existing history and push.

## During the project — work autonomously

Do these WITHOUT asking each time, using **conventional commit messages**
(`feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`, …):

- `git pull --rebase` before starting work so the local copy never diverges.
- `git add -A` and commit after each unit of work.
- Push to the remote — automatic for **private** repos (for public repos see
  gated actions below).
- Create and switch branches as needed for focused work.
- Keep local and remote in sync.

**Local-only projects (no remote):** still commit after each unit of work so
history is preserved, and skip the push/pull steps. Now and then remind the user
there is no off-machine backup yet and offer to connect GitHub.

Report briefly what you did (commit hash + files changed).

## Ask permission first — risky / irreversible

STOP and ask for explicit confirmation before:

- Pushing to a **public** repo.
- Opening or merging a **pull request**.
- **Force pushing** (`--force` / `--force-with-lease`).
- **Deleting branches** (local or remote).
- Changing **repository settings** (visibility, default branch, collaborators, …).

## Never do

- Permanently **delete a repository**.
- Change visibility from **private to public** without explicit confirmation.
- **Commit secrets or tokens.** Make sure `.env`, keys and tokens are in
  `.gitignore` before the first push. If a secret is already staged, unstage it
  and warn the user.

## Merge conflicts

Do not auto-resolve. Show the conflicting files and let the user decide how to
resolve them, then continue and report.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [OlivierHijlk1](https://github.com/OlivierHijlk1)
- **Source:** [OlivierHijlk1/github-auto-backup](https://github.com/OlivierHijlk1/github-auto-backup)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-olivierhijlk1-github-auto-backup-github-auto-backup
- Seller: https://agentstack.voostack.com/s/olivierhijlk1
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
