Skip to content

feat(cmd): restore plugin skill auto-install; fix undefined tryInstallPluginSkills CI failure#16

Closed
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-plugin-skills-implementation
Closed

feat(cmd): restore plugin skill auto-install; fix undefined tryInstallPluginSkills CI failure#16
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-plugin-skills-implementation

Conversation

Copy link
Copy Markdown

Copilot AI commented May 6, 2026

go vet ./... was failing because cmd/plugin_skills_test.go referenced tryInstallPluginSkills and pluginSkillInstaller that no longer existed in the codebase.

Changes

  • cmd/plugin_skills.go (new): implements tryInstallPluginSkills(name string) — a best-effort, silent-failure hook that:

    • looks up clime-<name> on PATH
    • runs <binary> skills to get a skill source
    • loads the skills manifest and fetches the repo manifest from that source
    • installs each skill not already present, skipping duplicates
  • cmd/plugin.go: adds pluginSkillInstaller = tryInstallPluginSkills to the package-level vars and wires the call into executePluginInstall after a successful plugin install + manifest save:

var (
    pluginInstallRunner  = executePluginInstall
    pluginSkillInstaller = tryInstallPluginSkills
)

func executePluginInstall(...) error {
    // ... install, manifest.Save() ...
    pluginSkillInstaller(name)
    spinner.Success(...)
}
Original prompt

The CI job failed in repository git-hulk/clime because go vet ./... reports undefined: tryInstallPluginSkills in cmd/plugin_skills_test.go.

Relevant context:

  • The failing workflow is .github/workflows/ci.yaml
  • The failing commit ref is 4bb95ace6f4a53e761f1668d5a71c1a89b928834
  • The failure is in tests under cmd/plugin_skills_test.go
  • cmd/plugin.go was already updated on branch fix-plugin-skills-ci to restore the plugin skill installer hook and invoke pluginSkillInstaller(name) after successful plugin installation.
  • What remains is to add the missing implementation file cmd/plugin_skills.go and then create a pull request.

Please complete the fix by:

  1. Adding cmd/plugin_skills.go with a best-effort implementation of tryInstallPluginSkills(name string) that:
    • returns silently for empty plugin names
    • looks up the plugin binary as clime-<name> on PATH
    • runs <plugin-binary> skills
    • returns silently if the command fails
    • trims stdout to obtain the skill source
    • returns silently if the output is empty
    • loads the skills manifest
    • fetches the repo manifest from the returned source
    • prepares the repo dir
    • installs skills not already present in the manifest using existing installSkillEntry(...)
    • skips already-installed skills
  2. Ensure the code is gofmt-formatted.
  3. Open a pull request from branch fix-plugin-skills-ci into master.

Use the existing changes already present on branch fix-plugin-skills-ci as the starting point. Create a concise PR title and description explaining that this restores plugin skill auto-install support and fixes the CI failure caused by the missing tryInstallPluginSkills symbol.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failure is a compile/vet error caused by a test referencing a function that no longer exists:

Solution

Restore the missing tryInstallPluginSkills symbol or update the tests to match the renamed implementation. Since the tests consistently call tryInstallPluginSkills(...), the lowest-risk fix is to reintroduce that function and keep it wired to the current plugin skill installer flow.

A simple compatibility fix is:

package cmd

var pluginSkillInstaller = tryInstallPluginSkills

func tryInstallPluginSkills(name string) {
	// existing plugin skill installation logic goes here
}

If the implementation was renamed, add a wrapper instead of duplicating logic:

package cmd

var pluginSkillInstaller = tryInstallPluginSkills

func tryInstallPluginSkills(name string) {
	installPluginSkills(name) // or whatever the new function is called
}

Why this is the right fix

The test file expects all of this behavior from tryInstallPluginSkills:

  • no error when plugin binary is missing
  • no error when plugin skills subcommand fails
  • no error when plugin returns empty output
  • installs skills from a source repo
  • skips already-installed skills

Those expectations are encoded throughout cmd/plugin_skills_test.go. The build is failing before tests even run, so the immediate issue is just the missing function symbol.

Recommended code shape

If you want to preserve testability and the existing injection point used later in the file, this pattern is appropriate:

package cmd

var pluginSkillInstaller = tryInstallPluginSkills

func tryInstallPluginSkills(name string) {
	if name == "" {
		return
	}

	// locate plugin binary, e.g. clime-<name>
	// run: <plugin> skills
	// if command fails or output is empty: return
	// otherwise install skills from the returned source path
}

If the code was intentionally renamed

Then update the tests instead, replacing:

tryInstallPluginSkills("...")

with the new function name everywhere in cmd/plugin_skills_test.go.

But unless there was a deliberate API cleanup, restoring tryInstallPluginSkills is the better fix because:

  • it is already the name encoded in the tests
  • it avoids touching multiple test cases
  • it likely preserves existing internal call sites such as pluginSkillInstaller

Minimal actionable fix

Add back this functi...

This pull request was created from Copilot chat.

@git-hulk git-hulk marked this pull request as ready for review May 6, 2026 02:03
- Add cmd/plugin_skills.go with tryInstallPluginSkills(name string) that
  looks up clime-<name> on PATH, runs `skills` subcommand, fetches the
  returned repo manifest, and installs any skills not already present
- Add pluginSkillInstaller var in cmd/plugin.go and invoke it from
  executePluginInstall after successful manifest save
- Fixes undefined: tryInstallPluginSkills CI failure in go vet

Agent-Logs-Url: https://github.com/git-hulk/clime/sessions/3680a0d7-99ec-46e5-a4bb-39916baa418a

Co-authored-by: git-hulk <4987594+git-hulk@users.noreply.github.com>
Copilot AI changed the title [WIP] Add implementation for tryInstallPluginSkills function feat(cmd): restore plugin skill auto-install; fix undefined tryInstallPluginSkills CI failure May 6, 2026
Copilot AI requested a review from git-hulk May 6, 2026 02:05
@git-hulk git-hulk closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants