()
| 41 | } |
| 42 | |
| 43 | async function createSkillTemplate() { |
| 44 | try { |
| 45 | console.log("🎯 Agent Skills Creator"); |
| 46 | console.log( |
| 47 | "This tool will help you create a new skill following the Agent Skills specification.\n" |
| 48 | ); |
| 49 | |
| 50 | const parsed = parseArgs(); |
| 51 | |
| 52 | // Get skill name |
| 53 | let skillName = parsed.name; |
| 54 | if (!skillName) { |
| 55 | skillName = await prompt("Skill name (lowercase, hyphens only): "); |
| 56 | } |
| 57 | |
| 58 | // Validate skill name format |
| 59 | if (!skillName) { |
| 60 | console.error("❌ Skill name is required"); |
| 61 | process.exit(1); |
| 62 | } |
| 63 | |
| 64 | if (!/^[a-z0-9-]+$/.test(skillName)) { |
| 65 | console.error( |
| 66 | "❌ Skill name must contain only lowercase letters, numbers, and hyphens" |
| 67 | ); |
| 68 | process.exit(1); |
| 69 | } |
| 70 | |
| 71 | const skillFolder = path.join(SKILLS_DIR, skillName); |
| 72 | |
| 73 | // Check if folder already exists |
| 74 | if (fs.existsSync(skillFolder)) { |
| 75 | console.log(`⚠️ Skill folder ${skillName} already exists at ${skillFolder}`); |
| 76 | console.log("💡 Please choose a different name or edit the existing skill."); |
| 77 | process.exit(1); |
| 78 | } |
| 79 | |
| 80 | // Get description |
| 81 | let description = parsed.description; |
| 82 | if (!description) { |
| 83 | description = await prompt( |
| 84 | "Description (what this skill does and when to use it): " |
| 85 | ); |
| 86 | } |
| 87 | |
| 88 | if (!description || description.trim().length < 10) { |
| 89 | console.error( |
| 90 | "❌ Description is required and must be at least 10 characters (max 1024)" |
| 91 | ); |
| 92 | process.exit(1); |
| 93 | } |
| 94 | |
| 95 | // Get skill title (display name) |
| 96 | const defaultTitle = skillName |
| 97 | .split("-") |
| 98 | .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) |
| 99 | .join(" "); |
| 100 |
no test coverage detected