跳到正文
Skillpedia
部署与云(DevOps)7.2k · #13341

publish-project-to-github

它能做什么

这个技能指导智能体把完成的本地项目发布到 GitHub,包括 README、预览图,以及合适时的公开网站。适合想分享或开源一个小型网页项目的人。

适用场景

  • ✓你想把本地网页项目发布到 GitHub 的时候。
  • ✓你想要一个带有预览图和文档的代码仓库的时候。
  • ✓你想把小型网站托管在 GitHub Pages 上,并在上线后进行检查的时候。

技能链接

https://github.com/MengTo/Skills/blob/main/agent-skills/codex/publish-project-to-github/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/MengTo/Skills/blob/main/agent-skills/codex/publish-project-to-github/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把我的本地 HTML 项目发布到 GitHub,附上 README,并上线一个 GitHub Pages 网站。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会先检查项目和代码仓库,然后打包文件、编写 README 并推送内容。上线后,它会确认公开网站可以正常访问。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Publish Project to GitHub

Turn a finished local project into a clean public artifact. Treat repository creation, public visibility, and deployment as separate gates; a successful push is not proof that the public site works.

Deliverables

Produce the applicable items:

  • a narrowly scoped Git repository
  • an intentional public or private GitHub repository
  • a project-specific README.md
  • a real preview image when the project is visual
  • a portable build or remix prompt when it adds value
  • a configured GitHub Pages site for compatible web projects
  • post-push and post-deploy read-back

1. Resolve scope and authority

Inspect the local project, repository state, remotes, and local instructions before writing.

Confirm or safely infer:

  • the exact project directory and intended files
  • repository name and owner
  • whether the target should be public or private
  • whether an existing repository must be updated or a new one created
  • whether the user wants a live website, source hosting only, or both

Creating a public repository is authorized only when the user explicitly asks for public sharing, a public URL, open source, or equivalent. Otherwise ask for visibility before creating it.

Never force-push, overwrite an existing remote, change repository visibility, or replace an existing Pages configuration without exact authorization.

2. Audit before packaging

Run the bundled audit from the project root:

bash /path/to/publish-project-to-github/scripts/audit_public_project.sh .

Then inspect findings rather than treating the script as a substitute for judgment.

Block publication on:

  • API keys, tokens, private keys, passwords, or .env files
  • personal data or private client information
  • absolute local filesystem paths required at runtime
  • unlicensed or private assets
  • missing runtime files
  • unclear ownership of a repository name that already exists

Review all external runtime URLs and generated assets. State any required network dependency in the README.

Inspect the existing license before publishing. If the user explicitly wants others to reuse or modify the project and no license exists, ask which license to add rather than inventing one. If the goal is only public viewing, a missing license does not block deployment, but report that reuse rights are not granted explicitly.

3. Choose the packaging model

Clean existing repository

Use the existing checkout when its remote, history, and tracked files match the intended public project. Stage only the requested files.

Mixed or unrelated workspace

Create a clean project directory or sibling checkout when the source workspace contains unrelated experiments, deletions, private files, or history. Copy only the intended runtime files. Do not publish an entire mixed folder for convenience.

Existing public repository

Inspect its default branch, Pages source, README, license, and remote state before changing it. Pull or reconcile deliberately; never hide divergence with a force push.

For a static one-file experiment, prefer this minimal shape:

project-name/
├── index.html
├── README.md
├── PROMPT.md        # optional
├── assets/          # optional previews or runtime assets
└── .gitignore

4. Build the repository presentation

Write the README from the real project. Use assets/README-template.md as a starting structure, not as final copy.

Include:

  • project name and one concrete sentence explaining the experience
  • a live demo link near the top and, when useful outside GitHub, a repository source link
  • a screenshot or short GIF captured from the actual running project
  • key interactions or features
  • a concise explanation of the architecture and unusual implementation choices
  • accurate local run instructions
  • project structure
  • runtime dependencies and network requirements
  • originality, attribution, or non-affiliation notes when references inspired the work

For agent-built projects, optionally add official links and a portable prompt showing how to rebuild or remix the project with relevant coding agents. Verify current official URLs before publishing.

Avoid generic claims such as “cutting-edge,” “stunning,” or “production-ready.” Prefer specific craft and behavior.

5. Verify locally

Use the project's real runtime rather than opening module-based sites directly from disk.

For static sites:

python3 -m http.server 4173 --bind 127.0.0.1

Check:

  • initial render
  • the primary in
常见问题

未经询问,它会把我的代码仓库公开吗?

不会。技能说明,公开分享需要你明确的要求,否则它会询问可见性设置。

它会覆盖已有的远程仓库吗?

不会。技能规定,没有明确授权,绝不强制推送或替换远程仓库。

推送成功就代表网站能正常使用吗?

不代表。技能会在推送之后,单独检查已部署的结果。

详情

作者的原始描述

Package a finished local project into an intentional GitHub repository, create a strong README and visual preview, push it safely, configure a public GitHub Pages URL when the project is compatible, and verify the deployed result. Use when a user asks to upload, publish, open-source, share, or turn a local HTML/CSS/JavaScript experiment or small web project into a documented GitHub repository with a live demo.

repo: MengTo/Skills

热度

GitHub 星标
7.2k
排名
#13341
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能