Loading...
Loading...
Compare original and translation side by side
❌ BEFORE (vague):
- [ ] Add error handling
✅ AFTER (precise):
- [ ] Task 1: Add ConnectionError and TimeoutError handling to ClaudeAgentClient.query()
- Retry 3 times with exponential backoff (1s, 2s, 4s)
- Raise AgentConnectionError after retries exhausted
- Location: src/temet_run/agent/client.py:ClaudeAgentClient.query
- Verify: pytest tests/unit/agent/test_client.py passes❌ 之前(模糊):
- [ ] 添加错误处理
✅ 之后(精确):
- [ ] 任务1:为ClaudeAgentClient.query()添加ConnectionError和TimeoutError处理
- 采用指数退避策略重试3次(间隔1秒、2秒、4秒)
- 重试耗尽后抛出AgentConnectionError
- 位置:src/temet_run/agent/client.py:ClaudeAgentClient.query
- 验证:执行pytest tests/unit/agent/test_client.py并通过| Component | Description | Example |
|---|---|---|
| Specific | What exactly to do | "Add retry logic to |
| Measurable | How to verify completion | "Tests pass, mypy clean" |
| Actionable | Clear first step | "Create file |
| Referenced | File paths, functions, classes | "in |
| Testable | Success criteria | "3 retries with exponential backoff, circuit breaker after 5 failures" |
| +Context | Why this matters (optional) | "Needed for ADR-016 conversation persistence" |
| 组成部分 | 说明 | 示例 |
|---|---|---|
| S具体性 | 明确要做的具体内容 | "为 |
| M可衡量性 | 如何验证任务完成 | "测试通过,mypy检查无问题" |
| A可操作性 | 明确第一步动作 | "创建文件 |
| R可溯源性 | 文件路径、函数、类 | "位于 |
| T可测试性 | 成功标准 | "3次指数退避重试,5次失败后触发断路器" |
| +上下文 | 任务的意义(可选) | "为ADR-016对话持久化需求而设计" |
- [ ] Task N: [ACTION VERB] [SPECIFIC TARGET] [SUCCESS CRITERIA]
Location: [file paths or module names]
Verify: [how to confirm completion]- [ ] Task 1: Add ConversationError exception hierarchy to agent/errors.py
- Create: ConversationError(base), MessageError, StateError
- Location: src/temet_run/agent/errors.py
- Verify: mypy passes, errors importable from temet_run.agent- [ ] 任务N:[动作动词] [具体目标] [成功标准]
位置:[文件路径或模块名]
验证:[确认完成的方式]- [ ] 任务1:为agent/errors.py添加ConversationError异常层级
- 创建:ConversationError(基类)、MessageError、StateError
- 位置:src/temet_run/agent/errors.py
- 验证:mypy检查通过,错误可从temet_run.agent导入pytest pathmypy src/uv run temet-run ...pytest 路径mypy src/uv run temet-run ...| ❌ Forbidden Pattern | ✅ Precise Alternative |
|---|---|
| "Implement the feature" | "Implement X method in Y class with Z behavior" |
| "Add tests" | "Add unit tests for X covering cases A, B, C" |
| "Fix the bug" | "Fix TypeError in X:line Y caused by Z" |
| "Update the code" | "Update X function to accept Y parameter" |
| "Handle errors" | "Add try/except for ConnectionError in X, retry 3 times" |
| "Refactor" | "Extract X logic from Y into new Z class" |
| "Improve performance" | "Reduce X function runtime from 500ms to <100ms by caching Y" |
| "Add logging" | "Add structlog info-level logging to X function for events A, B, C" |
| "Document the code" | "Add Google-style docstring to X function with Args, Returns, Raises" |
| ❌ 禁用表述 | ✅ 精确替代方案 |
|---|---|
| "实现该功能" | "在Y类中实现X方法,具备Z行为" |
| "添加测试" | "为X添加覆盖A、B、C场景的单元测试" |
| "修复bug" | "修复X文件第Y行由Z导致的TypeError" |
| "更新代码" | "更新X函数以接受Y参数" |
| "处理错误" | "为X中的ConnectionError添加try/except块,重试3次" |
| "重构" | "将Y中的X逻辑提取到新的Z类中" |
| "提升性能" | "通过缓存Y将X函数的运行时间从500ms缩短至<100ms" |
| "添加日志" | "为X函数添加structlog info级日志,记录A、B、C事件" |
| "编写文档" | "为X函数添加Google风格的文档字符串,包含Args、Returns、Raises" |
undefinedundefinedhistoryuv run temet-run agents history --helpundefinedhistoryuv run temet-run agents history --helpundefinedexamples/transformation-examples.md❌ VAGUE:
- [ ] Add error handling to the client
✅ PRECISE:
- [ ] Add ConnectionError and TimeoutError handling to ClaudeAgentClient.query()
- Retry 3 times with exponential backoff (1s, 2s, 4s)
- Raise AgentConnectionError after retries exhausted
- Location: src/temet_run/agent/client.py:ClaudeAgentClient.query
- Verify: pytest tests/unit/agent/test_client.py passesexamples/transformation-examples.md❌ 模糊:
- [ ] 为客户端添加错误处理
✅ 精确:
- [ ] 为ClaudeAgentClient.query()添加ConnectionError和TimeoutError处理
- 采用指数退避策略重试3次(间隔1秒、2秒、4秒)
- 重试耗尽后抛出AgentConnectionError
- 位置:src/temet_run/agent/client.py:ClaudeAgentClient.query
- 验证:执行pytest tests/unit/agent/test_client.py并通过python ~/.claude/skills/write-atomic-tasks/scripts/validate_task.py "task description"Task: "Add error handling to the client"
❌ FAILED Precision Check:
- Missing: Specific file path
- Missing: Function/class name
- Missing: Verification command
- Vague pattern: "Add error handling" (see Section 6)
Suggested rewrite:
- [ ] Add ConnectionError handling to ClaudeAgentClient.query()
Location: src/temet_run/agent/client.py:ClaudeAgentClient.query
Verify: pytest tests/unit/agent/test_client.py passespython ~/.claude/skills/write-atomic-tasks/scripts/validate_task.py "任务描述"任务:"为客户端添加错误处理"
❌ 精确性检查未通过:
- 缺失:具体文件路径
- 缺失:函数/类名称
- 缺失:验证命令
- 模糊表述:"添加错误处理"(见第6节)
建议重写:
- [ ] 为ClaudeAgentClient.query()添加ConnectionError处理
位置:src/temet_run/agent/client.py:ClaudeAgentClient.query
验证:执行pytest tests/unit/agent/test_client.py并通过| Metric | Before (Vague Tasks) | After (Precise Tasks) |
|---|---|---|
| Clarifying questions per task | 2-5 questions | 0 questions |
| Task completion time variance | ±200% | ±20% |
| Rework due to misunderstanding | 30% of tasks | <5% of tasks |
| Autonomous execution success | 40% | 95% |
| Time spent planning vs doing | 20/80 | 40/60 |
| 指标 | 之前(模糊任务) | 之后(精确任务) |
|---|---|---|
| 每个任务的澄清问题数 | 2-5个 | 0个 |
| 任务完成时间偏差 | ±200% | ±20% |
| 因误解导致的返工率 | 30%的任务 | <5%的任务 |
| 自动执行成功率 | 40% | 95% |
| 规划时间与执行时间占比 | 20/80 | 40/60 |