
Success Criteria:【免费下载链接】humanlayerThe best way to get AI coding agents to solve hard problems in complex codebases.项目地址: https://gitcode.com/GitHub_Trending/hu/humanlayerAutomated Verification:Database migration runs successfully:make migrateAll unit tests pass:go test ./...No linting errors:golangci-lint runAPI endpoint returns 200:curl localhost:8080/api/new-endpointManual Verification:New feature appears correctly in the UIPerformance is acceptable with 1000 itemsError messages are user-friendlyFeature works correctly on mobile devices模板还在每阶段末尾固定放置一条**实现暂停点** **Implementation Note**: After completing this phase and all automated verification passes, pause here for manual confirmation from the human that the manual testing was successful before proceeding to the next phase. 这条约定与 [implement_plan.md](https://link.gitcode.com/i/c620b112bea266a3a40ebc086b11b147) 中的执行协议完全呼应——实现方完成一阶段的自动化验证后必须暂停并通知人类进行手动测试得到确认后才进入下一阶段。计划文档与执行命令之间形成了闭环约束。 ## 七、Step 5同步与评审Sync and Review 计划写完后并非结束还需要同步与迭代 1. **同步 thoughts 目录**在 [create_plan.md](https://link.gitcode.com/i/f4814785a7ebf7cb63242fd4f5a8b539) 中明确为 humanlayer thoughts sync通用版 create_plan_generic.md 则保留了该步骤但说明确保计划被正确索引和可用[create_plan_nt.md](https://link.gitcode.com/i/329dfd84cc1e450b93511f0c85ce03db) 是不做同步的变体 2. **展示草稿位置**并请用户评审阶段范围是否恰当、成功标准是否足够具体、技术细节是否需要调整、是否遗漏边界情况 3. **基于反馈迭代**随时准备增删阶段、调整技术方案、澄清成功标准自动化/手动、增删范围项直到用户满意。 ### 源码佐证humanlayer thoughts sync 到底做了什么 [hlyr/src/commands/thoughts/sync.ts](https://link.gitcode.com/i/6c3ddf0d64e1ec2a8029a7e482e8073c) 给出了该命令的真实实现可以印证同步的具体语义 - syncThoughts()第 32-99 行对 thoughts 仓库执行 git add -A → 有变更则 git commit默认消息为 Sync thoughts - ISO时间→ git pull --rebase若检测到合并冲突会提示用户手动解决后 git rebase --continue→ 若配置了 remote 则 git push失败仅告警不中断 - createSearchDirectory()第 101-196 行在 thoughts/searchable/ 下创建**硬链接索引**递归穿透符号链接用 visited 集合防环跳过隐藏文件与 CLAUDE.md为 AI 搜索建立可检索目录 - 入口 thoughtsSyncCommand()先校验配置与 thoughts/ 目录存在再按 profile 解析 thoughts 仓库路径执行同步。 配合 [hlyr/THOUGHTS.md](https://link.gitcode.com/i/9930a902dce0d502f698ecc823eb1839) 中的说明可知thoughts 系统通过 pre-commit hook 防止 thoughts/ 被误提交进代码仓库、post-commit hook 自动同步变更——计划文档存放在独立 git 仓库并通过符号链接映射进代码仓库既避免私有思考被误提交又让 AI 助手可以像读取本地文件一样检索。 ## 八、六条重要指南Important Guidelines 命令用六条原则约束计划制定者的行为这六条决定了计划质量的上限 1. **Be Skeptical保持怀疑**质疑模糊需求尽早识别潜在问题多问为什么和那……呢不要假设——用代码验证 2. **Be Interactive保持交互**不要一次性写完整个计划在每个关键步骤获得认可允许中途纠偏协作式推进 3. **Be Thorough保持彻底**规划前完整阅读所有上下文文件用并行子任务研究真实代码模式包含具体文件路径与行号写出可度量的、区分自动化/手动的成功标准自动化步骤优先用 make如 make -C humanlayer-wui check 而非 cd humanlayer-wui bun run fmt 4. **Be Practical保持务实**聚焦增量、可测试的变更考虑迁移与回滚思考边界情况包含What were NOT doing 5. **Track Progress跟踪进度**用 TodoWrite 跟踪规划任务随研究进展更新 6. **No Open Questions in Final Plan最终计划不允许有悬而未决的问题**规划中遇到未决问题必须立即停下研究或澄清绝不允许带着未解决疑问写计划——每项决策都必须在定稿前做出计划必须完整且可执行。 ## 九、常见模式与子任务派发最佳实践 ### 9.1 三类典型任务的实施顺序模式 - **数据库变更**先做 schema/migration → 添加 store 方法 → 更新业务逻辑 → 通过 API 暴露 → 更新客户端 - **新功能**先研究既有模式 → 从数据模型开始 → 构建后端逻辑 → 添加 API 端点 → 最后实现 UI - **重构**记录当前行为 → 规划增量变更 → 保持向后兼容 → 包含迁移策略。 这些模式与仓库的实际结构高度一致humanlayer 的后端hld/大量使用 Go SQLite 存储见 [hld/store/sqlite.go](https://link.gitcode.com/i/19de952e069f170b41094d63df886470) 与 [hld/store/migration_test.go](https://link.gitcode.com/i/771040221e28d40287372f3ebcaf12ff)改动顺序按存储层 → 业务逻辑 → API → 客户端推进正是数据库变更模式的现实映射。 ### 9.2 子任务派发的八条最佳实践 1. 并行派发多个任务以提高效率 2. 每个任务聚焦单一领域 3. 提供详细指令具体搜索什么、聚焦哪些目录、提取什么信息、期望什么输出格式 4. 目录要**极其具体**在提示词中包含完整路径上下文例如提到 WUI 就指定 humanlayer-wui/ 目录提到 daemon 就指定 hld/ 目录禁止用泛化的UI指代WUI 5. 指定只读工具 6. 要求响应中携带具体 file:line 引用 7. 等待所有任务完成后再综合 8. **验证子任务结果**若返回意外结果派发后续任务跟进并与真实代码库交叉核对不接受看似错误的结论。 命令还给出了并行派发的示例代码骨架 python # Spawn these tasks concurrently: tasks [ Task(Research database schema, db_research_prompt), Task(Find API patterns, api_research_prompt), Task(Investigate UI components, ui_research_prompt), Task(Check test patterns, test_research_prompt) ]十、完整示例交互流程Example Interaction Flow命令以一个真实可感的对话示例收束整个流程完整还原了命令调用 → 读取文件 → 基于证据提问 → 交互推进的节奏User: /implementation_plan Assistant: Ill help you create a detailed implementation plan... User: We need to add parent-child tracking for Claude sub-tasks. See thoughts/allison/tickets/eng_1478.md Assistant: Let me read that ticket file completely first... [Reads file fully] Based on the ticket, I understand we need to track parent-child relationships for Claude sub-task events in the daemon. Before I start planning, I have some questions... [Interactive process continues...]【免费下载链接】humanlayerThe best way to get AI coding agents to solve hard problems in complex codebases.项目地址: https://gitcode.com/GitHub_Trending/hu/humanlayer创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考