ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

TaskMaster Autonomous Workflow

2026/9/10 12:41:48 拓冰建站 浏览量
TaskMaster Autonomous Workflow TaskMaster Autonomous Workflow【免费下载链接】claude-task-masterAn AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.项目地址: https://gitcode.com/GitHub_Trending/cl/claude-task-masterWhen working on tasks withtm autopilot:Start workflow:tm autopilot start taskIdLoop until complete:# Get next action NEXT$(tm autopilot next --json) ACTION$(echo $NEXT | jq -r .action) SUBTASK$(echo $NEXT | jq -r .subtask.id) case $ACTION in red) # 1. Generate tests based on instructions # 2. Write test files # 3. Run tests yourself (you know the test command) npm test # or pytest, go test, cargo test, etc. # 4. Report results to TaskMaster tm autopilot complete red $SUBTASK --resultsfailed:3,passed:0 ;; green) # 1. Implement code to pass tests # 2. Write implementation files # 3. Run tests yourself npm test # 4. Report results to TaskMaster (include coverage if available) tm autopilot complete green $SUBTASK --resultspassed:3,failed:0 --coverage92 ;; commit) # TaskMaster handles git operations tm autopilot commit $SUBTASK ;; complete) echo Workflow complete! ;; esacState is preserved- you can stop/resume anytime withtm autopilot resumeImportant:You are responsible for:Running test commands (TaskMaster doesnt know your test framework)Parsing test output (passed/failed counts)Reporting accurate resultsVia MCP:Useautopilot_*tools for the same workflow with better integration.### 13.1 示例 AI 智能体提示词 markdown You are working autonomously on Task Master tasks using the autopilot workflow. Instructions: 1. Call tm autopilot next --json to get your next action 2. Read the action type and context 3. Execute the action: - **RED**: * Generate tests that fail initially * Run tests: npm test (or appropriate test command) * Report: tm autopilot complete red id --resultsfailed:n,passed:n - **GREEN**: * Implement code to pass the tests * Run tests: npm test * Report: tm autopilot complete green id --resultspassed:n,failed:n --coveragenn - **COMMIT**: * Call: tm autopilot commit id (TaskMaster handles git) 4. Repeat until action is complete Always: - Follow TDD principles (RED → GREEN → COMMIT) - YOU run the tests (TaskMaster doesnt know test frameworks) - Report accurate test results (passed/failed counts) - Write minimal code to pass tests - Check tm autopilot status if unsure of current state You are responsible for: - Knowing which test command to run (npm test, pytest, go test, etc.) - Parsing test output to get pass/fail counts - Understanding the projects testing framework - Running tests after generating/implementing code TaskMaster is responsible for: - Validating your reported results make sense (RED should fail, GREEN should pass) - Creating properly formatted git commits - Managing workflow state and transitions ## 十四、配置与 .gitignore ### 14.1 .taskmaster/config.json版本化 json { autopilot: { enabled: true, requireCleanWorkingTree: true, commitTemplate: {type}({scope}): {msg} (task {taskId}), defaultCommitType: feat, maxGreenAttempts: 3, testTimeout: 300000, storage: { location: global, basePath: ~/.taskmaster } }, test: { runner: auto, coverageThresholds: { lines: 80, branches: 80, functions: 80, statements: 80 }, targetedRunPattern: **/*.test.js }, git: { branchPattern: {tag}/task-{id}-{slug}, defaultRemote: origin } } 参数要点requireCleanWorkingTree 控制启动前是否强制要求工作区干净commitTemplate 定义提交信息模板与 [template-engine.ts](https://link.gitcode.com/i/022f58902ecd725d30984b0b90ba7ed0) 配合maxGreenAttempts 是 GREEN 相位最大重试次数coverageThresholds 的四维阈值行 / 分支 / 函数 / 语句默认 80%与 TestResultValidator 的 validateCoverage 逻辑一一对应storage.basePath 指定全局存储根目录。配置管理相关实现可参考 [config-manager.ts](https://link.gitcode.com/i/8e6b962b3ae187ff65ac8e11b6aadb0d) 与 [config-loader.service.ts](https://link.gitcode.com/i/f5295a65096cd09d753c7ef144dfc58a)。 ### 14.2 更新 .gitignore保持项目干净 gitignore # TaskMaster runtime artifacts (stored globally, not needed in repo) .taskmaster/state/ .taskmaster/reports/ # Keep these versioned !.taskmaster/tasks/ !.taskmaster/config.json !.taskmaster/docs/ !.taskmaster/templates/【免费下载链接】claude-task-masterAn AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.项目地址: https://gitcode.com/GitHub_Trending/cl/claude-task-master创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考