diff --git a/internal/store/pg/skills_content.go b/internal/store/pg/skills_content.go index eac99043..df3aca0c 100644 --- a/internal/store/pg/skills_content.go +++ b/internal/store/pg/skills_content.go @@ -40,6 +40,11 @@ func (s *PGSkillStore) LoadSkill(ctx context.Context, name string) (string, bool if err != nil { return "", false } + // Resolve {baseDir} placeholder so SKILL.md script-invocation lines hold + // absolute paths regardless of agent CWD. Mirrors skills.Loader.LoadSkill + // substitution; without it, agents reading SKILL.md via this RPC see the + // literal placeholder. + content = strings.ReplaceAll(content, "{baseDir}", info.BaseDir) return content, true } diff --git a/internal/store/sqlitestore/skills_content.go b/internal/store/sqlitestore/skills_content.go index e47c06a4..1c497660 100644 --- a/internal/store/sqlitestore/skills_content.go +++ b/internal/store/sqlitestore/skills_content.go @@ -35,6 +35,11 @@ func (s *SQLiteSkillStore) LoadSkill(ctx context.Context, name string) (string, if err != nil { return "", false } + // Resolve {baseDir} placeholder so SKILL.md script-invocation lines hold + // absolute paths regardless of agent CWD. Mirrors skills.Loader.LoadSkill + // substitution; without it, agents reading SKILL.md via this RPC see the + // literal placeholder. + content = strings.ReplaceAll(content, "{baseDir}", info.BaseDir) return content, true }