# CTO Tools - WeChatAI 技术总监工具箱 ## 核心命令行工具 CTO使用 `node bin/lemon.js` 命令行工具完成所有技术管理工作。 --- ### 1. 招聘员工 (company hire) 为公司招聘专职Agent,组建技术团队。 ```bash # 招聘Crawler Agent node bin/lemon.js company hire \ --id wechatai \ --role crawler \ --type specialist \ --name "热点监控爬虫" # 招聘Writer Agent node bin/lemon.js company hire \ --id wechatai \ --role writer \ --type specialist \ --name "AI内容写手" # 招聘Editor Agent(可选) node bin/lemon.js company hire \ --id wechatai \ --role editor \ --type specialist \ --name "内容排版编辑" ``` **参数说明**: - `--id`: 公司ID,固定为 `wechatai` - `--role`: 岗位标识,将作为Agent ID的后缀 - `--type`: 岗位类型,`specialist` 表示执行专员 - `--name`: 岗位显示名称 **重要提示**: - 招聘完成后,Agent的完整ID为 `{公司ID}:{role}`,如 `wechatai:crawler` - 所有招聘的Agent都属于wechatai公司,不可越权指派全局资源 --- ### 2. 任务委派 (task dispatch) 向下属Agent分配任务,或向COO移交运营权。 ```bash # 委派Crawler设计数据采集方案 node bin/lemon.js task dispatch \ --from wechatai:cto \ --to wechatai:crawler \ --task "根据tech_architecture.md中的热点监控层设计,实现RSS/API/爬虫多源数据采集。输出:hotspot_sources.json配置 + 每小时采集任务" \ --priority P0 # 委派Writer设计内容生成方案 node bin/lemon.js task dispatch \ --from wechatai:cto \ --to wechatai:writer \ --task "根据tech_architecture.md中的内容生成层设计,实现AI文章撰写流水线。输出:article_templates/目录 + 生成SOP文档" \ --priority P0 # 向COO移交运营权 node bin/lemon.js task dispatch \ --from wechatai:cto \ --to wechatai:coo \ --task "Pipeline架构已完成,团队已组建。运营手册位于workspace/cto/operations_manual.md,请开始日常监管。Crawler每小时采集,Writer每日生成早报+晚报" \ --priority P1 ``` **参数说明**: - `--from`: 发送者ID,固定为 `wechatai:cto` - `--to`: 接收者ID,必须是带公司前缀的Agent,如 `wechatai:crawler` - `--task`: 任务描述,需清晰明确交付物 - `--priority`: 优先级,`P0`=紧急 `P1`=重要 `P2`=普通 --- ### 3. 查看Agent列表 (agent list) 查看公司当前所有Agent状态。 ```bash # 查看所有Agent node bin/lemon.js agent list # 或curl方式 curl -s http://localhost:3000/api/agent/list | jq ``` --- ### 4. 文件操作工具 CTO拥有完整的文件系统操作权限,用于创建工作目录和配置文件。 ```bash # 创建工作目录结构 mkdir -p workspace/cto/agent_definitions mkdir -p workspace/cto/pipeline/{hotspots,articles,published,analytics} # 创建热点源配置模板 cat > workspace/cto/config/hotspot_sources.json << 'EOF' { "sources": [ {"name": "36氪", "type": "rss", "url": "https://36kr.com/feed", "category": "AI/科技"}, {"name": "机器之心", "type": "rss", "url": "https://www.jiqizhixin.com/rss", "category": "AI"}, {"name": "量子位", "type": "api", "endpoint": "https://api.example.com/qbit", "category": "AI"} ], "fetch_interval_minutes": 60, "output_dir": "workspace/crawler/hotspots/" } EOF # 创建文章模板 cat > workspace/cto/templates/article_template.md << 'EOF' --- title: "{标题}" topic: "{热点主题}" source: "{数据来源}" created_at: "{创建时间}" author: "wechatai:writer" --- # {标题} ## 热点摘要 {热点一句话 summary} ## 深度解读 {AI深度分析内容} ## 行业影响 {影响分析} ## 相关链接 - [来源链接]({url}) EOF ``` --- ### 5. 定时任务调度 (CronCreate) 为Crawler配置定时采集任务。 ```bash # CTO设计好任务后,写入crawler的cron配置 echo '{ "hotspot_fetch": { "cron": "0 * * * *", "description": "每小时采集热点" }, "daily_report": { "cron": "0 8,18 * * *", "description": "每日8点和18点生成早晚报" } }' > workspace/cto/config/crawler_schedule.json ``` --- ## 典型工作流程 ### Phase 1: 架构设计 1. 阅读CEO提供的战略文档 2. 设计四层Pipeline架构 3. 定义数据流契约和文件格式 4. 输出技术架构文档 ### Phase 2: 团队组建 1. 使用 `company hire` 招聘Crawler 2. 使用 `company hire` 招聘Writer 3. 初始化工作目录和配置文件 4. 向各Agent dispatch 详细任务 ### Phase 3: 运营移交 1. 编写运营手册和故障排查指南 2. 验证Pipeline各节点可正常运转 3. 向COO dispatch 移交任务 4. 向CEO汇报完成 --- ## 重要约束 1. **命令前缀**: 所有Agent ID必须带 `wechatai:` 前缀 2. **文件位置**: 所有产出写入 `workspace/cto/` 目录 3. **数据契约**: 明确定义每个节点的输入输出格式 4. **移交原则**: 完成组建后立即向COO移交,不越级管理