substitute-eraser
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSubstitute Eraser
Substitute Eraser
Scan existing codebases for placeholder tokens. Generate remediation plan.
扫描现有代码库中的占位符标记,生成修复计划。
Purpose
用途
Audit existing files for substitution tokens (TODO, FIXME, placeholder, mock, etc.) and produce actionable remediation plan. Distinct from which validates agent output.
accept-no-substitutes审计现有文件中的替代标记(TODO、FIXME、placeholder、mock等),并生成可执行的修复计划。与用于验证Agent输出的工具不同。
accept-no-substitutesScope: Existing Files
扫描范围:现有文件
This skill scans what already exists:
- Source code files
- Configuration files
- Documentation with stale placeholders
- Test fixtures that leaked into production
Complements (output validation).
accept-no-substitutes此技能扫描已存在的内容:
- 源代码文件
- 配置文件
- 包含过时占位符的文档
- 泄露到生产环境中的测试夹具
补充工具:(输出验证工具)
accept-no-substitutesTrit Assignment
Trit 分配
- Trit: -1 (MINUS/VALIDATOR)
- Hue: 270° (violet - deep scan)
- Role: Codebase auditor, technical debt detector
- Trit:-1(MINUS/VALIDATOR,验证器)
- Hue:270°(紫色 - 深度扫描)
- 角色:代码库审计员、技术债务检测器
Scan Workflow
扫描流程
1. Discovery
1. 发现阶段
bash
undefinedbash
undefinedScan current directory
扫描当前目录
just substitute-scan .
just substitute-scan .
Scan specific path
扫描指定路径
just substitute-scan src/
undefinedjust substitute-scan src/
undefined2. Classification
2. 分类
| Severity | Tokens | Action |
|---|---|---|
| CRITICAL | TODO, FIXME, placeholder, xxx | Must fix before merge |
| WARNING | mock-, fake-, stub-* (outside tests) | Review context |
| INFO | example_, demo_ | Document or remove |
| 严重程度 | 标记 | 操作 |
|---|---|---|
| CRITICAL(严重) | TODO, FIXME, placeholder, xxx | 合并前必须修复 |
| WARNING(警告) | mock-, fake-, stub-*(测试文件外) | 检查上下文 |
| INFO(信息) | example_, demo_ | 记录或移除 |
3. Remediation Report
3. 修复报告
Output format:
SUBSTITUTE ERASER REPORT
========================
Scanned: 142 files
Found: 23 substitutions
CRITICAL (7):
src/auth.py:42 TODO: implement token refresh
src/api.py:118 placeholder value
src/db.py:55 FIXME: race condition
...
WARNING (12):
src/service.py:30 mock_client (not in test file)
...
INFO (4):
README.md:15 example_config
...
REMEDIATION PLAN:
1. [CRITICAL] src/auth.py:42 - Implement token refresh logic
2. [CRITICAL] src/api.py:118 - Replace placeholder with actual value
...输出格式:
SUBSTITUTE ERASER REPORT
========================
已扫描: 142 files
发现: 23 substitutions
CRITICAL (7):
src/auth.py:42 TODO: implement token refresh
src/api.py:118 placeholder value
src/db.py:55 FIXME: race condition
...
WARNING (12):
src/service.py:30 mock_client (not in test file)
...
INFO (4):
README.md:15 example_config
...
修复计划:
1. [CRITICAL] src/auth.py:42 - Implement token refresh logic
2. [CRITICAL] src/api.py:118 - Replace placeholder with actual value
...Context-Aware Exceptions
上下文感知例外
Acceptable Locations
允许的位置
| Pattern | Acceptable In |
|---|---|
| |
| |
| |
| Issue tracker references with ID |
| 模式 | 允许出现的位置 |
|---|---|
| |
| |
| |
| 带有ID的问题追踪器引用 |
Exception Syntax
例外语法
Mark intentional placeholders:
python
undefined标记有意保留的占位符:
python
undefinedSUBSTITUTE-OK: mock used for test isolation
SUBSTITUTE-OK: mock used for test isolation
mock_client = MockHTTPClient()
undefinedmock_client = MockHTTPClient()
undefinedCommands
命令
bash
undefinedbash
undefinedFull scan with report
完整扫描并生成报告
just substitute-scan <path>
just substitute-scan <path>
Critical only (CI mode)
仅扫描严重问题(CI模式)
just substitute-critical <path>
just substitute-critical <path>
Generate remediation tasks
生成修复任务
just substitute-tasks <path> --output=github # GitHub issues
just substitute-tasks <path> --output=linear # Linear tickets
just substitute-tasks <path> --output=todo # TODO file
just substitute-tasks <path> --output=github # GitHub 议题
just substitute-tasks <path> --output=linear # Linear 工单
just substitute-tasks <path> --output=todo # TODO 文件
Interactive fix mode
交互式修复模式
just substitute-fix <path>
undefinedjust substitute-fix <path>
undefinedIntegration with GF(3)
与GF(3)的集成
Operates as MINUS (-1) in audit triads:
substitute-eraser(-1) + code-generator(+1) + review-coordinator(0) = 0Emits rejection signal when scan finds violations above threshold.
在审计三元组中作为MINUS (-1)角色运行:
substitute-eraser(-1) + code-generator(+1) + review-coordinator(0) = 0当扫描发现超过阈值的违规内容时,发出拒绝信号。
Additional Resources
额外资源
Reference Files
参考文件
- - Detection regex patterns (shared with accept-no-substitutes)
references/patterns.md - - Fix strategies per token type
references/remediation.md
- - 检测正则表达式模式(与accept-no-substitutes共享)
references/patterns.md - - 按标记类型分类的修复策略
references/remediation.md
Scripts
脚本
- - Main scanning script
scripts/scan.py - - Report generation
scripts/report.py
- - 主扫描脚本
scripts/scan.py - - 报告生成脚本
scripts/report.py