Commit fdda74f
fix(validate-module): harden standalone module validation (#97)
* fix(validate-module): harden standalone module validation
Three robustness fixes to validate-module.py for standalone
single-skill modules:
- Accept importable underscore-named merge scripts (merge_config.py)
in addition to the scaffolder's dash form (merge-config.py). Either
is valid; a module may rename them to be importable from
module-setup.md without that being a structural defect.
- Treat colon-less preceded-by/followed-by refs as cross-module
positional references (bare sibling-module skill names) and skip
them. Other installed modules aren't visible to the validator, so
they can't be resolved and aren't defects; intra-module
skill:action refs are still validated.
- Detect a standalone module when handed the skill directory itself,
not only its parent folder (as the reference doc already promised).
Skill-folder and orphan-entry checks now resolve in both cases.
Adds 3 regression tests (20 pass total); updates the reference doc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(validate-module): scope standalone orphan check to the module
Addresses CodeRabbit review on #97: in direct skill-dir mode the
orphan check resolved CSV skills against the parent folder, so an
unrelated sibling skill directory could mask a true orphan entry.
For a standalone module, skill_folders already enumerates every valid
skill (just the standalone skill), so any other CSV skill is an orphan
— drop the parent-folder filesystem lookup entirely. The multi-skill
path still re-checks the filesystem for the setup skill.
Adds a regression test (sibling dir must not mask the orphan); 21 tests
pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(validate-module): assert exit code in orphan regression test
Addresses CodeRabbit nit on #97: the orphan regression test unpacked
`code` without using it. Assert `code == 1` (the orphan makes
validation fail), which also strengthens the test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d97d675 commit fdda74f
3 files changed
Lines changed: 138 additions & 16 deletions
File tree
- skills/bmad-module-builder
- references
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 82 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
| |||
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
262 | | - | |
263 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
264 | 274 | | |
265 | 275 | | |
266 | 276 | | |
| |||
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
322 | 396 | | |
323 | 397 | | |
324 | 398 | | |
| |||
367 | 441 | | |
368 | 442 | | |
369 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
370 | 448 | | |
371 | 449 | | |
372 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
| |||
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
133 | | - | |
134 | | - | |
135 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
136 | 158 | | |
137 | 159 | | |
138 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
139 | 166 | | |
140 | | - | |
| 167 | + | |
141 | 168 | | |
142 | 169 | | |
143 | 170 | | |
| |||
202 | 229 | | |
203 | 230 | | |
204 | 231 | | |
205 | | - | |
206 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
207 | 238 | | |
208 | 239 | | |
209 | 240 | | |
| |||
215 | 246 | | |
216 | 247 | | |
217 | 248 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
222 | 258 | | |
223 | 259 | | |
224 | 260 | | |
| |||
249 | 285 | | |
250 | 286 | | |
251 | 287 | | |
252 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
253 | 297 | | |
254 | 298 | | |
255 | 299 | | |
| |||
0 commit comments