hexo-deploy

Introduction
介绍

This is an Agent Skill for automating Hexo blog site deployment, designed by WaterCoFire specifically for the development workflow of WaterCoFire Playground. It condenses the entire Hexo blog publishing process into a single conversational command, handling all deployment tasks from content generation to code submission.

这是一个用于 Hexo 博客站点自动化部署的 Agent Skill,是 WaterCoFire 专为 WaterCoFire Playground 网站的开发工作流而设计的。它能将 Hexo 博客的完整发布流程压缩为一次对话指令,负责处理从内容生成到代码提交的全部部署工作。

If you also maintain a Hexo blog site, feel free to use it directly!

如果你也在维护一个 Hexo 博客网站,欢迎直接取用!

Workflow Overview
工作流概览

This Skill splits deployment into two sequential phases:

该 Skill 将部署拆分为两个独立阶段,按顺序执行:

1
2
3
4
5
6
7
8
9
Phase 1 — Hexo Build & Publish
hexo clean → hexo g → hexo d
└─ Push the public/ directory to your hosting repository (e.g., GitHub Pages)
Hexo 构建 & 发布:将 public/ 目录推送到 hosting 仓库(如 GitHub Pages)

Phase 2 — Source Code Commit
git add . → git commit → git push origin main
└─ Save source files to your code repository
源码提交:将源文件保存到源码仓库

If any step fails, the Agent should immediately stop and report the error without proceeding to execute subsequent commands.

任意步骤失败时,Agent 应会立即停止并报告错误,不会继续执行后续命令。

How to Use?
如何使用?

Simply tell the Agent you’re using that you want to deploy and provide the commit message:

直接告诉您所用的 Agent 您要部署,并提供 commit 消息即可:

1
2
Deploy for me, commit message is "Added About page"
(帮我部署,commit 消息是"新增关于页面")

The Agent will automatically execute all commands sequentially.

如果您以中文提供了 commit 消息,Agent 应会自动将该消息润色为英文,然后依次执行所有命令。

You can also the Agent automatically generate the commit message based on the diff:

也可以让 Agent 根据 diff 自动生成 commit 消息:

1
2
Deploy for me, you generate the commit message
(帮我部署,commit 消息你来生成)

Partial Execution
部分执行

Command / 指令 Behavior / 行为
Deploy only or Hexo only
只部署只 hexo
Executes Phase 1 (Hexo Build & Publish) only, skips Phase 2
仅执行 Phase 1(Hexo 构建 & 发布),跳过 Phase 2
Commit only or Git only
只提交只 git
Executes Phase 2 (Git Commit) only, skips Phase 1
仅执行 Phase 2(Git 提交),跳过 Phase 1

Customization Notes
定制说明

This Skill is designed under the assumption that: Hexo blog source code is maintained in a separate Git repository (i.e., distinct from the hosting repository pushed by hexo d). This is the repository structure of WaterCoFire Playground.

该 Skill 的设计前提是:Hexo 博客的源码本身也维护在一个独立的 Git 仓库中(即与 hexo d 所推送的 hosting 仓库相分离)。这是 WaterCoFire Playground 的仓库结构。

If your setup differs, please adjust accordingly before use:

如果你的情况与此不同,在使用前请按需调整:

Single Git repository (source code = hosting repository)
只有一个 Git 仓库(源码即 hosting 仓库)

Remove the Git phase in Phase 2, or integrate it into the hexo d logic.

删除 Phase 2 的 Git 阶段,或将其合并进 hexo d 的逻辑中。

No need for hexo clean
不需要 hexo clean

Remove this command from Phase 1.

从 Phase 1 中移除该命令。

Main branch is not main
主分支不是 main

Replace main in git push origin main with your branch name.

git push origin main 中的 main 替换为你的分支名。

Prerequisites
适用前提

  • Hexo CLI is installed and configured (hexo command is available)
    已安装并配置好 Hexo CLI(hexo 命令可用)
  • Deployment target for hexo d is correctly configured in _config.yml
    hexo d 的部署目标已在 _config.yml 中正确配置
  • Git is initialized, remote repository origin is set up
    Git 已初始化,远程仓库 origin 已设置

File Contents
文件内容

Metadata
元数据

1
2
3
4
---
name: hexo-deploy
description: "Deploy this website and commit source files to Git. This skill handles the full two-step workflow: build & deploy public/ via hexo, then commit source files to the source repository."
---

Full File
完整文件

Click the button below to download.

请点击下方按钮下载。

📥 Download