ln-781-build-verifier
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseln-781-build-verifier
ln-781-build-verifier
Type: L3 Worker
Category: 7XX Project Bootstrap
Parent: ln-780-bootstrap-verifier
Type: L3 Worker
Category: 7XX Project Bootstrap
Parent: ln-780-bootstrap-verifier
Purpose
用途
Detects project types, restores dependencies, executes builds, and verifies successful compilation.
Scope:
- Auto-detect project types from file markers
- Restore dependencies using appropriate package manager
- Execute build commands for each project
- Verify build artifacts exist
Out of Scope:
- Running tests (handled by ln-782)
- Container operations (handled by ln-783)
- Workflow orchestration (handled by ln-780)
检测项目类型、恢复依赖、执行构建并验证编译是否成功。
适用范围:
- 从文件标记自动检测项目类型
- 使用合适的包管理器恢复依赖
- 为每个项目执行构建命令
- 验证构建产物是否存在
不适用范围:
- 运行测试(由ln-782处理)
- 容器操作(由ln-783处理)
- 工作流编排(由ln-780处理)
When to Use
使用场景
| Scenario | Use This Skill |
|---|---|
| Called by ln-780 orchestrator | Yes |
| Standalone build verification | Yes |
| CI/CD pipeline build step | Yes |
| Test execution needed | No, use ln-782 |
| 场景 | 是否使用本Skill |
|---|---|
| 由ln-780编排器调用 | 是 |
| 独立构建验证 | 是 |
| CI/CD流水线构建步骤 | 是 |
| 需要执行测试 | 否,使用ln-782 |
Workflow
工作流程
Step 1: Detect Project Types
步骤1:检测项目类型
Scan project root for type markers.
| Marker File | Project Type | Build System |
|---|---|---|
| package.json | Node.js/Frontend | npm/yarn/pnpm |
| *.csproj | .NET | dotnet |
| setup.py / pyproject.toml | Python | pip/poetry |
| go.mod | Go | go build |
| Cargo.toml | Rust | cargo |
| pom.xml | Java/Maven | mvn |
| build.gradle | Java/Gradle | gradle |
扫描项目根目录中的类型标记。
| 标记文件 | 项目类型 | 构建系统 |
|---|---|---|
| package.json | Node.js/前端 | npm/yarn/pnpm |
| *.csproj | .NET | dotnet |
| setup.py / pyproject.toml | Python | pip/poetry |
| go.mod | Go | go build |
| Cargo.toml | Rust | cargo |
| pom.xml | Java/Maven | mvn |
| build.gradle | Java/Gradle | gradle |
Step 2: Restore Dependencies
步骤2:恢复依赖
For each detected project, restore dependencies before building.
| Project Type | Dependency Restoration |
|---|---|
| Node.js | Install packages from lock file |
| .NET | Restore NuGet packages |
| Python | Install from requirements or pyproject |
| Go | Download modules |
| Rust | Fetch crates |
为每个检测到的项目在构建前恢复依赖。
| 项目类型 | 依赖恢复方式 |
|---|---|
| Node.js | 从锁文件安装包 |
| .NET | 恢复NuGet包 |
| Python | 从requirements或pyproject安装 |
| Go | 下载模块 |
| Rust | 获取crates |
Step 3: Build Projects
步骤3:执行项目构建
Execute build for each project type in Release/Production mode.
| Project Type | Build Mode | Expected Outcome |
|---|---|---|
| Node.js | Production | Bundled assets in dist/ or build/ |
| .NET | Release | Compiled DLLs in bin/Release/ |
| Python | Editable install | Package installed in environment |
| Go | Production | Compiled binary |
| Rust | Release | Optimized binary in target/release/ |
为每个项目类型以Release/生产模式执行构建。
| 项目类型 | 构建模式 | 预期结果 |
|---|---|---|
| Node.js | 生产模式 | 打包后的资源在dist/或build/目录 |
| .NET | Release模式 | 编译后的DLL在bin/Release/目录 |
| Python | 可编辑安装 | 包已安装到环境中 |
| Go | 生产模式 | 编译后的二进制文件 |
| Rust | Release模式 | 优化后的二进制文件在target/release/目录 |
Step 4: Verify Build Artifacts
步骤4:验证构建产物
Confirm build outputs exist.
| Project Type | Artifact Check |
|---|---|
| Node.js | dist/ or build/ directory exists, contains files |
| .NET | DLL files in bin/Release/{framework}/ |
| Python | Package importable |
| Go | Binary executable exists |
| Rust | Binary in target/release/ |
确认构建输出存在。
| 项目类型 | 产物检查 |
|---|---|
| Node.js | dist/或build/目录存在且包含文件 |
| .NET | bin/Release/{framework}/目录下存在DLL文件 |
| Python | 包可被导入 |
| Go | 二进制可执行文件存在 |
| Rust | target/release/目录下存在二进制文件 |
Step 5: Report Results
步骤5:报告结果
Return structured results to orchestrator.
Result Structure:
| Field | Description |
|---|---|
| projectName | Name of the project |
| projectType | Detected type (nodejs, dotnet, python, etc.) |
| status | success / failed |
| duration | Build time in seconds |
| outputPath | Path to build artifacts |
| errorMessage | Error details if failed |
向编排器返回结构化结果。
结果结构:
| 字段 | 描述 |
|---|---|
| projectName | 项目名称 |
| projectType | 检测到的类型(nodejs、dotnet、python等) |
| status | success / failed |
| duration | 构建时长(秒) |
| outputPath | 构建产物路径 |
| errorMessage | 失败时的错误详情 |
Error Handling
错误处理
| Error Type | Recovery Action |
|---|---|
| Dependency restore failed | Check network, verify lock file integrity |
| Compilation errors | Log full error output, report as failed |
| Missing build tool | Report required tool installation |
| Timeout | Report timeout, suggest increasing limit |
| 错误类型 | 恢复操作 |
|---|---|
| 依赖恢复失败 | 检查网络,验证锁文件完整性 |
| 编译错误 | 记录完整错误输出,报告为失败 |
| 缺少构建工具 | 报告需要安装所需工具 |
| 超时 | 报告超时,建议增加时间限制 |
Critical Rules
关键规则
- Always restore dependencies first - builds may fail without fresh dependencies
- Use production/release mode - development builds may hide issues
- Verify artifacts exist - successful exit code is not sufficient
- Report all projects - include both successful and failed builds
- 始终先恢复依赖 - 没有最新依赖可能导致构建失败
- 使用生产/Release模式 - 开发构建可能隐藏问题
- 验证产物存在 - 仅成功退出码并不足够
- 报告所有项目 - 包含成功和失败的构建
Definition of Done
完成标准
- All project types detected
- Dependencies restored for each project
- Build executed for each project
- Artifacts verified to exist
- Results returned to orchestrator
Version: 2.0.0
Last Updated: 2026-01-10
- 已检测所有项目类型
- 已为每个项目恢复依赖
- 已为每个项目执行构建
- 已验证产物存在
- 已向编排器返回结果
Version: 2.0.0
Last Updated: 2026-01-10