Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:35:16 +08:00
commit 676815a598
5 changed files with 149 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "rbs-goose",
"description": "Setup rbs type definitions for steep and automatically fix type errors",
"version": "1.1.0",
"author": {
"name": "kokuyouwind",
"url": "https://github.com/kokuyouwind"
},
"commands": [
"./commands"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# rbs-goose
Setup rbs type definitions for steep and automatically fix type errors

22
commands/run.md Normal file
View File

@@ -0,0 +1,22 @@
Follow these instructions:
```
# All file paths are relative to the plugin installation directory
# (e.g., ~/.claude/plugins/marketplaces/kokuyouwind-plugins/plugins/rbs-goose)
plugin_base_path = File.dirname(__FILE__) # This is the plugin root directory
# First Run Setup
unless File.exists?('./rbs_goose.yml')
follow_instruction(File.join(plugin_base_path, 'commands/setup.md'))
return
end
config = Config.load('./rbs_goose.yml')
case config.type_annotation_mode
when :inline
follow_instruction(File.join(plugin_base_path, 'internal/type_inline.md'))
when :file
follow_instruction(File.join(plugin_base_path, 'internal/type_file.md'))
end
```

63
commands/setup.md Normal file
View File

@@ -0,0 +1,63 @@
Follow these instructions:
```
# All file paths in this command are relative to the plugin installation directory
# (e.g., ~/.claude/plugins/marketplaces/kokuyouwind-plugins/plugins/rbs-goose)
plugin_base_path = File.dirname(__FILE__) # This is the plugin root directory
# Setup configurations
file = File.copy(File.join(plugin_base_path, 'templates/rbs_goose.template.yml'), './rbs_goose.yml')
puts(file.contents)
until('If there are no problems with the above settings file, please answer yes. If you wish to update the file, please describe the changes.') do
file.update_contents
end
# Setup tools
config = Config.load('./rbs_goose.yml')
unless gemfile.contain?('rbs')
puts('setup rbs...')
fetch('https://github.com/soutaro/steep')
setup_rbs
if config.type_annotation_mode.inline?
fetch('https://github.com/soutaro/rbs-inline')
begin
setup_rbs_inline
rescue => CompatibilityError(['rbs-inline', 'rubocop-ast'])
# rbs-inline <= v0.11.0 requires prism < 1.3, so use rubocop with prism < 1.3
# @see https://github.com/soutaro/rbs-inline/pull/207
if (confirm('Due to compatibility issues with rbs-inline, we will downgrade rubocop to version 1.74.0. Is that okay?'))
gemfile.update('rubocop', '1.74.0')
retry
else
say('Failed to install rbs-inline. Please resolve the dependencies of rbs-inline or switch the mode to file and try the `/rbs-goose:setup` command again.')
exit(1)
end
end
end
fetch('https://github.com/ruby/gem_rbs_collection')
setup_rbs_collection
end
unless gemifle.contain?('steep')
puts('setup steep...')
fetch('https://github.com/soutaro/steep')
setup_steep
update_steep_config(directory_structure)
end
if rails_app? && !gemfile.contain?('rbs')
puts('setup rbs-rails...')
fetch('https://github.com/pocke/rbs_rails')
setup_rails
end
update_git_ignore(<<~"IGNORE")
.gem_rbs_collection/
sig/generated/
IGNORE
puts('Initialize Complete! Run `/rbs-goose:run` to start type checking.')
```

49
plugin.lock.json Normal file
View File

@@ -0,0 +1,49 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:kokuyouwind/claude-plugins:plugins/rbs-goose",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "44bfb70e7b94498c69b810ae595b73ba8c90f921",
"treeHash": "fae7ecc014d380e410753a022fe3be616e9524171c2b63bb80ec0c233b4f2537",
"generatedAt": "2025-11-28T10:19:54.133585Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "rbs-goose",
"description": "Setup rbs type definitions for steep and automatically fix type errors",
"version": "1.1.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "5555b1aff09f4609896c978c07219704812e08e9fba71a7df289cab3a7e2a54c"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "850cf23194004e1b0bfcea75eb6a4a781a8b605f5d76c4f9868c9aca42c90bab"
},
{
"path": "commands/setup.md",
"sha256": "1bb02759990dd19260ea030edfe644c1c23cf2daaa6f2d87eb7bfa3f0750a9a4"
},
{
"path": "commands/run.md",
"sha256": "e93d7a41d117c173c695ae3d20997bf37bd117ea38a01c99ed2b24cea4855667"
}
],
"dirSha256": "fae7ecc014d380e410753a022fe3be616e9524171c2b63bb80ec0c233b4f2537"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}