.agents/skills/cli-patterns/SKILL.md
Cobra commands in cmd/ package, flag conventions
npx skillsauth add ronniegeraghty/hyoka cli-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Hyoka's CLI is built with Cobra, a popular Go CLI framework. Commands are organized in the cmd/ package with consistent flag naming and help text patterns.
Each command is a Cobra command object:
// cmd/run.go
var runCmd = &cobra.Command{
Use: "run",
Short: "Run evaluation",
Long: "Run an evaluation with prompts and configs.",
Args: cobra.NoArgs, // Positional arguments check
RunE: func(cmd *cobra.Command, args []string) error {
// Retrieve flags
promptID, _ := cmd.Flags().GetString("prompt-id")
config, _ := cmd.Flags().GetString("config")
// Validate
if promptID == "" && config == "" {
return fmt.Errorf("either --prompt-id or --config required")
}
// Execute
return run(promptID, config)
},
}
func init() {
rootCmd.AddCommand(runCmd)
runCmd.Flags().StringP("prompt-id", "", "", "Single prompt ID")
runCmd.Flags().StringP("config", "", "", "Config (comma-sep for multiple)")
}
--log-level, --max-files, --prompt-id (not --logLevel, --maxfiles)-v for --verbose)--*-timeout for duration limits (e.g., --gen-timeout)--skip-* for skipping phases (e.g., --skip-review)--*-file for file paths (e.g., --log-file)String flags:
cmd.Flags().StringP("config", "", "", "Config name")
Comma-separated lists:
cmd.Flags().String("tags", "", "Comma-separated tags (must quote: \"auth,crud\")")
// Parsed as: strings.Split(value, ",")
Boolean flags:
cmd.Flags().Bool("dry-run", false, "Show what would run without executing")
Numeric flags:
cmd.Flags().Int("max-files", 50, "Max files per eval")
cmd.Flags().Duration("gen-timeout", 600*time.Second, "Generation timeout")
Keep help text brief but actionable:
// Good
--config Config name or comma-sep list
--prompt-id Single prompt ID (e.g., identity-dp-python-default-credential)
--service Azure service (e.g., identity, key-vault)
--dry-run List matching prompts without executing
// Bad (too verbose, no examples)
--prompt-id The prompt identifier
--config The configuration to use
RunE: func(cmd *cobra.Command, args []string) error {
// 1. Get flags
promptID, _ := cmd.Flags().GetString("prompt-id")
config, _ := cmd.Flags().GetString("config")
// 2. Validate
if promptID == "" {
return fmt.Errorf("--prompt-id required")
}
// 3. Execute
ctx := context.Background()
return executeEval(ctx, promptID, config)
}
run — Execute evaluationlist — List available promptsvalidate — Validate prompt schemacheck-env — Check environment (Copilot SDK, Go version)clean — Clean orphaned sessionsserve — Start local web server for resultsReturn errors from RunE. Cobra catches them and prints with exit code 1:
RunE: func(cmd *cobra.Command, args []string) error {
result, err := runEval(...)
if err != nil {
slog.Error("Evaluation failed", "error", err)
return err // Cobra handles exit
}
return nil
}
--log-level flagRunE, let Cobra printRunE: func(cmd *cobra.Command, args []string) error {
config, _ := cmd.Flags().GetString("config")
allConfigs, _ := cmd.Flags().GetBool("all-configs")
if config == "" && !allConfigs {
return fmt.Errorf("either --config or --all-configs required")
}
if config != "" && allConfigs {
return fmt.Errorf("cannot use both --config and --all-configs")
}
return runWithConfig(config, allConfigs)
}
hyoka/cmd/root.gohyoka/cmd/*.gohyoka/cmd/common.go (if shared parsing logic)-a if context unclear)development
Identifies Azure SDK packages in generated code and checks whether they are the latest available versions. Use during code review to catch outdated dependencies.
development
Sets up build environments for generated Azure SDK code samples and attempts to compile/build without modifying generated files. Use during review to verify code compiles correctly.
development
# Java SDK Validation Skill You are a **Java Azure SDK validation reviewer** for generated code samples. Your job is to check whether generated Java code follows modern Azure SDK for Java conventions and flag violations of common anti-patterns that LLMs frequently produce. ## Rules 1. **NEVER modify generated code.** You are evaluating, not fixing. 2. Report all findings honestly — pass or fail with specific evidence. 3. Check every rule below. A single violation in a category means that cate
development
Reads generated Azure SDK code files and adds inline review comments without changing any actual code. Use during code review to annotate quality issues, best practices, and suggestions.