Plugin skill agent path resolution looks in wrong directory
Bug Description
When a workflow file specifies an Agent: directive, the skill loading system resolves the agent path relative to the skill directory instead of the plugin root directory.
Reproduction Steps
- Create a plugin with this structure:
````
plugins/my-plugin/
├── agents/
│ └── my-agent.md ← Agent file lives here
└── skills/
└── my-skill/
├── SKILL.md
└── workflows/
└── my-workflow.md ← References "Agent: my-agent"
- In
my-workflow.md, specify:
``markdown``
**Agent:** my-agent
- Trigger the workflow via the skill
- Observe error:
Error reading filefor pathplugins/my-plugin/skills/my-skill/agents/my-agent.md
Expected Behavior
The agent should be resolved relative to the plugin root:
- Expected path:
plugins/my-plugin/agents/my-agent.md✓
Actual Behavior
The agent is resolved relative to the skill directory:
- Attempted path:
plugins/my-plugin/skills/my-skill/agents/my-agent.md✗
Context
This affects inject-mode workflows that need to load agent persona principles. The SKILL.md documentation states:
Agent definitions live in agents/ directory
This implies <plugin-root>/agents/, but the loader resolves relative to the skill subdirectory.
Environment
- Claude Code version: Latest (as of 2025-01-13)
- OS: macOS (Darwin 24.6.0)
- Plugin structure follows the documented pattern in claude-code plugin docs
Workaround
Currently none — the agent file cannot be found regardless of where it's placed relative to the workflow.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