From af75e9d8a1fd82dc9902e5022d2845af2c2b23c5 Mon Sep 17 00:00:00 2001 From: murat Date: Fri, 8 May 2026 11:20:17 -0500 Subject: [PATCH] fix: addressed PR comments --- .husky/pre-commit | 11 +++++++++++ docs/tutorials/getting-started.md | 6 ++++-- tools/validate-marketplace.js | 25 ++++++++++++++++++++----- 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index ae9e0c44f..24e0c5c3a 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -6,6 +6,17 @@ npx --no-install lint-staged # Validate everything npm test +# Validate marketplace manifest when skills or manifest change +if command -v rg >/dev/null 2>&1; then + if git diff --cached --name-only | rg -q 'SKILL\.md|\.claude-plugin/marketplace\.json'; then + npm run validate:marketplace + fi +else + if git diff --cached --name-only | grep -Eq 'SKILL\.md|\.claude-plugin/marketplace\.json'; then + npm run validate:marketplace + fi +fi + # Validate docs links only when docs change if command -v rg >/dev/null 2>&1; then if git diff --cached --name-only | rg -q '^docs/'; then diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 3a8b37084..4c9c88fa2 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -19,7 +19,8 @@ Build software faster using AI-powered workflows with specialized agents that gu - **Git** — Recommended for version control - **AI-powered IDE** — Claude Code, Cursor, or similar - **A project idea** — Even a simple one works for learning - ::: + +::: :::tip[The Easiest Path] **Install** → `npx bmad-method install` @@ -285,6 +286,7 @@ BMad-Help inspects your project, detects what you've completed, and tells you ex - **Always use fresh chats** — Start a new chat for each workflow - **Track matters** — Quick Flow uses `bmad-quick-dev`; Method/Enterprise need PRD and architecture - **BMad-Help runs automatically** — Every workflow ends with guidance on what's next - ::: + +::: Ready to start? Install BMad, invoke `bmad-help`, and let your intelligent guide lead the way. diff --git a/tools/validate-marketplace.js b/tools/validate-marketplace.js index 8b1e82f81..5457d3902 100644 --- a/tools/validate-marketplace.js +++ b/tools/validate-marketplace.js @@ -86,10 +86,15 @@ function validate() { return { ok: false, fatal: `marketplace.json is not valid JSON: ${error.message}` }; } + if (!fs.existsSync(SRC_DIR)) { + return { ok: false, fatal: `src directory not found at ${SRC_DIR}` }; + } + const plugins = Array.isArray(marketplace.plugins) ? marketplace.plugins : []; const declaredBy = new Map(); // skillPath -> [pluginName] for (const plugin of plugins) { - for (const skillPath of plugin.skills || []) { + const skills = Array.isArray(plugin.skills) ? plugin.skills : []; + for (const skillPath of skills) { if (!declaredBy.has(skillPath)) declaredBy.set(skillPath, []); declaredBy.get(skillPath).push(plugin.name); } @@ -111,9 +116,16 @@ function validate() { } } - const duplicates = []; // same path declared by multiple plugins + const duplicates = []; // same path declared more than once (within or across plugins) for (const [skillPath, names] of declaredBy) { - if (names.length > 1) duplicates.push({ path: skillPath, declaredBy: names }); + if (names.length > 1) { + const uniquePlugins = [...new Set(names)]; + duplicates.push({ + path: skillPath, + declaredBy: uniquePlugins, + withinSamePlugin: uniquePlugins.length === 1, + }); + } } return { @@ -149,9 +161,12 @@ function reportHuman(result) { } if (duplicates.length > 0) { - console.log(`\n✗ ${duplicates.length} skill path(s) declared by multiple plugins:`); + console.log(`\n✗ ${duplicates.length} skill path(s) declared more than once:`); for (const d of duplicates) { - console.log(` ${d.path} (in: ${d.declaredBy.join(', ')})`); + const where = d.withinSamePlugin + ? `listed multiple times in "${d.declaredBy[0]}"` + : `in multiple plugins: ${d.declaredBy.join(', ')}`; + console.log(` ${d.path} (${where})`); } }