claude_code_slash_commands 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/README.md +5 -1
- data/commands/ruby--add-rubocop.md +19 -0
- data/commands/ruby--add-standard.md +19 -0
- data/commands/{configure-gem-ci.md → ruby--configure-gem-ci.md} +1 -1
- data/lib/claude_code_slash_commands/installer.rb +9 -2
- data/lib/claude_code_slash_commands/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e41a04bba52189335237582a60bbed45308a9999890086618137411cc70aa9e3
|
4
|
+
data.tar.gz: e19ede006674c49ca18748df1b65380a44b7187cf84ee1a865059acaaf4c02ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b93db29e612a3cf40e57be2fd383cc00606c5a0c13507d8b29103712f6b8c2822c8f2962e89ab5a32ea2a0eea4534655aceba7445b8a785f3f0903a4ea114ec4
|
7
|
+
data.tar.gz: f1be4e0572e1ca77a9db4c9b1969d7a46e4e6e9be384bdbf7af399d864235dcacc19374d33a7575d8018e2327510584bc3460a385f954981070fc905768ca11a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# claude_code_slash_commands
|
2
2
|
|
3
|
-
This gem is for distributing Ruby-specific [slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands) for [Claude Code](https://www.anthropic.com/claude-code).
|
3
|
+
This gem is for distributing Ruby-specific [custom slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands#custom-slash-commands) for [Claude Code](https://www.anthropic.com/claude-code).
|
4
4
|
|
5
5
|
## Prerequisites
|
6
6
|
|
@@ -56,6 +56,10 @@ This is useful for:
|
|
56
56
|
|
57
57
|
Check the `commands/` directory to see what is available.
|
58
58
|
|
59
|
+
### Using the Commands
|
60
|
+
|
61
|
+
In your Claude Code session, type `/ruby--` and you will the list of available commands.
|
62
|
+
|
59
63
|
## Development
|
60
64
|
|
61
65
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), WebFetch(domain:rubygems.org)
|
3
|
+
description: Add rubocop
|
4
|
+
---
|
5
|
+
Add `rubocop` to this repo by following these steps:
|
6
|
+
|
7
|
+
- Create a new branch
|
8
|
+
- Check what the latest release of rubocop is using https://rubygems.org/gems/rubocop/
|
9
|
+
- Add the latest release of the rubocop gem as a development dependency
|
10
|
+
- Commit
|
11
|
+
- If there is a `Rakefile`, configure the `rubocop` task
|
12
|
+
- If there is a default task, configure `rubocop` to run as part of that
|
13
|
+
- Commit
|
14
|
+
- Run rubocop
|
15
|
+
- If there are linting errors, run rubocop with the `--autocorrect` flag and commit
|
16
|
+
- If the CLI suggests that additional errors can be fixed unsafely then run with `--autocorrect-all` and commit
|
17
|
+
- If there are remaining linting errors, run rubocop with --auto-gen-config and commit.
|
18
|
+
- If there is a CI configuration such as GitHub Actions, configure it to run rubocop as part of CI. The linting should be in a separate job from the tests.
|
19
|
+
- Commit
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), WebFetch(domain:rubygems.org)
|
3
|
+
description: Add standard
|
4
|
+
---
|
5
|
+
Add `standardrb` to this repo by following these steps:
|
6
|
+
|
7
|
+
- Create a new branch
|
8
|
+
- Check what the latest release of standard is using https://rubygems.org/gems/standard/
|
9
|
+
- Add the latest release of the standard gem as a development dependency
|
10
|
+
- Commit
|
11
|
+
- If there is a `Rakefile`, configure the `standard` task
|
12
|
+
- If there is a default task, configure `standard` to run as part of that
|
13
|
+
- Commit
|
14
|
+
- Run standard
|
15
|
+
- If there are linting errors, run standardrb with the `--fix` flag and commit
|
16
|
+
- If the CLI suggests that additional errors can be fixed unsafely then run with `--fix-unsafely` and commit
|
17
|
+
- If there are remaining linting errors, run standardrb with --generate-todo and commit.
|
18
|
+
- If there is a CI configuration such as GitHub Actions, configure it to run standard as part of CI. The linting should be in a separate job from the tests.
|
19
|
+
- Commit
|
@@ -5,6 +5,6 @@ The goal is to create a CI workflow file that runs the gem's tests as well as an
|
|
5
5
|
|
6
6
|
If no CI workflow file exists, create one, otherwise update the existing one.
|
7
7
|
|
8
|
-
|
8
|
+
Read https://www.ruby-lang.org/en/downloads/branches/ to check the latest Ruby release version.
|
9
9
|
|
10
10
|
Configure the CI matrix such that it covers the the minimum `required_ruby_version` in the `.gemspec`, as well as every minor release up to the latest Ruby version.
|
@@ -4,6 +4,7 @@ require "fileutils"
|
|
4
4
|
require "pathname"
|
5
5
|
require "json"
|
6
6
|
require "open3"
|
7
|
+
require "base64"
|
7
8
|
|
8
9
|
module ClaudeCodeSlashCommands
|
9
10
|
class Installer
|
@@ -68,13 +69,19 @@ module ClaudeCodeSlashCommands
|
|
68
69
|
target_file = @commands_target.join(filename)
|
69
70
|
|
70
71
|
# Fetch the content of the command file
|
71
|
-
stdout, stderr, status = Open3.capture3(
|
72
|
+
stdout, stderr, status = Open3.capture3(
|
73
|
+
"gh",
|
74
|
+
"api",
|
75
|
+
"repos/#{@repo}/contents/" + command["path"],
|
76
|
+
"--jq",
|
77
|
+
".content"
|
78
|
+
)
|
72
79
|
|
73
80
|
unless status.success?
|
74
81
|
raise "Failed to fetch command content for #{filename}: #{stderr}"
|
75
82
|
end
|
76
83
|
|
77
|
-
content = stdout
|
84
|
+
content = Base64.decode64(stdout)
|
78
85
|
|
79
86
|
if target_file.exist?
|
80
87
|
if target_file.read == content
|
metadata
CHANGED
@@ -1,14 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: claude_code_slash_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Waite
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
-
dependencies:
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: base64
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
12
26
|
email:
|
13
27
|
- 13400+andyw8@users.noreply.github.com
|
14
28
|
executables:
|
@@ -24,7 +38,9 @@ files:
|
|
24
38
|
- LICENSE.txt
|
25
39
|
- README.md
|
26
40
|
- Rakefile
|
27
|
-
- commands/
|
41
|
+
- commands/ruby--add-rubocop.md
|
42
|
+
- commands/ruby--add-standard.md
|
43
|
+
- commands/ruby--configure-gem-ci.md
|
28
44
|
- exe/claude_code_slash_commands
|
29
45
|
- lib/claude_code_slash_commands.rb
|
30
46
|
- lib/claude_code_slash_commands/cli.rb
|