heymark 2.0.0 → 2.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 (38) hide show
  1. package/LICENSE +21 -21
  2. package/README.ko.md +121 -123
  3. package/README.md +123 -125
  4. package/package.json +57 -56
  5. package/src/alias.js +41 -0
  6. package/src/commands/clean/index.js +17 -0
  7. package/src/commands/cleaner.js +27 -0
  8. package/src/commands/constants.js +14 -0
  9. package/src/commands/help/index.js +34 -0
  10. package/src/commands/link/flags/branch.js +18 -0
  11. package/src/commands/link/flags/folder.js +18 -0
  12. package/src/commands/link/index.js +58 -0
  13. package/src/commands/select-tools.js +35 -0
  14. package/src/commands/sync/index.js +35 -0
  15. package/src/index.js +52 -0
  16. package/src/skill-repo/cache-folder.js +77 -0
  17. package/src/skill-repo/config-file.js +87 -0
  18. package/src/skill-repo/constants.js +14 -0
  19. package/src/skill-repo/skill-file-parser.js +79 -0
  20. package/src/tools/antigravity/index.js +33 -0
  21. package/src/tools/claude-code/index.js +33 -0
  22. package/src/tools/codex/index.js +33 -0
  23. package/src/tools/constants.js +52 -0
  24. package/src/tools/copilot/index.js +40 -0
  25. package/src/tools/cursor/index.js +39 -0
  26. package/src/tools/loader.js +17 -0
  27. package/src/tools/openclaw/index.js +72 -0
  28. package/src/tools/skill-per-file.js +29 -0
  29. package/src/tools/skill-per-folder.js +18 -0
  30. package/scripts/cli.js +0 -375
  31. package/scripts/lib/config.js +0 -126
  32. package/scripts/lib/parser.js +0 -125
  33. package/scripts/lib/repo.js +0 -97
  34. package/scripts/tools/antigravity.js +0 -49
  35. package/scripts/tools/claude.js +0 -49
  36. package/scripts/tools/codex.js +0 -49
  37. package/scripts/tools/copilot.js +0 -61
  38. package/scripts/tools/cursor.js +0 -48
