codebase-explorer
Deep codebase exploration agent for architecture understanding, pattern discovery, and…
Extends `qa.v2.md`. Load this file when dispatched with `mode: chaos`.
> /plugin marketplace add LerianStudio/ringHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Extends `qa.v2.md`. Load this file when dispatched with `mode: chaos`.
Extends `qa.v2.md`. Load this file when dispatched with `mode: chaos`.
// Simulate dependency failure with testcontainers
func TestAccountService_DatabaseDown(t *testing.T) {
ctx := context.Background()
pgContainer := startPostgres(t)
repo := NewPostgresRepository(connectionString(pgContainer))
svc := NewAccountService(repo)
// Verify baseline works
_, err := svc.Create(ctx, CreateRequest{Name: "Test"})
require.NoError(t, err)
// Inject failure — pause container
err = pgContainer.Stop(ctx, nil)
require.NoError(t, err)
// Service should return error gracefully (not panic, not hang)
done := make(chan error, 1)
go func() {
_, err := svc.Create(ctx, CreateRequest{Name: "DuringOutage"})
done <- err
}()
select {
case err := <-done:
require.Error(t, err)
// Verify it's a wrapped DB error, not a panic or timeout
assert.Contains(t, err.Error(), "connection")
case <-time.After(5 * time.Second):
t.Fatal("service hung during DB outage — timeout violated")
}
}| Scenario | What to Verify | |----------|---------------| | Database connection lost | Returns error with DB code, no panic, no hang | | Cache unavailable | Degrades gracefully, returns error or stale data per policy | | RabbitMQ connection dropped | Messages not lost (outbox pattern), reconnects cleanly | | Downstream service 500 | Circuit breaker opens after threshold | | Downstream service timeout | Context deadline propagated, not hung | | Network partition (partial) | Correct partial failure handling |
func TestCircuitBreaker_OpensAfterThreshold(t *testing.T) {
cb := circuitbreaker.New(circuitbreaker.Config{
Threshold: 5,
Timeout: 1 * time.Second,
})
// Inject 5 failures
for i := 0; i < 5; i++ {
cb.Execute(func() error { return errors.New("failure") })
}
// Circuit should be open — fast-fail without calling downstream
start := time.Now()
err := cb.Execute(func() error {
time.Sleep(100 * time.Millisecond) // should not reach here
return nil
})
elapsed := time.Since(start)
require.Error(t, err)
assert.Contains(t, err.Error(), "circuit open")
assert.Less(t, elapsed, 10*time.Millisecond, "circuit breaker did not fast-fail")
}## VERDICT: [PASS | FAIL] ## Chaos Testing Summary | Metric | Value | |--------|-------| | Failure Scenarios | N | | Services Tested | [list] | | Duration | Xs | ## Failure Scenarios | Scenario | Behavior Expected | Result | |----------|-----------------|--------| | DB connection lost | Wrapped error returned in <5s | ✅ PASS | | Cache unavailable | Graceful degradation to direct DB | ✅ PASS | | Circuit breaker | Opens after 5 failures, fast-fails | ✅ PASS | ## Identified Risks [If any scenarios fail] ### Scenario: [name] - **Expected:** [behavior] - **Actual:** [what happened] - **Risk:** [production impact] - **Fix:** [recommendation] ## Next Steps [PASS: "System handles dependency failures gracefully." | FAIL: list failure scenarios with fixes.]
Proven engineering practices, enforced through skills. Ring is a comprehensive skills library and workflow system for AI agents that transforms how AI assistants approach software development.
Repo: LerianStudio/ring
Deep codebase exploration agent for architecture understanding, pattern discovery, and…
Review Slicer: Adaptive classification engine that evaluates semantic cohesion to decide…
Senior Backend Engineer specialized in Go for high-demand financial systems. Handles API…
Senior Backend Engineer specialized in TypeScript/Node.js for scalable systems. Handles API…
Senior BFF (Backend for Frontend) Engineer specialized in Next.js API Routes with Clean…
Foundation Review: Reviews code quality, architecture, design patterns, algorithmic flow, and…