skill-universe 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.md +24 -0
  2. package/bin/skillc.mjs +3 -0
  3. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache +0 -0
  4. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_inline +0 -0
  5. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_meta +0 -0
  6. package/build/dev/javascript/argv/argv.erl +12 -0
  7. package/build/dev/javascript/argv/argv.mjs +31 -0
  8. package/build/dev/javascript/argv/argv_ffi.erl +27 -0
  9. package/build/dev/javascript/argv/argv_ffi.mjs +20 -0
  10. package/build/dev/javascript/argv/gleam.mjs +1 -0
  11. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache +0 -0
  12. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_inline +0 -0
  13. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_meta +0 -0
  14. package/build/dev/javascript/filepath/filepath.erl +425 -0
  15. package/build/dev/javascript/filepath/filepath.mjs +529 -0
  16. package/build/dev/javascript/filepath/filepath_ffi.erl +9 -0
  17. package/build/dev/javascript/filepath/filepath_ffi.mjs +6 -0
  18. package/build/dev/javascript/filepath/gleam.mjs +1 -0
  19. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
  20. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
  21. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
  22. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
  23. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
  24. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
  25. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
  26. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
  27. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
  28. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
  29. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
  30. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
  31. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
  32. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
  33. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
  34. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
  35. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
  36. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
  37. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
  38. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
  39. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
  40. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
  41. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
  42. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
  43. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
  44. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
  45. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
  46. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
  47. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
  48. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
  49. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
  50. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
  51. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
  52. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
  53. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
  54. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
  55. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
  56. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
  57. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
  58. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
  59. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
  60. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
  61. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
  62. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
  63. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
  64. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
  65. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
  66. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
  67. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
  68. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
  69. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
  70. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
  71. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
  72. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
  73. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
  74. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
  75. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
  76. package/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
  77. package/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +285 -0
  78. package/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +313 -0
  79. package/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
  80. package/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +456 -0
  81. package/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +985 -0
  82. package/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
  83. package/build/dev/javascript/gleam_stdlib/gleam/float.mjs +572 -0
  84. package/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
  85. package/build/dev/javascript/gleam_stdlib/gleam/int.mjs +832 -0
  86. package/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
  87. package/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3160 -0
  88. package/build/dev/javascript/gleam_stdlib/gleam/option.mjs +418 -0
  89. package/build/dev/javascript/gleam_stdlib/gleam/order.mjs +178 -0
  90. package/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +102 -0
  91. package/build/dev/javascript/gleam_stdlib/gleam/result.mjs +480 -0
  92. package/build/dev/javascript/gleam_stdlib/gleam/set.mjs +416 -0
  93. package/build/dev/javascript/gleam_stdlib/gleam/string.mjs +723 -0
  94. package/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +133 -0
  95. package/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1155 -0
  96. package/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
  97. package/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
  98. package/build/dev/javascript/gleam_stdlib/gleam@bool.erl +352 -0
  99. package/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
  100. package/build/dev/javascript/gleam_stdlib/gleam@dict.erl +521 -0
  101. package/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +106 -0
  102. package/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1112 -0
  103. package/build/dev/javascript/gleam_stdlib/gleam@float.erl +764 -0
  104. package/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
  105. package/build/dev/javascript/gleam_stdlib/gleam@int.erl +1004 -0
  106. package/build/dev/javascript/gleam_stdlib/gleam@io.erl +80 -0
  107. package/build/dev/javascript/gleam_stdlib/gleam@list.erl +2832 -0
  108. package/build/dev/javascript/gleam_stdlib/gleam@option.erl +413 -0
  109. package/build/dev/javascript/gleam_stdlib/gleam@order.erl +200 -0
  110. package/build/dev/javascript/gleam_stdlib/gleam@pair.erl +110 -0
  111. package/build/dev/javascript/gleam_stdlib/gleam@result.erl +532 -0
  112. package/build/dev/javascript/gleam_stdlib/gleam@set.erl +433 -0
  113. package/build/dev/javascript/gleam_stdlib/gleam@string.erl +1012 -0
  114. package/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +207 -0
  115. package/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1049 -0
  116. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +529 -0
  117. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1050 -0
  118. package/build/dev/javascript/gleam_version +1 -0
  119. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache +0 -0
  120. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_inline +0 -0
  121. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta +0 -0
  122. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache +0 -0
  123. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline +0 -0
  124. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta +0 -0
  125. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache +0 -0
  126. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline +0 -0
  127. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta +0 -0
  128. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache +0 -0
  129. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline +0 -0
  130. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta +0 -0
  131. package/build/dev/javascript/gleeunit/gleam.mjs +1 -0
  132. package/build/dev/javascript/gleeunit/gleeunit/internal/gleam_panic.mjs +180 -0
  133. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +49 -0
  134. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +91 -0
  135. package/build/dev/javascript/gleeunit/gleeunit/internal/reporting.mjs +256 -0
  136. package/build/dev/javascript/gleeunit/gleeunit/should.mjs +135 -0
  137. package/build/dev/javascript/gleeunit/gleeunit.erl +89 -0
  138. package/build/dev/javascript/gleeunit/gleeunit.mjs +62 -0
  139. package/build/dev/javascript/gleeunit/gleeunit@internal@gleam_panic.erl +56 -0
  140. package/build/dev/javascript/gleeunit/gleeunit@internal@reporting.erl +343 -0
  141. package/build/dev/javascript/gleeunit/gleeunit@should.erl +153 -0
  142. package/build/dev/javascript/gleeunit/gleeunit_ffi.erl +21 -0
  143. package/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +100 -0
  144. package/build/dev/javascript/gleeunit/gleeunit_progress.erl +72 -0
  145. package/build/dev/javascript/prelude.mjs +1575 -0
  146. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache +0 -0
  147. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_inline +0 -0
  148. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_meta +0 -0
  149. package/build/dev/javascript/simplifile/gleam.mjs +1 -0
  150. package/build/dev/javascript/simplifile/simplifile.erl +893 -0
  151. package/build/dev/javascript/simplifile/simplifile.mjs +893 -0
  152. package/build/dev/javascript/simplifile/simplifile_erl.erl +244 -0
  153. package/build/dev/javascript/simplifile/simplifile_js.mjs +400 -0
  154. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache +0 -0
  155. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_inline +0 -0
  156. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_meta +0 -0
  157. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_warnings +0 -0
  158. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache +0 -0
  159. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_inline +0 -0
  160. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_meta +0 -0
  161. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_warnings +0 -0
  162. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache +0 -0
  163. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_inline +0 -0
  164. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_meta +0 -0
  165. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_warnings +0 -0
  166. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache +0 -0
  167. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_inline +0 -0
  168. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_meta +0 -0
  169. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_warnings +0 -0
  170. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache +0 -0
  171. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_inline +0 -0
  172. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_meta +0 -0
  173. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_warnings +0 -0
  174. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache +0 -0
  175. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_inline +0 -0
  176. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_meta +0 -0
  177. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_warnings +0 -0
  178. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache +0 -0
  179. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_inline +0 -0
  180. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_meta +0 -0
  181. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_warnings +0 -0
  182. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache +0 -0
  183. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_inline +0 -0
  184. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_meta +0 -0
  185. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_warnings +0 -0
  186. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache +0 -0
  187. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_inline +0 -0
  188. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_meta +0 -0
  189. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_warnings +0 -0
  190. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache +0 -0
  191. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_inline +0 -0
  192. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_meta +0 -0
  193. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_warnings +0 -0
  194. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache +0 -0
  195. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_inline +0 -0
  196. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_meta +0 -0
  197. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_warnings +0 -0
  198. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache +0 -0
  199. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_inline +0 -0
  200. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_meta +0 -0
  201. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_warnings +0 -0
  202. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache +0 -0
  203. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_inline +0 -0
  204. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_meta +0 -0
  205. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_warnings +0 -0
  206. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache +0 -0
  207. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_inline +0 -0
  208. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_meta +0 -0
  209. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_warnings +0 -0
  210. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache +0 -0
  211. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_inline +0 -0
  212. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_meta +0 -0
  213. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_warnings +0 -0
  214. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache +0 -0
  215. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_inline +0 -0
  216. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_meta +0 -0
  217. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_warnings +0 -0
  218. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache +0 -0
  219. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_inline +0 -0
  220. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_meta +0 -0
  221. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_warnings +0 -0
  222. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache +0 -0
  223. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_inline +0 -0
  224. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_meta +0 -0
  225. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_warnings +0 -0
  226. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache +0 -0
  227. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_inline +0 -0
  228. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_meta +0 -0
  229. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_warnings +0 -0
  230. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache +0 -0
  231. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_inline +0 -0
  232. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_meta +0 -0
  233. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_warnings +0 -0
  234. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache +0 -0
  235. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_inline +0 -0
  236. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_meta +0 -0
  237. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_warnings +0 -0
  238. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache +0 -0
  239. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_inline +0 -0
  240. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_meta +0 -0
  241. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_warnings +0 -0
  242. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache +0 -0
  243. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_inline +0 -0
  244. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_meta +0 -0
  245. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_warnings +0 -0
  246. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache +0 -0
  247. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_inline +0 -0
  248. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_meta +0 -0
  249. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_warnings +0 -0
  250. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache +0 -0
  251. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_inline +0 -0
  252. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_meta +0 -0
  253. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_warnings +0 -0
  254. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache +0 -0
  255. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_inline +0 -0
  256. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_meta +0 -0
  257. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_warnings +0 -0
  258. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache +0 -0
  259. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_inline +0 -0
  260. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_meta +0 -0
  261. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_warnings +0 -0
  262. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache +0 -0
  263. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_inline +0 -0
  264. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_meta +0 -0
  265. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_warnings +0 -0
  266. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache +0 -0
  267. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_inline +0 -0
  268. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_meta +0 -0
  269. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_warnings +0 -0
  270. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache +0 -0
  271. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_inline +0 -0
  272. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_meta +0 -0
  273. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_warnings +0 -0
  274. package/build/dev/javascript/skillc/cli_test.mjs +461 -0
  275. package/build/dev/javascript/skillc/compiler_test.mjs +3089 -0
  276. package/build/dev/javascript/skillc/config_test.mjs +308 -0
  277. package/build/dev/javascript/skillc/gleam.main.mjs +2 -0
  278. package/build/dev/javascript/skillc/gleam.mjs +1 -0
  279. package/build/dev/javascript/skillc/importer_test.mjs +1643 -0
  280. package/build/dev/javascript/skillc/parser_test.mjs +1601 -0
  281. package/build/dev/javascript/skillc/path_test.mjs +26 -0
  282. package/build/dev/javascript/skillc/provider_test.mjs +221 -0
  283. package/build/dev/javascript/skillc/registry_test.mjs +359 -0
  284. package/build/dev/javascript/skillc/scaffold_test.mjs +405 -0
  285. package/build/dev/javascript/skillc/skillc/compiler.mjs +724 -0
  286. package/build/dev/javascript/skillc/skillc/config.mjs +172 -0
  287. package/build/dev/javascript/skillc/skillc/error.mjs +145 -0
  288. package/build/dev/javascript/skillc/skillc/fs.mjs +40 -0
  289. package/build/dev/javascript/skillc/skillc/importer.mjs +975 -0
  290. package/build/dev/javascript/skillc/skillc/parser.mjs +427 -0
  291. package/build/dev/javascript/skillc/skillc/path.mjs +52 -0
  292. package/build/dev/javascript/skillc/skillc/platform.mjs +44 -0
  293. package/build/dev/javascript/skillc/skillc/provider.mjs +86 -0
  294. package/build/dev/javascript/skillc/skillc/registry.mjs +701 -0
  295. package/build/dev/javascript/skillc/skillc/scaffold.mjs +117 -0
  296. package/build/dev/javascript/skillc/skillc/semver.mjs +293 -0
  297. package/build/dev/javascript/skillc/skillc/shell.mjs +14 -0
  298. package/build/dev/javascript/skillc/skillc/template.mjs +1177 -0
  299. package/build/dev/javascript/skillc/skillc/types.mjs +249 -0
  300. package/build/dev/javascript/skillc/skillc/version_constraint.mjs +290 -0
  301. package/build/dev/javascript/skillc/skillc/yaml.mjs +51 -0
  302. package/build/dev/javascript/skillc/skillc.mjs +873 -0
  303. package/build/dev/javascript/skillc/skillc_ffi.mjs +30 -0
  304. package/build/dev/javascript/skillc/skillc_test.mjs +5 -0
  305. package/build/dev/javascript/skillc/template_test.mjs +1638 -0
  306. package/build/dev/javascript/skillc/version_constraint_test.mjs +1325 -0
  307. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache +0 -0
  308. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_inline +0 -0
  309. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_meta +0 -0
  310. package/build/dev/javascript/yay/gleam.mjs +1 -0
  311. package/build/dev/javascript/yay/yaml_ffi.erl +106 -0
  312. package/build/dev/javascript/yay/yaml_ffi.mjs +373 -0
  313. package/build/dev/javascript/yay/yay.erl +1218 -0
  314. package/build/dev/javascript/yay/yay.mjs +1403 -0
  315. package/package.json +28 -0
  316. package/src/skillc/compiler.gleam +561 -0
  317. package/src/skillc/config.gleam +91 -0
  318. package/src/skillc/error.gleam +37 -0
  319. package/src/skillc/fs.gleam +31 -0
  320. package/src/skillc/importer.gleam +709 -0
  321. package/src/skillc/parser.gleam +279 -0
  322. package/src/skillc/path.gleam +30 -0
  323. package/src/skillc/platform.gleam +25 -0
  324. package/src/skillc/provider.gleam +58 -0
  325. package/src/skillc/registry.gleam +472 -0
  326. package/src/skillc/scaffold.gleam +112 -0
  327. package/src/skillc/semver.gleam +165 -0
  328. package/src/skillc/shell.gleam +12 -0
  329. package/src/skillc/template.gleam +885 -0
  330. package/src/skillc/types.gleam +93 -0
  331. package/src/skillc/version_constraint.gleam +163 -0
  332. package/src/skillc/yaml.gleam +27 -0
  333. package/src/skillc.gleam +466 -0
  334. package/src/skillc_ffi.mjs +30 -0
@@ -0,0 +1,3089 @@
1
+ import * as $list from "../gleam_stdlib/gleam/list.mjs";
2
+ import * as $option from "../gleam_stdlib/gleam/option.mjs";
3
+ import * as $string from "../gleam_stdlib/gleam/string.mjs";
4
+ import * as $should from "../gleeunit/gleeunit/should.mjs";
5
+ import * as $simplifile from "../simplifile/simplifile.mjs";
6
+ import { Ok, Error, toList, Empty as $Empty, makeError, isEqual } from "./gleam.mjs";
7
+ import * as $skillc from "./skillc.mjs";
8
+ import * as $compiler from "./skillc/compiler.mjs";
9
+ import * as $error from "./skillc/error.mjs";
10
+ import * as $parser from "./skillc/parser.mjs";
11
+ import * as $types from "./skillc/types.mjs";
12
+
13
+ const FILEPATH = "test/compiler_test.gleam";
14
+
15
+ export function compile_all_providers_test() {
16
+ let result = $compiler.compile_all("test/fixtures/valid-skill");
17
+ let compiled_list;
18
+ if (result instanceof Ok) {
19
+ compiled_list = result[0];
20
+ } else {
21
+ throw makeError(
22
+ "let_assert",
23
+ FILEPATH,
24
+ "compiler_test",
25
+ 18,
26
+ "compile_all_providers_test",
27
+ "Pattern match failed, no pattern matched the value.",
28
+ {
29
+ value: result,
30
+ start: 490,
31
+ end: 527,
32
+ pattern_start: 501,
33
+ pattern_end: 518
34
+ }
35
+ )
36
+ }
37
+ let providers = $list.map(compiled_list, (c) => { return c.provider; });
38
+ $should.be_true($list.contains(providers, new $types.ClaudeCode()));
39
+ $should.be_true($list.contains(providers, new $types.Codex()));
40
+ return $should.be_true($list.contains(providers, new $types.OpenClaw()));
41
+ }
42
+
43
+ export function compile_openclaw_produces_skill_md_test() {
44
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
45
+ let compiled;
46
+ if ($ instanceof Ok) {
47
+ compiled = $[0];
48
+ } else {
49
+ throw makeError(
50
+ "let_assert",
51
+ FILEPATH,
52
+ "compiler_test",
53
+ 26,
54
+ "compile_openclaw_produces_skill_md_test",
55
+ "Pattern match failed, no pattern matched the value.",
56
+ { value: $, start: 824, end: 911, pattern_start: 835, pattern_end: 847 }
57
+ )
58
+ }
59
+ $should.be_true($string.contains(compiled.skill_md, "---"));
60
+ $should.be_true($string.contains(compiled.skill_md, "name: test-skill"));
61
+ return $should.be_true(
62
+ $string.contains(compiled.skill_md, "metadata.openclaw:"),
63
+ );
64
+ }
65
+
66
+ export function compile_claude_code_produces_skill_md_test() {
67
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
68
+ let compiled;
69
+ if ($ instanceof Ok) {
70
+ compiled = $[0];
71
+ } else {
72
+ throw makeError(
73
+ "let_assert",
74
+ FILEPATH,
75
+ "compiler_test",
76
+ 34,
77
+ "compile_claude_code_produces_skill_md_test",
78
+ "Pattern match failed, no pattern matched the value.",
79
+ {
80
+ value: $,
81
+ start: 1179,
82
+ end: 1269,
83
+ pattern_start: 1190,
84
+ pattern_end: 1202
85
+ }
86
+ )
87
+ }
88
+ $should.be_true($string.contains(compiled.skill_md, "---"));
89
+ $should.be_true($string.contains(compiled.skill_md, "name: test-skill"));
90
+ return $should.be_true(
91
+ $string.contains(compiled.skill_md, "user-invocable: true"),
92
+ );
93
+ }
94
+
95
+ export function compile_codex_produces_skill_md_test() {
96
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
97
+ let compiled;
98
+ if ($ instanceof Ok) {
99
+ compiled = $[0];
100
+ } else {
101
+ throw makeError(
102
+ "let_assert",
103
+ FILEPATH,
104
+ "compiler_test",
105
+ 42,
106
+ "compile_codex_produces_skill_md_test",
107
+ "Pattern match failed, no pattern matched the value.",
108
+ {
109
+ value: $,
110
+ start: 1533,
111
+ end: 1617,
112
+ pattern_start: 1544,
113
+ pattern_end: 1556
114
+ }
115
+ )
116
+ }
117
+ $should.be_true($string.contains(compiled.skill_md, "---"));
118
+ return $should.be_true(
119
+ $string.contains(compiled.skill_md, "name: test-skill"),
120
+ );
121
+ }
122
+
123
+ export function compile_single_provider_openclaw_test() {
124
+ let result = $compiler.compile("test/fixtures/valid-skill", "openclaw");
125
+ $should.be_ok(result);
126
+ let compiled;
127
+ if (result instanceof Ok) {
128
+ compiled = result[0];
129
+ } else {
130
+ throw makeError(
131
+ "let_assert",
132
+ FILEPATH,
133
+ "compiler_test",
134
+ 55,
135
+ "compile_single_provider_openclaw_test",
136
+ "Pattern match failed, no pattern matched the value.",
137
+ {
138
+ value: result,
139
+ start: 2099,
140
+ end: 2131,
141
+ pattern_start: 2110,
142
+ pattern_end: 2122
143
+ }
144
+ )
145
+ }
146
+ return $should.equal(compiled.provider, new $types.OpenClaw());
147
+ }
148
+
149
+ export function compile_single_provider_claude_code_test() {
150
+ let result = $compiler.compile("test/fixtures/valid-skill", "claude-code");
151
+ $should.be_ok(result);
152
+ let compiled;
153
+ if (result instanceof Ok) {
154
+ compiled = result[0];
155
+ } else {
156
+ throw makeError(
157
+ "let_assert",
158
+ FILEPATH,
159
+ "compiler_test",
160
+ 62,
161
+ "compile_single_provider_claude_code_test",
162
+ "Pattern match failed, no pattern matched the value.",
163
+ {
164
+ value: result,
165
+ start: 2338,
166
+ end: 2370,
167
+ pattern_start: 2349,
168
+ pattern_end: 2361
169
+ }
170
+ )
171
+ }
172
+ return $should.equal(compiled.provider, new $types.ClaudeCode());
173
+ }
174
+
175
+ export function compile_single_provider_codex_test() {
176
+ let result = $compiler.compile("test/fixtures/valid-skill", "codex");
177
+ $should.be_ok(result);
178
+ let compiled;
179
+ if (result instanceof Ok) {
180
+ compiled = result[0];
181
+ } else {
182
+ throw makeError(
183
+ "let_assert",
184
+ FILEPATH,
185
+ "compiler_test",
186
+ 69,
187
+ "compile_single_provider_codex_test",
188
+ "Pattern match failed, no pattern matched the value.",
189
+ {
190
+ value: result,
191
+ start: 2567,
192
+ end: 2599,
193
+ pattern_start: 2578,
194
+ pattern_end: 2590
195
+ }
196
+ )
197
+ }
198
+ return $should.equal(compiled.provider, new $types.Codex());
199
+ }
200
+
201
+ export function compile_single_target_from_multi_provider_test() {
202
+ let result = $compiler.compile("test/fixtures/valid-skill", "openclaw");
203
+ $should.be_ok(result);
204
+ let compiled;
205
+ if (result instanceof Ok) {
206
+ compiled = result[0];
207
+ } else {
208
+ throw makeError(
209
+ "let_assert",
210
+ FILEPATH,
211
+ "compiler_test",
212
+ 81,
213
+ "compile_single_target_from_multi_provider_test",
214
+ "Pattern match failed, no pattern matched the value.",
215
+ {
216
+ value: result,
217
+ start: 3070,
218
+ end: 3102,
219
+ pattern_start: 3081,
220
+ pattern_end: 3093
221
+ }
222
+ )
223
+ }
224
+ return $should.equal(compiled.provider, new $types.OpenClaw());
225
+ }
226
+
227
+ export function compile_all_returns_all_providers_test() {
228
+ let $ = $compiler.compile_all("test/fixtures/valid-skill");
229
+ let compiled_list;
230
+ if ($ instanceof Ok) {
231
+ compiled_list = $[0];
232
+ } else {
233
+ throw makeError(
234
+ "let_assert",
235
+ FILEPATH,
236
+ "compiler_test",
237
+ 86,
238
+ "compile_all_returns_all_providers_test",
239
+ "Pattern match failed, no pattern matched the value.",
240
+ {
241
+ value: $,
242
+ start: 3208,
243
+ end: 3292,
244
+ pattern_start: 3219,
245
+ pattern_end: 3236
246
+ }
247
+ )
248
+ }
249
+ return $should.equal($list.length(compiled_list), 3);
250
+ }
251
+
252
+ export function openclaw_metadata_merging_test() {
253
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
254
+ let compiled;
255
+ if ($ instanceof Ok) {
256
+ compiled = $[0];
257
+ } else {
258
+ throw makeError(
259
+ "let_assert",
260
+ FILEPATH,
261
+ "compiler_test",
262
+ 96,
263
+ "openclaw_metadata_merging_test",
264
+ "Pattern match failed, no pattern matched the value.",
265
+ {
266
+ value: $,
267
+ start: 3573,
268
+ end: 3660,
269
+ pattern_start: 3584,
270
+ pattern_end: 3596
271
+ }
272
+ )
273
+ }
274
+ $should.be_true($string.contains(compiled.skill_md, "name: test-skill"));
275
+ $should.be_true(
276
+ $string.contains(
277
+ compiled.skill_md,
278
+ "description: \"A test skill for validation\"",
279
+ ),
280
+ );
281
+ return $should.be_true(
282
+ $string.contains(compiled.skill_md, "metadata.openclaw:"),
283
+ );
284
+ }
285
+
286
+ export function claude_code_flat_frontmatter_test() {
287
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
288
+ let compiled;
289
+ if ($ instanceof Ok) {
290
+ compiled = $[0];
291
+ } else {
292
+ throw makeError(
293
+ "let_assert",
294
+ FILEPATH,
295
+ "compiler_test",
296
+ 110,
297
+ "claude_code_flat_frontmatter_test",
298
+ "Pattern match failed, no pattern matched the value.",
299
+ {
300
+ value: $,
301
+ start: 4123,
302
+ end: 4213,
303
+ pattern_start: 4134,
304
+ pattern_end: 4146
305
+ }
306
+ )
307
+ }
308
+ $should.be_true(
309
+ $string.contains(compiled.skill_md, "disable-model-invocation: false"),
310
+ );
311
+ return $should.be_true(
312
+ $string.contains(compiled.skill_md, "user-invocable: true"),
313
+ );
314
+ }
315
+
316
+ export function codex_minimal_frontmatter_test() {
317
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
318
+ let compiled;
319
+ if ($ instanceof Ok) {
320
+ compiled = $[0];
321
+ } else {
322
+ throw makeError(
323
+ "let_assert",
324
+ FILEPATH,
325
+ "compiler_test",
326
+ 121,
327
+ "codex_minimal_frontmatter_test",
328
+ "Pattern match failed, no pattern matched the value.",
329
+ {
330
+ value: $,
331
+ start: 4488,
332
+ end: 4572,
333
+ pattern_start: 4499,
334
+ pattern_end: 4511
335
+ }
336
+ )
337
+ }
338
+ $should.be_true($string.contains(compiled.skill_md, "name: test-skill"));
339
+ return $should.be_true($string.contains(compiled.skill_md, "version: 1.2.3"));
340
+ }
341
+
342
+ export function metadata_conflict_provider_wins_test() {
343
+ let $ = $compiler.compile("test/fixtures/conflict-metadata", "openclaw");
344
+ let compiled;
345
+ if ($ instanceof Ok) {
346
+ compiled = $[0];
347
+ } else {
348
+ throw makeError(
349
+ "let_assert",
350
+ FILEPATH,
351
+ "compiler_test",
352
+ 130,
353
+ "metadata_conflict_provider_wins_test",
354
+ "Pattern match failed, no pattern matched the value.",
355
+ {
356
+ value: $,
357
+ start: 4889,
358
+ end: 4982,
359
+ pattern_start: 4900,
360
+ pattern_end: 4912
361
+ }
362
+ )
363
+ }
364
+ return $should.be_true(
365
+ $string.contains(compiled.skill_md, "OpenClaw-specific description"),
366
+ );
367
+ }
368
+
369
+ export function metadata_conflict_name_preserved_test() {
370
+ let $ = $compiler.compile("test/fixtures/conflict-metadata", "openclaw");
371
+ let compiled;
372
+ if ($ instanceof Ok) {
373
+ compiled = $[0];
374
+ } else {
375
+ throw makeError(
376
+ "let_assert",
377
+ FILEPATH,
378
+ "compiler_test",
379
+ 141,
380
+ "metadata_conflict_name_preserved_test",
381
+ "Pattern match failed, no pattern matched the value.",
382
+ {
383
+ value: $,
384
+ start: 5274,
385
+ end: 5367,
386
+ pattern_start: 5285,
387
+ pattern_end: 5297
388
+ }
389
+ )
390
+ }
391
+ return $should.be_true(
392
+ $string.contains(compiled.skill_md, "name: conflict-test"),
393
+ );
394
+ }
395
+
396
+ export function instructions_rendered_test() {
397
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
398
+ let compiled;
399
+ if ($ instanceof Ok) {
400
+ compiled = $[0];
401
+ } else {
402
+ throw makeError(
403
+ "let_assert",
404
+ FILEPATH,
405
+ "compiler_test",
406
+ 151,
407
+ "instructions_rendered_test",
408
+ "Pattern match failed, no pattern matched the value.",
409
+ {
410
+ value: $,
411
+ start: 5677,
412
+ end: 5764,
413
+ pattern_start: 5688,
414
+ pattern_end: 5700
415
+ }
416
+ )
417
+ }
418
+ $should.be_true($string.contains(compiled.skill_md, "test-skill v1.2.3"));
419
+ $should.be_false($string.contains(compiled.skill_md, "{{name}}"));
420
+ return $should.be_false($string.contains(compiled.skill_md, "{{version}}"));
421
+ }
422
+
423
+ export function provider_specific_content_included_test() {
424
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
425
+ let compiled;
426
+ if ($ instanceof Ok) {
427
+ compiled = $[0];
428
+ } else {
429
+ throw makeError(
430
+ "let_assert",
431
+ FILEPATH,
432
+ "compiler_test",
433
+ 160,
434
+ "provider_specific_content_included_test",
435
+ "Pattern match failed, no pattern matched the value.",
436
+ {
437
+ value: $,
438
+ start: 6074,
439
+ end: 6161,
440
+ pattern_start: 6085,
441
+ pattern_end: 6097
442
+ }
443
+ )
444
+ }
445
+ $should.be_true($string.contains(compiled.skill_md, "OpenClaw Notes"));
446
+ return $should.be_false(
447
+ $string.contains(compiled.skill_md, "Claude Code Notes"),
448
+ );
449
+ }
450
+
451
+ export function provider_specific_content_excluded_test() {
452
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
453
+ let compiled;
454
+ if ($ instanceof Ok) {
455
+ compiled = $[0];
456
+ } else {
457
+ throw makeError(
458
+ "let_assert",
459
+ FILEPATH,
460
+ "compiler_test",
461
+ 167,
462
+ "provider_specific_content_excluded_test",
463
+ "Pattern match failed, no pattern matched the value.",
464
+ {
465
+ value: $,
466
+ start: 6364,
467
+ end: 6454,
468
+ pattern_start: 6375,
469
+ pattern_end: 6387
470
+ }
471
+ )
472
+ }
473
+ $should.be_true($string.contains(compiled.skill_md, "Claude Code Notes"));
474
+ return $should.be_false($string.contains(compiled.skill_md, "OpenClaw Notes"));
475
+ }
476
+
477
+ export function multi_provider_content_openclaw_test() {
478
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
479
+ let compiled;
480
+ if ($ instanceof Ok) {
481
+ compiled = $[0];
482
+ } else {
483
+ throw makeError(
484
+ "let_assert",
485
+ FILEPATH,
486
+ "compiler_test",
487
+ 174,
488
+ "multi_provider_content_openclaw_test",
489
+ "Pattern match failed, no pattern matched the value.",
490
+ {
491
+ value: $,
492
+ start: 6654,
493
+ end: 6741,
494
+ pattern_start: 6665,
495
+ pattern_end: 6677
496
+ }
497
+ )
498
+ }
499
+ return $should.be_true($string.contains(compiled.skill_md, "Shared Notes"));
500
+ }
501
+
502
+ export function multi_provider_content_codex_test() {
503
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
504
+ let compiled;
505
+ if ($ instanceof Ok) {
506
+ compiled = $[0];
507
+ } else {
508
+ throw makeError(
509
+ "let_assert",
510
+ FILEPATH,
511
+ "compiler_test",
512
+ 180,
513
+ "multi_provider_content_codex_test",
514
+ "Pattern match failed, no pattern matched the value.",
515
+ {
516
+ value: $,
517
+ start: 6861,
518
+ end: 6945,
519
+ pattern_start: 6872,
520
+ pattern_end: 6884
521
+ }
522
+ )
523
+ }
524
+ return $should.be_true($string.contains(compiled.skill_md, "Shared Notes"));
525
+ }
526
+
527
+ export function multi_provider_content_excluded_test() {
528
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
529
+ let compiled;
530
+ if ($ instanceof Ok) {
531
+ compiled = $[0];
532
+ } else {
533
+ throw makeError(
534
+ "let_assert",
535
+ FILEPATH,
536
+ "compiler_test",
537
+ 186,
538
+ "multi_provider_content_excluded_test",
539
+ "Pattern match failed, no pattern matched the value.",
540
+ {
541
+ value: $,
542
+ start: 7068,
543
+ end: 7158,
544
+ pattern_start: 7079,
545
+ pattern_end: 7091
546
+ }
547
+ )
548
+ }
549
+ return $should.be_false($string.contains(compiled.skill_md, "Shared Notes"));
550
+ }
551
+
552
+ export function provider_instructions_appended_test() {
553
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
554
+ let compiled;
555
+ if ($ instanceof Ok) {
556
+ compiled = $[0];
557
+ } else {
558
+ throw makeError(
559
+ "let_assert",
560
+ FILEPATH,
561
+ "compiler_test",
562
+ 193,
563
+ "provider_instructions_appended_test",
564
+ "Pattern match failed, no pattern matched the value.",
565
+ {
566
+ value: $,
567
+ start: 7357,
568
+ end: 7444,
569
+ pattern_start: 7368,
570
+ pattern_end: 7380
571
+ }
572
+ )
573
+ }
574
+ $should.be_true(
575
+ $string.contains(compiled.skill_md, "OpenClaw-Specific Setup"),
576
+ );
577
+ return $should.be_true(
578
+ $string.contains(compiled.skill_md, "pip install test-cli"),
579
+ );
580
+ }
581
+
582
+ export function provider_without_instructions_ok_test() {
583
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
584
+ let compiled;
585
+ if ($ instanceof Ok) {
586
+ compiled = $[0];
587
+ } else {
588
+ throw makeError(
589
+ "let_assert",
590
+ FILEPATH,
591
+ "compiler_test",
592
+ 201,
593
+ "provider_without_instructions_ok_test",
594
+ "Pattern match failed, no pattern matched the value.",
595
+ {
596
+ value: $,
597
+ start: 7739,
598
+ end: 7829,
599
+ pattern_start: 7750,
600
+ pattern_end: 7762
601
+ }
602
+ )
603
+ }
604
+ return $should.be_false(
605
+ $string.contains(compiled.skill_md, "OpenClaw-Specific Setup"),
606
+ );
607
+ }
608
+
609
+ export function template_directives_fully_resolved_test() {
610
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
611
+ let compiled;
612
+ if ($ instanceof Ok) {
613
+ compiled = $[0];
614
+ } else {
615
+ throw makeError(
616
+ "let_assert",
617
+ FILEPATH,
618
+ "compiler_test",
619
+ 207,
620
+ "template_directives_fully_resolved_test",
621
+ "Pattern match failed, no pattern matched the value.",
622
+ {
623
+ value: $,
624
+ start: 7967,
625
+ end: 8054,
626
+ pattern_start: 7978,
627
+ pattern_end: 7990
628
+ }
629
+ )
630
+ }
631
+ $should.be_false($string.contains(compiled.skill_md, "{{#provider"));
632
+ $should.be_false($string.contains(compiled.skill_md, "{{/provider}}"));
633
+ return $should.be_false($string.contains(compiled.skill_md, "{{name}}"));
634
+ }
635
+
636
+ export function shared_scripts_collected_test() {
637
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
638
+ let compiled;
639
+ if ($ instanceof Ok) {
640
+ compiled = $[0];
641
+ } else {
642
+ throw makeError(
643
+ "let_assert",
644
+ FILEPATH,
645
+ "compiler_test",
646
+ 221,
647
+ "shared_scripts_collected_test",
648
+ "Pattern match failed, no pattern matched the value.",
649
+ {
650
+ value: $,
651
+ start: 8634,
652
+ end: 8724,
653
+ pattern_start: 8645,
654
+ pattern_end: 8657
655
+ }
656
+ )
657
+ }
658
+ let script_paths = $list.map(
659
+ compiled.scripts,
660
+ (f) => { return f.relative_path; },
661
+ );
662
+ $should.be_true($list.contains(script_paths, "common.sh"));
663
+ return $should.be_true($list.contains(script_paths, "shared.sh"));
664
+ }
665
+
666
+ export function provider_script_overrides_shared_test() {
667
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
668
+ let compiled;
669
+ if ($ instanceof Ok) {
670
+ compiled = $[0];
671
+ } else {
672
+ throw makeError(
673
+ "let_assert",
674
+ FILEPATH,
675
+ "compiler_test",
676
+ 230,
677
+ "provider_script_overrides_shared_test",
678
+ "Pattern match failed, no pattern matched the value.",
679
+ {
680
+ value: $,
681
+ start: 9044,
682
+ end: 9131,
683
+ pattern_start: 9055,
684
+ pattern_end: 9067
685
+ }
686
+ )
687
+ }
688
+ let script_paths = $list.map(
689
+ compiled.scripts,
690
+ (f) => { return f.relative_path; },
691
+ );
692
+ $should.be_true($list.contains(script_paths, "common.sh"));
693
+ let $1 = $list.find(
694
+ compiled.scripts,
695
+ (f) => { return f.relative_path === "common.sh"; },
696
+ );
697
+ let common;
698
+ if ($1 instanceof Ok) {
699
+ common = $1[0];
700
+ } else {
701
+ throw makeError(
702
+ "let_assert",
703
+ FILEPATH,
704
+ "compiler_test",
705
+ 235,
706
+ "provider_script_overrides_shared_test",
707
+ "Pattern match failed, no pattern matched the value.",
708
+ {
709
+ value: $1,
710
+ start: 9339,
711
+ end: 9436,
712
+ pattern_start: 9350,
713
+ pattern_end: 9360
714
+ }
715
+ )
716
+ }
717
+ return $should.be_true(
718
+ $string.contains(common.src, "providers/openclaw/scripts"),
719
+ );
720
+ }
721
+
722
+ export function provider_adds_extra_scripts_test() {
723
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
724
+ let compiled;
725
+ if ($ instanceof Ok) {
726
+ compiled = $[0];
727
+ } else {
728
+ throw makeError(
729
+ "let_assert",
730
+ FILEPATH,
731
+ "compiler_test",
732
+ 242,
733
+ "provider_adds_extra_scripts_test",
734
+ "Pattern match failed, no pattern matched the value.",
735
+ {
736
+ value: $,
737
+ start: 9626,
738
+ end: 9713,
739
+ pattern_start: 9637,
740
+ pattern_end: 9649
741
+ }
742
+ )
743
+ }
744
+ let script_paths = $list.map(
745
+ compiled.scripts,
746
+ (f) => { return f.relative_path; },
747
+ );
748
+ return $should.be_true($list.contains(script_paths, "openclaw-only.sh"));
749
+ }
750
+
751
+ export function shared_scripts_not_overridden_preserved_test() {
752
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
753
+ let compiled;
754
+ if ($ instanceof Ok) {
755
+ compiled = $[0];
756
+ } else {
757
+ throw makeError(
758
+ "let_assert",
759
+ FILEPATH,
760
+ "compiler_test",
761
+ 250,
762
+ "shared_scripts_not_overridden_preserved_test",
763
+ "Pattern match failed, no pattern matched the value.",
764
+ {
765
+ value: $,
766
+ start: 9988,
767
+ end: 10075,
768
+ pattern_start: 9999,
769
+ pattern_end: 10011
770
+ }
771
+ )
772
+ }
773
+ let script_paths = $list.map(
774
+ compiled.scripts,
775
+ (f) => { return f.relative_path; },
776
+ );
777
+ return $should.be_true($list.contains(script_paths, "shared.sh"));
778
+ }
779
+
780
+ export function shared_assets_collected_test() {
781
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
782
+ let compiled;
783
+ if ($ instanceof Ok) {
784
+ compiled = $[0];
785
+ } else {
786
+ throw makeError(
787
+ "let_assert",
788
+ FILEPATH,
789
+ "compiler_test",
790
+ 257,
791
+ "shared_assets_collected_test",
792
+ "Pattern match failed, no pattern matched the value.",
793
+ {
794
+ value: $,
795
+ start: 10255,
796
+ end: 10342,
797
+ pattern_start: 10266,
798
+ pattern_end: 10278
799
+ }
800
+ )
801
+ }
802
+ let asset_paths = $list.map(
803
+ compiled.assets,
804
+ (f) => { return f.relative_path; },
805
+ );
806
+ return $should.be_true($list.contains(asset_paths, "template.md"));
807
+ }
808
+
809
+ export function no_scripts_dir_produces_empty_list_test() {
810
+ let $ = $compiler.compile("test/fixtures/minimal-skill", "openclaw");
811
+ let compiled;
812
+ if ($ instanceof Ok) {
813
+ compiled = $[0];
814
+ } else {
815
+ throw makeError(
816
+ "let_assert",
817
+ FILEPATH,
818
+ "compiler_test",
819
+ 265,
820
+ "no_scripts_dir_produces_empty_list_test",
821
+ "Pattern match failed, no pattern matched the value.",
822
+ {
823
+ value: $,
824
+ start: 10576,
825
+ end: 10665,
826
+ pattern_start: 10587,
827
+ pattern_end: 10599
828
+ }
829
+ )
830
+ }
831
+ return $should.equal(compiled.scripts, toList([]));
832
+ }
833
+
834
+ export function emit_creates_output_structure_test() {
835
+ let output_dir = "/tmp/skillc-test-emit";
836
+ let $ = $simplifile.delete$(output_dir);
837
+
838
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "openclaw");
839
+ let compiled;
840
+ if ($1 instanceof Ok) {
841
+ compiled = $1[0];
842
+ } else {
843
+ throw makeError(
844
+ "let_assert",
845
+ FILEPATH,
846
+ "compiler_test",
847
+ 279,
848
+ "emit_creates_output_structure_test",
849
+ "Pattern match failed, no pattern matched the value.",
850
+ {
851
+ value: $1,
852
+ start: 11067,
853
+ end: 11154,
854
+ pattern_start: 11078,
855
+ pattern_end: 11090
856
+ }
857
+ )
858
+ }
859
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
860
+ if (!($2 instanceof Ok)) {
861
+ throw makeError(
862
+ "let_assert",
863
+ FILEPATH,
864
+ "compiler_test",
865
+ 281,
866
+ "emit_creates_output_structure_test",
867
+ "Pattern match failed, no pattern matched the value.",
868
+ {
869
+ value: $2,
870
+ start: 11157,
871
+ end: 11225,
872
+ pattern_start: 11168,
873
+ pattern_end: 11173
874
+ }
875
+ )
876
+ }
877
+ let $3 = $simplifile.read(output_dir + "/openclaw/test-skill/SKILL.md");
878
+ let content;
879
+ if ($3 instanceof Ok) {
880
+ content = $3[0];
881
+ } else {
882
+ throw makeError(
883
+ "let_assert",
884
+ FILEPATH,
885
+ "compiler_test",
886
+ 284,
887
+ "emit_creates_output_structure_test",
888
+ "Pattern match failed, no pattern matched the value.",
889
+ {
890
+ value: $3,
891
+ start: 11255,
892
+ end: 11346,
893
+ pattern_start: 11266,
894
+ pattern_end: 11277
895
+ }
896
+ )
897
+ }
898
+ $should.be_true($string.contains(content, "test-skill"));
899
+ let $4 = $simplifile.delete$(output_dir);
900
+
901
+ return undefined;
902
+ }
903
+
904
+ export function emit_codex_structure_test() {
905
+ let output_dir = "/tmp/skillc-test-emit-codex";
906
+ let $ = $simplifile.delete$(output_dir);
907
+
908
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "codex");
909
+ let compiled;
910
+ if ($1 instanceof Ok) {
911
+ compiled = $1[0];
912
+ } else {
913
+ throw makeError(
914
+ "let_assert",
915
+ FILEPATH,
916
+ "compiler_test",
917
+ 297,
918
+ "emit_codex_structure_test",
919
+ "Pattern match failed, no pattern matched the value.",
920
+ {
921
+ value: $1,
922
+ start: 11597,
923
+ end: 11681,
924
+ pattern_start: 11608,
925
+ pattern_end: 11620
926
+ }
927
+ )
928
+ }
929
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
930
+ if (!($2 instanceof Ok)) {
931
+ throw makeError(
932
+ "let_assert",
933
+ FILEPATH,
934
+ "compiler_test",
935
+ 299,
936
+ "emit_codex_structure_test",
937
+ "Pattern match failed, no pattern matched the value.",
938
+ {
939
+ value: $2,
940
+ start: 11684,
941
+ end: 11752,
942
+ pattern_start: 11695,
943
+ pattern_end: 11700
944
+ }
945
+ )
946
+ }
947
+ let $3 = $simplifile.read(
948
+ output_dir + "/codex/.agents/skills/test-skill/SKILL.md",
949
+ );
950
+ let content;
951
+ if ($3 instanceof Ok) {
952
+ content = $3[0];
953
+ } else {
954
+ throw makeError(
955
+ "let_assert",
956
+ FILEPATH,
957
+ "compiler_test",
958
+ 302,
959
+ "emit_codex_structure_test",
960
+ "Pattern match failed, no pattern matched the value.",
961
+ {
962
+ value: $3,
963
+ start: 11799,
964
+ end: 11902,
965
+ pattern_start: 11810,
966
+ pattern_end: 11821
967
+ }
968
+ )
969
+ }
970
+ $should.be_true($string.contains(content, "test-skill"));
971
+ let $4 = $simplifile.delete$(output_dir);
972
+
973
+ return undefined;
974
+ }
975
+
976
+ export function compile_nonexistent_directory_fails_test() {
977
+ let result = $compiler.compile("/tmp/nonexistent-skill-dir-xyz", "openclaw");
978
+ return $should.be_error(result);
979
+ }
980
+
981
+ export function compile_unsupported_provider_fails_test() {
982
+ let result = $compiler.compile(
983
+ "test/fixtures/valid-skill",
984
+ "nonexistent-provider",
985
+ );
986
+ $should.be_error(result);
987
+ if (result instanceof Error) {
988
+ let $ = result[0];
989
+ if (!($ instanceof $error.ProviderError)) {
990
+ throw makeError(
991
+ "let_assert",
992
+ FILEPATH,
993
+ "compiler_test",
994
+ 323,
995
+ "compile_unsupported_provider_fails_test",
996
+ "Pattern match failed, no pattern matched the value.",
997
+ {
998
+ value: result,
999
+ start: 12522,
1000
+ end: 12574,
1001
+ pattern_start: 12533,
1002
+ pattern_end: 12565
1003
+ }
1004
+ )
1005
+ }
1006
+ } else {
1007
+ throw makeError(
1008
+ "let_assert",
1009
+ FILEPATH,
1010
+ "compiler_test",
1011
+ 323,
1012
+ "compile_unsupported_provider_fails_test",
1013
+ "Pattern match failed, no pattern matched the value.",
1014
+ {
1015
+ value: result,
1016
+ start: 12522,
1017
+ end: 12574,
1018
+ pattern_start: 12533,
1019
+ pattern_end: 12565
1020
+ }
1021
+ )
1022
+ }
1023
+ return result;
1024
+ }
1025
+
1026
+ export function compile_no_providers_fails_test() {
1027
+ let result = $compiler.compile_all("test/fixtures/no-providers");
1028
+ return $should.be_error(result);
1029
+ }
1030
+
1031
+ export function compile_missing_instructions_fails_test() {
1032
+ let result = $compiler.compile(
1033
+ "test/fixtures/missing-instructions",
1034
+ "openclaw",
1035
+ );
1036
+ $should.be_error(result);
1037
+ if (result instanceof Error) {
1038
+ let $ = result[0];
1039
+ if (!($ instanceof $error.FileError)) {
1040
+ throw makeError(
1041
+ "let_assert",
1042
+ FILEPATH,
1043
+ "compiler_test",
1044
+ 336,
1045
+ "compile_missing_instructions_fails_test",
1046
+ "Pattern match failed, no pattern matched the value.",
1047
+ {
1048
+ value: result,
1049
+ start: 12938,
1050
+ end: 12986,
1051
+ pattern_start: 12949,
1052
+ pattern_end: 12977
1053
+ }
1054
+ )
1055
+ }
1056
+ } else {
1057
+ throw makeError(
1058
+ "let_assert",
1059
+ FILEPATH,
1060
+ "compiler_test",
1061
+ 336,
1062
+ "compile_missing_instructions_fails_test",
1063
+ "Pattern match failed, no pattern matched the value.",
1064
+ {
1065
+ value: result,
1066
+ start: 12938,
1067
+ end: 12986,
1068
+ pattern_start: 12949,
1069
+ pattern_end: 12977
1070
+ }
1071
+ )
1072
+ }
1073
+ return result;
1074
+ }
1075
+
1076
+ export function compile_empty_instructions_succeeds_test() {
1077
+ let result = $compiler.compile("test/fixtures/empty-instructions", "openclaw");
1078
+ return $should.be_ok(result);
1079
+ }
1080
+
1081
+ export function compile_invalid_yaml_fails_test() {
1082
+ let result = $compiler.compile("test/fixtures/invalid-yaml", "openclaw");
1083
+ return $should.be_error(result);
1084
+ }
1085
+
1086
+ export function compile_missing_fields_fails_test() {
1087
+ let result = $compiler.compile("test/fixtures/missing-name", "openclaw");
1088
+ return $should.be_error(result);
1089
+ }
1090
+
1091
+ export function compile_unsupported_provider_error_message_test() {
1092
+ let result = $compiler.compile(
1093
+ "test/fixtures/valid-skill",
1094
+ "nonexistent-provider",
1095
+ );
1096
+ let provider;
1097
+ let msg;
1098
+ if (result instanceof Error) {
1099
+ let $ = result[0];
1100
+ if ($ instanceof $error.ProviderError) {
1101
+ provider = $.provider;
1102
+ msg = $.message;
1103
+ } else {
1104
+ throw makeError(
1105
+ "let_assert",
1106
+ FILEPATH,
1107
+ "compiler_test",
1108
+ 362,
1109
+ "compile_unsupported_provider_error_message_test",
1110
+ "Pattern match failed, no pattern matched the value.",
1111
+ {
1112
+ value: result,
1113
+ start: 13864,
1114
+ end: 13925,
1115
+ pattern_start: 13875,
1116
+ pattern_end: 13916
1117
+ }
1118
+ )
1119
+ }
1120
+ } else {
1121
+ throw makeError(
1122
+ "let_assert",
1123
+ FILEPATH,
1124
+ "compiler_test",
1125
+ 362,
1126
+ "compile_unsupported_provider_error_message_test",
1127
+ "Pattern match failed, no pattern matched the value.",
1128
+ {
1129
+ value: result,
1130
+ start: 13864,
1131
+ end: 13925,
1132
+ pattern_start: 13875,
1133
+ pattern_end: 13916
1134
+ }
1135
+ )
1136
+ }
1137
+ $should.equal(provider, "nonexistent-provider");
1138
+ return $should.be_true($string.contains(msg, "Unknown provider"));
1139
+ }
1140
+
1141
+ export function compile_missing_instructions_error_message_test() {
1142
+ let result = $compiler.compile(
1143
+ "test/fixtures/missing-instructions",
1144
+ "openclaw",
1145
+ );
1146
+ let path;
1147
+ if (result instanceof Error) {
1148
+ let $ = result[0];
1149
+ if ($ instanceof $error.FileError) {
1150
+ path = $.path;
1151
+ } else {
1152
+ throw makeError(
1153
+ "let_assert",
1154
+ FILEPATH,
1155
+ "compiler_test",
1156
+ 370,
1157
+ "compile_missing_instructions_error_message_test",
1158
+ "Pattern match failed, no pattern matched the value.",
1159
+ {
1160
+ value: result,
1161
+ start: 14184,
1162
+ end: 14235,
1163
+ pattern_start: 14195,
1164
+ pattern_end: 14226
1165
+ }
1166
+ )
1167
+ }
1168
+ } else {
1169
+ throw makeError(
1170
+ "let_assert",
1171
+ FILEPATH,
1172
+ "compiler_test",
1173
+ 370,
1174
+ "compile_missing_instructions_error_message_test",
1175
+ "Pattern match failed, no pattern matched the value.",
1176
+ {
1177
+ value: result,
1178
+ start: 14184,
1179
+ end: 14235,
1180
+ pattern_start: 14195,
1181
+ pattern_end: 14226
1182
+ }
1183
+ )
1184
+ }
1185
+ return $should.be_true($string.contains(path, "INSTRUCTIONS.md"));
1186
+ }
1187
+
1188
+ export function frontmatter_instructions_generates_warning_test() {
1189
+ let $ = $compiler.compile(
1190
+ "test/fixtures/frontmatter-instructions",
1191
+ "openclaw",
1192
+ );
1193
+ let compiled;
1194
+ if ($ instanceof Ok) {
1195
+ compiled = $[0];
1196
+ } else {
1197
+ throw makeError(
1198
+ "let_assert",
1199
+ FILEPATH,
1200
+ "compiler_test",
1201
+ 379,
1202
+ "frontmatter_instructions_generates_warning_test",
1203
+ "Pattern match failed, no pattern matched the value.",
1204
+ {
1205
+ value: $,
1206
+ start: 14555,
1207
+ end: 14655,
1208
+ pattern_start: 14566,
1209
+ pattern_end: 14578
1210
+ }
1211
+ )
1212
+ }
1213
+ $should.equal($list.length(compiled.warnings), 1);
1214
+ let $1 = compiled.warnings;
1215
+ let file;
1216
+ if ($1 instanceof $Empty) {
1217
+ throw makeError(
1218
+ "let_assert",
1219
+ FILEPATH,
1220
+ "compiler_test",
1221
+ 382,
1222
+ "frontmatter_instructions_generates_warning_test",
1223
+ "Pattern match failed, no pattern matched the value.",
1224
+ {
1225
+ value: $1,
1226
+ start: 14708,
1227
+ end: 14778,
1228
+ pattern_start: 14719,
1229
+ pattern_end: 14758
1230
+ }
1231
+ )
1232
+ } else {
1233
+ let $2 = $1.head;
1234
+ if ($2 instanceof $types.FrontmatterInInstructions) {
1235
+ let $3 = $1.tail;
1236
+ if ($3 instanceof $Empty) {
1237
+ file = $2.file;
1238
+ } else {
1239
+ throw makeError(
1240
+ "let_assert",
1241
+ FILEPATH,
1242
+ "compiler_test",
1243
+ 382,
1244
+ "frontmatter_instructions_generates_warning_test",
1245
+ "Pattern match failed, no pattern matched the value.",
1246
+ {
1247
+ value: $1,
1248
+ start: 14708,
1249
+ end: 14778,
1250
+ pattern_start: 14719,
1251
+ pattern_end: 14758
1252
+ }
1253
+ )
1254
+ }
1255
+ } else {
1256
+ throw makeError(
1257
+ "let_assert",
1258
+ FILEPATH,
1259
+ "compiler_test",
1260
+ 382,
1261
+ "frontmatter_instructions_generates_warning_test",
1262
+ "Pattern match failed, no pattern matched the value.",
1263
+ {
1264
+ value: $1,
1265
+ start: 14708,
1266
+ end: 14778,
1267
+ pattern_start: 14719,
1268
+ pattern_end: 14758
1269
+ }
1270
+ )
1271
+ }
1272
+ }
1273
+ return $should.be_true($string.contains(file, "INSTRUCTIONS.md"));
1274
+ }
1275
+
1276
+ export function normal_instructions_no_warnings_test() {
1277
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1278
+ let compiled;
1279
+ if ($ instanceof Ok) {
1280
+ compiled = $[0];
1281
+ } else {
1282
+ throw makeError(
1283
+ "let_assert",
1284
+ FILEPATH,
1285
+ "compiler_test",
1286
+ 387,
1287
+ "normal_instructions_no_warnings_test",
1288
+ "Pattern match failed, no pattern matched the value.",
1289
+ {
1290
+ value: $,
1291
+ start: 14891,
1292
+ end: 14978,
1293
+ pattern_start: 14902,
1294
+ pattern_end: 14914
1295
+ }
1296
+ )
1297
+ }
1298
+ return $should.equal(compiled.warnings, toList([]));
1299
+ }
1300
+
1301
+ export function emit_roundtrip_content_matches_test() {
1302
+ let output_dir = "/tmp/skillc-test-roundtrip";
1303
+ let $ = $simplifile.delete$(output_dir);
1304
+
1305
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1306
+ let compiled;
1307
+ if ($1 instanceof Ok) {
1308
+ compiled = $1[0];
1309
+ } else {
1310
+ throw makeError(
1311
+ "let_assert",
1312
+ FILEPATH,
1313
+ "compiler_test",
1314
+ 400,
1315
+ "emit_roundtrip_content_matches_test",
1316
+ "Pattern match failed, no pattern matched the value.",
1317
+ {
1318
+ value: $1,
1319
+ start: 15350,
1320
+ end: 15437,
1321
+ pattern_start: 15361,
1322
+ pattern_end: 15373
1323
+ }
1324
+ )
1325
+ }
1326
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
1327
+ if (!($2 instanceof Ok)) {
1328
+ throw makeError(
1329
+ "let_assert",
1330
+ FILEPATH,
1331
+ "compiler_test",
1332
+ 402,
1333
+ "emit_roundtrip_content_matches_test",
1334
+ "Pattern match failed, no pattern matched the value.",
1335
+ {
1336
+ value: $2,
1337
+ start: 15440,
1338
+ end: 15508,
1339
+ pattern_start: 15451,
1340
+ pattern_end: 15456
1341
+ }
1342
+ )
1343
+ }
1344
+ let $3 = $simplifile.read(output_dir + "/openclaw/test-skill/SKILL.md");
1345
+ let read_back;
1346
+ if ($3 instanceof Ok) {
1347
+ read_back = $3[0];
1348
+ } else {
1349
+ throw makeError(
1350
+ "let_assert",
1351
+ FILEPATH,
1352
+ "compiler_test",
1353
+ 405,
1354
+ "emit_roundtrip_content_matches_test",
1355
+ "Pattern match failed, no pattern matched the value.",
1356
+ {
1357
+ value: $3,
1358
+ start: 15562,
1359
+ end: 15655,
1360
+ pattern_start: 15573,
1361
+ pattern_end: 15586
1362
+ }
1363
+ )
1364
+ }
1365
+ $should.equal(read_back, compiled.skill_md);
1366
+ let $4 = $simplifile.delete$(output_dir);
1367
+
1368
+ return undefined;
1369
+ }
1370
+
1371
+ export function emit_roundtrip_codex_content_matches_test() {
1372
+ let output_dir = "/tmp/skillc-test-roundtrip-codex";
1373
+ let $ = $simplifile.delete$(output_dir);
1374
+
1375
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "codex");
1376
+ let compiled;
1377
+ if ($1 instanceof Ok) {
1378
+ compiled = $1[0];
1379
+ } else {
1380
+ throw makeError(
1381
+ "let_assert",
1382
+ FILEPATH,
1383
+ "compiler_test",
1384
+ 417,
1385
+ "emit_roundtrip_codex_content_matches_test",
1386
+ "Pattern match failed, no pattern matched the value.",
1387
+ {
1388
+ value: $1,
1389
+ start: 15901,
1390
+ end: 15985,
1391
+ pattern_start: 15912,
1392
+ pattern_end: 15924
1393
+ }
1394
+ )
1395
+ }
1396
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
1397
+ if (!($2 instanceof Ok)) {
1398
+ throw makeError(
1399
+ "let_assert",
1400
+ FILEPATH,
1401
+ "compiler_test",
1402
+ 419,
1403
+ "emit_roundtrip_codex_content_matches_test",
1404
+ "Pattern match failed, no pattern matched the value.",
1405
+ {
1406
+ value: $2,
1407
+ start: 15988,
1408
+ end: 16056,
1409
+ pattern_start: 15999,
1410
+ pattern_end: 16004
1411
+ }
1412
+ )
1413
+ }
1414
+ let $3 = $simplifile.read(
1415
+ output_dir + "/codex/.agents/skills/test-skill/SKILL.md",
1416
+ );
1417
+ let read_back;
1418
+ if ($3 instanceof Ok) {
1419
+ read_back = $3[0];
1420
+ } else {
1421
+ throw makeError(
1422
+ "let_assert",
1423
+ FILEPATH,
1424
+ "compiler_test",
1425
+ 421,
1426
+ "emit_roundtrip_codex_content_matches_test",
1427
+ "Pattern match failed, no pattern matched the value.",
1428
+ {
1429
+ value: $3,
1430
+ start: 16060,
1431
+ end: 16165,
1432
+ pattern_start: 16071,
1433
+ pattern_end: 16084
1434
+ }
1435
+ )
1436
+ }
1437
+ $should.equal(read_back, compiled.skill_md);
1438
+ let $4 = $simplifile.delete$(output_dir);
1439
+
1440
+ return undefined;
1441
+ }
1442
+
1443
+ export function emit_script_content_verified_test() {
1444
+ let output_dir = "/tmp/skillc-test-script-content";
1445
+ let $ = $simplifile.delete$(output_dir);
1446
+
1447
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1448
+ let compiled;
1449
+ if ($1 instanceof Ok) {
1450
+ compiled = $1[0];
1451
+ } else {
1452
+ throw makeError(
1453
+ "let_assert",
1454
+ FILEPATH,
1455
+ "compiler_test",
1456
+ 433,
1457
+ "emit_script_content_verified_test",
1458
+ "Pattern match failed, no pattern matched the value.",
1459
+ {
1460
+ value: $1,
1461
+ start: 16402,
1462
+ end: 16489,
1463
+ pattern_start: 16413,
1464
+ pattern_end: 16425
1465
+ }
1466
+ )
1467
+ }
1468
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
1469
+ if (!($2 instanceof Ok)) {
1470
+ throw makeError(
1471
+ "let_assert",
1472
+ FILEPATH,
1473
+ "compiler_test",
1474
+ 435,
1475
+ "emit_script_content_verified_test",
1476
+ "Pattern match failed, no pattern matched the value.",
1477
+ {
1478
+ value: $2,
1479
+ start: 16492,
1480
+ end: 16560,
1481
+ pattern_start: 16503,
1482
+ pattern_end: 16508
1483
+ }
1484
+ )
1485
+ }
1486
+ let $3 = $simplifile.read(
1487
+ output_dir + "/openclaw/test-skill/scripts/common.sh",
1488
+ );
1489
+ let content;
1490
+ if ($3 instanceof Ok) {
1491
+ content = $3[0];
1492
+ } else {
1493
+ throw makeError(
1494
+ "let_assert",
1495
+ FILEPATH,
1496
+ "compiler_test",
1497
+ 438,
1498
+ "emit_script_content_verified_test",
1499
+ "Pattern match failed, no pattern matched the value.",
1500
+ {
1501
+ value: $3,
1502
+ start: 16648,
1503
+ end: 16748,
1504
+ pattern_start: 16659,
1505
+ pattern_end: 16670
1506
+ }
1507
+ )
1508
+ }
1509
+ $should.be_true($string.contains(content, "openclaw override"));
1510
+ let $4 = $simplifile.read(
1511
+ output_dir + "/openclaw/test-skill/scripts/shared.sh",
1512
+ );
1513
+ let shared_content;
1514
+ if ($4 instanceof Ok) {
1515
+ shared_content = $4[0];
1516
+ } else {
1517
+ throw makeError(
1518
+ "let_assert",
1519
+ FILEPATH,
1520
+ "compiler_test",
1521
+ 443,
1522
+ "emit_script_content_verified_test",
1523
+ "Pattern match failed, no pattern matched the value.",
1524
+ {
1525
+ value: $4,
1526
+ start: 16877,
1527
+ end: 16984,
1528
+ pattern_start: 16888,
1529
+ pattern_end: 16906
1530
+ }
1531
+ )
1532
+ }
1533
+ $should.be_true($string.contains(shared_content, "shared script"));
1534
+ let $5 = $simplifile.delete$(output_dir);
1535
+
1536
+ return undefined;
1537
+ }
1538
+
1539
+ export function golden_openclaw_output_test() {
1540
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1541
+ let compiled;
1542
+ if ($ instanceof Ok) {
1543
+ compiled = $[0];
1544
+ } else {
1545
+ throw makeError(
1546
+ "let_assert",
1547
+ FILEPATH,
1548
+ "compiler_test",
1549
+ 456,
1550
+ "golden_openclaw_output_test",
1551
+ "Pattern match failed, no pattern matched the value.",
1552
+ {
1553
+ value: $,
1554
+ start: 17354,
1555
+ end: 17441,
1556
+ pattern_start: 17365,
1557
+ pattern_end: 17377
1558
+ }
1559
+ )
1560
+ }
1561
+ let $1 = $simplifile.read("test/golden/valid-skill.openclaw.md");
1562
+ let expected;
1563
+ if ($1 instanceof Ok) {
1564
+ expected = $1[0];
1565
+ } else {
1566
+ throw makeError(
1567
+ "let_assert",
1568
+ FILEPATH,
1569
+ "compiler_test",
1570
+ 458,
1571
+ "golden_openclaw_output_test",
1572
+ "Pattern match failed, no pattern matched the value.",
1573
+ {
1574
+ value: $1,
1575
+ start: 17444,
1576
+ end: 17528,
1577
+ pattern_start: 17455,
1578
+ pattern_end: 17467
1579
+ }
1580
+ )
1581
+ }
1582
+ return $should.equal(compiled.skill_md, expected);
1583
+ }
1584
+
1585
+ export function golden_claude_code_output_test() {
1586
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
1587
+ let compiled;
1588
+ if ($ instanceof Ok) {
1589
+ compiled = $[0];
1590
+ } else {
1591
+ throw makeError(
1592
+ "let_assert",
1593
+ FILEPATH,
1594
+ "compiler_test",
1595
+ 464,
1596
+ "golden_claude_code_output_test",
1597
+ "Pattern match failed, no pattern matched the value.",
1598
+ {
1599
+ value: $,
1600
+ start: 17620,
1601
+ end: 17710,
1602
+ pattern_start: 17631,
1603
+ pattern_end: 17643
1604
+ }
1605
+ )
1606
+ }
1607
+ let $1 = $simplifile.read("test/golden/valid-skill.claude-code.md");
1608
+ let expected;
1609
+ if ($1 instanceof Ok) {
1610
+ expected = $1[0];
1611
+ } else {
1612
+ throw makeError(
1613
+ "let_assert",
1614
+ FILEPATH,
1615
+ "compiler_test",
1616
+ 466,
1617
+ "golden_claude_code_output_test",
1618
+ "Pattern match failed, no pattern matched the value.",
1619
+ {
1620
+ value: $1,
1621
+ start: 17713,
1622
+ end: 17800,
1623
+ pattern_start: 17724,
1624
+ pattern_end: 17736
1625
+ }
1626
+ )
1627
+ }
1628
+ return $should.equal(compiled.skill_md, expected);
1629
+ }
1630
+
1631
+ export function golden_codex_output_test() {
1632
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
1633
+ let compiled;
1634
+ if ($ instanceof Ok) {
1635
+ compiled = $[0];
1636
+ } else {
1637
+ throw makeError(
1638
+ "let_assert",
1639
+ FILEPATH,
1640
+ "compiler_test",
1641
+ 472,
1642
+ "golden_codex_output_test",
1643
+ "Pattern match failed, no pattern matched the value.",
1644
+ {
1645
+ value: $,
1646
+ start: 17886,
1647
+ end: 17970,
1648
+ pattern_start: 17897,
1649
+ pattern_end: 17909
1650
+ }
1651
+ )
1652
+ }
1653
+ let $1 = $simplifile.read("test/golden/valid-skill.codex.md");
1654
+ let expected;
1655
+ if ($1 instanceof Ok) {
1656
+ expected = $1[0];
1657
+ } else {
1658
+ throw makeError(
1659
+ "let_assert",
1660
+ FILEPATH,
1661
+ "compiler_test",
1662
+ 474,
1663
+ "golden_codex_output_test",
1664
+ "Pattern match failed, no pattern matched the value.",
1665
+ {
1666
+ value: $1,
1667
+ start: 17973,
1668
+ end: 18050,
1669
+ pattern_start: 17984,
1670
+ pattern_end: 17996
1671
+ }
1672
+ )
1673
+ }
1674
+ return $should.equal(compiled.skill_md, expected);
1675
+ }
1676
+
1677
+ export function compile_hello_world_openclaw_test() {
1678
+ let $ = $compiler.compile("../examples/hello-world", "openclaw");
1679
+ let compiled;
1680
+ if ($ instanceof Ok) {
1681
+ compiled = $[0];
1682
+ } else {
1683
+ throw makeError(
1684
+ "let_assert",
1685
+ FILEPATH,
1686
+ "compiler_test",
1687
+ 483,
1688
+ "compile_hello_world_openclaw_test",
1689
+ "Pattern match failed, no pattern matched the value.",
1690
+ {
1691
+ value: $,
1692
+ start: 18348,
1693
+ end: 18433,
1694
+ pattern_start: 18359,
1695
+ pattern_end: 18371
1696
+ }
1697
+ )
1698
+ }
1699
+ $should.be_true($string.contains(compiled.skill_md, "hello-world v1.0.0"));
1700
+ $should.be_true($string.contains(compiled.skill_md, "OpenClaw Notes"));
1701
+ $should.be_false($string.contains(compiled.skill_md, "Claude Code Notes"));
1702
+ return $should.be_false($string.contains(compiled.skill_md, "{{name}}"));
1703
+ }
1704
+
1705
+ export function compile_hello_world_claude_code_test() {
1706
+ let $ = $compiler.compile("../examples/hello-world", "claude-code");
1707
+ let compiled;
1708
+ if ($ instanceof Ok) {
1709
+ compiled = $[0];
1710
+ } else {
1711
+ throw makeError(
1712
+ "let_assert",
1713
+ FILEPATH,
1714
+ "compiler_test",
1715
+ 492,
1716
+ "compile_hello_world_claude_code_test",
1717
+ "Pattern match failed, no pattern matched the value.",
1718
+ {
1719
+ value: $,
1720
+ start: 18774,
1721
+ end: 18862,
1722
+ pattern_start: 18785,
1723
+ pattern_end: 18797
1724
+ }
1725
+ )
1726
+ }
1727
+ $should.be_true($string.contains(compiled.skill_md, "hello-world v1.0.0"));
1728
+ $should.be_true($string.contains(compiled.skill_md, "Claude Code Notes"));
1729
+ return $should.be_false($string.contains(compiled.skill_md, "OpenClaw Notes"));
1730
+ }
1731
+
1732
+ export function compile_hello_world_codex_test() {
1733
+ let $ = $compiler.compile("../examples/hello-world", "codex");
1734
+ let compiled;
1735
+ if ($ instanceof Ok) {
1736
+ compiled = $[0];
1737
+ } else {
1738
+ throw makeError(
1739
+ "let_assert",
1740
+ FILEPATH,
1741
+ "compiler_test",
1742
+ 500,
1743
+ "compile_hello_world_codex_test",
1744
+ "Pattern match failed, no pattern matched the value.",
1745
+ {
1746
+ value: $,
1747
+ start: 19131,
1748
+ end: 19209,
1749
+ pattern_start: 19142,
1750
+ pattern_end: 19154
1751
+ }
1752
+ )
1753
+ }
1754
+ $should.be_true($string.contains(compiled.skill_md, "hello-world v1.0.0"));
1755
+ $should.be_false($string.contains(compiled.skill_md, "OpenClaw Notes"));
1756
+ return $should.be_false(
1757
+ $string.contains(compiled.skill_md, "Claude Code Notes"),
1758
+ );
1759
+ }
1760
+
1761
+ export function compile_hello_world_all_providers_test() {
1762
+ let $ = $compiler.compile_all("../examples/hello-world");
1763
+ let compiled_list;
1764
+ if ($ instanceof Ok) {
1765
+ compiled_list = $[0];
1766
+ } else {
1767
+ throw makeError(
1768
+ "let_assert",
1769
+ FILEPATH,
1770
+ "compiler_test",
1771
+ 507,
1772
+ "compile_hello_world_all_providers_test",
1773
+ "Pattern match failed, no pattern matched the value.",
1774
+ {
1775
+ value: $,
1776
+ start: 19487,
1777
+ end: 19565,
1778
+ pattern_start: 19498,
1779
+ pattern_end: 19515
1780
+ }
1781
+ )
1782
+ }
1783
+ return $should.equal($list.length(compiled_list), 3);
1784
+ }
1785
+
1786
+ export function escaped_syntax_preserved_in_output_test() {
1787
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1788
+ let compiled;
1789
+ if ($ instanceof Ok) {
1790
+ compiled = $[0];
1791
+ } else {
1792
+ throw makeError(
1793
+ "let_assert",
1794
+ FILEPATH,
1795
+ "compiler_test",
1796
+ 518,
1797
+ "escaped_syntax_preserved_in_output_test",
1798
+ "Pattern match failed, no pattern matched the value.",
1799
+ {
1800
+ value: $,
1801
+ start: 20012,
1802
+ end: 20099,
1803
+ pattern_start: 20023,
1804
+ pattern_end: 20035
1805
+ }
1806
+ )
1807
+ }
1808
+ $should.be_false($string.contains(compiled.skill_md, "{{name}}"));
1809
+ $should.be_false($string.contains(compiled.skill_md, "{{version}}"));
1810
+ return $should.be_false(
1811
+ $string.contains(compiled.skill_md, "{{description}}"),
1812
+ );
1813
+ }
1814
+
1815
+ export function emit_with_scripts_test() {
1816
+ let output_dir = "/tmp/skillc-test-emit-scripts";
1817
+ let $ = $simplifile.delete$(output_dir);
1818
+
1819
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "openclaw");
1820
+ let compiled;
1821
+ if ($1 instanceof Ok) {
1822
+ compiled = $1[0];
1823
+ } else {
1824
+ throw makeError(
1825
+ "let_assert",
1826
+ FILEPATH,
1827
+ "compiler_test",
1828
+ 535,
1829
+ "emit_with_scripts_test",
1830
+ "Pattern match failed, no pattern matched the value.",
1831
+ {
1832
+ value: $1,
1833
+ start: 20768,
1834
+ end: 20855,
1835
+ pattern_start: 20779,
1836
+ pattern_end: 20791
1837
+ }
1838
+ )
1839
+ }
1840
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
1841
+ if (!($2 instanceof Ok)) {
1842
+ throw makeError(
1843
+ "let_assert",
1844
+ FILEPATH,
1845
+ "compiler_test",
1846
+ 537,
1847
+ "emit_with_scripts_test",
1848
+ "Pattern match failed, no pattern matched the value.",
1849
+ {
1850
+ value: $2,
1851
+ start: 20858,
1852
+ end: 20926,
1853
+ pattern_start: 20869,
1854
+ pattern_end: 20874
1855
+ }
1856
+ )
1857
+ }
1858
+ let skill_dir = output_dir + "/openclaw/test-skill";
1859
+ let $3 = $simplifile.is_file(skill_dir + "/scripts/common.sh");
1860
+ if ($3 instanceof Ok) {
1861
+ let $4 = $3[0];
1862
+ if (!($4)) {
1863
+ throw makeError(
1864
+ "let_assert",
1865
+ FILEPATH,
1866
+ "compiler_test",
1867
+ 541,
1868
+ "emit_with_scripts_test",
1869
+ "Pattern match failed, no pattern matched the value.",
1870
+ {
1871
+ value: $3,
1872
+ start: 21017,
1873
+ end: 21092,
1874
+ pattern_start: 21028,
1875
+ pattern_end: 21036
1876
+ }
1877
+ )
1878
+ }
1879
+ } else {
1880
+ throw makeError(
1881
+ "let_assert",
1882
+ FILEPATH,
1883
+ "compiler_test",
1884
+ 541,
1885
+ "emit_with_scripts_test",
1886
+ "Pattern match failed, no pattern matched the value.",
1887
+ {
1888
+ value: $3,
1889
+ start: 21017,
1890
+ end: 21092,
1891
+ pattern_start: 21028,
1892
+ pattern_end: 21036
1893
+ }
1894
+ )
1895
+ }
1896
+ let $5 = $simplifile.is_file(skill_dir + "/scripts/shared.sh");
1897
+ if ($5 instanceof Ok) {
1898
+ let $6 = $5[0];
1899
+ if (!($6)) {
1900
+ throw makeError(
1901
+ "let_assert",
1902
+ FILEPATH,
1903
+ "compiler_test",
1904
+ 542,
1905
+ "emit_with_scripts_test",
1906
+ "Pattern match failed, no pattern matched the value.",
1907
+ {
1908
+ value: $5,
1909
+ start: 21095,
1910
+ end: 21170,
1911
+ pattern_start: 21106,
1912
+ pattern_end: 21114
1913
+ }
1914
+ )
1915
+ }
1916
+ } else {
1917
+ throw makeError(
1918
+ "let_assert",
1919
+ FILEPATH,
1920
+ "compiler_test",
1921
+ 542,
1922
+ "emit_with_scripts_test",
1923
+ "Pattern match failed, no pattern matched the value.",
1924
+ {
1925
+ value: $5,
1926
+ start: 21095,
1927
+ end: 21170,
1928
+ pattern_start: 21106,
1929
+ pattern_end: 21114
1930
+ }
1931
+ )
1932
+ }
1933
+ let $7 = $simplifile.is_file(skill_dir + "/scripts/openclaw-only.sh");
1934
+ if ($7 instanceof Ok) {
1935
+ let $8 = $7[0];
1936
+ if (!($8)) {
1937
+ throw makeError(
1938
+ "let_assert",
1939
+ FILEPATH,
1940
+ "compiler_test",
1941
+ 543,
1942
+ "emit_with_scripts_test",
1943
+ "Pattern match failed, no pattern matched the value.",
1944
+ {
1945
+ value: $7,
1946
+ start: 21173,
1947
+ end: 21259,
1948
+ pattern_start: 21184,
1949
+ pattern_end: 21192
1950
+ }
1951
+ )
1952
+ }
1953
+ } else {
1954
+ throw makeError(
1955
+ "let_assert",
1956
+ FILEPATH,
1957
+ "compiler_test",
1958
+ 543,
1959
+ "emit_with_scripts_test",
1960
+ "Pattern match failed, no pattern matched the value.",
1961
+ {
1962
+ value: $7,
1963
+ start: 21173,
1964
+ end: 21259,
1965
+ pattern_start: 21184,
1966
+ pattern_end: 21192
1967
+ }
1968
+ )
1969
+ }
1970
+ let $9 = $simplifile.is_file(skill_dir + "/assets/template.md");
1971
+ if ($9 instanceof Ok) {
1972
+ let $10 = $9[0];
1973
+ if (!($10)) {
1974
+ throw makeError(
1975
+ "let_assert",
1976
+ FILEPATH,
1977
+ "compiler_test",
1978
+ 547,
1979
+ "emit_with_scripts_test",
1980
+ "Pattern match failed, no pattern matched the value.",
1981
+ {
1982
+ value: $9,
1983
+ start: 21294,
1984
+ end: 21370,
1985
+ pattern_start: 21305,
1986
+ pattern_end: 21313
1987
+ }
1988
+ )
1989
+ }
1990
+ } else {
1991
+ throw makeError(
1992
+ "let_assert",
1993
+ FILEPATH,
1994
+ "compiler_test",
1995
+ 547,
1996
+ "emit_with_scripts_test",
1997
+ "Pattern match failed, no pattern matched the value.",
1998
+ {
1999
+ value: $9,
2000
+ start: 21294,
2001
+ end: 21370,
2002
+ pattern_start: 21305,
2003
+ pattern_end: 21313
2004
+ }
2005
+ )
2006
+ }
2007
+ let $11 = $simplifile.delete$(output_dir);
2008
+
2009
+ return undefined;
2010
+ }
2011
+
2012
+ export function emit_claude_code_structure_test() {
2013
+ let output_dir = "/tmp/skillc-test-emit-cc";
2014
+ let $ = $simplifile.delete$(output_dir);
2015
+
2016
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "claude-code");
2017
+ let compiled;
2018
+ if ($1 instanceof Ok) {
2019
+ compiled = $1[0];
2020
+ } else {
2021
+ throw makeError(
2022
+ "let_assert",
2023
+ FILEPATH,
2024
+ "compiler_test",
2025
+ 557,
2026
+ "emit_claude_code_structure_test",
2027
+ "Pattern match failed, no pattern matched the value.",
2028
+ {
2029
+ value: $1,
2030
+ start: 21553,
2031
+ end: 21643,
2032
+ pattern_start: 21564,
2033
+ pattern_end: 21576
2034
+ }
2035
+ )
2036
+ }
2037
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
2038
+ if (!($2 instanceof Ok)) {
2039
+ throw makeError(
2040
+ "let_assert",
2041
+ FILEPATH,
2042
+ "compiler_test",
2043
+ 559,
2044
+ "emit_claude_code_structure_test",
2045
+ "Pattern match failed, no pattern matched the value.",
2046
+ {
2047
+ value: $2,
2048
+ start: 21646,
2049
+ end: 21714,
2050
+ pattern_start: 21657,
2051
+ pattern_end: 21662
2052
+ }
2053
+ )
2054
+ }
2055
+ let $3 = $simplifile.read(output_dir + "/claude-code/test-skill/SKILL.md");
2056
+ let content;
2057
+ if ($3 instanceof Ok) {
2058
+ content = $3[0];
2059
+ } else {
2060
+ throw makeError(
2061
+ "let_assert",
2062
+ FILEPATH,
2063
+ "compiler_test",
2064
+ 562,
2065
+ "emit_claude_code_structure_test",
2066
+ "Pattern match failed, no pattern matched the value.",
2067
+ {
2068
+ value: $3,
2069
+ start: 21781,
2070
+ end: 21875,
2071
+ pattern_start: 21792,
2072
+ pattern_end: 21803
2073
+ }
2074
+ )
2075
+ }
2076
+ $should.be_true($string.contains(content, "test-skill"));
2077
+ let $4 = $simplifile.delete$(output_dir);
2078
+
2079
+ return undefined;
2080
+ }
2081
+
2082
+ export function name_with_special_chars_produces_quoted_yaml_test() {
2083
+ let $ = $compiler.compile("test/fixtures/conflict-metadata", "openclaw");
2084
+ let compiled;
2085
+ if ($ instanceof Ok) {
2086
+ compiled = $[0];
2087
+ } else {
2088
+ throw makeError(
2089
+ "let_assert",
2090
+ FILEPATH,
2091
+ "compiler_test",
2092
+ 577,
2093
+ "name_with_special_chars_produces_quoted_yaml_test",
2094
+ "Pattern match failed, no pattern matched the value.",
2095
+ {
2096
+ value: $,
2097
+ start: 22361,
2098
+ end: 22454,
2099
+ pattern_start: 22372,
2100
+ pattern_end: 22384
2101
+ }
2102
+ )
2103
+ }
2104
+ $should.be_true($string.contains(compiled.skill_md, "name: conflict-test"));
2105
+ return $should.be_true(
2106
+ $string.contains(
2107
+ compiled.skill_md,
2108
+ "description: \"OpenClaw-specific description\"",
2109
+ ),
2110
+ );
2111
+ }
2112
+
2113
+ export function quote_yaml_string_with_newline_test() {
2114
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
2115
+ let compiled;
2116
+ if ($ instanceof Ok) {
2117
+ compiled = $[0];
2118
+ } else {
2119
+ throw makeError(
2120
+ "let_assert",
2121
+ FILEPATH,
2122
+ "compiler_test",
2123
+ 596,
2124
+ "quote_yaml_string_with_newline_test",
2125
+ "Pattern match failed, no pattern matched the value.",
2126
+ {
2127
+ value: $,
2128
+ start: 23294,
2129
+ end: 23378,
2130
+ pattern_start: 23305,
2131
+ pattern_end: 23317
2132
+ }
2133
+ )
2134
+ }
2135
+ return $should.be_true(
2136
+ $string.contains(
2137
+ compiled.skill_md,
2138
+ "description: \"A test skill for validation\"",
2139
+ ),
2140
+ );
2141
+ }
2142
+
2143
+ export function unknown_provider_string_returns_error_test() {
2144
+ let result = $compiler.compile(
2145
+ "test/fixtures/unknown-provider",
2146
+ "my-custom-provider",
2147
+ );
2148
+ $should.be_error(result);
2149
+ let provider;
2150
+ let msg;
2151
+ if (result instanceof Error) {
2152
+ let $ = result[0];
2153
+ if ($ instanceof $error.ProviderError) {
2154
+ provider = $.provider;
2155
+ msg = $.message;
2156
+ } else {
2157
+ throw makeError(
2158
+ "let_assert",
2159
+ FILEPATH,
2160
+ "compiler_test",
2161
+ 613,
2162
+ "unknown_provider_string_returns_error_test",
2163
+ "Pattern match failed, no pattern matched the value.",
2164
+ {
2165
+ value: result,
2166
+ start: 23929,
2167
+ end: 23990,
2168
+ pattern_start: 23940,
2169
+ pattern_end: 23981
2170
+ }
2171
+ )
2172
+ }
2173
+ } else {
2174
+ throw makeError(
2175
+ "let_assert",
2176
+ FILEPATH,
2177
+ "compiler_test",
2178
+ 613,
2179
+ "unknown_provider_string_returns_error_test",
2180
+ "Pattern match failed, no pattern matched the value.",
2181
+ {
2182
+ value: result,
2183
+ start: 23929,
2184
+ end: 23990,
2185
+ pattern_start: 23940,
2186
+ pattern_end: 23981
2187
+ }
2188
+ )
2189
+ }
2190
+ $should.equal(provider, "my-custom-provider");
2191
+ return $should.be_true($string.contains(msg, "Unknown provider"));
2192
+ }
2193
+
2194
+ export function compile_all_unknown_provider_silently_skipped_test() {
2195
+ let $ = $compiler.compile_all("test/fixtures/unknown-provider");
2196
+ let compiled_list;
2197
+ if ($ instanceof Ok) {
2198
+ compiled_list = $[0];
2199
+ } else {
2200
+ throw makeError(
2201
+ "let_assert",
2202
+ FILEPATH,
2203
+ "compiler_test",
2204
+ 621,
2205
+ "compile_all_unknown_provider_silently_skipped_test",
2206
+ "Pattern match failed, no pattern matched the value.",
2207
+ {
2208
+ value: $,
2209
+ start: 24310,
2210
+ end: 24399,
2211
+ pattern_start: 24321,
2212
+ pattern_end: 24338
2213
+ }
2214
+ )
2215
+ }
2216
+ $should.equal($list.length(compiled_list), 1);
2217
+ let compiled;
2218
+ if (compiled_list instanceof $Empty) {
2219
+ throw makeError(
2220
+ "let_assert",
2221
+ FILEPATH,
2222
+ "compiler_test",
2223
+ 624,
2224
+ "compile_all_unknown_provider_silently_skipped_test",
2225
+ "Pattern match failed, no pattern matched the value.",
2226
+ {
2227
+ value: compiled_list,
2228
+ start: 24448,
2229
+ end: 24485,
2230
+ pattern_start: 24459,
2231
+ pattern_end: 24469
2232
+ }
2233
+ )
2234
+ } else {
2235
+ let $1 = compiled_list.tail;
2236
+ if ($1 instanceof $Empty) {
2237
+ compiled = compiled_list.head;
2238
+ } else {
2239
+ throw makeError(
2240
+ "let_assert",
2241
+ FILEPATH,
2242
+ "compiler_test",
2243
+ 624,
2244
+ "compile_all_unknown_provider_silently_skipped_test",
2245
+ "Pattern match failed, no pattern matched the value.",
2246
+ {
2247
+ value: compiled_list,
2248
+ start: 24448,
2249
+ end: 24485,
2250
+ pattern_start: 24459,
2251
+ pattern_end: 24469
2252
+ }
2253
+ )
2254
+ }
2255
+ }
2256
+ $should.equal(compiled.provider, new $types.OpenClaw());
2257
+ return $should.equal(compiled.warnings, toList([]));
2258
+ }
2259
+
2260
+ export function provider_specific_assets_override_shared_test() {
2261
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
2262
+ let compiled;
2263
+ if ($ instanceof Ok) {
2264
+ compiled = $[0];
2265
+ } else {
2266
+ throw makeError(
2267
+ "let_assert",
2268
+ FILEPATH,
2269
+ "compiler_test",
2270
+ 632,
2271
+ "provider_specific_assets_override_shared_test",
2272
+ "Pattern match failed, no pattern matched the value.",
2273
+ {
2274
+ value: $,
2275
+ start: 24760,
2276
+ end: 24847,
2277
+ pattern_start: 24771,
2278
+ pattern_end: 24783
2279
+ }
2280
+ )
2281
+ }
2282
+ let $1 = $list.find(
2283
+ compiled.assets,
2284
+ (f) => { return f.relative_path === "template.md"; },
2285
+ );
2286
+ let template_asset;
2287
+ if ($1 instanceof Ok) {
2288
+ template_asset = $1[0];
2289
+ } else {
2290
+ throw makeError(
2291
+ "let_assert",
2292
+ FILEPATH,
2293
+ "compiler_test",
2294
+ 634,
2295
+ "provider_specific_assets_override_shared_test",
2296
+ "Pattern match failed, no pattern matched the value.",
2297
+ {
2298
+ value: $1,
2299
+ start: 24850,
2300
+ end: 24956,
2301
+ pattern_start: 24861,
2302
+ pattern_end: 24879
2303
+ }
2304
+ )
2305
+ }
2306
+ return $should.be_true(
2307
+ $string.contains(template_asset.src, "providers/openclaw/assets"),
2308
+ );
2309
+ }
2310
+
2311
+ export function has_frontmatter_with_leading_whitespace_integration_test() {
2312
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
2313
+ let compiled;
2314
+ if ($ instanceof Ok) {
2315
+ compiled = $[0];
2316
+ } else {
2317
+ throw makeError(
2318
+ "let_assert",
2319
+ FILEPATH,
2320
+ "compiler_test",
2321
+ 646,
2322
+ "has_frontmatter_with_leading_whitespace_integration_test",
2323
+ "Pattern match failed, no pattern matched the value.",
2324
+ {
2325
+ value: $,
2326
+ start: 25337,
2327
+ end: 25424,
2328
+ pattern_start: 25348,
2329
+ pattern_end: 25360
2330
+ }
2331
+ )
2332
+ }
2333
+ return $should.equal(compiled.warnings, toList([]));
2334
+ }
2335
+
2336
+ export function version_function_returns_expected_value_test() {
2337
+ let v = $skillc.version();
2338
+ return $should.equal(v, "1.1.0");
2339
+ }
2340
+
2341
+ export function codex_compile_produces_codex_yaml_test() {
2342
+ let $ = $compiler.compile("test/fixtures/valid-skill", "codex");
2343
+ let compiled;
2344
+ if ($ instanceof Ok) {
2345
+ compiled = $[0];
2346
+ } else {
2347
+ throw makeError(
2348
+ "let_assert",
2349
+ FILEPATH,
2350
+ "compiler_test",
2351
+ 662,
2352
+ "codex_compile_produces_codex_yaml_test",
2353
+ "Pattern match failed, no pattern matched the value.",
2354
+ {
2355
+ value: $,
2356
+ start: 25900,
2357
+ end: 25984,
2358
+ pattern_start: 25911,
2359
+ pattern_end: 25923
2360
+ }
2361
+ )
2362
+ }
2363
+ $should.be_true($option.is_some(compiled.codex_yaml));
2364
+ let $1 = compiled.codex_yaml;
2365
+ let yaml;
2366
+ if ($1 instanceof $option.Some) {
2367
+ yaml = $1[0];
2368
+ } else {
2369
+ throw makeError(
2370
+ "let_assert",
2371
+ FILEPATH,
2372
+ "compiler_test",
2373
+ 665,
2374
+ "codex_compile_produces_codex_yaml_test",
2375
+ "Pattern match failed, no pattern matched the value.",
2376
+ {
2377
+ value: $1,
2378
+ start: 26041,
2379
+ end: 26091,
2380
+ pattern_start: 26052,
2381
+ pattern_end: 26069
2382
+ }
2383
+ )
2384
+ }
2385
+ $should.be_true($string.contains(yaml, "interface:"));
2386
+ $should.be_true($string.contains(yaml, "display_name:"));
2387
+ return $should.be_true($string.contains(yaml, "policy:"));
2388
+ }
2389
+
2390
+ export function openclaw_compile_no_codex_yaml_test() {
2391
+ let $ = $compiler.compile("test/fixtures/valid-skill", "openclaw");
2392
+ let compiled;
2393
+ if ($ instanceof Ok) {
2394
+ compiled = $[0];
2395
+ } else {
2396
+ throw makeError(
2397
+ "let_assert",
2398
+ FILEPATH,
2399
+ "compiler_test",
2400
+ 672,
2401
+ "openclaw_compile_no_codex_yaml_test",
2402
+ "Pattern match failed, no pattern matched the value.",
2403
+ {
2404
+ value: $,
2405
+ start: 26306,
2406
+ end: 26393,
2407
+ pattern_start: 26317,
2408
+ pattern_end: 26329
2409
+ }
2410
+ )
2411
+ }
2412
+ return $should.be_true($option.is_none(compiled.codex_yaml));
2413
+ }
2414
+
2415
+ export function claude_code_compile_no_codex_yaml_test() {
2416
+ let $ = $compiler.compile("test/fixtures/valid-skill", "claude-code");
2417
+ let compiled;
2418
+ if ($ instanceof Ok) {
2419
+ compiled = $[0];
2420
+ } else {
2421
+ throw makeError(
2422
+ "let_assert",
2423
+ FILEPATH,
2424
+ "compiler_test",
2425
+ 678,
2426
+ "claude_code_compile_no_codex_yaml_test",
2427
+ "Pattern match failed, no pattern matched the value.",
2428
+ {
2429
+ value: $,
2430
+ start: 26503,
2431
+ end: 26593,
2432
+ pattern_start: 26514,
2433
+ pattern_end: 26526
2434
+ }
2435
+ )
2436
+ }
2437
+ return $should.be_true($option.is_none(compiled.codex_yaml));
2438
+ }
2439
+
2440
+ export function emit_codex_generates_openai_yaml_test() {
2441
+ let output_dir = "/tmp/skillc-test-codex-yaml";
2442
+ let $ = $simplifile.delete$(output_dir);
2443
+
2444
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "codex");
2445
+ let compiled;
2446
+ if ($1 instanceof Ok) {
2447
+ compiled = $1[0];
2448
+ } else {
2449
+ throw makeError(
2450
+ "let_assert",
2451
+ FILEPATH,
2452
+ "compiler_test",
2453
+ 687,
2454
+ "emit_codex_generates_openai_yaml_test",
2455
+ "Pattern match failed, no pattern matched the value.",
2456
+ {
2457
+ value: $1,
2458
+ start: 26792,
2459
+ end: 26876,
2460
+ pattern_start: 26803,
2461
+ pattern_end: 26815
2462
+ }
2463
+ )
2464
+ }
2465
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
2466
+ if (!($2 instanceof Ok)) {
2467
+ throw makeError(
2468
+ "let_assert",
2469
+ FILEPATH,
2470
+ "compiler_test",
2471
+ 689,
2472
+ "emit_codex_generates_openai_yaml_test",
2473
+ "Pattern match failed, no pattern matched the value.",
2474
+ {
2475
+ value: $2,
2476
+ start: 26879,
2477
+ end: 26947,
2478
+ pattern_start: 26890,
2479
+ pattern_end: 26895
2480
+ }
2481
+ )
2482
+ }
2483
+ let yaml_path = output_dir + "/codex/.agents/skills/test-skill/agents/openai.yaml";
2484
+ let $3 = $simplifile.read(yaml_path);
2485
+ let content;
2486
+ if ($3 instanceof Ok) {
2487
+ content = $3[0];
2488
+ } else {
2489
+ throw makeError(
2490
+ "let_assert",
2491
+ FILEPATH,
2492
+ "compiler_test",
2493
+ 693,
2494
+ "emit_codex_generates_openai_yaml_test",
2495
+ "Pattern match failed, no pattern matched the value.",
2496
+ {
2497
+ value: $3,
2498
+ start: 27041,
2499
+ end: 27092,
2500
+ pattern_start: 27052,
2501
+ pattern_end: 27063
2502
+ }
2503
+ )
2504
+ }
2505
+ $should.be_true($string.contains(content, "interface:"));
2506
+ $should.be_true($string.contains(content, "display_name:"));
2507
+ $should.be_true($string.contains(content, "policy:"));
2508
+ let $4 = $simplifile.delete$(output_dir);
2509
+
2510
+ return undefined;
2511
+ }
2512
+
2513
+ export function compile_providers_single_test() {
2514
+ let $ = $compiler.compile_providers(
2515
+ "test/fixtures/valid-skill",
2516
+ toList(["openclaw"]),
2517
+ );
2518
+ let compiled_list;
2519
+ if ($ instanceof Ok) {
2520
+ compiled_list = $[0];
2521
+ } else {
2522
+ throw makeError(
2523
+ "let_assert",
2524
+ FILEPATH,
2525
+ "compiler_test",
2526
+ 707,
2527
+ "compile_providers_single_test",
2528
+ "Pattern match failed, no pattern matched the value.",
2529
+ {
2530
+ value: $,
2531
+ start: 27583,
2532
+ end: 27687,
2533
+ pattern_start: 27594,
2534
+ pattern_end: 27611
2535
+ }
2536
+ )
2537
+ }
2538
+ $should.equal($list.length(compiled_list), 1);
2539
+ let compiled;
2540
+ if (compiled_list instanceof $Empty) {
2541
+ throw makeError(
2542
+ "let_assert",
2543
+ FILEPATH,
2544
+ "compiler_test",
2545
+ 710,
2546
+ "compile_providers_single_test",
2547
+ "Pattern match failed, no pattern matched the value.",
2548
+ {
2549
+ value: compiled_list,
2550
+ start: 27736,
2551
+ end: 27773,
2552
+ pattern_start: 27747,
2553
+ pattern_end: 27757
2554
+ }
2555
+ )
2556
+ } else {
2557
+ let $1 = compiled_list.tail;
2558
+ if ($1 instanceof $Empty) {
2559
+ compiled = compiled_list.head;
2560
+ } else {
2561
+ throw makeError(
2562
+ "let_assert",
2563
+ FILEPATH,
2564
+ "compiler_test",
2565
+ 710,
2566
+ "compile_providers_single_test",
2567
+ "Pattern match failed, no pattern matched the value.",
2568
+ {
2569
+ value: compiled_list,
2570
+ start: 27736,
2571
+ end: 27773,
2572
+ pattern_start: 27747,
2573
+ pattern_end: 27757
2574
+ }
2575
+ )
2576
+ }
2577
+ }
2578
+ return $should.equal(compiled.provider, new $types.OpenClaw());
2579
+ }
2580
+
2581
+ export function compile_providers_multiple_test() {
2582
+ let $ = $compiler.compile_providers(
2583
+ "test/fixtures/valid-skill",
2584
+ toList(["openclaw", "codex"]),
2585
+ );
2586
+ let compiled_list;
2587
+ if ($ instanceof Ok) {
2588
+ compiled_list = $[0];
2589
+ } else {
2590
+ throw makeError(
2591
+ "let_assert",
2592
+ FILEPATH,
2593
+ "compiler_test",
2594
+ 715,
2595
+ "compile_providers_multiple_test",
2596
+ "Pattern match failed, no pattern matched the value.",
2597
+ {
2598
+ value: $,
2599
+ start: 27872,
2600
+ end: 27998,
2601
+ pattern_start: 27883,
2602
+ pattern_end: 27900
2603
+ }
2604
+ )
2605
+ }
2606
+ $should.equal($list.length(compiled_list), 2);
2607
+ let providers = $list.map(compiled_list, (c) => { return c.provider; });
2608
+ $should.be_true($list.contains(providers, new $types.OpenClaw()));
2609
+ return $should.be_true($list.contains(providers, new $types.Codex()));
2610
+ }
2611
+
2612
+ export function compile_providers_invalid_provider_fails_test() {
2613
+ let result = $compiler.compile_providers(
2614
+ "test/fixtures/valid-skill",
2615
+ toList(["openclaw", "invalid"]),
2616
+ );
2617
+ $should.be_error(result);
2618
+ if (result instanceof Error) {
2619
+ let $ = result[0];
2620
+ if ($ instanceof $error.ProviderError) {
2621
+ let $1 = $.provider;
2622
+ if (!($1 === "invalid")) {
2623
+ throw makeError(
2624
+ "let_assert",
2625
+ FILEPATH,
2626
+ "compiler_test",
2627
+ 731,
2628
+ "compile_providers_invalid_provider_fails_test",
2629
+ "Pattern match failed, no pattern matched the value.",
2630
+ {
2631
+ value: result,
2632
+ start: 28425,
2633
+ end: 28485,
2634
+ pattern_start: 28436,
2635
+ pattern_end: 28476
2636
+ }
2637
+ )
2638
+ }
2639
+ } else {
2640
+ throw makeError(
2641
+ "let_assert",
2642
+ FILEPATH,
2643
+ "compiler_test",
2644
+ 731,
2645
+ "compile_providers_invalid_provider_fails_test",
2646
+ "Pattern match failed, no pattern matched the value.",
2647
+ {
2648
+ value: result,
2649
+ start: 28425,
2650
+ end: 28485,
2651
+ pattern_start: 28436,
2652
+ pattern_end: 28476
2653
+ }
2654
+ )
2655
+ }
2656
+ } else {
2657
+ throw makeError(
2658
+ "let_assert",
2659
+ FILEPATH,
2660
+ "compiler_test",
2661
+ 731,
2662
+ "compile_providers_invalid_provider_fails_test",
2663
+ "Pattern match failed, no pattern matched the value.",
2664
+ {
2665
+ value: result,
2666
+ start: 28425,
2667
+ end: 28485,
2668
+ pattern_start: 28436,
2669
+ pattern_end: 28476
2670
+ }
2671
+ )
2672
+ }
2673
+ return result;
2674
+ }
2675
+
2676
+ export function compile_providers_empty_list_fails_test() {
2677
+ let result = $compiler.compile_providers(
2678
+ "test/fixtures/valid-skill",
2679
+ toList([]),
2680
+ );
2681
+ return $should.be_error(result);
2682
+ }
2683
+
2684
+ export function check_dependencies_missing_dep_warns_test() {
2685
+ let $ = $simplifile.read("test/fixtures/skill-with-deps/skill.yaml");
2686
+ let skill_content;
2687
+ if ($ instanceof Ok) {
2688
+ skill_content = $[0];
2689
+ } else {
2690
+ throw makeError(
2691
+ "let_assert",
2692
+ FILEPATH,
2693
+ "compiler_test",
2694
+ 744,
2695
+ "check_dependencies_missing_dep_warns_test",
2696
+ "Pattern match failed, no pattern matched the value.",
2697
+ {
2698
+ value: $,
2699
+ start: 28885,
2700
+ end: 28979,
2701
+ pattern_start: 28896,
2702
+ pattern_end: 28913
2703
+ }
2704
+ )
2705
+ }
2706
+ let $1 = $skillc.run(toList(["check", "test/fixtures/skill-with-deps"]));
2707
+ if (!($1 instanceof Ok)) {
2708
+ throw makeError(
2709
+ "let_assert",
2710
+ FILEPATH,
2711
+ "compiler_test",
2712
+ 746,
2713
+ "check_dependencies_missing_dep_warns_test",
2714
+ "Pattern match failed, no pattern matched the value.",
2715
+ {
2716
+ value: $1,
2717
+ start: 28982,
2718
+ end: 29055,
2719
+ pattern_start: 28993,
2720
+ pattern_end: 28998
2721
+ }
2722
+ )
2723
+ }
2724
+ let $2 = $parser.parse_skill_yaml(skill_content);
2725
+ let parsed_skill;
2726
+ if ($2 instanceof Ok) {
2727
+ parsed_skill = $2[0];
2728
+ } else {
2729
+ throw makeError(
2730
+ "let_assert",
2731
+ FILEPATH,
2732
+ "compiler_test",
2733
+ 748,
2734
+ "check_dependencies_missing_dep_warns_test",
2735
+ "Pattern match failed, no pattern matched the value.",
2736
+ {
2737
+ value: $2,
2738
+ start: 29141,
2739
+ end: 29213,
2740
+ pattern_start: 29152,
2741
+ pattern_end: 29168
2742
+ }
2743
+ )
2744
+ }
2745
+ let output_dir = "/tmp/skillc-test-dep-check";
2746
+ let $3 = $simplifile.delete$(output_dir);
2747
+
2748
+ let $4 = $simplifile.create_directory_all(output_dir);
2749
+ if (!($4 instanceof Ok)) {
2750
+ throw makeError(
2751
+ "let_assert",
2752
+ FILEPATH,
2753
+ "compiler_test",
2754
+ 752,
2755
+ "check_dependencies_missing_dep_warns_test",
2756
+ "Pattern match failed, no pattern matched the value.",
2757
+ {
2758
+ value: $4,
2759
+ start: 29304,
2760
+ end: 29366,
2761
+ pattern_start: 29315,
2762
+ pattern_end: 29320
2763
+ }
2764
+ )
2765
+ }
2766
+ let warnings = $compiler.check_dependencies(parsed_skill, output_dir);
2767
+ $should.equal($list.length(warnings), 1);
2768
+ let dep;
2769
+ if (warnings instanceof $Empty) {
2770
+ throw makeError(
2771
+ "let_assert",
2772
+ FILEPATH,
2773
+ "compiler_test",
2774
+ 755,
2775
+ "check_dependencies_missing_dep_warns_test",
2776
+ "Pattern match failed, no pattern matched the value.",
2777
+ {
2778
+ value: warnings,
2779
+ start: 29481,
2780
+ end: 29533,
2781
+ pattern_start: 29492,
2782
+ pattern_end: 29522
2783
+ }
2784
+ )
2785
+ } else {
2786
+ let $5 = warnings.head;
2787
+ if ($5 instanceof $types.MissingDependency) {
2788
+ let $6 = warnings.tail;
2789
+ if ($6 instanceof $Empty) {
2790
+ dep = $5.dependency;
2791
+ } else {
2792
+ throw makeError(
2793
+ "let_assert",
2794
+ FILEPATH,
2795
+ "compiler_test",
2796
+ 755,
2797
+ "check_dependencies_missing_dep_warns_test",
2798
+ "Pattern match failed, no pattern matched the value.",
2799
+ {
2800
+ value: warnings,
2801
+ start: 29481,
2802
+ end: 29533,
2803
+ pattern_start: 29492,
2804
+ pattern_end: 29522
2805
+ }
2806
+ )
2807
+ }
2808
+ } else {
2809
+ throw makeError(
2810
+ "let_assert",
2811
+ FILEPATH,
2812
+ "compiler_test",
2813
+ 755,
2814
+ "check_dependencies_missing_dep_warns_test",
2815
+ "Pattern match failed, no pattern matched the value.",
2816
+ {
2817
+ value: warnings,
2818
+ start: 29481,
2819
+ end: 29533,
2820
+ pattern_start: 29492,
2821
+ pattern_end: 29522
2822
+ }
2823
+ )
2824
+ }
2825
+ }
2826
+ $should.equal(dep.name, "helper-skill");
2827
+ let $7 = $simplifile.delete$(output_dir);
2828
+
2829
+ return undefined;
2830
+ }
2831
+
2832
+ export function check_dependencies_optional_not_warned_test() {
2833
+ let $ = $simplifile.read("test/fixtures/skill-with-deps/skill.yaml");
2834
+ let skill_content;
2835
+ if ($ instanceof Ok) {
2836
+ skill_content = $[0];
2837
+ } else {
2838
+ throw makeError(
2839
+ "let_assert",
2840
+ FILEPATH,
2841
+ "compiler_test",
2842
+ 762,
2843
+ "check_dependencies_optional_not_warned_test",
2844
+ "Pattern match failed, no pattern matched the value.",
2845
+ {
2846
+ value: $,
2847
+ start: 29681,
2848
+ end: 29775,
2849
+ pattern_start: 29692,
2850
+ pattern_end: 29709
2851
+ }
2852
+ )
2853
+ }
2854
+ let $1 = $parser.parse_skill_yaml(skill_content);
2855
+ let skill;
2856
+ if ($1 instanceof Ok) {
2857
+ skill = $1[0];
2858
+ } else {
2859
+ throw makeError(
2860
+ "let_assert",
2861
+ FILEPATH,
2862
+ "compiler_test",
2863
+ 764,
2864
+ "check_dependencies_optional_not_warned_test",
2865
+ "Pattern match failed, no pattern matched the value.",
2866
+ {
2867
+ value: $1,
2868
+ start: 29778,
2869
+ end: 29839,
2870
+ pattern_start: 29789,
2871
+ pattern_end: 29798
2872
+ }
2873
+ )
2874
+ }
2875
+ let output_dir = "/tmp/skillc-test-dep-optional";
2876
+ let $2 = $simplifile.delete$(output_dir);
2877
+
2878
+ let $3 = $simplifile.create_directory_all(output_dir);
2879
+ if (!($3 instanceof Ok)) {
2880
+ throw makeError(
2881
+ "let_assert",
2882
+ FILEPATH,
2883
+ "compiler_test",
2884
+ 767,
2885
+ "check_dependencies_optional_not_warned_test",
2886
+ "Pattern match failed, no pattern matched the value.",
2887
+ {
2888
+ value: $3,
2889
+ start: 29933,
2890
+ end: 29995,
2891
+ pattern_start: 29944,
2892
+ pattern_end: 29949
2893
+ }
2894
+ )
2895
+ }
2896
+ let warnings = $compiler.check_dependencies(skill, output_dir);
2897
+ let names = $list.map(
2898
+ warnings,
2899
+ (w) => {
2900
+ if (w instanceof $types.MissingDependency) {
2901
+ let dep = w.dependency;
2902
+ return dep.name;
2903
+ } else {
2904
+ return "";
2905
+ }
2906
+ },
2907
+ );
2908
+ $should.be_false($list.contains(names, "optional-skill"));
2909
+ let $4 = $simplifile.delete$(output_dir);
2910
+
2911
+ return undefined;
2912
+ }
2913
+
2914
+ export function check_dependencies_present_dep_no_warn_test() {
2915
+ let $ = $simplifile.read("test/fixtures/skill-with-deps/skill.yaml");
2916
+ let skill_content;
2917
+ if ($ instanceof Ok) {
2918
+ skill_content = $[0];
2919
+ } else {
2920
+ throw makeError(
2921
+ "let_assert",
2922
+ FILEPATH,
2923
+ "compiler_test",
2924
+ 782,
2925
+ "check_dependencies_present_dep_no_warn_test",
2926
+ "Pattern match failed, no pattern matched the value.",
2927
+ {
2928
+ value: $,
2929
+ start: 30424,
2930
+ end: 30518,
2931
+ pattern_start: 30435,
2932
+ pattern_end: 30452
2933
+ }
2934
+ )
2935
+ }
2936
+ let $1 = $parser.parse_skill_yaml(skill_content);
2937
+ let skill;
2938
+ if ($1 instanceof Ok) {
2939
+ skill = $1[0];
2940
+ } else {
2941
+ throw makeError(
2942
+ "let_assert",
2943
+ FILEPATH,
2944
+ "compiler_test",
2945
+ 784,
2946
+ "check_dependencies_present_dep_no_warn_test",
2947
+ "Pattern match failed, no pattern matched the value.",
2948
+ {
2949
+ value: $1,
2950
+ start: 30521,
2951
+ end: 30582,
2952
+ pattern_start: 30532,
2953
+ pattern_end: 30541
2954
+ }
2955
+ )
2956
+ }
2957
+ let output_dir = "/tmp/skillc-test-dep-present";
2958
+ let $2 = $simplifile.delete$(output_dir);
2959
+
2960
+ let dep_dir = output_dir + "/openclaw/helper-skill";
2961
+ let $3 = $simplifile.create_directory_all(dep_dir);
2962
+ if (!($3 instanceof Ok)) {
2963
+ throw makeError(
2964
+ "let_assert",
2965
+ FILEPATH,
2966
+ "compiler_test",
2967
+ 789,
2968
+ "check_dependencies_present_dep_no_warn_test",
2969
+ "Pattern match failed, no pattern matched the value.",
2970
+ {
2971
+ value: $3,
2972
+ start: 30767,
2973
+ end: 30826,
2974
+ pattern_start: 30778,
2975
+ pattern_end: 30783
2976
+ }
2977
+ )
2978
+ }
2979
+ let $4 = $simplifile.write(
2980
+ dep_dir + "/SKILL.md",
2981
+ "---\nname: helper-skill\n---\n",
2982
+ );
2983
+ if (!($4 instanceof Ok)) {
2984
+ throw makeError(
2985
+ "let_assert",
2986
+ FILEPATH,
2987
+ "compiler_test",
2988
+ 790,
2989
+ "check_dependencies_present_dep_no_warn_test",
2990
+ "Pattern match failed, no pattern matched the value.",
2991
+ {
2992
+ value: $4,
2993
+ start: 30829,
2994
+ end: 30926,
2995
+ pattern_start: 30840,
2996
+ pattern_end: 30845
2997
+ }
2998
+ )
2999
+ }
3000
+ let warnings = $compiler.check_dependencies(skill, output_dir);
3001
+ $should.equal(warnings, toList([]));
3002
+ let $5 = $simplifile.delete$(output_dir);
3003
+
3004
+ return undefined;
3005
+ }
3006
+
3007
+ export function compile_with_deps_shows_warning_test() {
3008
+ let output_dir = "/tmp/skillc-test-compile-deps";
3009
+ let $ = $simplifile.delete$(output_dir);
3010
+
3011
+ let $1 = $skillc.run(
3012
+ toList(["compile", "test/fixtures/skill-with-deps", "--output", output_dir]),
3013
+ );
3014
+ let output;
3015
+ if ($1 instanceof Ok) {
3016
+ output = $1[0];
3017
+ } else {
3018
+ throw makeError(
3019
+ "let_assert",
3020
+ FILEPATH,
3021
+ "compiler_test",
3022
+ 801,
3023
+ "compile_with_deps_shows_warning_test",
3024
+ "Pattern match failed, no pattern matched the value.",
3025
+ {
3026
+ value: $1,
3027
+ start: 31210,
3028
+ end: 31349,
3029
+ pattern_start: 31221,
3030
+ pattern_end: 31231
3031
+ }
3032
+ )
3033
+ }
3034
+ $should.be_true($string.contains(output, "helper-skill"));
3035
+ $should.be_true($string.contains(output, "Warning"));
3036
+ let $2 = $simplifile.delete$(output_dir);
3037
+
3038
+ return undefined;
3039
+ }
3040
+
3041
+ export function emit_openclaw_no_openai_yaml_test() {
3042
+ let output_dir = "/tmp/skillc-test-no-codex-yaml";
3043
+ let $ = $simplifile.delete$(output_dir);
3044
+
3045
+ let $1 = $compiler.compile("test/fixtures/valid-skill", "openclaw");
3046
+ let compiled;
3047
+ if ($1 instanceof Ok) {
3048
+ compiled = $1[0];
3049
+ } else {
3050
+ throw makeError(
3051
+ "let_assert",
3052
+ FILEPATH,
3053
+ "compiler_test",
3054
+ 818,
3055
+ "emit_openclaw_no_openai_yaml_test",
3056
+ "Pattern match failed, no pattern matched the value.",
3057
+ {
3058
+ value: $1,
3059
+ start: 31650,
3060
+ end: 31737,
3061
+ pattern_start: 31661,
3062
+ pattern_end: 31673
3063
+ }
3064
+ )
3065
+ }
3066
+ let $2 = $compiler.emit(compiled, output_dir, "test-skill");
3067
+ if (!($2 instanceof Ok)) {
3068
+ throw makeError(
3069
+ "let_assert",
3070
+ FILEPATH,
3071
+ "compiler_test",
3072
+ 820,
3073
+ "emit_openclaw_no_openai_yaml_test",
3074
+ "Pattern match failed, no pattern matched the value.",
3075
+ {
3076
+ value: $2,
3077
+ start: 31740,
3078
+ end: 31808,
3079
+ pattern_start: 31751,
3080
+ pattern_end: 31756
3081
+ }
3082
+ )
3083
+ }
3084
+ let yaml_path = output_dir + "/openclaw/test-skill/agents/openai.yaml";
3085
+ $should.be_true(!isEqual($simplifile.is_file(yaml_path), new Ok(true)));
3086
+ let $3 = $simplifile.delete$(output_dir);
3087
+
3088
+ return undefined;
3089
+ }