RunSkill handles the "codemap skill" subcommand.
(args []string, root string)
| 10 | |
| 11 | // RunSkill handles the "codemap skill" subcommand. |
| 12 | func RunSkill(args []string, root string) { |
| 13 | subCmd := "" |
| 14 | if len(args) > 0 { |
| 15 | subCmd = args[0] |
| 16 | } |
| 17 | |
| 18 | switch subCmd { |
| 19 | case "list": |
| 20 | runSkillList(root) |
| 21 | case "show": |
| 22 | if len(args) < 2 { |
| 23 | fmt.Fprintln(os.Stderr, "Usage: codemap skill show <name>") |
| 24 | os.Exit(1) |
| 25 | } |
| 26 | runSkillShow(root, args[1]) |
| 27 | case "init": |
| 28 | runSkillInit(root) |
| 29 | default: |
| 30 | fmt.Println("Usage: codemap skill <list|show|init>") |
| 31 | fmt.Println() |
| 32 | fmt.Println("Commands:") |
| 33 | fmt.Println(" list Show all available skills with descriptions") |
| 34 | fmt.Println(" show <name> Print full skill content") |
| 35 | fmt.Println(" init Create a SKILL.md template in .codemap/skills/") |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func runSkillList(root string) { |
| 40 | idx, err := skills.LoadSkills(root) |
no test coverage detected