claude_code_slash_commands 0.2.0 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89ca4fe43efd662a0ead8fbc2638980bf11b1c087e1c67d2c8b8294e75af34b5
4
- data.tar.gz: 7f137f9800fda4559099125496339ad688add88e40ff5ab4562434c9265d5679
3
+ metadata.gz: 604b553647bf6700a44f59a883cdf722996b1826fe1007ed458bf950d4108bbc
4
+ data.tar.gz: 33702b9349904328a854f23d5818a3843aa617cc320b155e9f211046317fbfc9
5
5
  SHA512:
6
- metadata.gz: 39e56a72e6087ea9388136c7c8fda53af496a5a8cbafcd76f57e3abb8b3d40997a345562b81719ccd4260320fbbfc24dfafbcfa75eb651ad31b11d4f9e20d8b1
7
- data.tar.gz: 48db40cc5f04f83e8cea64ce05149306c6584391bb3ba4275ed1b9e73a08324b55274469bd660b79117a5cd4a6e3bea93a036866b1cfc8b0f2d80c93aa8368da
6
+ metadata.gz: fa704f70f1fe4a49737134bcd9db8a97a7fbf3fee2e7169ae8f950e8281dfe050b7e439f78248637aefda49d71f9ac6605c5abee40802f609fef576ac33f1a07
7
+ data.tar.gz: ded25fc6aac37b2d88a378bbff51b16ca636b00928b0f63e10884369ae7f053eb337ed703aa3921cb14f01382f8ed6b24659c25f4a54cd82773d8f7b1d20c9e2
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- claude_code_slash_commands (0.2.0)
4
+ claude_code_slash_commands (0.2.2)
5
+ base64
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
10
  ast (2.4.3)
11
+ base64 (0.3.0)
10
12
  date (3.4.1)
11
13
  erb (5.0.1)
12
14
  io-console (0.8.0)
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,15 @@ This is useful for:
56
56
 
57
57
  Check the `commands/` directory to see what is available.
58
58
 
59
+ ### Safety
60
+
61
+ Note that some commands have `allowed-tools` already defined, so Claude Code will not prompt you.
62
+ I aim to restrict these to low risk tools such as git usage or web fetching, but you may wish to review before running.
63
+
64
+ ### Using the Commands
65
+
66
+ In your Claude Code session, type `/ruby--` and you will the list of available commands.
67
+
59
68
  ## Development
60
69
 
61
70
  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
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Configure a gem's CI pipeline using GitHub Actions
3
+ ---
4
+ The goal is to create a CI workflow file that runs the gem's tests as well as any linting or other verificiation tasks.
5
+
6
+ - If no CI workflow file exists, create one, otherwise update the existing one.
7
+ - Read https://www.ruby-lang.org/en/downloads/branches/ to check the latest Ruby release version.
8
+ - 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.
9
+ - Commit
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: Update to latest Ruby version
3
+ ---
4
+ The goal is to update this project to use the latest Ruby version.
5
+
6
+ - Before starting, verify the tests are passing (make a note of any deprecations)
7
+ - Read https://www.ruby-lang.org/en/downloads/branches/ to check the latest Ruby release version.
8
+ - If it's not already available, install that Ruby version.
9
+ - Read https://www.ruby-lang.org/en/downloads/branches/ to check the latest Ruby release version.
10
+ - If a .ruby-version file exists, update it to the latest Ruby version, otherwise create it.
11
+ - Run `bundle install`.
12
+ - If any gems are not compatible with the latest Ruby version, try update them.
13
+ - Ensure the tests are still passing.
14
+ - If there any new deprecations, ask if the user you should fix them.
15
+ - Commit the changes.
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
3
+ begin
4
+ require "bundler/setup"
5
+ rescue LoadError
6
+ # Bundler not available or no Gemfile - just load the gem directly
7
+ end
8
+
4
9
  require "claude_code_slash_commands"
5
10
 
6
11
  ClaudeCodeSlashCommands::CLI.start(ARGV)
@@ -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("gh", "api", command["download_path"])
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeCodeSlashCommands
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
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.0
4
+ version: 0.2.2
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,10 @@ files:
24
38
  - LICENSE.txt
25
39
  - README.md
26
40
  - Rakefile
27
- - commands/configure-gem-ci.md
41
+ - commands/ruby--add-rubocop.md
42
+ - commands/ruby--add-standard.md
43
+ - commands/ruby--configure-gem-ci.md
44
+ - commands/ruby--update-ruby-version.md
28
45
  - exe/claude_code_slash_commands
29
46
  - lib/claude_code_slash_commands.rb
30
47
  - lib/claude_code_slash_commands/cli.rb
@@ -1,10 +0,0 @@
1
- ---
2
- description: Configure a gem's CI pipeline using GitHub Actions
3
- ---
4
- The goal is to create a CI workflow file that runs the gem's tests as well as any linting or other verificiation tasks.
5
-
6
- If no CI workflow file exists, create one, otherwise update the existing one.
7
-
8
-  Read https://www.ruby-lang.org/en/downloads/branches/ to check the latest Ruby release version.
9
-
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.