anthropics / anthropics/claude-plugins-official
code-modernization: recommended workspace settings use Write(path) rules that never match
- 主要语言
- Python
- 星标
- 36.3k
- 派生
- 4.1k
- 平均合并
- 2 天 14 小时
- 30 天内合并 PR
- 539
描述
`plugins/code-modernization/README.md`, the **Recommended workspace setup** section (lines 88–95), tells readers to put this in the project they're modernizing:
```json
{
"permissions": {
"allow": ["Read(**)", "Write(analysis/**)", "Write(modernized/**)", "Edit(analysis/**)", "Edit(modernized/**)"],
"deny": ["Edit(legacy/**)", "Write(legacy/**)"]
}
}
```
File permission checks only ever match `Edit(path)` rules, and `Edit` covers every file-editing tool including Write. The three `Write(...)` entries therefore never match anything. Copying the block into a project's `.claude/settings.json` produces a startup warning per entry:
```
Permission allow rule (.claude/settings.json): Write(analysis/**) is not matched by
file permission checks — only Edit(path) rules are. Use Edit(analysis/**) instead
(Edit rules cover all file-editing tools).
```
**This is a docs problem, not a security one.** The `Edit(...)` rules sitting alongside them already do the work, so the containment the section describes was never weakened — `deny: Edit(legacy/**)` blocks writes to `legacy/` on its own. The risk is that readers copy the pattern into their own settings and learn a rule form that silently does nothing.
Suggested replacement:
```json
{
"permissions": {
"allow": ["Read(**)", "Edit(analysis/**)", "Edit(modernized/**)"],
"deny": ["Edit(legacy/**)"]
}
}
```
A line after the block noting that `Edit(...)` covers every file-editing tool would stop the `Write` entries being added back.
I grepped the rest of the repo for the same pattern — `Write(`, `MultiEdit(`, and `NotebookEdit(` with a path argument — and this README is the only site.
I opened #5332 with exactly this change (one file, +4/−2), but the repo's automation auto-closes external PRs since `code-modernization` is an internal plugin, so I'm raising it here instead. The diff on that PR is still viewable if it's useful.
贡献指南
这个仓库没有索引到贡献指南
调研方向
Open plugins/code-modernization/README.md and inspect the Recommended workspace setup section at lines 88–95, then compare it with the proposed replacement in the issue. Done means the example no longer contains ineffective Write(path) entries and explicitly notes that Edit(path) covers file-editing tools.
由索引模型根据 Issue 内容生成。
评估
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100