package/src/alias.js ADDED
@@ -0,0 +1,41 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const Module = require("module");
4
+
5
+ const PREFIX = "@/";
6
+ const REGISTERED_KEY = "__heymark_alias_registered__";
7
+ const ROOT = __dirname;
8
+
9
+ function getPath(request) {
10
+ if (!request.startsWith(PREFIX)) {
11
+ return null;
12
+ }
13
+
14
+ const rest = request.slice(PREFIX.length);
15
+ const base = path.join(ROOT, rest);
16
+ const candidates = [`${base}.js`, path.join(base, "index.js"), base];
17
+
18
+ const found = candidates.find((c) => fs.existsSync(c));
19
+ return found || base;
20
+ }
21
+
22
+ function registerPath() {
23
+ const g = /** @type {Record<string, unknown>} */ (globalThis);
24
+ if (g[REGISTERED_KEY] === true) {
25
+ return;
26
+ }
27
+
28
+ const original = Module._resolveFilename;
29
+
30
+ Module._resolveFilename = function (request, parent, isMain, options) {
31
+ const resolved = typeof request === "string" ? getPath(request) : null;
32
+ if (resolved) {
33
+ return original.call(this, resolved, parent, isMain, options);
34
+ }
35
+ return original.call(this, request, parent, isMain, options);
36
+ };
37
+
38
+ g[REGISTERED_KEY] = true;
39
+ }
40
+
41
+ registerPath();
@@ -0,0 +1,17 @@
1
+ const { cleaner } = require("@/commands/cleaner");
2
+ const { selectTools } = require("@/commands/select-tools");
3
+ const { readCache } = require("@/skill-repo/cache-folder");
4
+
5
+ function runClean(flags, context) {
6
+ const selectedTools = selectTools(flags, context.tools);
7
+ const { skills } = readCache(context.cwd);
8
+
9
+ const skillNames = skills.map((s) => s.name);
10
+ const cleanedCount = cleaner(context.tools, selectedTools, skillNames, context.cwd);
11
+
12
+ console.log(`[Done] ${cleanedCount} tools cleaned.`);
13
+ }
14
+
15
+ module.exports = {
16
+ runClean,
17
+ };
@@ -0,0 +1,27 @@
1
+ function cleaner(tools, selectedTools, skillNames, cwd) {
2
+ let headerPrinted = false;
3
+ let cleanedCount = 0;
4
+
5
+ for (const toolKey of selectedTools) {
6
+ const cleanedPaths = tools[toolKey].clean(skillNames, cwd);
7
+ if (cleanedPaths.length === 0) continue;
8
+
9
+ if (!headerPrinted) {
10
+ console.log("[Clean]");
11
+ headerPrinted = true;
12
+ }
13
+
14
+ cleanedPaths.forEach((p) => console.log(` Removed: ${p}`));
15
+ cleanedCount++;
16
+ }
17
+
18
+ if (headerPrinted) {
19
+ console.log("");
20
+ }
21
+
22
+ return cleanedCount;
23
+ }
24
+
25
+ module.exports = {
26
+ cleaner,
27
+ };
@@ -0,0 +1,14 @@
1
+ const COMMAND_LINK = "link";
2
+ const COMMAND_SYNC = "sync";
3
+ const COMMAND_CLEAN = "clean";
4
+ const COMMAND_HELP = "help";
5
+
6
+ const LATEST_VERSION_COMMAND = "npx heymark@latest";
7
+
8
+ module.exports = {
9
+ COMMAND_LINK,
10
+ COMMAND_SYNC,
11
+ COMMAND_CLEAN,
12
+ COMMAND_HELP,
13
+ LATEST_VERSION_COMMAND,
14
+ };
@@ -0,0 +1,34 @@
1
+ const { LATEST_VERSION_COMMAND } = require("@/commands/constants");
2
+
3
+ function runHelp(flags, context) {
4
+ if (flags.length > 0) {
5
+ console.error(`[Error] Unknown: ${flags.join(", ")}. help takes no arguments.`);
6
+ process.exit(1);
7
+ }
8
+
9
+ const toolLines = Object.entries(context.tools)
10
+ .map(([key, tool]) => ` ${key.padEnd(14)} ${tool.output}`)
11
+ .join("\n");
12
+
13
+ console.log(`
14
+ Usage:
15
+ heymark link <repo-url>
16
+ heymark sync .
17
+ heymark sync <tool1> <tool2> ...
18
+ heymark clean .
19
+ heymark clean <tool1> <tool2> ...
20
+
21
+ Link flags:
22
+ --branch | -b
23
+ --folder | -f
24
+
25
+ Supported tools:
26
+ ${toolLines}
27
+
28
+ Update: ${LATEST_VERSION_COMMAND}
29
+ `);
30
+ }
31
+
32
+ module.exports = {
33
+ runHelp,
34
+ };
@@ -0,0 +1,18 @@
1
+ const key = "branch";
2
+ const FLAG = "--branch";
3
+ const SHORT_FLAG = "-b";
4
+
5
+ function is(flag) {
6
+ return flag === FLAG || flag === SHORT_FLAG;
7
+ }
8
+
9
+ function parse(flags, index) {
10
+ const value = flags[index + 1];
11
+ if (!value) {
12
+ console.error("[Error] --branch needs a value.");
13
+ process.exit(1);
14
+ }
15
+ return { value: value.trim(), advance: 1 };
16
+ }
17
+
18
+ module.exports = { key, is, parse };
@@ -0,0 +1,18 @@
1
+ const key = "folder";
2
+ const FLAG = "--folder";
3
+ const SHORT_FLAG = "-f";
4
+
5
+ function is(flag) {
6
+ return flag === FLAG || flag === SHORT_FLAG;
7
+ }
8
+
9
+ function parse(flags, index) {
10
+ const value = flags[index + 1];
11
+ if (!value) {
12
+ console.error("[Error] --folder needs a value.");
13
+ process.exit(1);
14
+ }
15
+ return { value: value.trim(), advance: 1 };
16
+ }
17
+
18
+ module.exports = { key, is, parse };
@@ -0,0 +1,58 @@
1
+ const path = require("path");
2
+ const { writeConfig } = require("@/skill-repo/config-file");
3
+ const { SKILL_REPO_DEFAULT_BRANCH } = require("@/skill-repo/constants");
4
+ const branch = require("@/commands/link/flags/branch");
5
+ const folder = require("@/commands/link/flags/folder");
6
+
7
+ function parseFlags(flags, handlers) {
8
+ const result = {};
9
+ for (let i = 0; i < flags.length; i++) {
10
+ const flag = flags[i];
11
+ const handler = handlers.find((h) => h.is(flag));
12
+ if (handler) {
13
+ const parsed = handler.parse(flags, i);
14
+ result[handler.key] = parsed.value;
15
+ i += parsed.advance;
16
+ continue;
17
+ }
18
+ console.error(`[Error] Unknown flag: ${flag}`);
19
+ process.exit(1);
20
+ }
21
+ return result;
22
+ }
23
+
24
+ function parseConfig(flags) {
25
+ const repoUrl = flags[0];
26
+ if (!repoUrl || repoUrl.startsWith("--")) {
27
+ console.error(
28
+ "[Error] Provide a repo URL. Example: heymark link https://github.com/org/repo.git"
29
+ );
30
+ process.exit(1);
31
+ }
32
+
33
+ const parsed = parseFlags(flags.slice(1), [branch, folder]);
34
+
35
+ return {
36
+ repoUrl: repoUrl.trim(),
37
+ branch: parsed.branch || SKILL_REPO_DEFAULT_BRANCH,
38
+ folder: parsed.folder || "",
39
+ };
40
+ }
41
+
42
+ function runLink(flags, context) {
43
+ const config = parseConfig(flags);
44
+ const configPath = writeConfig(context.cwd, config);
45
+
46
+ console.log(`[Link] Saved to ${path.relative(context.cwd, configPath) || configPath}`);
47
+ console.log(` repo: ${config.repoUrl}`);
48
+ if (config.branch !== SKILL_REPO_DEFAULT_BRANCH) {
49
+ console.log(` branch: ${config.branch}`);
50
+ }
51
+ if (config.folder) {
52
+ console.log(` folder: ${config.folder}`);
53
+ }
54
+ }
55
+
56
+ module.exports = {
57
+ runLink,
58
+ };
@@ -0,0 +1,35 @@
1
+ const ALL_TOOLS_TOKEN = ".";
2
+
3
+ function selectTools(flags, availableTools) {
4
+ const availableToolKeys = Object.keys(availableTools);
5
+ if (flags.length === 0) {
6
+ return availableToolKeys;
7
+ }
8
+
9
+ if (flags.some((tool) => tool.includes(","))) {
10
+ console.error("[Error] Use spaces between tools, not commas.");
11
+ process.exit(1);
12
+ }
13
+
14
+ if (flags.includes(ALL_TOOLS_TOKEN)) {
15
+ if (flags.length > 1) {
16
+ console.error("[Error] Use '.' alone for all tools.");
17
+ process.exit(1);
18
+ }
19
+ return availableToolKeys;
20
+ }
21
+
22
+ const invalid = flags.filter((tool) => !availableTools[tool]);
23
+ if (invalid.length > 0) {
24
+ console.error(
25
+ `[Error] Unknown: ${invalid.join(", ")}. Available: ${availableToolKeys.join(", ")}`
26
+ );
27
+ process.exit(1);
28
+ }
29
+
30
+ return Array.from(new Set(flags));
31
+ }
32
+
33
+ module.exports = {
34
+ selectTools,
35
+ };
@@ -0,0 +1,35 @@
1
+ const { cleaner } = require("@/commands/cleaner");
2
+ const { selectTools } = require("@/commands/select-tools");
3
+ const { readCache } = require("@/skill-repo/cache-folder");
4
+ const { readConfig } = require("@/skill-repo/config-file");
5
+ const { SKILL_REPO_DEFAULT_BRANCH } = require("@/skill-repo/constants");
6
+
7
+ function runSync(flags, context) {
8
+ const selectedTools = selectTools(flags, context.tools);
9
+ const { skills } = readCache(context.cwd);
10
+ const config = readConfig(context.cwd);
11
+
12
+ console.log("[Sync]");
13
+ if (config) {
14
+ console.log(` repo: ${config.repoUrl}`);
15
+ if (config.folder) console.log(` folder: ${config.folder}`);
16
+ if (config.branch !== SKILL_REPO_DEFAULT_BRANCH) console.log(` branch: ${config.branch}`);
17
+ }
18
+ console.log("");
19
+
20
+ const skillNames = skills.map((s) => s.name);
21
+ cleaner(context.tools, selectedTools, skillNames, context.cwd);
22
+
23
+ for (const toolKey of selectedTools) {
24
+ const tool = context.tools[toolKey];
25
+ const count = tool.generate(skills, context.cwd);
26
+ console.log(` ${tool.name.padEnd(16)} -> ${tool.output} (${count} skills)`);
27
+ }
28
+
29
+ console.log("");
30
+ console.log(`[Done] ${selectedTools.length} tools synced.`);
31
+ }
32
+
33
+ module.exports = {
34
+ runSync,
35
+ };
package/src/index.js ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+
3
+ require("./alias.js");
4
+
5
+ const { COMMAND_LINK, COMMAND_SYNC, COMMAND_CLEAN, COMMAND_HELP } = require("@/commands/constants");
6
+ const { runLink } = require("@/commands/link");
7
+ const { runSync } = require("@/commands/sync");
8
+ const { runClean } = require("@/commands/clean");
9
+ const { runHelp } = require("@/commands/help");
10
+ const { loadTools } = require("@/tools/loader");
11
+
12
+ function main() {
13
+ const context = {
14
+ cwd: process.cwd(),
15
+ tools: loadTools(),
16
+ };
17
+
18
+ const args = process.argv.slice(2);
19
+
20
+ if (args.length === 0) {
21
+ runHelp([], context);
22
+ return;
23
+ }
24
+
25
+ const command = args[0];
26
+ const flags = args.slice(1);
27
+
28
+ if (command === COMMAND_LINK) {
29
+ runLink(flags, context);
30
+ return;
31
+ }
32
+
33
+ if (command === COMMAND_SYNC) {
34
+ runSync(flags, context);
35
+ return;
36
+ }
37
+
38
+ if (command === COMMAND_CLEAN) {
39
+ runClean(flags, context);
40
+ return;
41
+ }
42
+
43
+ if (command === COMMAND_HELP) {
44
+ runHelp(flags, context);
45
+ return;
46
+ }
47
+
48
+ console.error(`[Error] Unknown command: ${command}. Run: heymark help`);
49
+ process.exit(1);
50
+ }
51
+
52
+ main();
@@ -0,0 +1,77 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const { execSync } = require("child_process");
4
+ const { HEYMARK, SKILL_REPO_DEFAULT_BRANCH } = require("@/skill-repo/constants");
5
+ const { readConfig } = require("@/skill-repo/config-file");
6
+ const { readSkillFiles } = require("@/skill-repo/skill-file-parser");
7
+
8
+ function getCloneFolderPath(cwd, repoUrl) {
9
+ const name = repoUrl.trim().split("/").pop() || "repo";
10
+ const dirName = name.endsWith(".git") ? name.slice(0, -4) : name;
11
+ return path.join(cwd, HEYMARK.DIR, HEYMARK.CACHE_DIR, dirName);
12
+ }
13
+
14
+ function gitClone(cwd, dir, branch, repoUrl) {
15
+ execSync(`git clone --depth 1 --branch "${branch}" "${repoUrl}" "${dir}"`, {
16
+ stdio: "inherit",
17
+ cwd,
18
+ });
19
+ }
20
+
21
+ function gitPull(dir, branch) {
22
+ execSync(`git fetch origin && git checkout --quiet . && git pull --quiet origin "${branch}"`, {
23
+ stdio: "pipe",
24
+ cwd: dir,
25
+ });
26
+ }
27
+
28
+ function writeCache(cwd) {
29
+ const config = readConfig(cwd);
30
+ if (!config) {
31
+ console.error(
32
+ `[Error] Not linked. Run: heymark link <repo-url> (config: ${HEYMARK.DIR}/${HEYMARK.CONFIG_FILE})`
33
+ );
34
+ process.exit(1);
35
+ }
36
+
37
+ const branch = config.branch || SKILL_REPO_DEFAULT_BRANCH;
38
+ const cacheBase = path.join(cwd, HEYMARK.DIR, HEYMARK.CACHE_DIR);
39
+ const cloneFolderPath = getCloneFolderPath(cwd, config.repoUrl);
40
+
41
+ if (!fs.existsSync(cloneFolderPath)) {
42
+ fs.mkdirSync(cacheBase, { recursive: true });
43
+ try {
44
+ gitClone(cwd, cloneFolderPath, branch, config.repoUrl);
45
+ } catch {
46
+ console.error("[Error] Clone failed. Check repo access (SSH or token).");
47
+ process.exit(1);
48
+ }
49
+ } else {
50
+ try {
51
+ gitPull(cloneFolderPath, branch);
52
+ } catch {
53
+ // Continue with cached clone when fetch/pull fails.
54
+ }
55
+ }
56
+
57
+ return { config, cloneFolderPath };
58
+ }
59
+
60
+ function readCache(cwd) {
61
+ const { config, cloneFolderPath } = writeCache(cwd);
62
+
63
+ const folder = config.folder || "";
64
+ const skillsFolderPath = folder ? path.join(cloneFolderPath, folder) : cloneFolderPath;
65
+ if (!fs.existsSync(skillsFolderPath) || !fs.statSync(skillsFolderPath).isDirectory()) {
66
+ console.error(`[Error] Folder not found in repo: ${folder || "(root)"}`);
67
+ process.exit(1);
68
+ }
69
+
70
+ const skills = readSkillFiles(skillsFolderPath);
71
+
72
+ return { config, skillsFolderPath, skills };
73
+ }
74
+
75
+ module.exports = {
76
+ readCache,
77
+ };
@@ -0,0 +1,87 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const { HEYMARK, SKILL_REPO_DEFAULT_BRANCH } = require("@/skill-repo/constants");
4
+
5
+ function getConfigFilePath(cwd) {
6
+ return path.join(cwd, HEYMARK.DIR, HEYMARK.CONFIG_FILE);
7
+ }
8
+
9
+ function parseRawConfig(rawConfig) {
10
+ if (!rawConfig || typeof rawConfig !== "object") {
11
+ return null;
12
+ }
13
+
14
+ const raw = rawConfig;
15
+
16
+ const repoUrl =
17
+ typeof raw.repoUrl === "string" && raw.repoUrl.trim()
18
+ ? raw.repoUrl.trim()
19
+ : typeof raw.skillSource === "string" && raw.skillSource.trim()
20
+ ? raw.skillSource.trim()
21
+ : typeof raw.rulesSource === "string" && raw.rulesSource.trim()
22
+ ? raw.rulesSource.trim()
23
+ : "";
24
+
25
+ if (!repoUrl) {
26
+ return null;
27
+ }
28
+
29
+ const branch =
30
+ typeof raw.branch === "string" && raw.branch.trim()
31
+ ? raw.branch.trim()
32
+ : SKILL_REPO_DEFAULT_BRANCH;
33
+
34
+ const folder =
35
+ typeof raw.folder === "string"
36
+ ? raw.folder.trim()
37
+ : typeof raw.skillSourceDir === "string"
38
+ ? raw.skillSourceDir.trim()
39
+ : typeof raw.rulesSourceDir === "string"
40
+ ? raw.rulesSourceDir.trim()
41
+ : "";
42
+
43
+ return { repoUrl, branch, folder };
44
+ }
45
+
46
+ function writeConfig(cwd, config) {
47
+ const dir = path.join(cwd, HEYMARK.DIR);
48
+ if (!fs.existsSync(dir)) {
49
+ fs.mkdirSync(dir, { recursive: true });
50
+ }
51
+
52
+ const data = parseRawConfig(config);
53
+ if (!data) {
54
+ throw new Error("Invalid config");
55
+ }
56
+
57
+ const filePath = getConfigFilePath(cwd);
58
+ const payload = {
59
+ repoUrl: data.repoUrl,
60
+ branch: data.branch || SKILL_REPO_DEFAULT_BRANCH,
61
+ };
62
+ if (data.folder) {
63
+ payload.folder = data.folder;
64
+ }
65
+
66
+ fs.writeFileSync(filePath, JSON.stringify(payload, null, 2), "utf8");
67
+ return filePath;
68
+ }
69
+
70
+ function readConfig(cwd) {
71
+ const filePath = getConfigFilePath(cwd);
72
+ if (!fs.existsSync(filePath)) {
73
+ return null;
74
+ }
75
+
76
+ try {
77
+ const raw = fs.readFileSync(filePath, "utf8");
78
+ return parseRawConfig(JSON.parse(raw));
79
+ } catch {
80
+ return null;
81
+ }
82
+ }
83
+
84
+ module.exports = {
85
+ writeConfig,
86
+ readConfig,
87
+ };
@@ -0,0 +1,14 @@
1
+ const HEYMARK = {
2
+ DIR: ".heymark",
3
+ CONFIG_FILE: "config.json",
4
+ CACHE_DIR: "cache",
5
+ };
6
+
7
+ const SKILL_FILE_EXTENSION = ".md";
8
+ const SKILL_REPO_DEFAULT_BRANCH = "main";
9
+
10
+ module.exports = {
11
+ HEYMARK,
12
+ SKILL_FILE_EXTENSION,
13
+ SKILL_REPO_DEFAULT_BRANCH,
14
+ };
@@ -0,0 +1,79 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const { SKILL_FILE_EXTENSION } = require("@/skill-repo/constants");
4
+
5
+ const FRONTMATTER_REGEX = /^---\r?\n([\s\S]+?)\r?\n---\r?\n?([\s\S]*)$/;
6
+
7
+ function parseFrontmatter(content) {
8
+ const match = content.match(FRONTMATTER_REGEX);
9
+ if (!match) {
10
+ return { metadata: {}, body: content.trim() };
11
+ }
12
+
13
+ const [, metadataBlock, body] = match;
14
+
15
+ const metadata = {};
16
+ metadataBlock.split(/\r?\n/).forEach((line) => {
17
+ const separatorIndex = line.indexOf(":");
18
+ if (separatorIndex === -1) return;
19
+
20
+ const key = line.slice(0, separatorIndex).trim();
21
+ let value = line.slice(separatorIndex + 1).trim();
22
+
23
+ if (
24
+ (value.startsWith('"') && value.endsWith('"')) ||
25
+ (value.startsWith("'") && value.endsWith("'"))
26
+ ) {
27
+ value = value.slice(1, -1);
28
+ }
29
+
30
+ if (value === "true") metadata[key] = true;
31
+ else if (value === "false") metadata[key] = false;
32
+ else metadata[key] = value;
33
+ });
34
+
35
+ return { metadata, body: body.trim() };
36
+ }
37
+
38
+ function readSkillFile(skillsDir, fileName) {
39
+ const filePath = path.join(skillsDir, fileName);
40
+ const raw = fs.readFileSync(filePath, "utf8");
41
+ const { metadata, body } = parseFrontmatter(raw);
42
+ const baseName = path.basename(fileName, SKILL_FILE_EXTENSION);
43
+
44
+ return {
45
+ fileName,
46
+ name: typeof metadata.name === "string" && metadata.name ? metadata.name : baseName,
47
+ description:
48
+ typeof metadata.description === "string" && metadata.description
49
+ ? metadata.description
50
+ : baseName,
51
+ globs: typeof metadata.globs === "string" ? metadata.globs : "",
52
+ alwaysApply: metadata.alwaysApply === true,
53
+ metadata,
54
+ body,
55
+ };
56
+ }
57
+
58
+ function readSkillFiles(skillsDir) {
59
+ if (!fs.existsSync(skillsDir)) {
60
+ console.error(`[Error] Skills folder not found: ${skillsDir}`);
61
+ process.exit(1);
62
+ }
63
+
64
+ const files = fs
65
+ .readdirSync(skillsDir)
66
+ .filter((fileName) => fileName.endsWith(SKILL_FILE_EXTENSION))
67
+ .sort();
68
+
69
+ if (files.length === 0) {
70
+ console.error(`[Error] No .md files in: ${skillsDir}`);
71
+ process.exit(1);
72
+ }
73
+
74
+ return files.map((fileName) => readSkillFile(skillsDir, fileName));
75
+ }
76
+
77
+ module.exports = {
78
+ readSkillFiles,
79
+ };
@@ -0,0 +1,33 @@
1
+ const { ANTIGRAVITY } = require("@/tools/constants");
2
+ const { generate, clean } = require("@/tools/skill-per-folder");
3
+
4
+ function createContent(skill) {
5
+ const frontmatterLines = [
6
+ "---",
7
+ `name: ${skill.name}`,
8
+ `description: "${skill.description}"`,
9
+ "---",
10
+ ];
11
+
12
+ return `${frontmatterLines.join("\n")}\n\n${skill.body}\n`;
13
+ }
14
+
15
+ module.exports = {
16
+ key: ANTIGRAVITY.KEY,
17
+ name: ANTIGRAVITY.NAME,
18
+ output: ANTIGRAVITY.OUTPUT_PATTERN,
19
+
20
+ generate(skills, cwd) {
21
+ return generate({
22
+ cwd,
23
+ dir: ANTIGRAVITY.SKILLS_DIR,
24
+ fileName: ANTIGRAVITY.SKILL_FILE_NAME,
25
+ skills,
26
+ createContent,
27
+ });
28
+ },
29
+
30
+ clean(skillNames, cwd) {
31
+ return clean(cwd, ANTIGRAVITY.SKILLS_DIR);
32
+ },
33
+ };
@@ -0,0 +1,33 @@
1
+ const { CLAUDE_CODE } = require("@/tools/constants");
2
+ const { generate, clean } = require("@/tools/skill-per-folder");
3
+
4
+ function createContent(skill) {
5
+ const frontmatterLines = [
6
+ "---",
7
+ `name: ${skill.name}`,
8
+ `description: "${skill.description}"`,
9
+ "---",
10
+ ];
11
+
12
+ return `${frontmatterLines.join("\n")}\n\n${skill.body}\n`;
13
+ }
14
+
15
+ module.exports = {
16
+ key: CLAUDE_CODE.KEY,
17
+ name: CLAUDE_CODE.NAME,
18
+ output: CLAUDE_CODE.OUTPUT_PATTERN,
19
+
20
+ generate(skills, cwd) {
21
+ return generate({
22
+ cwd,
23
+ dir: CLAUDE_CODE.SKILLS_DIR,
24
+ fileName: CLAUDE_CODE.SKILL_FILE_NAME,
25
+ skills,
26
+ createContent,
27
+ });
28
+ },
29
+
30
+ clean(skillNames, cwd) {
31
+ return clean(cwd, CLAUDE_CODE.SKILLS_DIR);
32
+ },
33
+ };