GitHub Personal Repo Publisher

👤 grey0758 📦 v1.0.0 ⭐ 0.0 ⬇️ 753 下載
💻 開發程式設計 免費 🔑 需 API Key

📖 技能介紹


name: github-personal-repo-publisher description: Create a repository under your own GitHub account, wire a local project repo to it, and push committed history safely. 為你自己的 GitHub 賬戶建立倉庫,把本地專案倉庫接過去,並安全推送已提交歷史。 license: CC-BY-4.0 compatibility: OpenClaw, Codex, Claude Code, and ClawHub-style markdown skill runners with bash, git, curl, ssh, network access, and 1Password CLI available.


GitHub Personal Repo Publisher

Use this skill when a local Git project should be published to a new repository under your own GitHub account and the account access is managed through SSH plus a 1Password-stored PAT. 當本地 Git 專案需要釋出到你自己 GitHub 賬戶下的新倉庫,且賬戶訪問通過 SSH 和 1Password 中儲存的 PAT 管理時,使用這個 skill。

Read First | 先讀這些

  • {baseDir}/README.md
  • {baseDir}/WORKFLOW.md
  • {baseDir}/FAQ.md
  • {baseDir}/CHANGELOG.md

    小蔥技能7w4.net有完整的技能分類。

Primary Rule | 核心原則

Treat Git history as the publish boundary: only committed local history should be described as pushed. 把 Git 提交歷史當作釋出邊界:只有已提交的本地歷史,才能算已經推送。

Workflow | 執行流程

  1. inspect the local repository state 檢查本地倉庫狀態
  2. verify SSH auth to the personal GitHub account 驗證到個人 GitHub 賬戶的 SSH 認證
  3. check whether the target repository already exists 檢查目標倉庫是否已存在
  4. create the GitHub repository through the API if missing 如果缺失,則通過 API 建立 GitHub 倉庫
  5. add or update the local origin 新增或更新本地 origin
  6. push the current branch and set upstream 推送當前分支並建立 upstream
  7. verify remote wiring and pushed commit 校驗遠端繫結和已推送提交
  8. state clearly what remains local-only 明確說明哪些內容仍只存在於本地

Strong Heuristics | 強判斷規則

  • if origin already points to the correct repo, do not recreate the repository
  • if SSH auth fails, do not continue to remote rewiring or push
  • if the GitHub repo does not exist and gh is unavailable, use the REST API with a 1Password-managed PAT
  • default new personal project repositories to private unless the user clearly wants public exposure
  • if the worktree is dirty, say explicitly that uncommitted files were not pushed
  • if origin exists but points elsewhere, update it intentionally rather than assuming it is disposable

中文解釋:

  • 如果 origin 已經指向正確倉庫,就不要重複建倉庫。
  • SSH 認證失敗時,不要繼續改 remote 或 push。
  • GitHub 倉庫不存在且 gh 不可用時,用 1Password 管理的 PAT 調 REST API。
  • 新的個人專案倉庫預設建成 private,除非使用者明確要求公開。
  • 工作區有髒改動時,要明確說明未提交檔案並沒有被推送。
  • origin 已存在但指向別處時,要有意識地更新,不要假設它可以隨便覆蓋。

Safe Commands | 安全命令

git -C /path/to/project status --short
git -C /path/to/project remote -v
git -C /path/to/project log --oneline -3
ssh -T git@github-grey0758
git ls-remote git@github-grey0758:grey0758/your-repo.git HEAD
TOKEN="$(op read 'op://OpenClaw/GitHub Fine-Grained PAT - Repo Admin - grey0758/credential')"
curl -fsSL -X POST -H 'Accept: application/vnd.github+json' -H "Authorization: Bearer $TOKEN" https://api.github.com/user/repos -d '{"name":"your-repo","private":true}'
git -C /path/to/project remote add origin git@github-grey0758:grey0758/your-repo.git
git -C /path/to/project push -u origin main

Response Format | 輸出格式

Always return: 始終返回:

  1. current local repo status
  2. GitHub repo existence or creation status
  3. remote wiring status
  4. push status
  5. local-only work that still remains

Constraints | 約束

  • do not reveal PAT values or copy secret material into files
  • do not say a project is fully published when uncommitted changes still exist
  • do not assume gh is installed
  • keep the owner, SSH alias, and target repo name explicit

📁 包含檔案 (7 個)

📄 CHANGELOG.md 249 B
📄 FAQ.md 696 B
📄 README.md 1.6 KB
📄 SKILL.md 4.1 KB
📄 WORKFLOW.md 774 B
📄 _meta.json 149 B
📄 agents/openai.yaml 353 B