bug_bunny 4.8.0 → 4.9.0
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 +116 -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 +293 -0
- data/.agents/skills/skill-manager/SKILL.md +225 -0
- data/.agents/skills/skill-manager/scripts/sync.rb +356 -0
- data/.agents/skills/yard/SKILL.md +311 -0
- data/.agents/skills/yard/references/tipos.md +144 -0
- data/CHANGELOG.md +14 -0
- data/CLAUDE.md +28 -225
- data/README.md +5 -3
- data/lib/bug_bunny/consumer.rb +21 -5
- data/lib/bug_bunny/otel.rb +47 -0
- data/lib/bug_bunny/producer.rb +13 -4
- data/lib/bug_bunny/request.rb +14 -2
- data/lib/bug_bunny/version.rb +1 -1
- data/lib/bug_bunny.rb +1 -0
- data/skill/SKILL.md +253 -0
- data/skill/references/client-middleware.md +161 -0
- data/skill/references/consumer.md +122 -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 +30 -0
- data/skills.yml +40 -0
- data/spec/integration/consumer_middleware_spec.rb +23 -2
- data/spec/unit/consumer_spec.rb +138 -6
- data/spec/unit/otel_spec.rb +54 -0
- data/spec/unit/producer_spec.rb +187 -0
- data/spec/unit/request_spec.rb +51 -0
- metadata +28 -29
- data/.agents/skills/rabbitmq-expert/SKILL.md +0 -1555
- 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
|
@@ -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
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
Generate or update the complete AI documentation suite for this microservice.
|
|
2
|
-
|
|
3
|
-
This skill is invoked automatically by `/pr`. It can also be run standalone.
|
|
4
|
-
|
|
5
|
-
The same quality standard as BugBunny's `docs/ai/` applies here — self-contained chunks, RAG-optimized, no introductory prose.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Step 1 — Discover the current state
|
|
10
|
-
|
|
11
|
-
Read in order:
|
|
12
|
-
1. `docs/_index.md` — if it exists, lists all files and their purpose
|
|
13
|
-
2. `docs/ai/_index.md` — if it exists, current profile and file list
|
|
14
|
-
3. `CLAUDE.md` — service purpose, architecture, dependencies
|
|
15
|
-
4. `config/services.yml` — declared dependencies (other services this one talks to)
|
|
16
|
-
5. `config/routes.rb` or `config/initializers/bug_bunny_routes.rb` — what this service exposes
|
|
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 PR**.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Step 2 — Profile
|
|
24
|
-
|
|
25
|
-
Microservices always use the **full profile** with `contracts.md` instead of `api.md`:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
docs/ai/
|
|
29
|
-
_index.md
|
|
30
|
-
glossary.md
|
|
31
|
-
architecture.md
|
|
32
|
-
contracts.md ← what this service exposes (queues, endpoints, events)
|
|
33
|
-
faq_internal.md
|
|
34
|
-
faq_external.md
|
|
35
|
-
antipatterns.md
|
|
36
|
-
errors.md
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Step 3 — Analyze the codebase
|
|
42
|
-
|
|
43
|
-
Read:
|
|
44
|
-
- `app/` — controllers, models, workers, services
|
|
45
|
-
- `config/` — routes, initializers, services.yml
|
|
46
|
-
- `lib/` — custom libraries
|
|
47
|
-
- `spec/` — usage patterns and edge cases
|
|
48
|
-
- `CHANGELOG.md` or git log — what changed in this PR
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Step 4 — Generate or update each file
|
|
53
|
-
|
|
54
|
-
Apply the same RAG optimization rules as `gem-ai-setup`:
|
|
55
|
-
1. Each section ≤ 400 tokens, self-contained
|
|
56
|
-
2. `faq_*.md` strict Q&A format, H3 question, answer ≤ 150 words
|
|
57
|
-
3. `glossary.md` one entry per term, 1-3 lines
|
|
58
|
-
4. `errors.md` one entry per error, cause + reproduction + resolution
|
|
59
|
-
5. No introductory prose
|
|
60
|
-
|
|
61
|
-
### `_index.md`
|
|
62
|
-
|
|
63
|
-
Frontmatter manifest. Use `kind: microservice` and `transports:` listing all transports used (bug_bunny, http, etc.). List every file with its audience.
|
|
64
|
-
|
|
65
|
-
```yaml
|
|
66
|
-
---
|
|
67
|
-
type: knowledge_base
|
|
68
|
-
kind: microservice
|
|
69
|
-
name: service_name
|
|
70
|
-
version: main # microservices don't have semver — use branch or date
|
|
71
|
-
profile: full
|
|
72
|
-
language: ruby
|
|
73
|
-
audiences:
|
|
74
|
-
- internal
|
|
75
|
-
- external
|
|
76
|
-
transports:
|
|
77
|
-
- bug_bunny # list actual transports used
|
|
78
|
-
- http
|
|
79
|
-
files:
|
|
80
|
-
- path: glossary.md
|
|
81
|
-
audience: [internal, external]
|
|
82
|
-
- path: architecture.md
|
|
83
|
-
audience: [internal]
|
|
84
|
-
- path: contracts.md
|
|
85
|
-
audience: [external]
|
|
86
|
-
...
|
|
87
|
-
---
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### `glossary.md`
|
|
91
|
-
|
|
92
|
-
Domain terms specific to this service's business domain and technical patterns.
|
|
93
|
-
|
|
94
|
-
### `architecture.md`
|
|
95
|
-
|
|
96
|
-
Internal-facing. Include:
|
|
97
|
-
- Service responsibility (one paragraph)
|
|
98
|
-
- Component map
|
|
99
|
-
- Data flows for the main operations
|
|
100
|
-
- External dependencies and how they're used
|
|
101
|
-
- Background jobs and their triggers
|
|
102
|
-
|
|
103
|
-
### `contracts.md`
|
|
104
|
-
|
|
105
|
-
External-facing. The complete contract this service exposes. Include:
|
|
106
|
-
|
|
107
|
-
**BugBunny queues (if applicable):**
|
|
108
|
-
- Queue name, exchange, routing key, exchange type
|
|
109
|
-
- For each route: method, path, request format, response format, possible errors
|
|
110
|
-
- Example request and response payloads
|
|
111
|
-
|
|
112
|
-
**HTTP endpoints (if applicable):**
|
|
113
|
-
- Method, path, parameters, response format
|
|
114
|
-
- Authentication requirements
|
|
115
|
-
|
|
116
|
-
**Events published (if applicable):**
|
|
117
|
-
- Exchange, routing key, payload format
|
|
118
|
-
|
|
119
|
-
### `faq_internal.md`
|
|
120
|
-
|
|
121
|
-
Q&A for the service developer. Cover:
|
|
122
|
-
- How to add a new route or endpoint
|
|
123
|
-
- How background jobs work and how to add one
|
|
124
|
-
- How to add a new service dependency
|
|
125
|
-
- Non-obvious architectural decisions
|
|
126
|
-
|
|
127
|
-
### `faq_external.md`
|
|
128
|
-
|
|
129
|
-
Q&A for developers of other services that consume this one. Cover:
|
|
130
|
-
- How to make a request to this service
|
|
131
|
-
- What errors to expect and how to handle them
|
|
132
|
-
- How to handle retries and timeouts
|
|
133
|
-
- How to test integrations against this service
|
|
134
|
-
|
|
135
|
-
### `antipatterns.md`
|
|
136
|
-
|
|
137
|
-
Common mistakes when interacting with or modifying this service.
|
|
138
|
-
|
|
139
|
-
### `errors.md`
|
|
140
|
-
|
|
141
|
-
All error responses this service can return. For each:
|
|
142
|
-
- HTTP status / error code
|
|
143
|
-
- When it occurs
|
|
144
|
-
- What the response body looks like
|
|
145
|
-
- How the caller should handle it
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Step 5 — Update docs/howto/ and README.md
|
|
150
|
-
|
|
151
|
-
Read `docs/_index.md` to discover which human docs exist.
|
|
152
|
-
Update sections affected by this PR's changes.
|
|
153
|
-
Update `README.md` last — after `docs/howto/` is updated.
|
|
154
|
-
|
|
155
|
-
README structure for a microservice:
|
|
156
|
-
1. Service purpose (one paragraph)
|
|
157
|
-
2. Transports (BugBunny queue name, HTTP base URL)
|
|
158
|
-
3. Quick start — how another service calls this one
|
|
159
|
-
4. Links to `docs/ai/contracts.md` for full contract reference
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Step 6 — Show diff and wait for approval
|
|
164
|
-
|
|
165
|
-
Show the complete diff of all generated/updated files.
|
|
166
|
-
Wait for developer approval before proceeding to PR creation.
|
|
167
|
-
The developer may adjust content before confirming.
|
|
168
|
-
Do NOT create the PR until the docs are approved.
|
data/.claude/commands/test.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Run RSpec tests for BugBunny. Usage: /test [path]
|
|
2
|
-
|
|
3
|
-
Ejecutá la suite de tests de BugBunny con Ruby 3.3.8.
|
|
4
|
-
|
|
5
|
-
## Comando base
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec rspec
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Si se pasa un path como argumento, corré solo ese archivo o directorio:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec rspec $ARGUMENTS
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Después de correr los tests
|
|
18
|
-
|
|
19
|
-
- Si hay failures: analizá el error, identificá la causa raíz, proponé el fix al usuario antes de tocar código
|
|
20
|
-
- Si hay warnings de deprecación: reportalos al usuario
|
|
21
|
-
- Si todos pasan: confirmá con el conteo de ejemplos y tiempo de ejecución
|
|
22
|
-
|
|
23
|
-
## Convenciones de RSpec en este proyecto
|
|
24
|
-
|
|
25
|
-
- Tests en `spec/`
|
|
26
|
-
- Sin mocks de RabbitMQ real — usar doubles de Bunny
|
|
27
|
-
- Describir comportamiento, no implementación
|
|
28
|
-
- Un `context` por escenario, `it` con descripción en español o inglés consistente con el archivo
|
data/.claude/commands/yard.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
Validate and generate YARD documentation for BugBunny. Usage: /yard
|
|
2
|
-
|
|
3
|
-
Verificá y generá la documentación YARD de la gema.
|
|
4
|
-
|
|
5
|
-
## Comandos
|
|
6
|
-
|
|
7
|
-
Generar docs:
|
|
8
|
-
```bash
|
|
9
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec yard doc
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Ver métodos sin documentar:
|
|
13
|
-
```bash
|
|
14
|
-
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh && chruby ruby-3.3.8 && bundle exec yard stats --list-undoc
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Estándar YARD de este proyecto
|
|
18
|
-
|
|
19
|
-
Todo método público nuevo o modificado debe tener:
|
|
20
|
-
|
|
21
|
-
```ruby
|
|
22
|
-
# Descripción breve en una línea.
|
|
23
|
-
#
|
|
24
|
-
# Descripción extendida opcional si la firma no es autoexplicativa.
|
|
25
|
-
#
|
|
26
|
-
# @param nombre [Tipo] Descripción del parámetro
|
|
27
|
-
# @return [Tipo] Descripción del valor de retorno
|
|
28
|
-
# @raise [ClaseError] Condición bajo la cual se lanza
|
|
29
|
-
# @example
|
|
30
|
-
# resultado = mi_metodo(arg)
|
|
31
|
-
def mi_metodo(nombre)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Tipos comunes en este proyecto
|
|
35
|
-
|
|
36
|
-
- `[String]`, `[Integer]`, `[Boolean]`, `[Hash]`, `[Array]`, `[Symbol]`
|
|
37
|
-
- `[Bunny::Session]`, `[Bunny::Channel]`, `[Bunny::MessageProperties]`
|
|
38
|
-
- `[BugBunny::Session]`, `[BugBunny::Request]`, `[BugBunny::Configuration]`
|
|
39
|
-
- `[Proc, nil]` para callbacks opcionales
|
|
40
|
-
- `[void]` para métodos sin return value relevante
|
|
41
|
-
|
|
42
|
-
## Después de correr
|
|
43
|
-
|
|
44
|
-
- Reportá los métodos públicos sin documentar
|
|
45
|
-
- No documentar métodos privados (YARD los ignora por defecto con `private`)
|
|
46
|
-
- No documentar métodos triviales (`attr_reader`, `attr_accessor`) salvo que necesiten contexto
|
data/docs/_index.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# docs/_index.md — Documentation Manifest
|
|
2
|
-
|
|
3
|
-
This file is the source of truth for the `docs/` directory structure.
|
|
4
|
-
It is read by the `/release` command to know which files to generate or update.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Human documentation (developers integrating BugBunny)
|
|
9
|
-
|
|
10
|
-
| File | Purpose |
|
|
11
|
-
|---|---|
|
|
12
|
-
| `concepts.md` | AMQP in 5 min, architecture diagram, RPC vs fire-and-forget, connection pool |
|
|
13
|
-
| `howto/routing.md` | Routes DSL: `resources`, `namespace`, `member`, `collection`, `recognize` |
|
|
14
|
-
| `howto/controller.md` | `params`, `before_action`, `after_action`, `around_action`, `rescue_from`, `render` |
|
|
15
|
-
| `howto/resource.md` | CRUD methods, typed vs dynamic attributes, dirty tracking, validations, `.with` |
|
|
16
|
-
| `howto/middleware_client.md` | Client-side middlewares: built-ins, custom, usage in Client and Resource |
|
|
17
|
-
| `howto/middleware_consumer.md` | Consumer-side middlewares: execution order, writing, registering |
|
|
18
|
-
| `howto/tracing.md` | Trace context propagation: `rpc_reply_headers`, `on_rpc_reply`, consumer middleware |
|
|
19
|
-
| `howto/rails.md` | Full Rails setup: initializer, connection pool, Zeitwerk, Puma, Sidekiq, K8s health checks |
|
|
20
|
-
| `howto/testing.md` | Bunny doubles, unit tests for controllers/middleware, integration helper |
|
|
21
|
-
|
|
22
|
-
These files are referenced by `README.md`. Update them before updating the README.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## AI documentation (agents consuming or maintaining BugBunny)
|
|
27
|
-
|
|
28
|
-
Managed by `docs/ai/_index.md`. See that file for the full manifest and audience breakdown.
|
|
29
|
-
|
|
30
|
-
| File | Audience | Purpose |
|
|
31
|
-
|---|---|---|
|
|
32
|
-
| `ai/_index.md` | internal + external | Manifest: version, profile, file index |
|
|
33
|
-
| `ai/glossary.md` | internal + external | Domain terms with precise definitions |
|
|
34
|
-
| `ai/architecture.md` | internal | Internal patterns, component map, data flows |
|
|
35
|
-
| `ai/api.md` | external | Public API contracts |
|
|
36
|
-
| `ai/faq_internal.md` | internal | Q&A for gem maintainers |
|
|
37
|
-
| `ai/faq_external.md` | external | Q&A for gem integrators |
|
|
38
|
-
| `ai/antipatterns.md` | internal + external | What NOT to do and why |
|
|
39
|
-
| `ai/errors.md` | external | All exceptions with cause and resolution |
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Update rules for `/release`
|
|
44
|
-
|
|
45
|
-
1. Run tests first. If they fail, stop.
|
|
46
|
-
2. Read this file to discover all files to update.
|
|
47
|
-
3. For each file in **Human documentation**: update only sections affected by the changes in this release.
|
|
48
|
-
4. For each file in **AI documentation**: update only sections affected by the changes. Update `version` in `ai/_index.md`.
|
|
49
|
-
5. Update `README.md` last — it depends on `docs/howto/` being up to date.
|
|
50
|
-
6. Show the full diff to the developer and wait for approval before touching version or CHANGELOG.
|
data/docs/ai/_index.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: knowledge_base
|
|
3
|
-
kind: gem
|
|
4
|
-
name: bug_bunny
|
|
5
|
-
version: 4.8.0
|
|
6
|
-
profile: full
|
|
7
|
-
language: ruby
|
|
8
|
-
generated_by: gem-ai-setup@1.0.0
|
|
9
|
-
audiences:
|
|
10
|
-
- internal
|
|
11
|
-
- external
|
|
12
|
-
files:
|
|
13
|
-
- path: glossary.md
|
|
14
|
-
audience: [internal, external]
|
|
15
|
-
- path: architecture.md
|
|
16
|
-
audience: [internal]
|
|
17
|
-
- path: api.md
|
|
18
|
-
audience: [external]
|
|
19
|
-
- path: faq_internal.md
|
|
20
|
-
audience: [internal]
|
|
21
|
-
- path: faq_external.md
|
|
22
|
-
audience: [external]
|
|
23
|
-
- path: antipatterns.md
|
|
24
|
-
audience: [internal, external]
|
|
25
|
-
- path: errors.md
|
|
26
|
-
audience: [external]
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## What is BugBunny?
|
|
30
|
-
|
|
31
|
-
BugBunny is a Ruby gem that implements a RESTful routing layer over AMQP (RabbitMQ). It lets microservices communicate via RabbitMQ using familiar HTTP patterns: verbs (GET, POST, PUT, DELETE), controllers, declarative routes, synchronous RPC, and fire-and-forget.
|
|
32
|
-
|
|
33
|
-
**Problem solved:** Eliminates direct HTTP coupling between microservices. RabbitMQ acts as the message bus with the same ergonomics as a web framework.
|
|
34
|
-
|
|
35
|
-
## Version
|
|
36
|
-
|
|
37
|
-
4.8.0 — April 2026
|
|
38
|
-
|
|
39
|
-
## Key features in this version
|
|
40
|
-
|
|
41
|
-
- Namespace routing (`namespace :admin { resources :users }`)
|
|
42
|
-
- `after_action` filter (runs after action, not after `before_action` halts)
|
|
43
|
-
- `render(headers:)` — inject custom headers into RPC replies
|
|
44
|
-
- `Consumer#shutdown` — explicit graceful shutdown with health check cleanup
|
|
45
|
-
- `Configuration#validate!` — invoked automatically at end of `BugBunny.configure`
|
|
46
|
-
- Producer/Session caching per connection slot (prevents double-consumer AMQP error)
|
|
47
|
-
- Expanded `SENSITIVE_KEYS` filter in `safe_log`
|
|
48
|
-
- `ConsumerMiddleware::Stack` mutex for thread-safe registration
|
|
49
|
-
|
|
50
|
-
## How to use this knowledge base
|
|
51
|
-
|
|
52
|
-
- **Building an integration** → start with `api.md`, then `faq_external.md`
|
|
53
|
-
- **Debugging errors** → `errors.md`
|
|
54
|
-
- **Avoiding mistakes** → `antipatterns.md`
|
|
55
|
-
- **Understanding internals** → `architecture.md`, then `faq_internal.md`
|
|
56
|
-
- **Domain vocabulary** → `glossary.md`
|