suggest

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package suggest provides the command to suggest issue refinements.

Index

Constants

This section is empty.

Variables

View Source
var SuggestRefinementCmd = &cobra.Command{
	Use:     "suggest-refinement",
	Short:   "Generate a prompt for an AI to classify untyped issues.",
	Example: `  contextvibes project plan suggest-refinement -o for-ai.md`,
	RunE: func(cmd *cobra.Command, _ []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		provider, err := newProvider(ctx, globals.AppLogger, globals.LoadedAppConfig)
		if err != nil {
			presenter.Error("Failed to initialize work item provider: %v", err)

			return err
		}

		presenter.Summary("Finding unclassified issues for AI analysis...")
		query := "is:open is:issue -label:epic -label:story -label:bug -label:chore"
		items, err := provider.SearchItems(ctx, query)
		if err != nil {
			presenter.Error("Failed to search for unclassified issues: %v", err)

			return fmt.Errorf("failed to search items: %w", err)
		}

		if len(items) == 0 {
			presenter.Success("No unclassified issues found. The backlog is clean!")

			return nil
		}

		prompt := generateAIPrompt(items)

		if outputFile == "" {

			fmt.Fprint(presenter.Out(), prompt)
		} else {

			err := os.WriteFile(outputFile, []byte(prompt), 0o644)
			if err != nil {
				presenter.Error("Failed to write prompt to file %s: %v", outputFile, err)

				return fmt.Errorf("failed to write output file: %w", err)
			}
			presenter.Success("AI prompt successfully generated at: %s", outputFile)
		}

		return nil
	},
}

SuggestRefinementCmd represents the project plan suggest-refinement command.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL