Marketing skills for Claude Code and AI agents. CRO, copywriting, SEO, analytics, and growth engineering.
JavaScript agent-skillsai-agentsai-seoclaudeclaude-codeclaude-code-pluginclaude-skillscodexcontent-marketingconversion-rate-optimizationcopywritingcursoremail-marketinggenerative-engine-optimizationgrowth-marketingmarketingmarketing-automationsaas-marketingseoskill-md
fix(validation): inspect nested references and relative sibling links
Rudy Celekli5f2d307977fd
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 39ddc4c..68a230d 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -6,7 +6,7 @@},"metadata": {"description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, and growth",- "version": "2.11.26",+ "version": "2.11.27","repository": "https://github.com/coreyhaines31/marketingskills"},"plugins": [diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex f1a5cf8..aabe26f 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "marketing-skills","description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth",- "version": "2.11.26",+ "version": "2.11.27","author": {"name": "Corey Haines"},diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 45d9d89..9cd1f4c 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "marketing-skills","description": "Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth",- "version": "2.11.26",+ "version": "2.11.27","author": {"name": "Corey Haines"},diff --git a/VERSIONS.md b/VERSIONS.mdindex dc6d5ce..7a78e40 100644--- a/VERSIONS.md+++ b/VERSIONS.md@@ -57,6 +57,10 @@ Current versions of all skills. Agents can compare against local versions to che## Recent Changes+### 2.11.27 (2026-10-10)++- Validate nested skill references and resolve sibling reference links relative to their file.+### 2.11.26 (2026-10-08)- **lead-magnets** (2.0.0 → 2.1.0): new `references/content-to-skill.md` (plus corpus design and release companions) on packaging a course, webinar series, podcast, or newsletter archive you own as an installable agent skill: a new kind of lead magnet. From @rudycelekli's #725 (closes #432), folded in rather than added as a new skill. Triggers added: 'course as a skill,' 'package our content as an agent skill.' **ai-seo** (2.7.5 → 2.7.6) points to it.diff --git a/scripts/check-versions.mjs b/scripts/check-versions.mjsindex 6dc0fea..5caa4fe 100644--- a/scripts/check-versions.mjs+++ b/scripts/check-versions.mjs@@ -14,7 +14,7 @@// - if any skill changed, was added, or was removed, the repo version must bumpimport { readFileSync, readdirSync, existsSync } from "node:fs";-import { resolve, dirname } from "node:path";+import { resolve, dirname, relative } from "node:path";import { fileURLToPath } from "node:url";import { execFileSync } from "node:child_process";@@ -69,15 +69,26 @@ if (existsSync(codexPath)) {const latestHeading = versionsMd.match(/^### (\d+\.\d+\.\d+)(\s|$)/m)?.[1];if (latestHeading !== plugin) errors.push(`VERSIONS.md: newest changelog block is ${latestHeading ?? "missing"}, but repo version is ${plugin}`);+// Preserve relative paths when walking bundled reference subdirectories.+const referenceFiles = (directory, prefix = "") => readdirSync(directory, { withFileTypes: true })+ .flatMap((entry) => {+ const name = prefix + entry.name;+ return entry.isDirectory() ? referenceFiles(resolve(directory, entry.name), name + "/") : [name];+ });+// Orphan referencesfor (const name of skills) {const dir = resolve(ROOT, "skills", name, "references");if (!existsSync(dir)) continue;- const files = readdirSync(dir);+ const files = referenceFiles(dir);const skillMd = read(`skills/${name}/SKILL.md`);for (const file of files) {if (skillMd.includes(file)) continue;- const linkedFromSibling = files.some((other) => other !== file && read(`skills/${name}/references/${other}`).includes(file));+ const linkedFromSibling = files.some((other) => {+ if (other === file) return false;+ const link = relative(dirname(resolve(dir, other)), resolve(dir, file)).replaceAll("\\", "/");+ return read(`skills/${name}/references/${other}`).includes(link);+ });if (!linkedFromSibling) errors.push(`skills/${name}/references/${file}: not linked from SKILL.md or any sibling reference`);}}diff --git a/tests/clis/version-nested-references.test.cjs b/tests/clis/version-nested-references.test.cjsnew file mode 100644index 0000000..4b93ed8--- /dev/null+++ b/tests/clis/version-nested-references.test.cjs@@ -0,0 +1,34 @@+const { test } = require('node:test')+const assert = require('node:assert/strict')+const { spawnSync } = require('node:child_process')+const { mkdtempSync, mkdirSync, writeFileSync, copyFileSync, rmSync } = require('node:fs')+const { tmpdir } = require('node:os')+const path = require('node:path')+const original = path.resolve(__dirname, '../../scripts/check-versions.mjs')+function check(body, files) {+ const root = mkdtempSync(path.join(tmpdir(), 'marketing-versions-'))+ const write = (name, data) => { const p = path.join(root, name); mkdirSync(path.dirname(p), {recursive:true}); writeFileSync(p,data) }+ try {+ write('skills/example/SKILL.md', `---\nname: example\ndescription: Use when testing reference packaging.\nmetadata:\n version: 1.0.0\n---\n${body}\n`)+ for (const [name, content] of Object.entries(files)) write(`skills/example/references/${name}`,content)+ write('VERSIONS.md', '| example | 1.0.0 |\n\n### 1.0.0 (2026-10-10)\n')+ write('.claude-plugin/plugin.json', JSON.stringify({version:'1.0.0'}))+ write('.claude-plugin/marketplace.json', JSON.stringify({metadata:{version:'1.0.0'}}))+ mkdirSync(path.join(root,'scripts'))+ copyFileSync(original,path.join(root,'scripts/check-versions.mjs'))+ return spawnSync(process.execPath,[path.join(root,'scripts/check-versions.mjs')],{cwd:root,encoding:'utf8',timeout:10000})+ } finally { rmSync(root,{recursive:true,force:true}) }+}+test('nested orphan files are rejected even when their directory is mentioned', () => {+ const result = check('Read [guide](references/nested/guide.md).', {'nested/guide.md':'Guide', 'nested/orphan.md':'Unreachable'})+ assert.equal(result.status,1,result.stdout + result.stderr)+ assert.match(result.stderr,/references\/nested\/orphan.md: not linked/)+})+test('linked nested references and relative sibling links pass', () => {+ const result = check('Read [guide](references/nested/guide.md).', {'nested/guide.md':'Read [other](../other.md).','other.md':'Reference'})+ assert.equal(result.status,0,result.stdout + result.stderr)+})+test('flat linked references keep passing', () => {+ const result = check('Read [guide](references/guide.md).', {'guide.md':'Read [other](other.md).','other.md':'Reference'})+ assert.equal(result.status,0,result.stdout + result.stderr)+})