Files
NewStock/.kilocode/rules/restricted_reads.md

50 lines
1018 B
Markdown
Raw Permalink Normal View History

# 禁止读取的文件
以下文件包含敏感信息或属于配置文件,**绝对禁止**以任何方式读取。
## 配置文件
包含 `config` 字符串的文件(不区分大小写):
- `**/*config*` - 所有包含 config 的文件名
- `config.py`
- `app_config.py`
- `database_config.py`
- `config.json`
- `config.yaml`
- `config.yml`
- `my_config.py`
- `CONFIG.py`
- `AppConfig.json`
## JSON 文件
所有以 `.json` 结尾的文件:
- `**/*.json`
- `settings.json`
- `data.json`
- `output.json`
- `package.json`
- `tsconfig.json`
## 强制执行规则
### 无例外原则
- ❌ 禁止任何理由读取上述文件
- ❌ 即使任务无法完成也禁止读取
- ❌ 禁止使用任何变通方法读取
### 唯一例外
用户主动将文件内容上传至对话上下文(非文件读取工具)
### 错误处理
如果尝试读取上述文件,必须返回:
```
FileRestrictionError: 禁止读取文件: {路径}
原因: 文件名包含 'config' 或文件扩展名为 '.json'