project-scanner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project Scanner Workflow

项目扫描器工作流

Scanner Location

扫描器位置

C:\Users\BLogic\.cursor\user-scripts\project-scanner\
C:\Users\BLogic\.cursor\user-scripts\project-scanner\

Commands

命令

bash
undefined
bash
undefined

Full 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"
undefined
npx tsx scan.ts --path "<项目源码路径>" --framework angular --query "类名"
undefined

Output Files

输出文件

FileWhen
output.json
Full scan
output-query.json
Query mode
文件触发场景
output.json
完整扫描
output-query.json
查询模式

When to Scan

何时进行扫描

SituationAction
First time với projectFull scan
Edit shared service/utilityQuery class
Change method signatureQuery class → check calledBy
Delete/renameQuery → check all references
Create new codeQuery similar existing
场景操作
首次使用项目完整扫描
编辑共享服务/工具类查询对应类
修改方法签名查询对应类 → 检查
calledBy
删除/重命名查询 → 检查所有引用
创建新代码查询类似的现有代码

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)

质量检查门限(强制要求)

TriggerMUST Check
Change method signature
calledBy
Class extends another
inheritance
Shared service
summary.mostUsedServices
Delete/renameAll references
触发条件必须检查
修改方法签名
calledBy
类继承自其他类
inheritance
共享服务
summary.mostUsedServices
删除/重命名所有引用

Reading Output (Token-Efficient)

高效读取输出内容(减少Token消耗)

Full scan → Read ONLY summary section first
Query → Read calledBy + inheritance
Key sections:
  • calledBy
    : Ai gọi method này
  • callChain
    : Multi-level call path
  • inheritance
    : Parent/child classes
  • deadCode
    : Unused methods
  • summary.mostUsedServices
    : High-impact services
完整扫描 → 先只阅读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ừ:
  • angular-coding/SKILL.md
    → Pre-edit analysis
Scanner 被引用自:
  • angular-coding/SKILL.md
    → 编辑前分析