con un clic
build-project
定义 NemesisBot 项目的构建流程,包括环境准备、版本信息收集、编译构建、结果验证等步骤。所有构建工作必须严格按照此流程执行。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
定义 NemesisBot 项目的构建流程,包括环境准备、版本信息收集、编译构建、结果验证等步骤。所有构建工作必须严格按照此流程执行。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Scanner 杀毒引擎端到端自动化测试。验证 ClamAV 从配置、下载、安装、启动、扫描到拦截的完整生命周期。
This skill should be used when the user asks to "analyze crash dump", "analyze dump files", "analyze .dmp", "check crash dumps", "debug crash", "analyze crash", "cdb analyze", "windbg analyze", or mentions dump analysis, crash analysis, or debugging crash dumps (.dmp files).
This skill should be used when the user asks to "run WSL commands", "execute Linux on Windows", "manage WSL processes", "check WSL status", "transfer files between Windows and WSL", or mentions WSL-related operations like "wsl", "ubuntu", "debian in WSL", "compile in WSL", "wsl bash", "wsl script".
与集群中的其他节点进行 RPC 通信,实现分布式协作和能力发现
A simple test skill that performs basic math calculations and string operations. Use this skill when you need to demonstrate that skills are being loaded and executed correctly.
定义完整的结构化开发流程,包括预研、计划、开发、测试、复查、报告等阶段。所有开发工作必须严格按照此流程执行。
| name | build-project |
| description | 定义 NemesisBot 项目的构建流程,包括环境准备、版本信息收集、编译构建、结果验证等步骤。所有构建工作必须严格按照此流程执行。 |
此 skill 定义了严格的构建流程,确保每次构建都能正确生成可执行文件,并包含完整的版本信息。
完整的构建流程包含以下阶段:
目标: 确保构建环境正确,准备构建参数。
执行步骤:
检查 Go 环境
go version
检查项目路径
C:\AI\NemesisBot\NemesisBot确定输出文件名
nemesisbot.exe设置 PATH 环境变量
SET PATH=C:\AI\golang\go1.25.7\bin;%PATH%
输出: 构建环境就绪
目标: 收集所有构建所需的版本信息。
执行步骤:
获取版本号
git describe --tags --abbrev=0
0.0.0.1获取 Git 提交哈希
git rev-parse --short HEAD
获取构建时间
powershell -Command "Get-Date -Format yyyy/MM/dd"
2026/03/05获取 Go 版本
go version
go1.25.7)显示构建信息
Build Information:
- Version: 0.0.0.1
- Git Commit: abc1234
- Build Time: 2026/03/05
- Go Version: go1.25.7
输出: 构建信息字典
目标: 执行 Go 编译,生成可执行文件。
执行步骤:
设置编译参数(ldflags)
-ldflags "-X main.version=%VERSION%
-X main.gitCommit=%GIT_COMMIT%
-X main.buildTime=%BUILD_TIME%
-X main.goVersion=%GO_VERSION%
-s -w"
-s: 去除符号表-w: 去除调试信息-X: 注入版本信息到 main 包执行编译命令
go build -ldflags "..." -o %OUTPUT_NAME% .\nemesisbot\
nemesisbot.exe检查编译结果
输出: 可执行文件(nemesisbot.exe 或自定义名称)
目标: 验证构建结果是否正确。
执行步骤:
检查文件存在性
if exist "%OUTPUT_NAME%" (
echo 文件存在
) else (
echo 文件不存在
)
获取文件大小
for %%A in ("%OUTPUT_NAME%") do (
set size=%%~zA
set /a sizeMB=!size! / 1048576
echo 文件大小: !sizeMB! MB
)
显示构建摘要
============================================
Build Summary
============================================
Output file: nemesisbot.exe
File size: 15 MB
Build Info:
Version: 0.0.0.1
Git Commit: abc1234
Build Time: 2026/03/05
Go Version: go1.25.7
[SUCCESS] Build completed successfully!
You can now run: .\nemesisbot.exe gateway
============================================
输出: 构建验证报告
目标: 向用户汇报构建结果。
执行步骤:
汇总构建信息
确认构建状态
提供后续指导
构建成功!你可以运行:
# 启动 Web 网关
.\nemesisbot.exe gateway
# 查看帮助
.\nemesisbot.exe --help
# 启动特定 agent
.\nemesisbot.exe agent
输出: 构建报告 + 用户指导
@echo off
setlocal enabledelayedexpansion
SET PATH=C:\AI\golang\go1.25.7\bin;%PATH%
# 默认输出文件名
if "%~1"=="" (
set OUTPUT_NAME=nemesisbot.exe
) else (
set OUTPUT_NAME=%~1
)
# 获取构建信息
set VERSION=0.0.0.1
for /f "tokens=*" %%i in ('git describe --tags --abbrev=0 2^>nul') do set VERSION=%%i
set GIT_COMMIT=unknown
for /f "tokens=*" %%i in ('git rev-parse --short HEAD 2^>nul') do set GIT_COMMIT=%%i
for /f "delims=" %%i in ('powershell -Command "Get-Date -Format yyyy/MM/dd"') do set BUILD_TIME=%%i
for /f "tokens=3" %%i in ('go version') do set GO_VERSION_RAW=%%i
set GO_VERSION=%GO_VERSION_RAW:go=%
# 显示构建信息
echo Build Information:
echo - Version: %VERSION%
echo - Git Commit: %GIT_COMMIT%
echo - Build Time: %BUILD_TIME%
echo - Go Version: %GO_VERSION%
# 执行编译
echo.
echo [Step 2/3] Building %OUTPUT_NAME%...
go build -ldflags "-X main.version=%VERSION% -X main.gitCommit=%GIT_COMMIT% -X main.buildTime=%BUILD_TIME% -X main.goVersion=%GO_VERSION% -s -w" -o %OUTPUT_NAME% .\nemesisbot\
if errorlevel 1 (
echo [ERROR] Build failed!
pause
exit /b 1
)
echo [OK] Build completed successfully
# 显示文件大小
for %%A in ("%OUTPUT_NAME%") do (
set size=%%~zA
set /a sizeMB=!size! / 1048576
echo File size: !sizeMB! MB
)
echo.
echo [SUCCESS] Build completed successfully!
echo You can now run: .\%OUTPUT_NAME% gateway
build.bat
build.bat my-bot.exe
NemesisBot/
├── build.bat # 构建脚本
├── nemesisbot/ # 主程序目录
│ ├── main.go # 入口文件
│ ├── command/ # 命令处理
│ └── ...
├── module/ # 核心模块
│ ├── agent/
│ ├── channels/
│ ├── cluster/
│ ├── config/
│ ├── providers/
│ ├── security/
│ └── tools/
└── nemesisbot.exe # 构建输出(运行后生成)
环境检查
版本信息
错误处理
验证完整
用户友好
❌ 禁止在未配置环境的情况下构建 ❌ 禁止忽略编译错误继续执行 ❌ 禁止不验证输出文件就报告成功 ❌ 禁止使用错误的 ldflags 参数 ❌ 禁止在错误的目录执行构建
在向用户报告构建成功前,确认以下事项:
只有所有检查项都完成,构建才算真正成功!
C:\AI\NemesisBot\NemesisBotC:\AI\NemesisBot\NemesisBot\build.batC:\AI\golang\go1.25.7\binC:\AI\NemesisBot\NemesisBot\nemesisbot用户: 帮我构建项目
助手: 收到。我将开始构建流程。
📋 阶段 1: 准备阶段
检查 Go 环境...
go version: go version go1.25.7 windows/amd64
✅ 环境检查通过
📋 阶段 2: 信息收集阶段
收集构建信息...
- Version: 0.0.0.1
- Git Commit: abc1234
- Build Time: 2026/03/05
- Go Version: go1.25.7
✅ 信息收集完成
📋 阶段 3: 构建阶段
执行编译命令...
go build -ldflags "-X main.version=0.0.0.1 -X main.gitCommit=abc1234 ..." -o nemesisbot.exe .\nemesisbot\
✅ 编译成功
📋 阶段 4: 验证阶段
验证构建结果...
- 输出文件: nemesisbot.exe
- 文件大小: 15 MB
✅ 验证通过
📋 阶段 5: 报告阶段
构建成功!你可以运行:
.\nemesisbot.exe gateway
构建过程中注入的版本信息可在程序中访问:
package main
var (
version string // 版本号
gitCommit string // Git 提交哈希
buildTime string // 构建时间
goVersion string // Go 版本
)
这些变量可以在程序运行时显示,帮助用户了解当前使用的具体版本。
# 默认构建
build.bat
# 指定输出文件名
build.bat my-custom-name.exe
============================================
NemesisBot Build Script
============================================
[INFO] Output filename specified: nemesisbot.exe
[INFO] Gathering build information...
Build Information:
- Version: 0.0.0.1
- Git Commit: abc1234
- Build Time: 2026/03/05
- Go Version: go1.25.7
[Step 1/3] Nothing
[Step 2/3] Building nemesisbot.exe...
[OK] Build completed successfully
[Step 3/3] Nothing
============================================
Build Summary
============================================
Output file: nemesisbot.exe
File size: 15 MB
Build Info:
Version: 0.0.0.1
Git Commit: abc1234
Build Time: 2026/03/05
Go Version: go1.25.7
[SUCCESS] Build completed successfully!
You can now run: .\nemesisbot.exe gateway
============================================
构建流程定义完成!所有构建工作必须严格按照此流程执行,确保每次构建都包含完整的版本信息,并且输出文件可正常使用。