@kurokeita/add-skill 1.7.0 → 1.9.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.
@@ -1,45 +0,0 @@
1
- import os from "node:os";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- const __filename = fileURLToPath(import.meta.url);
5
- const __dirname = path.dirname(__filename);
6
- export const PROJECT_ROOT = path.resolve(__dirname, "../..");
7
- export const PLATFORM_LABELS = {
8
- antigravity: "Antigravity",
9
- gemini: "Gemini CLI",
10
- copilot: "GitHub Copilot",
11
- windsurf: "Windsurf",
12
- };
13
- export const PLATFORM_PATHS_SKILLS = {
14
- antigravity: path.join(os.homedir(), ".gemini/antigravity/global_skills"),
15
- copilot: path.join(os.homedir(), ".copilot/skills"),
16
- gemini: path.join(os.homedir(), ".gemini/skills"),
17
- windsurf: path.join(os.homedir(), ".codeium/windsurf/skills"),
18
- };
19
- export const PLATFORM_PATHS_AGENTS = {
20
- antigravity: path.join(os.homedir(), ".gemini/antigravity/global_agents"),
21
- copilot: path.join(os.homedir(), ".copilot/agents"),
22
- gemini: path.join(os.homedir(), ".gemini/agents"),
23
- windsurf: path.join(os.homedir(), ".codeium/windsurf/agents"),
24
- };
25
- export const PLATFORM_PATHS_WORKFLOWS = {
26
- antigravity: path.join(os.homedir(), ".gemini/antigravity/global_workflows"),
27
- copilot: path.join(os.homedir(), ".copilot/prompts"),
28
- gemini: path.join(os.homedir(), ".gemini/commands"),
29
- windsurf: path.join(os.homedir(), ".codeium/windsurf/global_workflows"),
30
- };
31
- export const TYPE_DIRS = {
32
- skill: path.join(PROJECT_ROOT, "skills"),
33
- agent: path.join(PROJECT_ROOT, "agents"),
34
- workflow: path.join(PROJECT_ROOT, "workflows"),
35
- };
36
- export function getTargetPaths(type) {
37
- switch (type) {
38
- case "agent":
39
- return PLATFORM_PATHS_AGENTS;
40
- case "workflow":
41
- return PLATFORM_PATHS_WORKFLOWS;
42
- default:
43
- return PLATFORM_PATHS_SKILLS;
44
- }
45
- }
@@ -1,60 +0,0 @@
1
- /**
2
- * Converts Markdown content to the Gemini CLI Custom Command TOML format.
3
- *
4
- * @param markdownContent The original Markdown content.
5
- * @returns A string in TOML format with description and prompt fields.
6
- */
7
- export function convertToGeminiCommandTOML(markdownContent) {
8
- // Extract description: find the first line that isn't empty, a horizontal rule, or just whitespace
9
- const lines = markdownContent.split("\n");
10
- let description = "";
11
- for (let i = 0; i < lines.length; i++) {
12
- const trimmedLine = lines[i].trim();
13
- // Skip empty lines, separators, and common non-description markers
14
- if (trimmedLine &&
15
- trimmedLine !== "---" &&
16
- !trimmedLine.startsWith("<!--")) {
17
- if (trimmedLine.startsWith("#")) {
18
- description = trimmedLine.replace(/^#+\s*/, "");
19
- }
20
- else {
21
- description = trimmedLine;
22
- }
23
- break;
24
- }
25
- }
26
- // Limit description length for the help menu
27
- if (description.length > 100) {
28
- description = `${description.substring(0, 97)}...`;
29
- }
30
- // Escape triple quotes in the content if any (replace """ with \"\"\" )
31
- const escapedContent = markdownContent.replace(/"""/g, '\\"\\"\\"');
32
- return `description = ${JSON.stringify(description)}
33
-
34
- prompt = """
35
- ${escapedContent.trim()}
36
- """
37
- `;
38
- }
39
- /**
40
- * Performs a basic validation of a Gemini Command TOML string.
41
- *
42
- * @param tomlContent The TOML content to validate.
43
- * @returns An object with valid boolean and optional error message.
44
- */
45
- export function validateGeminiCommandTOML(tomlContent) {
46
- // 1. Basic syntax check for prompt field
47
- if (!tomlContent.includes('prompt = """')) {
48
- return {
49
- valid: false,
50
- error: 'Missing required "prompt" field with """ wrapping.',
51
- };
52
- }
53
- // 2. Check for closing triple quotes
54
- const promptStart = tomlContent.indexOf('prompt = """');
55
- const rest = tomlContent.substring(promptStart + 'prompt = """'.length);
56
- if (!rest.includes('"""')) {
57
- return { valid: false, error: 'Unterminated "prompt" multi-line string.' };
58
- }
59
- return { valid: true };
60
- }