| 307 | } |
| 308 | |
| 309 | async function discoverSkills(repoPath) { |
| 310 | const skillsDir = join(repoPath, ".github", "skills"); |
| 311 | const out = []; |
| 312 | let entries; |
| 313 | try { |
| 314 | entries = await readdir(skillsDir, { withFileTypes: true }); |
| 315 | } catch { |
| 316 | return out; |
| 317 | } |
| 318 | for (const e of entries) { |
| 319 | if (!e.isDirectory()) continue; |
| 320 | const md = await readText(join(skillsDir, e.name, "SKILL.md")); |
| 321 | let name = e.name; |
| 322 | let description = ""; |
| 323 | if (md) { |
| 324 | const nameM = md.match(/(?:^|\n)#+\s*(.+)|name:\s*(.+)/i); |
| 325 | if (nameM) name = stripMd(nameM[1] || nameM[2] || e.name); |
| 326 | const descM = md.match(/description:\s*(.+)/i); |
| 327 | if (descM) description = stripMd(descM[1]); |
| 328 | } |
| 329 | out.push({ folder: e.name, name, description, hasSkillMd: !!md }); |
| 330 | } |
| 331 | return out; |
| 332 | } |
| 333 | |
| 334 | function detectJavaVersion(pom, gradle) { |
| 335 | const text = `${pom || ""}\n${gradle || ""}`; |