diff --git a/skilld.c b/skilld.c index 78569c0..6a64467 100644 --- a/skilld.c +++ b/skilld.c @@ -7,7 +7,7 @@ * Built on libmcp (../libmcp/mcp.h): this file owns storage and the tool * handlers, the library owns the protocol. * - * Storage: $SKILLLIB (default ~/.hermes/skilld) + * Storage: $SKILLLIB (default $XDG_DATA_HOME/skilld, else ~/.local/share/skilld) * /SKILL.md YAML frontmatter + markdown body * / references, scripts, templates */ @@ -86,7 +86,14 @@ static char *skilllib_path(void) home = getenv("HOME"); if (home == NULL) home = "/tmp"; - mcp_buf_printf(&b, "%s/.hermes/skilld", home); + { + const char *xdg = getenv("XDG_DATA_HOME"); + + if (xdg != NULL && *xdg != '\0') + mcp_buf_printf(&b, "%s/skilld", xdg); + else + mcp_buf_printf(&b, "%s/.local/share/skilld", home); + } return b.p; }