New repository (publish a project)
Turn a local folder into a repository on the user's forge (GitHub by default,
GitLab or Forgejo on request) and push it, without surprises.
Tools: git (status, init, add, commit, remote, push; it uses Navin's credential
bridge, so no token ever appears in a URL or the chat), forge action
repo_create (asks the user for approval, refused in unattended runs), and
request_credentials (kind=git_host) when the host is not connected yet.
Hard limits
- Never delete a repository, local or remote.
- Never change an existing remote (
origin or any other). Never git remote set-url.
- Never create a second repository for a project that already has a remote.
- Private by default. Public only when the user said so (
/publish --public, "public repo").
- Never commit anything that looks like a secret without asking first.
- Never ask the user to paste a token or password in the chat.
1. Inspect first
git rev-parse --is-inside-work-tree (git action=status works too).
git remote -v (git action=remote).
- If a remote already exists: say which one (host and owner/repo, no credentials),
offer to commit and push the pending work there, and stop. Do not create
anything new, do not touch the remote.
2. Prepare
- List what would be committed (git action=status; untracked files included).
Show it grouped and short, not a raw dump.
- Make sure
.gitignore covers, for the stack you see:
- dependency dirs:
node_modules/, .venv/, venv/, vendor/, target/, __pycache__/
- build outputs:
dist/, build/, .next/, out/, coverage/, *.egg-info/
- secrets:
.env, .env.* (keep !.env.example), *.pem, *.key, id_rsa*,
credentials*.json, *.p12, .navin/secrets*, .navin/credentials*
- OS / editor noise:
.DS_Store, Thumbs.db, .idea/, .vscode/ (unless the project shares settings)
Add the missing lines; do not rewrite the user's existing rules.
- Anything that still looks like a secret (a
.env already tracked, a key file,
a config with password= / token=): name the file and ask before including it.
- Only if needed:
git init -b main (git action=init) and one initial commit
("Initial commit") staging the named paths you listed (git action=add with paths),
never a blind add-everything over secrets. If commits already exist, keep them.
3. Create and push
- Name: the folder name in lowercase with dashes (
My App -> my-app), or the
name the user gave. If the forge says the name is taken (forge_repo_exists),
try one close variant (my-app-1 or my-app-<year>); if that is taken too, ask.
forge action=repo_create name=<name> host=<host> private=true (add org= only
when the user named an organization or group). The user approves it in a card.
- If the host is not connected, call
request_credentials(kind=git_host, host=<host>)
once with a clear reason (GitHub offers the device sign-in). Then retry once.
git action=remote create=true name=origin remote=<clone_url> (only because no
remote existed in step 1).
git action=push set_upstream=true (pushes the current branch, main by default).
4. Report
Say in one or two lines: the repository page (web_url), private or public, the
branch pushed and how many files went in. Mention anything you left out on purpose
(a secret file, a large binary).
Plain-language variant (novice users)
When the user does not speak git, keep the same steps but talk about outcomes:
- "Your project is not online yet. I will put it in a private space on GitHub that
only you can see." (instead of "init, commit, create remote, push")
- "I found a file with passwords (
.env). I will keep it off the internet."
- "GitHub needs to know it is you: a sign-in window opens, approve it there."
- At the end: "Done. Your project is here: . It is private."
Never show raw command output to a novice unless they ask; summarize it.
1---2name: new-repo3description: "Publish a local project to a new private repository on GitHub, GitLab or Forgejo: inspect first, prepare a safe first commit (.gitignore, no secrets), create the repo with forge action=repo_create, add origin and push through the git tool. Use for /publish, 'push this project to GitHub', 'put this on GitLab', 'crée un repo pour ce projet'. Never creates a second repo, never changes an existing remote, never deletes a repo."4metadata:5 source: https://skillmd.com/skills/navinspire-ia/new-repo6 navin:7 emoji: 📦8 category: devops9 requires:10 bins:11 - git12---1314# New repository (publish a project)1516Turn a local folder into a repository on the user's forge (GitHub by default,17GitLab or Forgejo on request) and push it, without surprises.1819Tools: `git` (status, init, add, commit, remote, push; it uses Navin's credential20bridge, so no token ever appears in a URL or the chat), `forge` action21`repo_create` (asks the user for approval, refused in unattended runs), and22`request_credentials` (kind=git_host) when the host is not connected yet.2324## Hard limits2526- Never delete a repository, local or remote.27- Never change an existing remote (`origin` or any other). Never `git remote set-url`.28- Never create a second repository for a project that already has a remote.29- Private by default. Public only when the user said so (`/publish --public`, "public repo").30- Never commit anything that looks like a secret without asking first.31- Never ask the user to paste a token or password in the chat.3233## 1. Inspect first34351. `git rev-parse --is-inside-work-tree` (git action=status works too).362. `git remote -v` (git action=remote).373. If a remote already exists: say which one (host and owner/repo, no credentials),38 offer to commit and push the pending work there, and **stop**. Do not create39 anything new, do not touch the remote.4041## 2. Prepare42431. List what would be committed (git action=status; untracked files included).44 Show it grouped and short, not a raw dump.452. Make sure `.gitignore` covers, for the stack you see:46 - dependency dirs: `node_modules/`, `.venv/`, `venv/`, `vendor/`, `target/`, `__pycache__/`47 - build outputs: `dist/`, `build/`, `.next/`, `out/`, `coverage/`, `*.egg-info/`48 - secrets: `.env`, `.env.*` (keep `!.env.example`), `*.pem`, `*.key`, `id_rsa*`,49 `credentials*.json`, `*.p12`, `.navin/secrets*`, `.navin/credentials*`50 - OS / editor noise: `.DS_Store`, `Thumbs.db`, `.idea/`, `.vscode/` (unless the project shares settings)51 Add the missing lines; do not rewrite the user's existing rules.523. Anything that still looks like a secret (a `.env` already tracked, a key file,53 a config with `password=` / `token=`): name the file and ask before including it.544. Only if needed: `git init -b main` (git action=init) and one initial commit55 ("Initial commit") staging the named paths you listed (git action=add with paths),56 never a blind add-everything over secrets. If commits already exist, keep them.5758## 3. Create and push59601. Name: the folder name in lowercase with dashes (`My App` -> `my-app`), or the61 name the user gave. If the forge says the name is taken (`forge_repo_exists`),62 try one close variant (`my-app-1` or `my-app-<year>`); if that is taken too, ask.632. `forge action=repo_create name=<name> host=<host> private=true` (add `org=` only64 when the user named an organization or group). The user approves it in a card.653. If the host is not connected, call `request_credentials(kind=git_host, host=<host>)`66 once with a clear reason (GitHub offers the device sign-in). Then retry once.674. `git action=remote create=true name=origin remote=<clone_url>` (only because no68 remote existed in step 1).695. `git action=push set_upstream=true` (pushes the current branch, `main` by default).7071## 4. Report7273Say in one or two lines: the repository page (`web_url`), private or public, the74branch pushed and how many files went in. Mention anything you left out on purpose75(a secret file, a large binary).7677## Plain-language variant (novice users)7879When the user does not speak git, keep the same steps but talk about outcomes:8081- "Your project is not online yet. I will put it in a private space on GitHub that82 only you can see." (instead of "init, commit, create remote, push")83- "I found a file with passwords (`.env`). I will keep it off the internet."84- "GitHub needs to know it is you: a sign-in window opens, approve it there."85- At the end: "Done. Your project is here: <link>. It is private."8687Never show raw command output to a novice unless they ask; summarize it.