ansible-automation-eng…
Ansible automation: playbooks, roles, collections, Molecule testing, Vault security.
Real-world bugs found in code reviews with examples.
$ npx -y skills add notque/vexjoy-agent --agent claude-codeHow 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.
Real-world bugs found in code reviews with examples.
Real-world bugs found in code reviews with examples.
// BUG: Integer division loses precision averagePrice := totalPrice / itemCount // Returns 2 when should be 2.5 // FIX: averagePrice := float64(totalPrice) / float64(itemCount)
// BUG: taxedPrice := price * 1 + taxRate // Should be: price * (1 + taxRate) // FIX: taxedPrice := price * (1 + taxRate)
// BUG: Rounding each item compounds errors
total := 0.0
for _, item := range items {
total += math.Round(item.Price * taxRate * 100) / 100
}
// FIX: Round final total only
total := 0.0
for _, item := range items {
total += item.Price * taxRate
}
total = math.Round(total * 100) / 100// BUG: This is the discount amount, not final price discountedPrice := price * discountPercent / 100 // FIX: discountedPrice := price - (price * discountPercent / 100)
// BUG: Excludes last valid value
if page > totalPages { // User can request page 11 when totalPages=10
return ErrInvalidPage
}
// FIX:
if page < 1 || page > totalPages {
return ErrInvalidPage
}// BUG: <= causes panic on last iteration
for i := 0; i <= len(items); i++ {
process(items[i])
}
// FIX: Use <
for i := 0; i < len(items); i++ {
process(items[i])
}// BUG: Wrong if not evenly divisible totalPages := totalItems / pageSize // FIX: Ceiling division totalPages := (totalItems + pageSize - 1) / pageSize
// BUG: No validation of current state
func (o *Order) Ship() error {
o.Status = "shipped" // What if already cancelled?
return nil
}
// FIX:
func (o *Order) Ship() error {
if o.Status != "paid" {
return fmt.Errorf("cannot ship order in status: %s", o.Status)
}
o.Status = "shipped"
return nil
}// BUG: Can transition out of terminal state
func (t *Task) SetStatus(status string) {
t.Status = status
}
// FIX:
func (t *Task) SetStatus(status string) error {
if t.Status == "completed" || t.Status == "cancelled" {
return ErrTerminalState
}
t.Status = status
return nil
}// BUG: Check-then-act race
if order.Status == "pending" {
order.Status = "confirmed"
db.Save(order)
}
// FIX: Atomic update with WHERE
result := db.Exec("UPDATE orders SET status = ? WHERE id = ? AND status = ?",
"confirmed", order.ID, "pending")
if result.RowsAffected == 0 {
return ErrInvalidStateTransition
}// BUG: Negative quantity possible
func CreateOrder(quantity int) (*Order, error) {
return &Order{Quantity: quantity}, nil
}
// FIX:
func CreateOrder(quantity int) (*Order, error) {
if quantity < 1 {
return nil, ErrInvalidQuantity
}
return &Order{Quantity: quantity}, nil
}// BUG: Treats null and empty identically
if user.MiddleName == "" {
// Triggers for both null and ""
}
// FIX: Handle separately
if user.MiddleName == nil {
// No data provided
} else if *user.MiddleName == "" {
// Explicitly empty
}// BUG: Race between check and act
if inventory.Available(productID) > 0 {
inventory.Decrement(productID) // Negative inventory possible
}
// FIX: Atomic decrement-if-available
if err := inventory.DecrementIfAvailable(productID); err != nil {
return ErrOutOfStock
}// BUG: Balance checked separately from deduction
balance := accounts.GetBalance(userID)
if balance >= amount {
accounts.Deduct(userID, amount)
}
// FIX: Atomic deduct-if-sufficient
if err := accounts.DeductIfSufficient(userID, amount); err != nil {
return ErrInsufficientFunds
}// BUG: Read-modify-write race
counter := cache.Get("view_count")
counter++
cache.Set("view_count", counter)
// FIX: Atomic increment
cache.Increment("view_count", 1)// BUG:
averageRating := totalStars / reviewCount // Panics if 0
// FIX:
var averageRating float64
if reviewCount > 0 {
averageRating = float64(totalStars) / float64(reviewCount)
}// BUG:
firstItem := items[0] // Panics if empty
// FIX:
if len(items) == 0 {
return ErrNoItems
}
firstItem := items[0]// BUG:
userName := user.Profile.Name // Panics if Profile nil
// FIX:
if user.Profile != nil {
userName = user.Profile.Name
} else {
userName = "Anonymous"
}// BUG: No rollback if 2nd op fails
err1 := createUser(user)
err2 := sendWelcomeEmail(user.Email)
// FIX:
tx := db.Begin()
if err := createUser(tx, user); err != nil {
return err
}
if err := sendWelcomeEmail(user.Email); err != nil {
tx.Rollback()
return err
}
tx.Commit()// BUG: Error ignored
func ProcessOrder(order *Order) {
chargePayment(order.PaymentMethod, order.Total)
updateInventory(order.Items)
}
// FIX:
func ProcessOrder(order *Order) error {
if err := chargePayment(order.PaymentMethod, order.Total); err != nil {
return fmt.Errorf("payment failed: %w", err)
}
if err := updateInventory(order.Items); err != nil {
refundPayment(order.PaymentMethod, order.Total)
return fmt.Errorf("inventory update failed: %w", err)
}
return nil
}// BUG: Retrying increments multiple times
for retries := 0; retries < 3; retries++ {
incrementCounter(userID)
if err == nil { break }
}
// FIX: Make idempotent
transactionID := generaEssays and writing behind this toolkit live at vexjoy.com. VexJoy Agent connects plain-English requests to specialist agents, skills, and workflows. /do selects the knowledge and tools needed for your task.
Repo: notque/vexjoy-agent
Ansible automation: playbooks, roles, collections, Molecule testing, Vault security.
**Scope**: Module selection patterns, builtin vs command/shell decisions, collection modules, and version-specific module changes **Version range**:…
**Scope**: Molecule test scenarios, ansible-lint rules, idempotency validation, and check-mode patterns **Version range**: Molecule 6.0+ / ansible-lint 6.0+ /…
Universal rules injected by /do at dispatch. Each agent's .md file supplies domain rules.
**Scope**: Failure modes in agent output style — over-reporting, self-congratulation, verbose narration, and hedging. Covers what to detect and how to fix…
Zero-dependency combat visual upgrades: CSS particle replacement, Framer Motion combat juice, CSS 3D card transforms.