(p: string)
| 122 | // candidate path) isn't masked behind a generic "couldn't find SKILL.md". |
| 123 | let lastStatErr: any; |
| 124 | const tryStat = async (p: string): Promise<boolean> => { |
| 125 | try { |
| 126 | await fs.stat(p); |
| 127 | return true; |
| 128 | } catch (e: any) { |
| 129 | if (e?.code !== 'ENOENT') lastStatErr = e; |
| 130 | return false; |
| 131 | } |
| 132 | }; |
| 133 | |
| 134 | // Direct hit: src/SKILL.md |
| 135 | if (await tryStat(path.join(src, 'SKILL.md'))) return src; |