cmdSkill dispatches `flow skill install|uninstall|update`.
(args []string)
| 95 | skillPath, err := h.SkillInstallPath() |
| 96 | if err != nil { |
| 97 | return |
| 98 | } |
| 99 | if _, err := os.Stat(skillPath); err != nil { |
| 100 | // Not installed → user opted out; don't reinstall behind their back. |
| 101 | return |
| 102 | } |
| 103 | if readSkillVersion() == Version { |
| 104 | return |
| 105 | } |
| 106 | // Version mismatch — refresh skill bytes and the SessionStart hook. |
| 107 | if err := h.InstallSkill(skillFiles()); err != nil { |
| 108 | return |
| 109 | } |
| 110 | _ = writeSkillVersion(Version) |
| 111 | _, _ = h.InstallSessionStartHook(hookCommand) |
| 112 | _, _ = h.InstallUserPromptSubmitHook(userPromptSubmitHookCommand) |
| 113 | fmt.Fprintf(os.Stderr, "flow: upgraded skill to %s\n", Version) |
| 114 | } |
| 115 | |
| 116 | // cmdSkill dispatches `flow skill install|uninstall|update`. |
| 117 | func cmdSkill(args []string) int { |