Loading...
Loading...
Compare original and translation side by side
shared/references/storage_mode_detection.mdshared/references/storage_mode_detection.mdtaskTypetaskTypeGrep(pattern="[keyword]", path="src/", output_mode="files_with_matches")⚠️ DRY Warning> [!WARNING]
> **DRY Check:** Similar functionality detected in codebase
> - Existing: src/services/auth/validateToken.ts:15-42
> - Similarity: 85% (function name, domain match)
> - **Recommendation:** Review existing implementation before creating new code
> - Option 1: Reuse existing function (import and call)
> - Option 2: Extend existing function with new parameters
> - Option 3: Justify why reimplementation needed (document in Technical Approach)Grep(pattern="[keyword]", path="src/", output_mode="files_with_matches")⚠️ DRY警告> [!WARNING]
> **DRY检查:** 代码库中检测到相似功能
> - 现有代码:src/services/auth/validateToken.ts:15-42
> - 匹配度:85%(函数名称、领域匹配)
> - **建议:** 在创建新代码前先参考现有实现
> - 选项1:复用现有函数(导入并调用)
> - 选项2:扩展现有函数,新增参数
> - 选项3:说明为何需要重新实现(记录在技术方案中)| taskType | Hard rule | What to verify |
|---|---|---|
| implementation | No new test creation | Scan text for "write/create/add tests" etc.; allow only updating existing tests |
| refactoring | Regression strategy required | Issues listed with severity; plan in 3 phases; regression strategy (Baseline/Verify/Failure); preserve functionality |
| test | Risk-based plan required | Priority ≤15 scenarios; E2E 2-5, Integration 0-8, Unit 0-15, Total 10-28; no framework/library/DB tests |
| 任务类型 | 硬性规则 | 验证内容 |
|---|---|---|
| 实现 | 不得创建新测试 | 扫描文本中是否包含「编写/创建/添加测试」等内容;仅允许更新现有测试 |
| 重构 | 必须包含回归策略 | 列出问题及严重程度;计划分为3个阶段;包含回归策略(基准/验证/故障处理);需保留原有功能 |
| 测试 | 必须包含基于风险的计划 | 场景优先级≤15;E2E测试2-5个、集成测试0-8个、单元测试0-15个,总数量10-28个;不得包含框架/库/数据库测试 |
state: "Backlog"⚠️ DRY WarningExample 1: Email validation (HIGH similarity - 90%)
> [!WARNING]
> **DRY Check:** Similar functionality detected
> - Existing: src/utils/validators/email.ts:validateEmail()
> - Similarity: 90% (exact function name + domain match)
> - **Recommendation:** REUSE existing function (Option 1)
Example 2: User authentication (MEDIUM similarity - 75%)
> [!WARNING]
> **DRY Check:** Partial functionality exists
> - Existing: src/services/auth/login.ts:authenticateUser()
> - Similarity: 75% (domain match, different scope)
> - **Recommendation:** Review existing code, consider EXTEND (Option 2) or JUSTIFY new implementation (Option 3)
Example 3: No duplication (skip warning)
- No similar code found → Proceed without DRY warningstate: "Backlog"⚠️ DRY警告示例1:邮箱验证(高匹配度 - 90%)
> [!WARNING]
> **DRY检查:** 检测到相似功能
> - 现有代码:src/utils/validators/email.ts:validateEmail()
> - 匹配度:90%(完全匹配函数名称+领域)
> - **建议:** 复用现有函数(选项1)
示例2:用户认证(中匹配度 - 75%)
> [!WARNING]
> **DRY检查:** 存在部分相似功能
> - 现有代码:src/services/auth/login.ts:authenticateUser()
> - 匹配度:75%(领域匹配,范围不同)
> - **建议:** 参考现有代码,考虑扩展(选项2)或说明重新实现的理由(选项3)
示例3:无重复代码(跳过警告)
- 未发现相似代码 → 无需添加DRY警告shared/references/template_loading_pattern.mdimplementationtask_template_implementation.mdrefactoringrefactoring_task_template.mdtesttest_task_template.mddocs/templates/*.mdshared/references/template_loading_pattern.mdimplementationtask_template_implementation.mdrefactoringrefactoring_task_template.mdtesttest_task_template.mddocs/templates/*.mdshared/references/kanban_update_algorithm.mdshared/references/template_loading_pattern.mdshared/references/linear_creation_workflow.mdshared/references/storage_mode_detection.mdshared/templates/task_template_implementation.mdshared/templates/refactoring_task_template.mdshared/templates/test_task_template.mddocs/templates/*.mddocs/tasks/kanban_board.mdshared/references/kanban_update_algorithm.mdshared/references/template_loading_pattern.mdshared/references/linear_creation_workflow.mdshared/references/storage_mode_detection.mdshared/templates/task_template_implementation.mdshared/templates/refactoring_task_template.mdshared/templates/test_task_template.mddocs/templates/*.mddocs/tasks/kanban_board.md