Skip to content

Conversation

@dbpolito
Copy link
Member

@dbpolito dbpolito commented Jan 28, 2026

Adding new kool run --json,
Adding support for https://skills.sh/

@dbpolito dbpolito requested a review from fabriciojs January 28, 2026 17:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for skills.sh by implementing a new kool scripts command that lists available scripts from kool.yml files with optional JSON output for machine consumption.

Changes:

  • Adds new kool scripts command with --json flag to list scripts from kool.yml files
  • Upgrades YAML parser to v3 to support comment extraction from kool.yml files
  • Adds ScriptDetail structure to capture script names, comments, and commands for AI/agent consumption

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
skills/kool/SKILL.md New skill documentation for skills.sh integration explaining how AI agents should use kool commands
docs/05-Commands-Reference/kool-scripts.md Command reference documentation for the new kool scripts command
docs/05-Commands-Reference/0-kool.md Updated to include reference to the new kool scripts command
core/parser/yml.go Enhanced YAML parser to use yaml.v3, added comment extraction, and ScriptDetail support
core/parser/yml_test.go Updated tests to validate YAML structure instead of string comparison, added tests for comment parsing
core/parser/parser.go Added ParseAvailableScriptsDetails method to Parser interface
core/parser/parser_test.go Added tests for the new ParseAvailableScriptsDetails functionality
core/parser/fake_parser.go Extended fake parser to support ParseAvailableScriptsDetails for testing
commands/scripts.go New command implementation with JSON and human-readable output modes
commands/scripts_test.go Comprehensive tests for the scripts command including JSON output validation
commands/root.go Registered the new scripts command
commands/root_test.go Updated test to verify scripts command is registered

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +70 to +99
// ParseKoolYamlWithDetails decodes the target kool.yml and includes script details.
func ParseKoolYamlWithDetails(filePath string) (parsed *KoolYaml, err error) {
var (
file *os.File
raw []byte
root yaml.Node
)

if file, err = os.OpenFile(filePath, os.O_RDONLY, os.ModePerm); err != nil {
return
}

defer file.Close()

if raw, err = io.ReadAll(file); err != nil {
return
}

parsed = new(KoolYaml)
if err = yaml.Unmarshal(raw, parsed); err != nil {
return
}

if err = yaml.Unmarshal(raw, &root); err != nil {
return
}

parsed.ScriptDetails = parseScriptDetails(&root)
return
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ParseKoolYamlWithDetails function reads the file twice and unmarshals the content twice. This could be optimized by reading the file once and unmarshaling once into both the KoolYaml structure and the yaml.Node for comment extraction. Consider refactoring to improve performance, especially for large files.

Copilot uses AI. Check for mistakes.
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.

3 participants