ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

Task Plan: [Brief Description]

Task Plan: [Brief Description] Task Plan: [Brief Description]【免费下载链接】planning-with-filesPersistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style. Install from npm, the Claude Code plugin marketplace, or npx skills. Codex, Cursor, OpenCode, 60 agents.项目地址: https://gitcode.com/GitHub_Trending/pl/planning-with-filesUse this file as the durable roadmap for the task. Create it before complex work and keep it current as phases change.标题中的 [Brief Description] 需要替换为任务的简短描述。文档头的一句说明强调了两个核心契约任务开始前创建、随阶段变化持续更新。 ### 2. Goal目标 markdown ## Goal State the intended end result in one clear sentence. [One sentence describing the end state]Goal 要求用一句清晰的话描述最终状态。SKILL.md 的5-Question Reboot Test把目标作为恢复上下文的五大问题之一Whats the goal?其答案来源正是本节的 Goal 语句。因此 Goal 的质量直接决定 Agent 在上下文丢失后能否快速校准方向。3. Next Step下一步## Next Step Record the single action that should happen next. Update it whenever the active phase or immediate action changes. [The single next action. Update whenever phase status changes.]Next Step 记录唯一一个接下来应执行的动作并且在活动阶段或即时动作变化时必须同步更新。SKILL.md 的Critical Rules第 4 条明确要求每当阶段状态变化都要同步刷新## Next Step让它指向唯一的下一步动作。它的存在让 Agent 在每轮注入时都能立即知道该做什么而不必重新扫描整个阶段列表。4. Current Phase当前阶段## Current Phase Name the phase currently being worked on. Phase 1当前阶段只需写出正在工作的阶段名称例如Phase 1。它是5-Question Reboot Test中 Where am I? 的直接答案来源。5. Phases阶段清单## Phases Break the task into three to seven verifiable phases. Use only pending, in_progress, or complete for each status and update the value when work advances. ### Phase 1: Requirements Discovery - [ ] Understand user intent - [ ] Identify constraints and requirements - [ ] Document findings in findings.md - **Status:** in_progress ### Phase 2: Planning Structure - [ ] Define technical approach - [ ] Create project structure if needed - [ ] Document decisions with rationale - **Status:** pending ### Phase 3: Implementation - [ ] Execute the plan step by step - [ ] Write code to files before executing - [ ] Test incrementally - **Status:** pending ### Phase 4: Testing Verification - [ ] Verify all requirements met - [ ] Document test results in progress.md - [ ] Fix any issues found - **Status:** pending ### Phase 5: Delivery - [ ] Review all output files - [ ] Ensure deliverables are complete - [ ] Deliver to user - **Status:** pendingPhases 是模板中机器可读性最强的部分也是整个技能的完成度判定基础。它有两条硬性约定阶段数量3 到 7 个每个阶段都必须可验证verifiable状态词汇表严格限定为三个值pending、in_progress、complete且必须使用**Status:** value这种 Markdown 加粗行格式模板还兼容[complete]行内格式见下文解析逻辑工作推进时同步更新。默认模板预置了 5 个阶段的参考骨架需求与发现 → 规划与结构 → 实现 → 测试与验证 → 交付每个阶段内含对应的检查清单项。这些清单项是编写者的脚手架实际使用时应当替换为任务相关的具体动作。6. Key Questions关键问题## Key Questions Record important questions and replace them with answers as they are resolved. 1. [Question to answer] 2. [Question to answer]关键问题清单用于记录暂未解决的疑问并在解决后用答案替换问题本身。这一机制保证计划文件永远是最新真相的载体而不是历史疑问的堆积。7. Decisions Made决策记录## Decisions Made Record significant choices and the reason for each one. | Decision | Rationale | |----------|-----------| | | |决策记录采用两列表格决策与理由。它让后续会话甚至协作者能够理解为什么这样设计而不是只看到结果。从源码结构看这一节还承担着第二个职责——在开启PWF_INJECTsmart智能注入时注入器会专门抽取Decisions Made 的最后 3 行随计划注入上下文见 SKILL.md 的 Structure-aware injection 一节因此保持该表格的整洁与最新会直接影响注入质量。8. Errors Encountered错误记录## Errors Encountered Record each distinct error, the attempt number, and the resolution. Change the approach before retrying a failed action. | Error | Attempt | Resolution | |-------|---------|------------| | | 1 | |错误表记录每个独立的错误、尝试次数与解决方案其隐含规则是换方法再重试绝不原样重复失败动作。SKILL.md 用伪代码表达了这条铁律if action_failed: next_action ! same_action这与3-Strike 错误协议第 3 次失败后必须升级给用户共同构成错误管理闭环。9. Notes维护说明## Notes - Update phase status as work progresses: pending to in_progress to complete. - Re-read the goal and next step before major decisions. - Log errors promptly so failed approaches are not repeated.Notes 节汇总了三条维护纪律状态单向流转pending→in_progress→complete、重大决策前重读目标与下一步、及时记录错误以防重复踩坑。三、状态机与完成度判定check-complete.sh 如何解析模板task_plan.md之所以能被程序化判定是因为它的结构约定与脚本解析逻辑严格对应。仓库中的 check-complete.sh 是完成度检查的核心实现其解析策略如下统计总阶段数用grep -c ### Phase统计### Phase标题行得到TOTAL统计各状态数分别用grep -cF **Status:** complete、**Status:** in_progress、**Status:** pending统计主格式同时用grep -c \[complete\]等统计行内格式混合格式兼容两种格式按字段取较大值per-field max这样一份同时混用**Status:** pending与[in_progress]的计划也能被正确统计不会漏掉 in_progress 状态导致门禁误判无阶段保护如果完全没有### Phase标题TOTAL0脚本直接静默退出避免输出误导性的 0/0 phases complete 状态。默认advisory模式下脚本输出状态报告并始终以 0 退出——未完成不是错误这是 issue #178 的经验教训an incomplete plan is a normal state, not an error。脚本对输出报告的格式约定这些字符串同时被测试与门禁依赖[planning-with-files] ALL PHASES COMPLETE (5/5). If the user has additional work, add new phases to task_plan.md before starting. [planning-with-files] Task in progress (2/5 phases complete). Update progress.md before stopping. [planning-with-files] 1 phase(s) still in progress. [planning-with-files] 2 phase(s) pending.--gate门禁模式在 5 个守卫全部通过时才会输出{decision:block,...}JSON 阻止停止详见第四节。仓库中的 test_check_complete_resolver.py 与 test_gate.py 对解析与门禁逻辑做了系统验证。四、从模板到可用计划init-session.sh 的三种初始化路径init-session.sh 负责把模板实例化为可用的规划文件。它的完整用法如下./init-session.sh # legacy: root-level task_plan.md, findings.md, progress.md ./init-session.sh [--template TYPE] # legacy with template choice ./init-session.sh Backend Refactor # slug mode: .planning/date-backend-refactor/ ./init-session.sh --plan-dir # slug mode with auto-generated untitled-short name ./init-session.sh --plan-dir Quick Spike # slug mode, explicit slug ./init-session.sh --autonomous Long Run # v3 autonomous mode (opt-in): .mode nonce auto-attest ./init-session.sh --gated Gated Run # v3 gated mode (opt-in, implies autonomous): adds Stop-gate marker三种路径的区别Legacy 根目录模式零位置参数在项目根目录直接生成task_plan.md、findings.md、progress.md三个文件保持 v1.x 的向后兼容行为Slug 并行计划模式传入任务名或--plan-dir在.planning/YYYY-MM-DD-slug/下创建隔离计划目录并把计划 ID 写入.planning/.active_plan供 resolve-plan-dir.sh 解析。脚本会打印PLAN_ID2026-09-05-backend-refactor之类的 ID用于后续export PLAN_ID...固定会话v3 模式--autonomous/--gated在计划目录写入.mode标记gated 会写入autonomous gate两个 token、生成 16 位十六进制.nonce用于定界符防混淆、重置.stop_blocks门禁计数器、并自动对计划做 SHA-256 公证。脚本的 slug 化函数slugify会把任务名转为小写、非字母数字字符转连字符、折叠重复连字符、截断到 40 字符遇到重名目录时自动追加-2、-3后缀。模板选择支持default与analytics两种见 templates/analytics_task_plan.md传入其他值会回退到默认模板并给出提示。初始化完成后脚本会打印固定会话的方法export PLAN_ID2026-09-05-backend-refactor # 在启动 Agent 的终端中设置【免费下载链接】planning-with-filesPersistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style. Install from npm, the Claude Code plugin marketplace, or npx skills. Codex, Cursor, OpenCode, 60 agents.项目地址: https://gitcode.com/GitHub_Trending/pl/planning-with-files创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表