project-scanner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Scanner Workflow
项目扫描器工作流
Scanner Location
扫描器位置
C:\Users\BLogic\.cursor\user-scripts\project-scanner\C:\Users\BLogic\.cursor\user-scripts\project-scanner\Commands
命令
bash
undefinedbash
undefinedFull scan
完整扫描
npx tsx scan.ts --path "<project-src-path>" --framework angular
npx tsx scan.ts --path "<项目源码路径>" --framework angular
Query specific
特定查询
npx tsx scan.ts --path "<project-src-path>" --framework angular --query "ClassName"
undefinednpx tsx scan.ts --path "<项目源码路径>" --framework angular --query "类名"
undefinedOutput Files
输出文件
| File | When |
|---|---|
| Full scan |
| Query mode |
| 文件 | 触发场景 |
|---|---|
| 完整扫描 |
| 查询模式 |
When to Scan
何时进行扫描
| Situation | Action |
|---|---|
| First time với project | Full scan |
| Edit shared service/utility | Query class |
| Change method signature | Query class → check calledBy |
| Delete/rename | Query → check all references |
| Create new code | Query similar existing |
| 场景 | 操作 |
|---|---|
| 首次使用项目 | 完整扫描 |
| 编辑共享服务/工具类 | 查询对应类 |
| 修改方法签名 | 查询对应类 → 检查 |
| 删除/重命名 | 查询 → 检查所有引用 |
| 创建新代码 | 查询类似的现有代码 |
When NOT to Scan
何时无需扫描
- Simple typo fix
- Private method internal change
- New isolated code (0 callers)
- Already have context
- Comment/doc updates
- 简单拼写错误修复
- 私有方法内部修改
- 新的孤立代码(无调用方)
- 已掌握上下文信息
- 注释/文档更新
Quality Gates (MANDATORY)
质量检查门限(强制要求)
| Trigger | MUST Check |
|---|---|
| Change method signature | |
| Class extends another | |
| Shared service | |
| Delete/rename | All references |
| 触发条件 | 必须检查 |
|---|---|
| 修改方法签名 | |
| 类继承自其他类 | |
| 共享服务 | |
| 删除/重命名 | 所有引用 |
Reading Output (Token-Efficient)
高效读取输出内容(减少Token消耗)
Full scan → Read ONLY summary section first
Query → Read calledBy + inheritanceKey sections:
- : Ai gọi method này
calledBy - : Multi-level call path
callChain - : Parent/child classes
inheritance - : Unused methods
deadCode - : High-impact services
summary.mostUsedServices
完整扫描 → 先只阅读summary部分
查询 → 阅读calledBy + inheritance关键部分:
- : 谁调用了这个方法
calledBy - : 多级调用路径
callChain - : 父/子类关系
inheritance - : 未使用的方法
deadCode - : 高影响服务
summary.mostUsedServices
Pattern-First Principle
模式优先原则
Before CREATE → Query similar existing code
Before EDIT → Check existing patterns
Follow 100% existing style创建代码前 → 查询类似的现有代码
编辑代码前 → 检查现有模式
100%遵循现有代码风格Example Workflow
示例工作流
User: "Sửa SalonService.list()"
1. Query SalonService
2. Read calledBy → Biết SalonsComponent gọi
3. Check signature → Không đổi thì OK
4. Edit safely用户:"修改SalonService.list()"
1. 查询SalonService
2. 查看calledBy → 了解到SalonsComponent调用了它
3. 检查签名 → 若未修改则没问题
4. 安全进行编辑Integration
集成
Scanner được reference từ:
- → Pre-edit analysis
angular-coding/SKILL.md
Scanner 被引用自:
- → 编辑前分析
angular-coding/SKILL.md