bug_bunny 4.8.0 → 4.8.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/.agents/skills/documentation-writer/SKILL.md +45 -0
- data/.agents/skills/gem-release/SKILL.md +114 -0
- data/.agents/skills/quality-code/SKILL.md +51 -0
- data/.agents/skills/sentry/SKILL.md +135 -0
- data/.agents/skills/sentry/references/api-endpoints.md +147 -0
- data/.agents/skills/sentry/scripts/sentry.rb +194 -0
- data/.agents/skills/skill-builder/SKILL.md +232 -0
- data/.agents/skills/skill-manager/SKILL.md +172 -0
- data/.agents/skills/skill-manager/scripts/sync.rb +310 -0
- data/.agents/skills/yard/SKILL.md +311 -0
- data/.agents/skills/yard/references/tipos.md +144 -0
- data/CHANGELOG.md +8 -0
- data/CLAUDE.md +28 -231
- data/lib/bug_bunny/version.rb +1 -1
- data/skill/SKILL.md +230 -0
- data/skill/references/client-middleware.md +144 -0
- data/skill/references/consumer.md +104 -0
- data/skill/references/controller.md +105 -0
- data/skill/references/errores.md +97 -0
- data/skill/references/resource.md +116 -0
- data/skill/references/routing.md +82 -0
- data/skill/references/testing.md +138 -0
- data/skills.lock +24 -0
- data/skills.yml +19 -0
- metadata +24 -28
- data/.claude/commands/gem-ai-setup.md +0 -174
- data/.claude/commands/pr.md +0 -53
- data/.claude/commands/release.md +0 -52
- data/.claude/commands/rubocop.md +0 -22
- data/.claude/commands/service-ai-setup.md +0 -168
- data/.claude/commands/test.md +0 -28
- data/.claude/commands/yard.md +0 -46
- data/docs/_index.md +0 -50
- data/docs/ai/_index.md +0 -56
- data/docs/ai/antipatterns.md +0 -166
- data/docs/ai/api.md +0 -251
- data/docs/ai/architecture.md +0 -92
- data/docs/ai/errors.md +0 -158
- data/docs/ai/faq_external.md +0 -133
- data/docs/ai/faq_internal.md +0 -86
- data/docs/ai/glossary.md +0 -45
- data/docs/concepts.md +0 -140
- data/docs/howto/controller.md +0 -194
- data/docs/howto/middleware_client.md +0 -119
- data/docs/howto/middleware_consumer.md +0 -127
- data/docs/howto/rails.md +0 -214
- data/docs/howto/resource.md +0 -200
- data/docs/howto/routing.md +0 -133
- data/docs/howto/testing.md +0 -259
- data/docs/howto/tracing.md +0 -119
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
## Estructura
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
spec/
|
|
7
|
+
├── spec_helper.rb
|
|
8
|
+
├── support/
|
|
9
|
+
│ ├── bunny_mocks.rb # Stubs para unit tests
|
|
10
|
+
│ └── integration_helper.rb # Helpers para integration tests
|
|
11
|
+
├── unit/ # Sin RabbitMQ real
|
|
12
|
+
│ ├── configuration_spec.rb
|
|
13
|
+
│ ├── client_session_pool_spec.rb
|
|
14
|
+
│ ├── consumer_spec.rb
|
|
15
|
+
│ ├── session_spec.rb
|
|
16
|
+
│ ├── consumer_middleware_spec.rb
|
|
17
|
+
│ ├── controller_after_action_spec.rb
|
|
18
|
+
│ ├── observability_spec.rb
|
|
19
|
+
│ └── resource_attributes_spec.rb
|
|
20
|
+
└── integration/ # Requiere RabbitMQ
|
|
21
|
+
├── client_spec.rb
|
|
22
|
+
├── consumer_middleware_spec.rb
|
|
23
|
+
├── controller_spec.rb
|
|
24
|
+
├── error_handling_spec.rb
|
|
25
|
+
├── infrastructure_spec.rb
|
|
26
|
+
└── resource_spec.rb
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Unit Tests — Mocking de Bunny
|
|
30
|
+
|
|
31
|
+
Los unit tests usan `BunnyMocks` para evitar dependencia de RabbitMQ:
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
# spec/support/bunny_mocks.rb
|
|
35
|
+
BunnyMocks::FakeChannel # Simula canal Bunny
|
|
36
|
+
BunnyMocks::FakeConnection # Simula conexión Bunny
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Patrón de uso:
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
let(:connection) { BunnyMocks::FakeConnection.new }
|
|
43
|
+
let(:session) { BugBunny::Session.new(connection) }
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Para Producer: `allow_any_instance_of(BugBunny::Producer).to receive(:rpc).and_return(response)`
|
|
47
|
+
|
|
48
|
+
## Integration Tests — Helpers
|
|
49
|
+
|
|
50
|
+
### with_running_worker
|
|
51
|
+
|
|
52
|
+
Levanta un consumer real en un thread:
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
with_running_worker(
|
|
56
|
+
queue: unique('test_q'),
|
|
57
|
+
exchange: unique('test_ex'),
|
|
58
|
+
exchange_type: 'topic',
|
|
59
|
+
routing_key: 'users.#'
|
|
60
|
+
) do
|
|
61
|
+
response = client.request('users/1', method: :get)
|
|
62
|
+
expect(response['status']).to eq(200)
|
|
63
|
+
end
|
|
64
|
+
# Worker se detiene automáticamente al salir del bloque
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### with_spy_worker
|
|
68
|
+
|
|
69
|
+
Captura mensajes sin procesarlos:
|
|
70
|
+
|
|
71
|
+
```ruby
|
|
72
|
+
with_spy_worker(queue:, exchange:) do |messages|
|
|
73
|
+
client.publish('events', body: { type: 'test' })
|
|
74
|
+
msg = wait_for_message(messages, 5)
|
|
75
|
+
expect(msg[:body]).to include('type' => 'test')
|
|
76
|
+
end
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### unique(name)
|
|
80
|
+
|
|
81
|
+
Genera nombres únicos para evitar colisiones entre tests:
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
unique('my_queue') # → "my_queue_a3f1b2c4"
|
|
85
|
+
# Usa SecureRandom.hex(4)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Thread Safety Testing
|
|
89
|
+
|
|
90
|
+
Patrón con `Concurrent::CyclicBarrier`:
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
barrier = Concurrent::CyclicBarrier.new(10)
|
|
94
|
+
counter = Concurrent::AtomicFixnum.new(0)
|
|
95
|
+
|
|
96
|
+
threads = 10.times.map do
|
|
97
|
+
Thread.new do
|
|
98
|
+
barrier.wait # Sincroniza inicio
|
|
99
|
+
session.channel
|
|
100
|
+
counter.increment
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
threads.each(&:join)
|
|
105
|
+
expect(counter.value).to eq(10)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Skip de Integration Tests
|
|
109
|
+
|
|
110
|
+
Los tests `:integration` se skipean automáticamente si RabbitMQ no está disponible:
|
|
111
|
+
|
|
112
|
+
```ruby
|
|
113
|
+
# spec_helper.rb
|
|
114
|
+
config.before(:each, :integration) do
|
|
115
|
+
skip 'RabbitMQ not available' unless rabbitmq_available?
|
|
116
|
+
end
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Configuración de Test
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
BugBunny.configure do |config|
|
|
123
|
+
config.host = ENV.fetch('RABBITMQ_HOST', 'localhost')
|
|
124
|
+
config.username = ENV.fetch('RABBITMQ_USER', 'guest')
|
|
125
|
+
config.password = ENV.fetch('RABBITMQ_PASS', 'guest')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
TEST_POOL = ConnectionPool.new(size: 5) { BugBunny.create_connection }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Ejecutar Tests
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
bundle exec rspec # Todos
|
|
135
|
+
bundle exec rspec spec/unit/ # Solo unit
|
|
136
|
+
bundle exec rspec spec/integration/ # Solo integration (requiere RabbitMQ)
|
|
137
|
+
bundle exec rspec spec/unit/session_spec.rb # Archivo específico
|
|
138
|
+
```
|
data/skills.lock
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
synced_at: '2026-04-04 12:24:37'
|
|
3
|
+
skills:
|
|
4
|
+
- name: documentation-writer
|
|
5
|
+
scope: local
|
|
6
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/documentation-writer"
|
|
7
|
+
- name: gem-release
|
|
8
|
+
scope: local
|
|
9
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/gem-release"
|
|
10
|
+
- name: quality-code
|
|
11
|
+
scope: local
|
|
12
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/quality-code"
|
|
13
|
+
- name: rabbitmq-expert
|
|
14
|
+
scope: local
|
|
15
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/rabbitmq-expert"
|
|
16
|
+
- name: skill-builder
|
|
17
|
+
scope: local
|
|
18
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/skill-builder"
|
|
19
|
+
- name: skill-manager
|
|
20
|
+
scope: local
|
|
21
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/skill-manager"
|
|
22
|
+
- name: yard
|
|
23
|
+
scope: local
|
|
24
|
+
path: "/Users/gabriel/src/gems/bug_bunny/.agents/skills/yard"
|
data/skills.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
mcps:
|
|
2
|
+
- github
|
|
3
|
+
skills:
|
|
4
|
+
- name: skill-manager
|
|
5
|
+
repo: sequre/ai_knowledge
|
|
6
|
+
- name: yard
|
|
7
|
+
repo: sequre/ai_knowledge
|
|
8
|
+
- name: quality-code
|
|
9
|
+
repo: sequre/ai_knowledge
|
|
10
|
+
- name: gem-release
|
|
11
|
+
repo: sequre/ai_knowledge
|
|
12
|
+
- name: skill-builder
|
|
13
|
+
repo: sequre/ai_knowledge
|
|
14
|
+
- name: rabbitmq-expert
|
|
15
|
+
repo: martinholovsky/claude-skills-generator
|
|
16
|
+
path: skills/rabbitmq-expert
|
|
17
|
+
- name: documentation-writer
|
|
18
|
+
repo: github/awesome-copilot
|
|
19
|
+
path: skills/documentation-writer
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bug_bunny
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.8.
|
|
4
|
+
version: 4.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- gabix
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bunny
|
|
@@ -229,36 +229,22 @@ executables: []
|
|
|
229
229
|
extensions: []
|
|
230
230
|
extra_rdoc_files: []
|
|
231
231
|
files:
|
|
232
|
+
- ".agents/skills/documentation-writer/SKILL.md"
|
|
233
|
+
- ".agents/skills/gem-release/SKILL.md"
|
|
234
|
+
- ".agents/skills/quality-code/SKILL.md"
|
|
232
235
|
- ".agents/skills/rabbitmq-expert/SKILL.md"
|
|
233
|
-
- ".
|
|
234
|
-
- ".
|
|
235
|
-
- ".
|
|
236
|
-
- ".
|
|
237
|
-
- ".
|
|
238
|
-
- ".
|
|
239
|
-
- ".
|
|
236
|
+
- ".agents/skills/sentry/SKILL.md"
|
|
237
|
+
- ".agents/skills/sentry/references/api-endpoints.md"
|
|
238
|
+
- ".agents/skills/sentry/scripts/sentry.rb"
|
|
239
|
+
- ".agents/skills/skill-builder/SKILL.md"
|
|
240
|
+
- ".agents/skills/skill-manager/SKILL.md"
|
|
241
|
+
- ".agents/skills/skill-manager/scripts/sync.rb"
|
|
242
|
+
- ".agents/skills/yard/SKILL.md"
|
|
243
|
+
- ".agents/skills/yard/references/tipos.md"
|
|
240
244
|
- CHANGELOG.md
|
|
241
245
|
- CLAUDE.md
|
|
242
246
|
- README.md
|
|
243
247
|
- Rakefile
|
|
244
|
-
- docs/_index.md
|
|
245
|
-
- docs/ai/_index.md
|
|
246
|
-
- docs/ai/antipatterns.md
|
|
247
|
-
- docs/ai/api.md
|
|
248
|
-
- docs/ai/architecture.md
|
|
249
|
-
- docs/ai/errors.md
|
|
250
|
-
- docs/ai/faq_external.md
|
|
251
|
-
- docs/ai/faq_internal.md
|
|
252
|
-
- docs/ai/glossary.md
|
|
253
|
-
- docs/concepts.md
|
|
254
|
-
- docs/howto/controller.md
|
|
255
|
-
- docs/howto/middleware_client.md
|
|
256
|
-
- docs/howto/middleware_consumer.md
|
|
257
|
-
- docs/howto/rails.md
|
|
258
|
-
- docs/howto/resource.md
|
|
259
|
-
- docs/howto/routing.md
|
|
260
|
-
- docs/howto/testing.md
|
|
261
|
-
- docs/howto/tracing.md
|
|
262
248
|
- initializer_example.rb
|
|
263
249
|
- lib/bug_bunny.rb
|
|
264
250
|
- lib/bug_bunny/client.rb
|
|
@@ -284,7 +270,17 @@ files:
|
|
|
284
270
|
- lib/generators/bug_bunny/install/templates/initializer.rb
|
|
285
271
|
- lib/tasks/bug_bunny.rake
|
|
286
272
|
- plan_test.txt
|
|
273
|
+
- skill/SKILL.md
|
|
274
|
+
- skill/references/client-middleware.md
|
|
275
|
+
- skill/references/consumer.md
|
|
276
|
+
- skill/references/controller.md
|
|
277
|
+
- skill/references/errores.md
|
|
278
|
+
- skill/references/resource.md
|
|
279
|
+
- skill/references/routing.md
|
|
280
|
+
- skill/references/testing.md
|
|
287
281
|
- skills-lock.json
|
|
282
|
+
- skills.lock
|
|
283
|
+
- skills.yml
|
|
288
284
|
- spec/integration/client_spec.rb
|
|
289
285
|
- spec/integration/consumer_middleware_spec.rb
|
|
290
286
|
- spec/integration/controller_spec.rb
|
|
@@ -312,7 +308,7 @@ metadata:
|
|
|
312
308
|
homepage_uri: https://github.com/gedera/bug_bunny
|
|
313
309
|
source_code_uri: https://github.com/gedera/bug_bunny
|
|
314
310
|
changelog_uri: https://github.com/gedera/bug_bunny/blob/main/CHANGELOG.md
|
|
315
|
-
documentation_uri: https://github.com/gedera/bug_bunny/blob/v4.8.
|
|
311
|
+
documentation_uri: https://github.com/gedera/bug_bunny/blob/v4.8.1/skill
|
|
316
312
|
post_install_message:
|
|
317
313
|
rdoc_options: []
|
|
318
314
|
require_paths:
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
Generate or update the complete AI documentation suite for this gem.
|
|
2
|
-
|
|
3
|
-
This skill is invoked automatically by `/release`. It can also be run standalone to update docs without a full release.
|
|
4
|
-
|
|
5
|
-
BugBunny's `docs/ai/` is the **golden example** of the expected output quality. When in doubt, read it.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Step 1 — Discover the current state
|
|
10
|
-
|
|
11
|
-
Read in order:
|
|
12
|
-
1. `lib/bug_bunny/version.rb` (or equivalent) — current version
|
|
13
|
-
2. `docs/_index.md` — if it exists, it lists all files to update and their purpose
|
|
14
|
-
3. `docs/ai/_index.md` — if it exists, it has the current profile (minimal/full) and file list
|
|
15
|
-
4. `gemspec` — gem name, summary, description, dependencies
|
|
16
|
-
5. `CLAUDE.md` — architecture, components, patterns, extension hooks
|
|
17
|
-
|
|
18
|
-
If `docs/ai/` does not exist yet, this is a **first-time generation**. Create from scratch.
|
|
19
|
-
If it exists, **update only the sections affected by the changes in this release**.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Step 2 — Determine the profile
|
|
24
|
-
|
|
25
|
-
**Full profile** when any of these apply:
|
|
26
|
-
- Gem is public (has a homepage or published to RubyGems)
|
|
27
|
-
- Gem has multiple audiences (internal maintainers + external integrators)
|
|
28
|
-
- Gem has a non-trivial public API (multiple classes, errors, configuration)
|
|
29
|
-
|
|
30
|
-
**Minimal profile** when all of these apply:
|
|
31
|
-
- Gem is internal-only
|
|
32
|
-
- Single audience
|
|
33
|
-
- Simple API (one entry point, few methods)
|
|
34
|
-
|
|
35
|
-
Full profile files: `_index.md`, `glossary.md`, `architecture.md`, `api.md`, `faq_internal.md`, `faq_external.md`, `antipatterns.md`, `errors.md`
|
|
36
|
-
Minimal profile files: `_index.md`, `api.md`, `errors.md`
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Step 3 — Analyze the codebase
|
|
41
|
-
|
|
42
|
-
Read the following to generate accurate content:
|
|
43
|
-
- All files under `lib/` — public API, class responsibilities, method signatures
|
|
44
|
-
- `spec/` or `test/` — usage patterns, edge cases, what errors are expected
|
|
45
|
-
- `CHANGELOG.md` — what changed in this version (for updating existing docs)
|
|
46
|
-
- `docs/howto/` — existing human docs to stay consistent with
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Step 4 — Generate or update each file
|
|
51
|
-
|
|
52
|
-
Apply these rules to every file:
|
|
53
|
-
|
|
54
|
-
**RAG optimization rules (mandatory):**
|
|
55
|
-
1. Each section ≤ 400 tokens — chunks must be self-contained
|
|
56
|
-
2. Each section self-contained — do not assume context from previous sections
|
|
57
|
-
3. `faq_*.md` always in strict Q&A format — H3 with the question, answer ≤ 150 words
|
|
58
|
-
4. `glossary.md` one entry per term — term in bold, definition in 1-3 lines
|
|
59
|
-
5. `errors.md` one entry per error — name, cause, how to reproduce, how to resolve
|
|
60
|
-
6. No introductory prose — go straight to content
|
|
61
|
-
|
|
62
|
-
### `_index.md`
|
|
63
|
-
|
|
64
|
-
Frontmatter manifest. Update `version:` to the new version. Keep `profile:`, `kind:`, `audiences:` stable unless the gem changed fundamentally. List every file under `files:` with its audience.
|
|
65
|
-
|
|
66
|
-
Reference: `docs/ai/_index.md` in BugBunny.
|
|
67
|
-
|
|
68
|
-
### `glossary.md`
|
|
69
|
-
|
|
70
|
-
Domain terms specific to this gem. Include:
|
|
71
|
-
- Core abstractions introduced by the gem
|
|
72
|
-
- Terms a developer needs to understand to use the gem correctly
|
|
73
|
-
- Terms that have a non-obvious meaning in this context
|
|
74
|
-
|
|
75
|
-
Do NOT include generic Ruby or framework terms unless the gem redefines them.
|
|
76
|
-
|
|
77
|
-
Reference: `docs/ai/glossary.md` in BugBunny.
|
|
78
|
-
|
|
79
|
-
### `architecture.md`
|
|
80
|
-
|
|
81
|
-
Internal-facing. Include:
|
|
82
|
-
- Component map (ASCII diagram if useful)
|
|
83
|
-
- How the components interact at runtime
|
|
84
|
-
- Key design decisions and why (not just what)
|
|
85
|
-
- Thread safety considerations if relevant
|
|
86
|
-
- Caching or lifecycle patterns
|
|
87
|
-
|
|
88
|
-
Reference: `docs/ai/architecture.md` in BugBunny.
|
|
89
|
-
|
|
90
|
-
### `api.md`
|
|
91
|
-
|
|
92
|
-
External-facing. Include:
|
|
93
|
-
- Configuration block with all options, types, defaults, and constraints
|
|
94
|
-
- Every public class with its public methods: signature, parameters, return type, description
|
|
95
|
-
- Code examples for each major operation
|
|
96
|
-
- Class-level configuration options (`.with`, class attributes, etc.)
|
|
97
|
-
|
|
98
|
-
Reference: `docs/ai/api.md` in BugBunny.
|
|
99
|
-
|
|
100
|
-
### `faq_internal.md`
|
|
101
|
-
|
|
102
|
-
Q&A for the gem maintainer. Cover:
|
|
103
|
-
- Non-obvious implementation decisions ("why X instead of Y?")
|
|
104
|
-
- Thread safety and concurrency considerations
|
|
105
|
-
- How to extend or hook into the gem
|
|
106
|
-
- Common mistakes when modifying the gem internals
|
|
107
|
-
|
|
108
|
-
Each Q&A: H3 for the question, answer ≤ 150 words, no preamble.
|
|
109
|
-
|
|
110
|
-
Reference: `docs/ai/faq_internal.md` in BugBunny.
|
|
111
|
-
|
|
112
|
-
### `faq_external.md`
|
|
113
|
-
|
|
114
|
-
Q&A for the developer integrating the gem. Cover:
|
|
115
|
-
- Setup and configuration questions
|
|
116
|
-
- How to perform the most common operations
|
|
117
|
-
- Error handling patterns
|
|
118
|
-
- Testing patterns
|
|
119
|
-
- Performance and tuning questions
|
|
120
|
-
|
|
121
|
-
Each Q&A: H3 for the question, answer ≤ 150 words, no preamble.
|
|
122
|
-
|
|
123
|
-
Reference: `docs/ai/faq_external.md` in BugBunny.
|
|
124
|
-
|
|
125
|
-
### `antipatterns.md`
|
|
126
|
-
|
|
127
|
-
What NOT to do. For each antipattern:
|
|
128
|
-
1. Name it clearly
|
|
129
|
-
2. Show the wrong code
|
|
130
|
-
3. Explain why it's wrong (not just "it's bad")
|
|
131
|
-
4. Show the correct alternative
|
|
132
|
-
|
|
133
|
-
Reference: `docs/ai/antipatterns.md` in BugBunny.
|
|
134
|
-
|
|
135
|
-
### `errors.md`
|
|
136
|
-
|
|
137
|
-
All exceptions the gem raises. For each:
|
|
138
|
-
- Class name and inheritance
|
|
139
|
-
- Cause (what triggers it)
|
|
140
|
-
- How to reproduce it (minimal example)
|
|
141
|
-
- How to resolve it
|
|
142
|
-
|
|
143
|
-
Reference: `docs/ai/errors.md` in BugBunny.
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Step 5 — Update docs/howto/ and docs/concepts.md
|
|
148
|
-
|
|
149
|
-
Read `docs/_index.md` (human documentation section) to know which files exist.
|
|
150
|
-
Update only the sections affected by the changes in this release.
|
|
151
|
-
Do not rewrite files that were not affected by the changes.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Step 6 — Update README.md
|
|
156
|
-
|
|
157
|
-
Generate or update README.md after `docs/howto/` is already updated.
|
|
158
|
-
README structure:
|
|
159
|
-
1. One-line description
|
|
160
|
-
2. Installation (`gem 'gem_name'` in Gemfile)
|
|
161
|
-
3. Quick start — two minimal code examples (publisher side + consumer/server side if applicable)
|
|
162
|
-
4. Features list for the current version
|
|
163
|
-
5. Links to `docs/` for deeper guides
|
|
164
|
-
|
|
165
|
-
Keep it under 150 lines. README is the entry point — `docs/` is the depth.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Step 7 — Show diff and wait for approval
|
|
170
|
-
|
|
171
|
-
Show the complete diff of all generated/updated files.
|
|
172
|
-
Wait for developer approval before proceeding.
|
|
173
|
-
The developer may adjust content before confirming.
|
|
174
|
-
Do NOT proceed to version bump or CHANGELOG until approved.
|
data/.claude/commands/pr.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
Create a Pull Request for BugBunny via GitHub CLI. Usage: /pr
|
|
2
|
-
|
|
3
|
-
Creá un PR desde la rama actual hacia `main` usando `gh`.
|
|
4
|
-
|
|
5
|
-
## Pasos
|
|
6
|
-
|
|
7
|
-
1. **Correr tests** — si fallan, detener todo:
|
|
8
|
-
```bash
|
|
9
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8
|
|
10
|
-
bundle exec rspec
|
|
11
|
-
```
|
|
12
|
-
2. **autocorregir rubocop** - si fallan, detener todo
|
|
13
|
-
```bash
|
|
14
|
-
bundle exec rubocop -a
|
|
15
|
-
```
|
|
16
|
-
3. **Ejecutar `/gem-ai-setup`** — genera/actualiza `docs/howto/`, `docs/ai/` y `README.md`.
|
|
17
|
-
Esperar aprobación del developer antes de continuar.
|
|
18
|
-
4. Verificá que hay commits en la rama que no están en main: `git log main..HEAD --oneline`
|
|
19
|
-
5. Revisá todos los cambios del PR: `git diff main...HEAD`
|
|
20
|
-
6. Determiná el tipo de cambio (feature, bugfix, refactor, docs, chore)
|
|
21
|
-
7. Creá el PR con `gh pr create`:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
gh pr create --title "tipo: descripción breve" --body "$(cat <<'EOF'
|
|
25
|
-
## Summary
|
|
26
|
-
- Bullet points de los cambios principales
|
|
27
|
-
|
|
28
|
-
## Test plan
|
|
29
|
-
- [ ] Tests existentes pasan (`/test`)
|
|
30
|
-
- [ ] RuboCop sin offenses (`/rubocop`)
|
|
31
|
-
- [ ] YARD documentado en métodos nuevos/modificados
|
|
32
|
-
|
|
33
|
-
## Notes
|
|
34
|
-
Contexto adicional si es necesario.
|
|
35
|
-
|
|
36
|
-
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
37
|
-
EOF
|
|
38
|
-
)"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Convenciones de título
|
|
42
|
-
|
|
43
|
-
- `feat: descripción` — feature nueva
|
|
44
|
-
- `fix: descripción` — bugfix
|
|
45
|
-
- `chore: descripción` — mantenimiento, deps, config
|
|
46
|
-
- `docs: descripción` — solo documentación
|
|
47
|
-
- `refactor: descripción` — refactor sin cambio de comportamiento
|
|
48
|
-
|
|
49
|
-
## Importante
|
|
50
|
-
|
|
51
|
-
- El remote SSH está roto — si el PR requiere push previo, usar HTTPS temporalmente
|
|
52
|
-
- Mostrar la URL del PR creado al usuario
|
|
53
|
-
- No crear el PR sin confirmación del usuario
|
data/.claude/commands/release.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
Release BugBunny gem. Usage: /release [patch|minor|major]
|
|
2
|
-
|
|
3
|
-
Ejecutá el flujo completo de release para BugBunny. El argumento determina el tipo de bump:
|
|
4
|
-
- `patch` → bugfix (4.6.1 → 4.6.2)
|
|
5
|
-
- `minor` → feature nueva (4.6.1 → 4.7.0)
|
|
6
|
-
- `major` → breaking change (4.6.1 → 5.0.0)
|
|
7
|
-
|
|
8
|
-
## Pasos
|
|
9
|
-
|
|
10
|
-
1. **Leer versión actual** de `lib/bug_bunny/version.rb`
|
|
11
|
-
2. **Calcular nueva versión** según el tipo de bump
|
|
12
|
-
3. **Correr tests** — si fallan, detener todo:
|
|
13
|
-
```bash
|
|
14
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8
|
|
15
|
-
bundle exec rspec
|
|
16
|
-
```
|
|
17
|
-
4. **autocorregir rubocop** - si fallan, detener todo
|
|
18
|
-
```bash
|
|
19
|
-
bundle exec rubocop -a
|
|
20
|
-
```
|
|
21
|
-
5. **Ejecutar `/gem-ai-setup`** — genera/actualiza `docs/howto/`, `docs/ai/` y `README.md`.
|
|
22
|
-
Esperar aprobación del developer antes de continuar.
|
|
23
|
-
6. **Actualizar `lib/bug_bunny/version.rb`** con la nueva versión
|
|
24
|
-
7. **Agregar entrada al tope de `CHANGELOG.md`** con formato:
|
|
25
|
-
```
|
|
26
|
-
## [X.Y.Z] - YYYY-MM-DD
|
|
27
|
-
### ✨ New Features / 🐛 Bug Fixes / 💥 Breaking Changes
|
|
28
|
-
* Descripción de los cambios
|
|
29
|
-
```
|
|
30
|
-
8. **Mostrar el diff completo** al usuario y pedir confirmación antes de continuar
|
|
31
|
-
9. **Commit** con mensaje: `feat|fix|chore: descripción breve vX.Y.Z`
|
|
32
|
-
10. **Merge a main** desde `/Users/gabriel/src/gems/bug_bunny`: `git merge --ff-only <branch>`
|
|
33
|
-
11. **Push via HTTPS**:
|
|
34
|
-
```bash
|
|
35
|
-
git remote set-url origin https://github.com/gedera/bug_bunny.git
|
|
36
|
-
git push origin main
|
|
37
|
-
git remote set-url origin git@github.com:gedera/bug_bunny.git
|
|
38
|
-
```
|
|
39
|
-
12. **Tag y push**:
|
|
40
|
-
```bash
|
|
41
|
-
git tag vX.Y.Z
|
|
42
|
-
git remote set-url origin https://github.com/gedera/bug_bunny.git
|
|
43
|
-
git push origin vX.Y.Z
|
|
44
|
-
git remote set-url origin git@github.com:gedera/bug_bunny.git
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Importante
|
|
48
|
-
|
|
49
|
-
- Nunca commitear ni pushear sin confirmación explícita del usuario
|
|
50
|
-
- El worktree de main está en `/Users/gabriel/src/gems/bug_bunny`
|
|
51
|
-
- SSH está roto — siempre usar HTTPS para push y restaurar SSH después
|
|
52
|
-
- Sourcear chruby antes de cualquier comando Ruby: `source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8`
|
data/.claude/commands/rubocop.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Run RuboCop for BugBunny. Usage: /rubocop [--fix]
|
|
2
|
-
|
|
3
|
-
Ejecutá RuboCop con rubocop-rails-omakase sobre el código modificado.
|
|
4
|
-
|
|
5
|
-
## Comandos
|
|
6
|
-
|
|
7
|
-
Sin argumentos — solo reporte:
|
|
8
|
-
```bash
|
|
9
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec rubocop
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Con `--fix` — autocorrect seguro:
|
|
13
|
-
```bash
|
|
14
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec rubocop -a
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Reglas importantes
|
|
18
|
-
|
|
19
|
-
- **Solo corregir código nuevo o modificado en el PR actual** — nunca tocar código existente no relacionado
|
|
20
|
-
- Si hay offenses que requieren intervención manual (no autocorregibles), reportalos con línea y descripción
|
|
21
|
-
- rubocop-rails-omakase tiene opiniones fuertes sobre estilo — seguirlas sin discutir
|
|
22
|
-
- Si hay un offense legítimo que debe ignorarse, usar `# rubocop:disable Cop/Name` en la línea específica con un comentario explicativo
|