#!/bin/bash
# 极简任务创建脚本

if [ -z "$1" ]; then
  echo "使用方法: ./create_task_simple.sh \"任务描述\""
  echo "例如: ./create_task_simple.sh \"整合选股报告\""
  exit 1
fi

TASK_ID="TASK-$(date +%Y%m%d%H%M%S)"
TASK_FILE="management/tasks/pending/${TASK_ID}.md"

echo "# 任务ID: $TASK_ID" > "$TASK_FILE"
echo "# 状态: pending" >> "$TASK_FILE"
echo "# 创建时间: $(date '+%Y-%m-%d %H:%M:%S')" >> "$TASK_FILE"
echo "# 负责人: " >> "$TASK_FILE"
echo "" >> "$TASK_FILE"
echo "## 任务需求" >> "$TASK_FILE"
echo "$1" >> "$TASK_FILE"

echo "✅ 任务创建成功"
echo "📋 任务ID: $TASK_ID"
echo "📄 文件位置: $TASK_FILE"

echo ""
echo "## 使用方法"
echo "1. 主公创建任务: ./create_task_simple.sh \"任务描述\""
echo "2. 诸葛亮分配任务: ./assign_task_simple.sh TASK-XXXX 负责人"
echo "3. Agent自动接收并执行任务"