github-publish

Solid

Agent-native skill for publishing local projects to GitHub with auto proxy detection

Code & Development 1 stars 0 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
10
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# GitHub 开源发布 Skill ## 1. 触发条件 当用户说以下关键词时触发: - "发布到 GitHub" / "github publish" - "开源发布" / "上传代码到 GitHub" - "push to GitHub" / "GitHub 发布" - "整理成 GitHub 项目" / "发布代码到 GitHub" ## 2. 前置条件 1. 项目目录已初始化 git 仓库(`git init` 已完成) 2. 已配置 GitHub 远程仓库(`git remote add origin <url>` 或已有 origin) 3. 用户已在 GitHub 创建对应仓库(或已有仓库) ## 3. 执行流程(6 阶段) ``` Stage 1 → Stage 2 → Stage 3 → Stage 4 → Stage 5 → Stage 6 Prepare → Commit → Diagnose → Push → Tag → Verify ``` ### Stage 1: 项目准备检查 - 检查 Git 仓库状态(`git status`, `git remote -v`) - 检查必备文件:`.gitignore`, `README.md`, `LICENSE`(推荐) - 扫描敏感文件是否被排除(`.env`, `secret`, `key`, `password`, `token`) - 检查文档中的占位符(`YOUR_USERNAME`, `YOUR_REPO`, `placeholder`, `TODO`) - 如有敏感文件或占位符,暂停并警告用户 ### Stage 2: Git 提交整理 - 暂存所有更改:`git add -A` - 生成语义化提交信息(默认:`chore: prepare for GitHub release`) - 执行提交:`git commit -m "<message>"` - 无更改则跳过此阶段 ### Stage 3: 推送前网络诊断 - 检测系统代理配置(macOS 使用 `scutil --proxy`) - 测试 GitHub API 可达性:`curl -sI https://api.github.com` - 测试 Git 协议连接:`git ls-remote origin` - 若 Git 超时但 API 可达 → 自动配置 Git 使用系统代理 ### Stage 4: 推送代码 - 检测当前分支:`BRANCH=$(git branch --show-current)` - 推送到远程当前分支:`git push origin "$BRANCH"` - 处理常见推送错误(认证失败、超时、non-fast-forward、权限不足) - 详细错误排查 → [故障排除手册](references/troubleshooting.md) ### Stage 5: 创建版本标签(可选) - 用户指定版本号时执行:`git tag -a <version> -m "Release <version>"` - 推送标签到远程:`git push origin <version>` ### Stage 6: 验证 - 验证远程提交: - 从 origin URL 提取 owner/repo:`OWNER_REPO=$(git remote get-url origin | sed -E 's/.*github.com[\/:]([^\/]+)\/...

Details

Author
zhongwentuo-creator
Repository
zhongwentuo-creator/github-publish-skill
Created
1 weeks ago
Last Updated
1 weeks ago
Language
N/A
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category