Skip to content
AI & Agents
Skill

/fortify

Use when the workflow lacks error handling, has been failing in production, or needs retry logic, fallback strategies, and circuit breakers.

From plugin
maestro
41125 skills
Install
$ npx -y skills add sharpdeveye/maestro --skill fortify --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/fortify

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use when the workflow lacks error handling, has been failing in production, or needs retry logic, fallback strategies, and circuit breakers.

SKILL.md

fortify.SKILL.md
name: fortify
description: "Use when the workflow lacks error handling, has been failing in production, or needs retry logic, fallback strategies, and circuit breakers."
argument-hint: "[target area]"
category: fix
version: 2.0.0
user-invocable: true

MANDATORY PREPARATION

Invoke /agent-workflow — it contains workflow principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no workflow context exists yet, you MUST run /teach-maestro first. Consult the guardrails-safety reference in the agent-workflow skill for defense-in-depth patterns and error boundary design.

---

Make the workflow resilient. Every external call will fail eventually — model APIs, tools, databases, third-party services. Fortify ensures the workflow handles failure gracefully.

Fortification Layers

**Layer 1: Input Validation**

  • Validate all inputs before processing
  • Return clear error messages for invalid input
  • Set size limits on all input fields

**Layer 2: Retry with Backoff** For transient failures (network errors, rate limits, timeouts):

Retry strategy:
  max_retries: 3
  initial_delay: 1s
  backoff_multiplier: 2
  max_delay: 30s
  retryable_errors: [429, 500, 502, 503, 504, TIMEOUT, CONNECTION_ERROR]
  non_retryable_errors: [400, 401, 403, 404]

**Layer 3: Fallback Responses** When retries are exhausted:

  • Use a cached previous response (if applicable)
  • Use a simpler/cheaper model as fallback
  • Return a graceful degradation response
  • Escalate to human review

**Layer 4: Circuit Breakers** When a service is consistently failing:

Circuit breaker:
  failure_threshold: 5 consecutive failures
  state: CLOSED → OPEN (after threshold) → HALF_OPEN (after cooldown)
  cooldown: 60 seconds
  half_open_max_requests: 1

**Layer 5: Timeout Controls** Every external call needs a timeout:

  • Model API calls: 30-120s depending on task
  • Tool executions: 10-60s depending on tool
  • Database queries: 5-15s
  • Third-party APIs: 10-30s

Fortification Audit

For each component, verify:

  • [ ] Input validation present
  • [ ] Retry logic for transient failures
  • [ ] Fallback for when retries fail
  • [ ] Timeout set
  • [ ] Error logged with context
  • [ ] User gets a meaningful error (not a stack trace)

Recommended Next Step

After fortification, run `/evaluate` to verify error handling works under realistic failure scenarios.

**NEVER**:

  • Retry non-retryable errors (authentication failures, validation errors)
  • Retry without backoff (you'll make the problem worse)
  • Swallow errors silently (log and handle, don't ignore)
  • Set infinite timeouts (they'll hang forever)
  • Skip the fallback (retries exhausted with no fallback = user sees an error)
Read more
Ships withmaestro

Workflow fluency for AI coding agents. 1 core skill · 25 commands · 7 domain references · memory layer · audit trail — works across Cursor, Claude Code, Gemini CLI, Copilot, and 6 more.

Get the whole plugin
Stats
411
Stars
63
Forks
Maintained
Maintenance
TypeScript
Language
MIT
License
3mo ago
Last commit
4mo ago
Created

Repo: sharpdeveye/maestro