feat(plh): flag plugin namespace collisions (same declared name)
Two plugins that declare the same `name` in plugin.json collapse into one component namespace (/name:command, name:skill, agent "name"). Resolution between two installed same-name plugins is undocumented, so one plugin's commands/skills/agents are silently shadowed and unreachable. PLH now flags this at medium severity, keying on the declared `name` (not folder basename, via new declaredName on scanSinglePlugin) with a COL-shaped details.namespaces payload. Name-less plugins are excluded from the collision map. Search-first (code.claude.com/docs/en/plugins): plugin components are namespaced by the declared name, so a plugin component can never shadow a user/project one — only a same-name collision loses components. This refutes the original "plugin vs user vs project shadowing" framing in the backlog. Adds humanizer pattern, fixture (duplicate-plugin-name: 2 colliding + 2 name-less), and 3 tests. Suite 929->932. self-audit A 97 / A 100, scanners 13.
This commit is contained in:
parent
d678765fad
commit
c6c5f17752
11 changed files with 182 additions and 3 deletions
5
tests/fixtures/duplicate-plugin-name/alpha/.claude-plugin/plugin.json
vendored
Normal file
5
tests/fixtures/duplicate-plugin-name/alpha/.claude-plugin/plugin.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "dup",
|
||||
"description": "Alpha plugin that declares the namespace 'dup'",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
12
tests/fixtures/duplicate-plugin-name/alpha/CLAUDE.md
vendored
Normal file
12
tests/fixtures/duplicate-plugin-name/alpha/CLAUDE.md
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Dup Plugin
|
||||
|
||||
## Commands
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/dup:hello` | say hello |
|
||||
|
||||
## Agents
|
||||
(none)
|
||||
|
||||
## Hooks
|
||||
(none)
|
||||
5
tests/fixtures/duplicate-plugin-name/beta/.claude-plugin/plugin.json
vendored
Normal file
5
tests/fixtures/duplicate-plugin-name/beta/.claude-plugin/plugin.json
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "dup",
|
||||
"description": "Beta plugin that declares the SAME namespace 'dup' — collides with alpha",
|
||||
"version": "2.0.0"
|
||||
}
|
||||
12
tests/fixtures/duplicate-plugin-name/beta/CLAUDE.md
vendored
Normal file
12
tests/fixtures/duplicate-plugin-name/beta/CLAUDE.md
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Dup Plugin
|
||||
|
||||
## Commands
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/dup:hello` | say hello |
|
||||
|
||||
## Agents
|
||||
(none)
|
||||
|
||||
## Hooks
|
||||
(none)
|
||||
4
tests/fixtures/duplicate-plugin-name/delta/.claude-plugin/plugin.json
vendored
Normal file
4
tests/fixtures/duplicate-plugin-name/delta/.claude-plugin/plugin.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "Plugin with NO name field — must be excluded from the namespace-collision map",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
4
tests/fixtures/duplicate-plugin-name/gamma/.claude-plugin/plugin.json
vendored
Normal file
4
tests/fixtures/duplicate-plugin-name/gamma/.claude-plugin/plugin.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"description": "Plugin with NO name field — must be excluded from the namespace-collision map",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue