Skip to content

Commit f36d3ae

Browse files
committed
Fix crash on invalid YAML frontmatter in plugin skill files
1 parent 70ef8a3 commit f36d3ae

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Clarify Task tool prompt for task ordering, task granularity, concurrent starts, and clearing finished task lists.
66
- Replace MCP Java SDK with plumcp for MCP client communication. SSE transport is no longer supported (deprecated in MCP spec 2025-03-26).
7+
- Fix crash on invalid YAML frontmatter in plugin skill files.
78

89
## 0.112.1
910

src/eca/features/skills.clj

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,25 @@
44
[clojure.java.io :as io]
55
[eca.config :as config]
66
[eca.interpolation :as interpolation]
7+
[eca.logger :as logger]
78
[eca.shared :as shared]))
89

910
(set! *warn-on-reflection* true)
1011

12+
(def ^:private logger-tag "[skills]")
13+
1114
(defn ^:private skill-file->skill [skill-file]
12-
(let [content (interpolation/replace-dynamic-strings (slurp (str skill-file)) (fs/parent skill-file) nil)
13-
{:keys [name description body]} (shared/parse-md (or content ""))]
14-
(when (and name description)
15-
{:name name
16-
:description description
17-
:body body
18-
:dir (str (fs/canonicalize (fs/parent skill-file)))})))
15+
(try
16+
(let [content (interpolation/replace-dynamic-strings (slurp (str skill-file)) (fs/parent skill-file) nil)
17+
{:keys [name description body]} (shared/parse-md (or content ""))]
18+
(when (and name description)
19+
{:name name
20+
:description description
21+
:body body
22+
:dir (str (fs/canonicalize (fs/parent skill-file)))}))
23+
(catch Exception e
24+
(logger/warn logger-tag (format "Error parsing skill file '%s': %s" (str skill-file) (.getMessage e)))
25+
nil)))
1926

2027
(defn global-skills-dir []
2128
(let [xdg-config-home (or (config/get-env "XDG_CONFIG_HOME")

0 commit comments

Comments
 (0)