Skip to content
Back to skills

Cfn Error Management

ASecurity

Error handling, batching, logging for CFN Loop. Use to capture agent errors, batch errors for processing, log structured error data, or categorize/recover from agent failures.

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 1, 2026
ai-agentstypescriptgobashnodedockerdocumentation

Works with

  • cli

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned October 1, 2026

npx -y skills add masharratt/claude-flow-novice --skill cfn-error-management --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cfn Error Management?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cfn Error Management
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/masharratt-cfn-error-management-claude-flow-novice/badge)](https://www.skillsdirectory.com/skills/masharratt-cfn-error-management-claude-flow-novice)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cfn-error-management
description: "Error handling, batching, logging for CFN Loop. Use to capture agent errors, batch errors for processing, log structured error data, or categorize/recover from agent failures."
version: 1.0.0
tags: [mega-skill, errors, logging, batch-processing]
status: production
---

# Error Management Skill (Mega-Skill)

**Version:** 1.0.0
**Purpose:** Unified error handling, batching, and logging
**Status:** Production
**Consolidates:** cfn-standardized-error-handling, cfn-error-batching-strategy, cfn-error-logging

---

## Overview

This mega-skill provides complete error management:
- **Capture** - Standardized error capture and categorization
- **Batching** - Error grouping for batch agent processing
- **Logging** - Error log storage and retrieval

---

## Directory Structure

```
error-management/
├── SKILL.md                          # This file
├── lib/
│   ├── capture/                      # Error capture (from cfn-standardized-error-handling)
│   │   ├── capture-agent-error.sh    # Capture agent errors
│   │   └── README.md                 # Capture documentation
│   ├── batching/                     # Error batching (from cfn-error-batching-strategy)
│   │   ├── cli.sh                    # Batching CLI
│   │   ├── analyze-errors.sh         # Error analysis
│   │   ├── calculate-waves.sh        # Wave calculation
│   │   ├── cluster-files.sh          # File clustering
│   │   ├── create-batches.sh         # Batch creation
│   │   ├── templates/                # Batch templates
│   │   └── README.md                 # Batching documentation
│   └── logging/                      # Error logging (from cfn-error-logging)
│       ├── invoke-error-logging.sh   # Log errors
│       ├── cleanup-error-logs.sh     # Log cleanup
│       ├── src/                      # TypeScript implementation
│       └── README.md                 # Logging documentation
└── cli/                              # CLI wrappers
    ├── capture-error.sh              # → lib/capture/capture-agent-error.sh
    ├── batch-errors.sh               # → lib/batching/cli.sh
    └── log-error.sh                  # → lib/logging/invoke-error-logging.sh
```

---

## Quick Start

### 1. Capture an Error

```bash
./cli/capture-error.sh \
  --agent-id "agent-123" \
  --error-type "TIMEOUT" \
  --message "Agent timed out after 900s" \
  --context "Loop 3 implementation"
```

### 2. Batch Errors for Processing

```bash
./cli/batch-errors.sh \
  --input errors.json \
  --max-batch-size 5 \
  --output batches.json
```

### 3. Log an Error

```bash
./cli/log-error.sh \
  --task-id "task-123" \
  --agent-id "agent-123" \
  --error-type "VALIDATION" \
  --message "Output validation failed"
```

---

## Module Details

### Capture Module (lib/capture/)

**Purpose:** Standardized error capture and categorization

**Error Types:**
- TIMEOUT - Agent execution timeout
- CRASH - Agent process crash
- VALIDATION - Output validation failure
- COORDINATION - Redis coordination failure (CLI mode only; task-mode default has no Redis)
- UNKNOWN - Uncategorized errors

**Features:**
- Standardized error format
- Category-based recovery strategies
- Context preservation

### Batching Module (lib/batching/)

**Purpose:** Group errors for batch agent processing

**Features:**
- Error clustering by file
- Wave calculation for parallel processing
- Tier-based batching (small/medium/large)
- Template-based batch configuration

### Logging Module (lib/logging/)

**Purpose:** Error log storage and management

**Features:**
- Structured error logging
- Log cleanup and rotation
- Integration with CLI and Docker modes
- TypeScript implementation

---

## Integration with CFN Loop

```bash
# 1. Capture error when agent fails
./cli/capture-error.sh \
  --agent-id "$AGENT_ID" \
  --error-type "TIMEOUT" \
  --message "$ERROR_MESSAGE"

# 2. Log the error
./cli/log-error.sh \
  --task-id "$TASK_ID" \
  --agent-id "$AGENT_ID" \
  --error-type "TIMEOUT"

# 3. Batch multiple errors for batch processing
./cli/batch-errors.sh --input collected-errors.json
```

---

## Migration from Individual Skills

### Old Paths → New Paths

| Old Path | New Path |
|----------|----------|
| `.claude/skills/cfn-standardized-error-handling/capture-agent-error.sh` | `.claude/skills/cfn-error-management/lib/capture/capture-agent-error.sh` |
| `.claude/skills/cfn-error-batching-strategy/cli.sh` | `.claude/skills/cfn-error-management/lib/batching/cli.sh` |
| `.claude/skills/cfn-error-logging/invoke-error-logging.sh` | `.claude/skills/cfn-error-management/lib/logging/invoke-error-logging.sh` |

---

## Version History

### 1.0.0 (2025-12-02) - Mega-Skill Creation
- Merged: cfn-standardized-error-handling, cfn-error-batching-strategy, cfn-error-logging
- Added: CLI wrappers
- Added: Unified documentation

---

## Dependencies

- **Bash:** 4.0+
- **jq:** JSON processing
- **Node.js:** TypeScript logging (optional)

Files in this skill

  • SKILL.md5 KB
  • cli/batch-errors.sh153 B
  • cli/capture-error.sh167 B
  • cli/log-error.sh168 B
  • lib/batching/README.md25.6 KB
  • lib/batching/analyze-errors.sh7.2 KB
  • lib/batching/calculate-waves.sh6.8 KB
  • lib/batching/cli.sh12.7 KB
  • lib/batching/cluster-files.sh4.2 KB
  • lib/batching/create-batches.sh6 KB
  • lib/batching/templates/default-tiers.json473 B
  • lib/capture/README.md1.7 KB
  • lib/capture/capture-agent-error.sh3.8 KB
  • lib/capture/error-type-mapping.json160 B
  • lib/logging/README.md10.2 KB
  • lib/logging/cleanup-error-logs.sh9 KB
  • lib/logging/integrate-cli.sh7.3 KB
  • lib/logging/integrate-docker.sh9.4 KB
  • lib/logging/invoke-error-logging.sh26.2 KB
  • lib/logging/src/error-logger.ts28.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.