Loading...
Loading...
Compare original and translation side by side
PHASE 1: Exploration (explore-codebase) → BLOCKER
PHASE 2: Documentation (research-expert) → BLOCKER
PHASE 3: Impact Analysis (Grep usages) → BLOCKER
PHASE 3.5: DRY Detection (jscpd duplication) → NON-BLOCKING
PHASE 4: Error Detection (linters)
PHASE 5: Precision Correction (with docs + impact + DRY)
PHASE 6: Verification (re-run linters, tests, duplication)PHASE 1: Exploration (explore-codebase) → BLOCKER
PHASE 2: Documentation (research-expert) → BLOCKER
PHASE 3: Impact Analysis (Grep usages) → BLOCKER
PHASE 3.5: DRY Detection (jscpd duplication) → NON-BLOCKING
PHASE 4: Error Detection (linters)
PHASE 5: Precision Correction (with docs + impact + DRY)
PHASE 6: Verification (re-run linters, tests, duplication)> Use Task tool with subagent_type="explore-codebase"> Use Task tool with subagent_type="explore-codebase"> Use Task tool with subagent_type="research-expert"
> Request: Verify [library/framework] documentation for [error type]
> Request: Find [language] best practices for [specific issue]> Use Task tool with subagent_type="research-expert"
> Request: Verify [library/framework] documentation for [error type]
> Request: Find [language] best practices for [specific issue]| Risk | Criteria | Action |
|---|---|---|
| 🟢 LOW | Internal, 0-1 usages | Proceed |
| 🟡 MEDIUM | 2-5 usages, compatible | Proceed with care |
| 🔴 HIGH | 5+ usages OR breaking | Flag to user FIRST |
| 风险等级 | 判断标准 | 操作建议 |
|---|---|---|
| 🟢 低风险 | 内部使用,0-1处引用 | 直接推进 |
| 🟡 中风险 | 2-5处引用,兼容现有逻辑 | 谨慎推进 |
| 🔴 高风险 | 5处以上引用 或 会导致破坏性变更 | 先向用户标记说明 |
jscpdnpx jscpd ./src --threshold 5 --reporters console,json| Level | Threshold | Action |
|---|---|---|
| 🟢 Excellent | < 3% | No action needed |
| 🟡 Good | 3-5% | Document, fix if time |
| 🟠 Acceptable | 5-10% | Extract shared logic |
| 🔴 Critical | > 10% | Mandatory refactoring |
jscpdnpx jscpd ./src --threshold 5 --reporters console,json| 等级 | 阈值 | 操作建议 |
|---|---|---|
| 🟢 优秀 | < 3% | 无需操作 |
| 🟡 良好 | 3-5% | 记录情况,若有时间则修复 |
| 🟠 可接受 | 5-10% | 提取共享逻辑 |
| 🔴 严重 | > 10% | 必须重构 |
| Priority | Type | Examples | Action |
|---|---|---|---|
| Critical | Security | SQL injection, XSS, CSRF, auth bypass | Fix IMMEDIATELY |
| High | Logic | SOLID violations, memory leaks, race conditions | Fix same session |
| High | DRY | Code duplication > 10%, copy-paste logic blocks | Mandatory refactoring |
| Medium | DRY | Code duplication 5-10%, repeated patterns | Extract shared logic |
| Medium | Performance | N+1 queries, deprecated APIs, inefficient algorithms | Fix if time |
| Low | Style | Formatting, naming, missing docs | Fix if time |
| 优先级 | 类型 | 示例 | 操作建议 |
|---|---|---|---|
| 严重 | 安全类 | SQL注入、XSS、CSRF、身份验证绕过 | 立即修复 |
| 高 | 逻辑类 | SOLID原则违反、内存泄漏、竞态条件 | 本次会话内修复 |
| 高 | DRY类 | 代码重复率>10%、复制粘贴的逻辑块 | 必须重构 |
| 中 | DRY类 | 代码重复率5-10%、重复出现的模式 | 提取共享逻辑 |
| 中 | 性能类 | N+1查询、废弃API、低效算法 | 若有时间则修复 |
| 低 | 风格类 | 格式问题、命名规范、缺失文档 | 若有时间则修复 |