ansible-automation-eng…
Ansible automation: playbooks, roles, collections, Molecule testing, Vault security.
Review methodologies for state machines and stateful business logic.
$ 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.
Review methodologies for state machines and stateful business logic.
Review methodologies for state machines and stateful business logic.
type OrderStatus string
const (
OrderPending OrderStatus = "pending"
OrderPaid OrderStatus = "paid"
OrderShipped OrderStatus = "shipped"
OrderDelivered OrderStatus = "delivered"
OrderCancelled OrderStatus = "cancelled"
)
// Valid: pending->paid->shipped->delivered, pending/paid->cancelled
func (o *Order) SetStatus(newStatus OrderStatus) error {
switch o.Status {
case OrderPending:
if newStatus != OrderPaid && newStatus != OrderCancelled {
return ErrInvalidTransition
}
case OrderPaid:
if newStatus != OrderShipped && newStatus != OrderCancelled {
return ErrInvalidTransition
}
case OrderShipped:
if newStatus != OrderDelivered {
return ErrInvalidTransition
}
case OrderDelivered, OrderCancelled:
return ErrTerminalState
default:
return ErrUnknownStatus
}
o.Status = newStatus
return nil
}func (t *Task) Start() error {
if t.Status != TaskAssigned {
return fmt.Errorf("cannot start task in status: %s", t.Status)
}
if t.Assignee == nil {
return ErrNoAssignee
}
t.Status = TaskInProgress
return nil
}func (s *Session) Refresh() error {
if s.Status != SessionActive {
return ErrSessionNotActive
}
if s.IsExpired() {
s.Status = SessionExpired
return ErrSessionExpired
}
s.ExpiresAt = time.Now().Add(SessionTimeout)
return nil
}// BUG: Any transition allowed
func (o *Order) SetStatus(status OrderStatus) { o.Status = status }
// FIX: Validate transitions
func (o *Order) SetStatus(status OrderStatus) error {
if !o.IsValidTransition(o.Status, status) { return ErrInvalidTransition }
o.Status = status
return nil
}// BUG: Can modify completed order
func (o *Order) AddItem(item Item) { o.Items = append(o.Items, item) }
// FIX:
func (o *Order) AddItem(item Item) error {
if o.Status == OrderCompleted || o.Status == OrderCancelled { return ErrOrderClosed }
o.Items = append(o.Items, item)
return nil
}// BUG: Check-then-act race
if order.Status == "pending" { order.Status = "paid"; db.Save(order) }
// FIX: Atomic update
result := db.Exec("UPDATE orders SET status = ? WHERE id = ? AND status = ?",
"paid", order.ID, "pending")
if result.RowsAffected == 0 { return ErrConcurrentModification }// BUG: Session never expires — no ExpiresAt field
// FIX: Add ExpiresAt, check in methods
func (s *Session) CheckExpiration() {
if time.Now().After(s.ExpiresAt) && s.Status == SessionActive {
s.Status = SessionExpired
}
}| From | To | Valid? | Condition | |------|-----|--------|-----------| | pending | paid | Y | Payment successful | | pending | cancelled | Y | User cancels | | paid | shipped | Y | Dispatched | | paid | cancelled | Y | Cancel before shipping | | shipped | delivered | Y | Delivery confirmed | | shipped | cancelled | N | Cannot cancel after shipment | | delivered | any | N | Terminal | | cancelled | any | N | Terminal |
| From | To | Valid? | Condition | |------|-----|--------|-----------| | pending | assigned | Y | Assignee set | | assigned | in_progress | Y | User starts | | assigned | pending | Y | Assignee removed | | in_progress | completed | Y | Result provided | | in_progress | failed | Y | Error occurred | | completed | any | N | Terminal | | failed | pending | Y | Retry allowed |
1. **States**: All documented? Initial/terminal clear? 2. **Transitions**: Validation function? Invalid rejected with clear errors? 3. **Guards**: Preconditions checked before change? Failure handled? 4. **Concurrency**: Atomic? Race possible? Lock ordering? 5. **Errors**: Recovery path? Rollback mechanism? 6. **Persistence**: When persisted? What if persistence fails? Validation before or after?
### State Machine: [Component] **States**: [list] | Initial: [x] | Terminal: [x] | Error: [x] **Transitions Verified:** - [FROM] -> [TO]: [condition] Y/N **Issues Found:** 1. **[Issue]** - `file.go:line` — [problem]. Impact: [what it allows]. Fix: [recommendation]. **Terminal Enforcement:** Y/N **Concurrent Safety:** Y/N **Timeout Handling:** Y/N **Error Recovery:** Y/N
Essays 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.