cfn-error-management
Unified error handling, batching, and logging for CFN Loop. Use when you need to capture agent errors, batch multiple errors for processing, log structured error data, or categorize and recover from agent failures.
Best use case
cfn-error-management is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Unified error handling, batching, and logging for CFN Loop. Use when you need to capture agent errors, batch multiple errors for processing, log structured error data, or categorize and recover from agent failures.
Teams using cfn-error-management should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cfn-error-management/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cfn-error-management Compares
| Feature / Agent | cfn-error-management | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Unified error handling, batching, and logging for CFN Loop. Use when you need to capture agent errors, batch multiple errors for processing, log structured error data, or categorize and recover from agent failures.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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
- 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/error-management/lib/capture/capture-agent-error.sh` |
| `.claude/skills/cfn-error-batching-strategy/cli.sh` | `.claude/skills/error-management/lib/batching/cli.sh` |
| `.claude/skills/cfn-error-logging/invoke-error-logging.sh` | `.claude/skills/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)Related Skills
Ground Truth Management
Comprehensive guide to creating, managing, and maintaining ground truth datasets for AI evaluation including annotation, quality control, and versioning
error-diagnostics-smart-debug
Use when working with error diagnostics smart debug
error-detective
Search logs and codebases for error patterns, stack traces, and anomalies. Correlates errors across systems and identifies root causes. Use PROACTIVELY when debugging issues, analyzing logs, or investigating production errors.
error-debugging-multi-agent-review
Use when working with error debugging multi agent review
data-management
Comprehensive DataFrame loading, filtering, transformation, and data pipeline management from Excel, CSV, and multiple sources with YAML-driven configuration.
composer-dependency-management
Rules pertaining to Composer dependency management, promoting best practices for declaring and updating dependencies.
claude-config-management
Claude Code設定(リポジトリルート)の構成管理ガイド。ファイルレベルsymlinkによる設定管理、管理対象の追加・削除、Taskfileタスクの実行方法を提供する。「設定ファイルを追加して」「新しいスキルを追加して」「symlinkの状態を確認して」「Claude設定を変更して」のようにClaude Code設定の構成変更を行うときに使用する。
ck:project-management
Track progress, update plan statuses, manage Claude Tasks, generate reports, coordinate docs updates. Use for project oversight, status checks, plan completion, task hydration, cross-session continuity.
agentpmt-tool-file-management-d789ed
Use AgentPMT external API to run the File Management tool with wallet signatures, credits purchase, or credits earned from jobs.
agent-error-detective
Expert error detective specializing in complex error pattern analysis, correlation, and root cause discovery. Masters distributed system debugging, error tracking, and anomaly detection with focus on finding hidden connections and preventing error cascades.
advanced-file-management
Advanced file management tools. Includes batch folder creation, batch file moving, file listing, and HTML author extraction.
1k-state-management
Jotai state management patterns for OneKey. Use when working with atoms, global state, feature state, or context atoms. Triggers on jotai, atom, state, globalAtom, contextAtom, store, persistence, settings.