| 15 | } |
| 16 | |
| 17 | function parseArgs(argv) { |
| 18 | const args = { |
| 19 | projectRoot: process.cwd(), |
| 20 | taskClass: 'utility', |
| 21 | riskLevel: 'medium', |
| 22 | withBenchmark: false, |
| 23 | write: false, |
| 24 | }; |
| 25 | for (let index = 2; index < argv.length; index++) { |
| 26 | const arg = argv[index]; |
| 27 | const value = argv[index + 1]; |
| 28 | if (arg === '--project-root') { args.projectRoot = path.resolve(value); index++; } |
| 29 | else if (arg === '--name') { args.name = slug(value); index++; } |
| 30 | else if (arg === '--description') { args.description = value; index++; } |
| 31 | else if (arg === '--task-class') { args.taskClass = value; index++; } |
| 32 | else if (arg === '--risk-level') { args.riskLevel = value; index++; } |
| 33 | else if (arg === '--with-benchmark') args.withBenchmark = true; |
| 34 | else if (arg === '--write') args.write = true; |
| 35 | else if (arg === '--help' || arg === '-h') args.help = true; |
| 36 | } |
| 37 | return args; |
| 38 | } |
| 39 | |
| 40 | function usage() { |
| 41 | return 'Usage: node scripts/skill-scaffold.js --name name --description "..." [--task-class utility] [--risk-level medium] [--with-benchmark] --write'; |