()
| 184 | // ── Scenario discovery ──────────────────────────────────────────────────────── |
| 185 | |
| 186 | function discoverScenarios() { |
| 187 | if (!fs.existsSync(SKILLS_DIR)) return []; |
| 188 | |
| 189 | const scenarios = []; |
| 190 | // Discover skill names from nested skills/{name}/SKILL.md directories |
| 191 | const skillNames = fs.readdirSync(SKILLS_DIR) |
| 192 | .filter(name => { |
| 193 | const skillFile = path.join(SKILLS_DIR, name, 'SKILL.md'); |
| 194 | return fs.existsSync(skillFile) && fs.statSync(skillFile).isFile(); |
| 195 | }); |
| 196 | |
| 197 | for (const skillName of skillNames) { |
| 198 | const benchDir = path.join(SKILLS_DIR, skillName, '__benchmarks__'); |
| 199 | if (!fs.existsSync(benchDir)) continue; |
| 200 | |
| 201 | const files = fs.readdirSync(benchDir) |
| 202 | .filter(f => f.endsWith('.md')) |
| 203 | .sort(); |
| 204 | |
| 205 | for (const file of files) { |
| 206 | const scenario = parseScenario(path.join(benchDir, file)); |
| 207 | if (scenario) scenarios.push(scenario); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | return scenarios; |
| 212 | } |
| 213 | |
| 214 | // ── Project state setup ─────────────────────────────────────────────────────── |
| 215 |
no test coverage detected