(dirPath, arrayOfFiles = [])
| 144 | |
| 145 | // List bundled assets (all files except SKILL.md), recursing through subdirectories |
| 146 | const getAllFiles = (dirPath, arrayOfFiles = []) => { |
| 147 | const files = fs.readdirSync(dirPath); |
| 148 | const assetPaths = ['references', 'assets', 'scripts']; |
| 149 | |
| 150 | files.forEach((file) => { |
| 151 | const filePath = path.join(dirPath, file); |
| 152 | if (fs.statSync(filePath).isDirectory() && assetPaths.includes(file)) { |
| 153 | arrayOfFiles = getAllFiles(filePath, arrayOfFiles); |
| 154 | } else { |
| 155 | const relativePath = path.relative(skillPath, filePath); |
| 156 | if (relativePath !== "SKILL.md") { |
| 157 | // Normalize path separators to forward slashes for cross-platform consistency |
| 158 | arrayOfFiles.push(relativePath.replace(/\\/g, "/")); |
| 159 | } |
| 160 | } |
| 161 | }); |
| 162 | |
| 163 | return arrayOfFiles; |
| 164 | }; |
| 165 | |
| 166 | const assets = getAllFiles(skillPath).sort(); |
| 167 |
no outgoing calls
no test coverage detected