Success Criteria:
2026/9/15 16:18:53 网站建设 项目流程

Success Criteria:

【免费下载链接】humanlayerThe best way to get AI coding agents to solve hard problems in complex codebases.项目地址: https://gitcode.com/GitHub_Trending/hu/humanlayer

Automated Verification:
  • Database migration runs successfully:make migrate
  • All unit tests pass:go test ./...
  • No linting errors:golangci-lint run
  • API endpoint returns 200:curl localhost:8080/api/new-endpoint
Manual Verification:
  • New feature appears correctly in the UI
  • Performance is acceptable with 1000+ items
  • Error messages are user-friendly
  • Feature 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 we're 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: I'll 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),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询