mkt-skills 1.3.0 → 1.3.1

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.
package/README.md CHANGED
@@ -58,6 +58,10 @@ Override the API URL for testing against a local WordPress instance:
58
58
  MKT_API_URL=http://localhost:8080/wp-json/mkt/v1 npx mkt-skills list
59
59
  ```
60
60
 
61
+ ## Source
62
+
63
+ https://github.com/sandeepkelvadi/mkt-skills
64
+
61
65
  ## License
62
66
 
63
67
  MIT
@@ -37,7 +37,7 @@ if (!command || command === '--help' || command === '-h') {
37
37
  }
38
38
 
39
39
  if (command === '--version' || command === '-v') {
40
- console.log('mkt-skills 1.3.0');
40
+ console.log('mkt-skills 1.3.1');
41
41
  process.exit(0);
42
42
  }
43
43
 
package/lib/api.mjs CHANGED
@@ -8,7 +8,7 @@ async function request(path) {
8
8
  try {
9
9
  const res = await fetch(`${BASE_URL}${path}`, {
10
10
  signal: controller.signal,
11
- headers: { 'User-Agent': 'mkt-skills-cli/1.3.0' },
11
+ headers: { 'User-Agent': 'mkt-skills-cli/1.3.1' },
12
12
  });
13
13
  return res;
14
14
  } finally {
package/lib/paths.mjs CHANGED
@@ -4,7 +4,13 @@ import { readdir } from 'fs/promises';
4
4
 
5
5
  const SKILLS_ROOT = join(homedir(), '.claude', 'skills');
6
6
 
7
+ const SLUG_RE = /^[a-z0-9][a-z0-9-]*$/;
8
+
9
+ // Slugs come from the user and from the server. Never let one escape SKILLS_ROOT.
7
10
  export function skillDir(slug) {
11
+ if (typeof slug !== 'string' || !SLUG_RE.test(slug)) {
12
+ throw new Error(`Invalid skill slug: ${JSON.stringify(slug)}`);
13
+ }
8
14
  return join(SKILLS_ROOT, slug);
9
15
  }
10
16
 
package/lib/video.mjs CHANGED
@@ -1,13 +1,14 @@
1
1
  import { createInterface } from "readline";
2
- import { mkdir, rm, writeFile, readFile } from "fs/promises";
2
+ import { mkdir, mkdtemp, rm, writeFile, readFile } from "fs/promises";
3
3
  import { existsSync } from "fs";
4
4
  import { join, dirname } from "path";
5
- import { execSync } from "child_process";
5
+ import { execSync, execFileSync } from "child_process";
6
+ import { tmpdir } from "os";
6
7
  import { bold, dim, green, red, cyan } from "./ui.mjs";
7
8
 
8
9
  const TEMPLATE_REPO = "https://github.com/sandeepkelvadi/tm-videogen-template.git";
9
10
  const TEMPLATE_BRANCH = "main";
10
- const TEMPLATE_DIR = "/tmp/.tm-videogen-template";
11
+ let TEMPLATE_DIR; // private temp dir, created per run in cloneTemplate()
11
12
 
12
13
  async function question(query) {
13
14
  const rl = createInterface({ input: process.stdin, output: process.stdout });
@@ -105,10 +106,8 @@ function exec(cmd, cwd) {
105
106
  }
106
107
 
107
108
  async function cloneTemplate() {
108
- if (existsSync(TEMPLATE_DIR)) {
109
- await rm(TEMPLATE_DIR, { recursive: true, force: true });
110
- }
111
- execSync(`git clone --depth=1 --branch ${TEMPLATE_BRANCH} ${TEMPLATE_REPO} "${TEMPLATE_DIR}"`, { stdio: "pipe" });
109
+ TEMPLATE_DIR = await mkdtemp(join(tmpdir(), "tm-videogen-"));
110
+ execFileSync("git", ["clone", "--depth=1", "--branch", TEMPLATE_BRANCH, TEMPLATE_REPO, TEMPLATE_DIR], { stdio: "pipe" });
112
111
  }
113
112
 
114
113
  export async function video(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mkt-skills",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Install Claude Code marketing skills from marketingskills.directory",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,11 @@
33
33
  "license": "MIT",
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "git+https://github.com/sandeepkelvadi/mkt-skills-dir.git"
36
+ "url": "git+https://github.com/sandeepkelvadi/mkt-skills.git",
37
+ "directory": "cli"
37
38
  },
38
- "homepage": "https://marketingskills.directory"
39
+ "homepage": "https://marketingskills.directory",
40
+ "bugs": {
41
+ "url": "https://github.com/sandeepkelvadi/mkt-skills/issues"
42
+ }
39
43
  }