Install
openclaw skills install code-hugAI驱动的软件开发工作流编排器,基于六层控制系统提供端到端项目管理能力,包含全面的代码分析、商业智能提取和智能工作流自动化。
openclaw skills install code-hugCode Hug 是一个先进的 AI 驱动的软件开发工作流编排器,提供全面的端到端项目管理能力。基于六层控制系统构建,它无缝集成了代码考古学、商业智能提取和智能工作流自动化。
# Python 依赖
pip install PyYAML requests python-dotenv
# 验证安装
python3 -c "import yaml; print('OK')"
node --version
java -version
| 工具 | 描述 | 参数 |
|---|---|---|
codehug:start_session | 启动新的工作流会话 | project_name, project_root, tech_stack |
codehug:run_stage | 执行指定阶段 | session_id, stage, context |
codehug:diagnose | 诊断构建/测试失败 | session_id, build_log, test_log |
codehug:auto_fix | 尝试自动修复问题 | session_id, problem_type, project_root |
codehug:validate | 运行集成验证 | session_id, project_root, test_cases |
codehug:get_status | 获取当前会话状态 | session_id |
codehug:extract_business_rules | 从代码库提取业务规则 | project_root, output_format |
codehug:generate_prd | 生成PRD文档 | project_root, business_context |
codehug:map_workflows | 映射业务工作流 | project_root, workflow_types |
在 ~/.openclaw/config.json 中添加:
{
"skills": {
"code-hug": {
"project_root": "/path/to/your/project",
"auto_fix_enabled": true,
"max_fix_attempts": 3,
"enable_safety_checks": true,
"enable_rollback": true,
"notification_channels": ["webchat", "email"],
"business_intelligence_enabled": true
}
}
}
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
project_root | string | 必填 | 项目根目录 |
auto_fix_enabled | boolean | true | 启用自动修复 |
max_fix_attempts | integer | 3 | 最大自动修复尝试次数 |
enable_safety_checks | boolean | true | 启用安全验证 |
enable_rollback | boolean | true | 启用回滚机制 |
notification_channels | array | ["webchat"] | 通知渠道 |
business_intelligence_enabled | boolean | true | 启用商业智能提取 |
/codehug:start_session {
"project_name": "membership-service",
"project_root": "/Users/dev/projects/membership-service",
"tech_stack": ["Java 17", "Spring Boot 3", "MySQL 8"]
}
/codehug:run_stage {
"session_id": "membership-service-001",
"stage": "requirements_analysis",
"context": {
"business_context_provided": true,
"success_metrics_defined": true,
"stakeholder_identified": true,
"extract_business_rules": true,
"generate_prd": true
}
}
/codehug:extract_business_rules {
"project_root": "/Users/dev/projects/membership-service",
"output_format": "markdown"
}
/codehug:diagnose {
"session_id": "membership-service-001",
"build_log": "[ERROR] COMPILATION ERROR: cannot find symbol...",
"test_log": ""
}
/codehug:auto_fix {
"session_id": "membership-service-001",
"problem_type": "compilation_error",
"project_root": "/Users/dev/projects/membership-service"
}
| 阶段 | 准入标准 | 准出标准 | 产出物 |
|---|---|---|---|
requirements_analysis | 业务背景、成功指标、干系人 | PRD完整性≥0.8、干系人批准、技术可行性确认 | prd.md, business_rules.json |
functional_decomposition | PRD批准、架构约束、技术栈 | 技术规格完整性≥0.9、API契约验证、数据库Schema评审 | tech_spec.md, api_contracts.json |
code_implementation | 技术规格批准、编码规范、开发环境 | 单元测试覆盖率≥80%、静态分析通过、代码评审≥0.85 | source_code/, test_coverage.json |
integration_validation | 代码批准、构建脚本、测试环境 | 构建成功、集成测试通过、冒烟测试通过 | test_results.json, integration_report.md |
deployment_preparation | 集成验证批准、部署脚本、回滚计划 | 部署包验证、生产就绪确认、监控配置 | deployment_plan.md, production_checklist.md |
| 问题类型 | 描述 | 自动修复支持 |
|---|---|---|
build_configuration | 构建配置错误(Java版本、Maven/Gradle配置) | ✅ 完全支持 |
dependency_conflict | 依赖冲突、版本不兼容 | ✅ 完全支持 |
compilation_error | 编译错误、语法错误、符号未找到 | ✅ 完全支持 |
test_failure | 单元/集成测试失败 | ⚠️ 部分支持 |
runtime_error | 运行时错误(空指针、内存溢出) | ⚠️ 建议性修复 |
environment_issue | 环境问题(权限、磁盘空间、网络) | ⚠️ 建议性修复 |
business_rule_violation | 违反提取的业务规则 | ✅ 完全支持 |
| 错误码 | 描述 | 解决方案 |
|---|---|---|
SESSION_NOT_FOUND | 会话不存在 | 验证 session_id |
STAGE_INVALID | 阶段名称无效 | 检查阶段是否在定义列表中 |
ENTRY_CRITERIA_NOT_MET | 不满足准入标准 | 验证上下文先决条件 |
EXIT_CRITERIA_NOT_MET | 不满足准出标准 | 完成所需产出物 |
AUTO_FIX_FAILED | 自动修复失败 | 查看日志,考虑手动干预 |
VALIDATION_FAILED | 集成验证失败 | 检查构建日志和测试报告 |
所有操作都会记录到审计轨迹中:
{
"timestamp": "2026-03-24T12:50:00Z",
"action": "stage_completed",
"actor": "code-hug",
"details": {
"session_id": "membership-service-001",
"stage": "requirements_analysis",
"artifact": "/path/to/prd.md",
"business_rules_extracted": true
}
}
Code Hug 与代码考古学技能无缝集成,提供:
| 版本 | 日期 | 变更 |
|---|---|---|
| 1.0.0 | 2026-03-24 | 初始发布,从 workflow-orchestrator 演化而来,增强了商业智能能力 |