Current section

42 Versions

Jump to

Compare versions

4 files changed
+34 additions
-3 deletions
  @@ -12,6 +12,15 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
12 12
13 13 <!-- changelog -->
14 14
15 + ## v1.0.3 (2026-02-10)
16 +
17 +
18 +
19 +
20 + ### Bug Fixes:
21 +
22 + * ensure multiline skill descriptions are formatted properly by Zach Daniel
23 +
15 24 ## v1.0.2 (2026-02-10)
16 25
17 26 Fix examples in error outputs and docs
  @@ -7,7 +7,7 @@
7 7 {<<"GitHub">>,<<"https://github.com/ash-project/usage_rules">>},
8 8 {<<"Website">>,<<"https://ash-hq.org">>}]}.
9 9 {<<"name">>,<<"usage_rules">>}.
10 - {<<"version">>,<<"1.0.2">>}.
10 + {<<"version">>,<<"1.0.3">>}.
11 11 {<<"description">>,
12 12 <<"A config-driven dev tool for Elixir projects to manage AGENTS.md files and agent skills from dependencies">>}.
13 13 {<<"elixir">>,<<"~> 1.18">>}.
  @@ -815,11 +815,13 @@ if Code.ensure_loaded?(Igniter) do
815 815 defp build_skill_md(igniter, skill_name, resolved_packages, custom_description) do
816 816 description = custom_description || build_skill_description(skill_name, resolved_packages)
817 817
818 + formatted_description = format_yaml_string(description)
819 +
818 820 frontmatter =
819 821 """
820 822 ---
821 823 name: #{skill_name}
822 - description: "#{escape_yaml(description)}"
824 + description: #{formatted_description}
823 825 metadata:
824 826 managed-by: #{@managed_by_marker}
825 827 ---
  @@ -1114,6 +1116,26 @@ if Code.ensure_loaded?(Igniter) do
1114 1116 String.replace(content, ~r/\A\s*<!--\s*\n(?:.*?SPDX-.*?\n)*.*?-->\s*\n*/s, "")
1115 1117 end
1116 1118
1119 + defp format_yaml_string(str) do
1120 + str = String.trim(str)
1121 +
1122 + if String.contains?(str, "\n") do
1123 + indent = " "
1124 +
1125 + lines =
1126 + str
1127 + |> String.split("\n")
1128 + |> Enum.map_join("\n", fn line ->
1129 + trimmed = String.trim(line)
1130 + if trimmed == "", do: "", else: indent <> trimmed
1131 + end)
1132 +
1133 + ">-\n" <> lines
1134 + else
1135 + "\"" <> escape_yaml(str) <> "\""
1136 + end
1137 + end
1138 +
1117 1139 defp escape_yaml(str) do
1118 1140 str
1119 1141 |> String.replace("\\", "\\\\")
  @@ -5,7 +5,7 @@
5 5 defmodule UsageRules.MixProject do
6 6 use Mix.Project
7 7
8 - @version "1.0.2"
8 + @version "1.0.3"
9 9 @description """
10 10 A config-driven dev tool for Elixir projects to manage AGENTS.md files and agent skills from dependencies
11 11 """