在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用概览
配置文件读取和验证技能,确保用户配置正确且完整
安装命令
npx skills add https://github.com/konglong87/enjoy_harness_ai --skill harness-config复制此命令并粘贴到 Claude Code 中以安装该技能
星标0
分支0
更新时间2026年4月1日 08:21
SKILL.md
readonly配置文件读取和验证技能,确保用户配置正确且完整
npx skills add https://github.com/konglong87/enjoy_harness_ai --skill harness-config复制此命令并粘贴到 Claude Code 中以安装该技能
EnjoyHarness 唯一强制入口,初始化全局状态、文件体系、技能注册表
全流程自动执行超级组合技能,编排所有16个基础技能,从用户需求到完整交付的全自动化流程
头脑风暴技能,在实现前探索用户意图、需求和设计,防止返工
实施计划执行技能,逐任务执行实施计划,支持检查点、错误恢复和进度跟踪
10倍产能提效超级组合技能,通过并行执行、智能调度、优化策略实现10倍开发效率提升
构建≤60行的核心规则清单,从源头避免Agent行为跑偏
| name | harness-config |
| description | 配置文件读取和验证技能,确保用户配置正确且完整 |
| trigger_words | ["config","配置","configuration"] |
| priority | HIGHEST |
| dependencies | [] |
| version | v1.0.0 |
.EnjoyHarness/CONFIG.md使用 Bash 工具执行:
if [ ! -f ".EnjoyHarness/CONFIG.md" ]; then
echo ""
echo "❌ 错误: 未找到配置文件 .EnjoyHarness/CONFIG.md"
echo ""
echo "💡 请执行以下操作:"
echo ""
echo "1. 复制示例配置文件:"
echo " cp docs/examples/CONFIG.example.md .EnjoyHarness/CONFIG.md"
echo ""
echo "2. 编辑配置文件,设置你的 claude_command:"
echo " nano .EnjoyHarness/CONFIG.md"
echo ""
echo "3. 重新运行此技能"
echo ""
exit 1
fi
echo "✅ 配置文件存在"
使用 Read 工具读取:.EnjoyHarness/CONFIG.md
检查必填项:
检查项 1: claude_command
CLAUDE_CMD=$(grep "^claude_command:" .EnjoyHarness/CONFIG.md | sed 's/claude_command: *//' | tr -d '"' | tr -d "'")
if [ -z "$CLAUDE_CMD" ]; then
echo ""
echo "❌ 错误: 配置文件缺少必填项 'claude_command'"
echo ""
echo "💡 请在 .EnjoyHarness/CONFIG.md 中添加:"
echo ""
echo " claude_command: \"你的实际命令\""
echo ""
echo "示例:"
echo " claude_command: \"ccc\""
echo " claude_command: \"claude\""
echo " claude_command: \"/usr/local/bin/claude\""
echo ""
exit 1
fi
echo "✅ claude_command: $CLAUDE_CMD"
检查项 2: tasks_per_session
TASKS_PER_SESSION=$(grep "^tasks_per_session:" .EnjoyHarness/CONFIG.md | sed 's/tasks_per_session: *//')
if [ -z "$TASKS_PER_SESSION" ]; then
echo ""
echo "❌ 错误: 配置文件缺少必填项 'tasks_per_session'"
echo ""
echo "💡 请在 .EnjoyHarness/CONFIG.md 中添加:"
echo ""
echo " tasks_per_session: 5"
echo ""
echo "建议值: 3-10"
echo " - 简单任务: 8-10"
echo " - 复杂任务: 3-5"
echo ""
exit 1
fi
# 验证数值范围
if ! [[ "$TASKS_PER_SESSION" =~ ^[0-9]+$ ]] || [ "$TASKS_PER_SESSION" -lt 1 ] || [ "$TASKS_PER_SESSION" -gt 100 ]; then
echo ""
echo "❌ 错误: tasks_per_session 的值无效: $TASKS_PER_SESSION"
echo ""
echo "💡 请设置为 1-100 之间的整数"
echo " 示例: tasks_per_session: 5"
echo ""
exit 1
fi
echo "✅ tasks_per_session: $TASKS_PER_SESSION"
检查项 3: 用户身份信息
USER_NAME=$(grep "^user_name:" .EnjoyHarness/CONFIG.md | sed 's/user_name: *//' | tr -d '"' | tr -d "'")
USER_PHONE=$(grep "^user_phone:" .EnjoyHarness/CONFIG.md | sed 's/user_phone: *//' | tr -d '"' | tr -d "'")
USER_EMAIL=$(grep "^user_email:" .EnjoyHarness/CONFIG.md | sed 's/user_email: *//' | tr -d '"' | tr -d "'")
if [ -z "$USER_NAME" ]; then
USER_NAME="$(git config user.name 2>/dev/null || true)"
fi
if [ -z "$USER_EMAIL" ]; then
USER_EMAIL="$(git config user.email 2>/dev/null || true)"
fi
if [ -z "$USER_NAME" ] || [ -z "$USER_EMAIL" ]; then
echo ""
echo "❌ 错误: 用户身份信息不完整"
echo ""
echo "💡 请在 .EnjoyHarness/CONFIG.md 中添加:"
echo " user_name: \"你的姓名\""
echo " user_email: \"your@email.com\""
echo " user_phone: \"你的手机号\"(可选)"
echo ""
echo "或者先配置 git identity:"
echo " git config user.name \"你的姓名\""
echo " git config user.email \"your@email.com\""
echo ""
exit 1
fi
echo "✅ user_name: $USER_NAME"
echo "✅ user_phone: ${USER_PHONE:-未配置}"
echo "✅ user_email: $USER_EMAIL"
读取高级配置(可选):
# Token 使用率阈值(默认 60%)
TOKEN_THRESHOLD=$(grep "^token_threshold:" .EnjoyHarness/CONFIG.md | sed 's/token_threshold: *//' | tr -d '%')
if [ -z "$TOKEN_THRESHOLD" ]; then
TOKEN_THRESHOLD=60
echo "ℹ️ token_threshold: 使用默认值 $TOKEN_THRESHOLD%"
else
echo "✅ token_threshold: $TOKEN_THRESHOLD%"
fi
# 任务复杂度阈值(默认 6)
TASK_COMPLEXITY=$(grep "^task_complexity_threshold:" .EnjoyHarness/CONFIG.md | sed 's/task_complexity_threshold: *//')
if [ -z "$TASK_COMPLEXITY" ]; then
TASK_COMPLEXITY=6
echo "ℹ️ task_complexity_threshold: 使用默认值 $TASK_COMPLEXITY"
else
echo "✅ task_complexity_threshold: $TASK_COMPLEXITY"
fi
# 连续任务数上限(默认 5)
CONSECUTIVE_LIMIT=$(grep "^consecutive_tasks_limit:" .EnjoyHarness/CONFIG.md | sed 's/consecutive_tasks_limit: *//')
if [ -z "$CONSECUTIVE_LIMIT" ]; then
CONSECUTIVE_LIMIT=5
echo "ℹ️ consecutive_tasks_limit: 使用默认值 $CONSECUTIVE_LIMIT"
else
echo "✅ consecutive_tasks_limit: $CONSECUTIVE_LIMIT"
fi
# 错误率阈值(默认 30%)
ERROR_RATE=$(grep "^error_rate_threshold:" .EnjoyHarness/CONFIG.md | sed 's/error_rate_threshold: *//' | tr -d '%')
if [ -z "$ERROR_RATE" ]; then
ERROR_RATE=30
echo "ℹ️ error_rate_threshold: 使用默认值 $ERROR_RATE%"
else
echo "✅ error_rate_threshold: $ERROR_RATE%"
fi
# 绝对上限(默认 10)
ABSOLUTE_LIMIT=$(grep "^absolute_limit:" .EnjoyHarness/CONFIG.md | sed 's/absolute_limit: *//')
if [ -z "$ABSOLUTE_LIMIT" ]; then
ABSOLUTE_LIMIT=10
echo "ℹ️ absolute_limit: 使用默认值 $ABSOLUTE_LIMIT"
else
echo "✅ absolute_limit: $ABSOLUTE_LIMIT"
fi
# brainstorm 用户参与开关(默认 false)
BRAINSTORM_USER_PARTICIPATION=$(grep "^brainstorm_user_participation:" .EnjoyHarness/CONFIG.md | sed 's/brainstorm_user_participation: *//' | tr -d '"' | tr -d "'")
if [ -z "$BRAINSTORM_USER_PARTICIPATION" ]; then
BRAINSTORM_USER_PARTICIPATION=false
echo "ℹ️ brainstorm_user_participation: 使用默认值 $BRAINSTORM_USER_PARTICIPATION"
elif [ "$BRAINSTORM_USER_PARTICIPATION" != "true" ] && [ "$BRAINSTORM_USER_PARTICIPATION" != "false" ]; then
echo ""
echo "❌ 错误: brainstorm_user_participation 的值无效: $BRAINSTORM_USER_PARTICIPATION"
echo ""
echo "💡 请设置为 true 或 false"
echo " 示例: brainstorm_user_participation: false"
echo ""
exit 1
else
echo "✅ brainstorm_user_participation: $BRAINSTORM_USER_PARTICIPATION"
fi
# 检查用户配置的命令是否存在
if ! command -v "$CLAUDE_CMD" &> /dev/null; then
echo ""
echo "❌ 错误: 命令 '$CLAUDE_CMD' 不存在或不可执行"
echo ""
echo "💡 请检查:"
echo " 1. 命令是否正确(区分大小写)"
echo " 2. 命令是否已安装"
echo " 3. 如果是 alias,请确认当前 shell 环境中有定义"
echo ""
echo "验证方法:"
echo " which $CLAUDE_CMD"
echo " type $CLAUDE_CMD"
echo ""
exit 1
fi
echo "✅ 命令验证通过: $CLAUDE_CMD"
使用 Write 工具创建:.EnjoyHarness/CONFIG_VALIDATION_REPORT.md
内容:
---
validated_at: {TIMESTAMP}
status: SUCCESS
---
# 配置验证报告
## 验证时间
{TIMESTAMP}
## 核心配置
- ✅ claude_command: `{CLAUDE_CMD}`
- ✅ tasks_per_session: `{TASKS_PER_SESSION}`
## 高级配置
- ✅ token_threshold: `{TOKEN_THRESHOLD}%`
- ✅ task_complexity_threshold: `{TASK_COMPLEXITY}`
- ✅ consecutive_tasks_limit: `{CONSECUTIVE_LIMIT}`
- ✅ error_rate_threshold: `{ERROR_RATE}%`
- ✅ absolute_limit: `{ABSOLUTE_LIMIT}`
- ✅ user_name: `{USER_NAME}`
- ✅ user_phone: `{USER_PHONE}`
- ✅ user_email: `{USER_EMAIL}`
- ✅ brainstorm_user_participation: `{BRAINSTORM_USER_PARTICIPATION}`
## 命令验证
- ✅ 命令可用: `{CLAUDE_CMD}`
## 验证结果
✅ **配置验证通过**
所有配置项已验证,系统已准备就绪。
echo ""
echo "✅ 配置验证完成"
echo ""
echo "📋 配置摘要:"
echo " - Claude 命令: $CLAUDE_CMD"
echo " - 任务切换阈值: $TASKS_PER_SESSION 个任务"
echo " - Token 阈值: $TOKEN_THRESHOLD%"
echo " - 复杂度阈值: $TASK_COMPLEXITY"
echo " - 连续任务上限: $CONSECUTIVE_LIMIT"
echo " - 错误率阈值: $ERROR_RATE%"
echo " - 绝对上限: $ABSOLUTE_LIMIT 个任务"
echo " - 用户姓名: $USER_NAME"
echo " - 用户手机: ${USER_PHONE:-未配置}"
echo " - 用户邮箱: $USER_EMAIL"
echo " - brainstorm 用户参与: $BRAINSTORM_USER_PARTICIPATION"
echo ""
echo "📁 详细报告: .EnjoyHarness/CONFIG_VALIDATION_REPORT.md"
echo ""
处理方式:提示用户创建配置文件,提供示例路径
处理方式:明确提示缺少哪个配置项,提供正确格式示例
处理方式:提示验证命令是否正确,提供验证方法
用户执行: harness-config
AI 输出:
❌ 错误: 未找到配置文件 .EnjoyHarness/CONFIG.md
💡 请执行以下操作:
1. 复制示例配置文件:cp docs/examples/CONFIG.example.md .EnjoyHarness/CONFIG.md
2. 编辑配置文件:nano .EnjoyHarness/CONFIG.md
3. 重新运行此技能
用户执行: harness-config
AI 输出:
✅ 配置文件存在
✅ claude_command: ccc
✅ tasks_per_session: 5
✅ 命令验证通过: ccc
✅ 配置验证完成
📋 配置摘要:
- Claude 命令: ccc
- 任务切换阈值: 5 个任务
- Token 阈值: 60%
- 复杂度阈值: 6
- 连续任务上限: 5
- 错误率阈值: 30%
- 绝对上限: 10 个任务
📁 详细报告: .EnjoyHarness/CONFIG_VALIDATION_REPORT.md