You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(integrations): stop frontmatter injection gluing onto a missing trailing newline
ClaudeIntegration/VibeIntegration/AlquimiaAIIntegration's
_inject_frontmatter_flag() detected the closing "---" line's existing
EOL and reused it when injecting a new key -- so when that "---" was
the file's last line with no trailing newline, the injected text was
appended with no newline at all, producing "user-invocable: true---"
instead of a properly separated line. This corrupts the frontmatter
(the closing delimiter is no longer alone on its own line) and, since
post_process_skill_content() chains multiple injection calls, silently
drops every subsequent key: a second call's pre-scan can no longer find
a second "---" line to inject before, so e.g.
"disable-model-invocation: false" is never added at all.
post_process_skill_content() runs on content from "external skill
generators (presets, extensions)" per its own docstring, so a trailing
newline after the closing delimiter isn't guaranteed.
DroidIntegration's own copy of this helper already emits an
unconditional "\n" instead of detecting/reusing the existing EOL,
exactly avoiding this bug -- ported that fix to the other three
implementations. Added a regression test to each of the three affected
integrations' test files, covering both the single-call corruption and
the chained-calls silent-drop.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U74yBbvVQCPwB7Ed8Dzeu6
* fix(integrations): preserve existing EOL when injecting frontmatter flags
Per Copilot review on PR #4570: unconditionally emitting "\n" after the
injected key regressed CRLF-authored skills into mixed line endings.
Detect the closing delimiter's existing EOL (\r\n or \n) and only fall
back to "\n" when the delimiter has none at all (the original
no-trailing-newline corruption bug).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments