skillstogether 0.1.6 → 0.1.8

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 (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -398,16 +398,19 @@ function generateSkillContent(skill, organizationSlug, filesChecksum) {
398
398
  const frontmatter = [
399
399
  "---",
400
400
  `name: ${escapeYaml(skill.name)}`,
401
+ skill.description ? `description: ${escapeYaml(skill.description)}` : null,
401
402
  `slug: ${escapeYaml(skill.slug)}`,
402
403
  `organization: ${escapeYaml(organizationSlug)}`,
403
- skill.description ? `description: ${escapeYaml(skill.description)}` : null,
404
- `createdBy: ${escapeYaml(skill.createdBy.name)}`,
404
+ skill.createdBy.name ? `createdBy: ${escapeYaml(skill.createdBy.name)}` : null,
405
405
  `installedAt: ${(/* @__PURE__ */ new Date()).toISOString()}`,
406
406
  filesChecksum ? `filesChecksum: ${filesChecksum}` : null,
407
- "---",
408
- ""
409
- ].filter(Boolean).join("\n");
410
- return frontmatter + (skill.content || "");
407
+ "---"
408
+ ].filter((line) => line !== null && line !== void 0).join("\n");
409
+ const body = skill.content || "";
410
+ const separator = body ? body.startsWith("\n") || body.startsWith("\r\n") ? "\n" : "\n\n" : "\n";
411
+ const content = frontmatter + separator + body;
412
+ return content.endsWith("\n") ? content : `${content}
413
+ `;
411
414
  }
412
415
  async function downloadFile(url) {
413
416
  return fetchWithSizeLimit(url, {
@@ -415,7 +418,10 @@ async function downloadFile(url) {
415
418
  timeout: DEFAULT_REQUEST_TIMEOUT_MS
416
419
  });
417
420
  }
418
- var SKILL_FOLDER_PATTERN = (organizationSlug, skillSlug) => `${organizationSlug}-${skillSlug}`;
421
+ var SKILL_FOLDER_PATTERN = (organizationSlug, skillSlug) => {
422
+ const prefix = `${organizationSlug}-`;
423
+ return skillSlug.startsWith(prefix) ? skillSlug : `${prefix}${skillSlug}`;
424
+ };
419
425
  var SKILL_FILENAME = "SKILL.md";
420
426
  async function installSkill(skill, organizationSlug, options) {
421
427
  if (!isValidSlug(organizationSlug)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillstogether",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "CLI tool to install skills",
5
5
  "keywords": [
6
6
  "cli",