소스 정보
- 저장소
- fabioc-aloha/alex-cognitive-architecture
- 최근 소스 활동
- 2026년 4월 23일 03:10
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/fabioc-aloha/alex-cognitive-architecture --skill error-recovery-patterns명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | error-recovery-patterns |
| description | What to do when things break. |
| tier | core |
| applyTo | **/*error*,**/*exception*,**/*retry*,**/*fallback*,**/*recovery* |
| currency | 2026-04-20T00:00:00.000Z |
What to do when things break.
Prevent → Detect → Contain → Recover → Learn
| Retry | Don't Retry |
|---|---|
| Network timeouts | Validation errors (400) |
| Rate limits (429) | Auth failures (401, 403) |
| Server errors (5xx) | Not found (404) |
| Connection refused | Business logic errors |
const delay = baseDelay * Math.pow(2, attempt - 1);
const jitter = Math.random() * 0.3 * delay;
await sleep(delay + jitter);
CLOSED → (failures > threshold) → OPEN → (timeout) → HALF-OPEN → (success) → CLOSED
| Pattern | Use Case |
|---|---|
| Default value | Config loading |
| Cached value | Data fetch failure |
| Degraded service | Non-critical features |
const result = await primary().catch(() => fallback());
| Pattern | Use Case |
|---|---|
| DB transaction | Atomic operations |
| Saga (compensate) | Distributed transactions |
| Feature flag | Instant rollback |
// Compensating transactions for distributed operations
interface SagaStep<T> {
execute: () => Promise<T>;
compensate: () => Promise<void>;
}
async function executeSaga<T>(steps: SagaStep<T>[]): Promise<T[]> {
const completed: SagaStep<T>[] = [];
const results: T[] = [];
try {
for (const step of steps) {
results.push(await step.execute());
completed.push(step);
}
return results;
} catch (error) {
// Compensate in reverse order
for (const step of completed.reverse()) {
try {
await step.compensate();
} catch (compensateError) {
console.error('Compensation failed:', compensateError);
// Log but continue compensating other steps
}
}
throw error;
}
}
// Usage: Order processing saga
const orderSaga: SagaStep<>[] = [
{
: (orderId),
: (orderId)
},
{
: (orderId),
: (orderId)
},
{
: (orderId),
: (orderId)
}
];
Contain failures to prevent cascade. Catch at component boundaries, log, show fallback UI.
// React error boundary pattern
class ErrorBoundary extends React.Component<Props, State> {
state = { hasError: false, error: null };
static getDerivedStateFromError(error: Error) {
return { hasError: true, error };
}
componentDidCatch(error: Error, info: React.ErrorInfo) {
// Log to monitoring service
logErrorToService(error, info.componentStack);
}
render() {
if (this.state.hasError) {
return <FallbackUI error={this.state.error} onRetry={() => this.setState({ hasError: false })} />;
}
return this.props.children;
}
}
// AbortController for cancellable operations
async function fetchWithTimeout<T>(
url: string,
options: RequestInit = {},
timeoutMs: number = 30000
): Promise<T> {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
try {
const response = await fetch(url, {
...options,
signal: controller.signal
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return response.json();
} finally {
clearTimeout(timeoutId);
}
}
When your approach fails repeatedly, don't keep retrying — pivot.
| Failure Pattern | Pivot Strategy |
|---|---|
| Same edit fails twice | Re-read file, verify context is current |
| Same command fails twice | Try alternative tool or manual approach |
| Same build error | Check if your prior changes caused it |
| User says "upstream problem" | Back up, analyze earlier changes |
| Pattern doesn't work | Ask user what they know |
Rule of Three: Two failures of the same approach = third attempt MUST be fundamentally different.
Surface the problem: "I've tried X twice and it's failing. I think the issue is [analysis]. Here's an alternative approach..."
| Error Type | Retry? | Strategy |
|---|---|---|
| Transient (network, timeout) | Yes | Exponential backoff with jitter |
| Rate limit (429) | Yes | Respect Retry-After header |
| Client error (4xx) | No | Fix request, don't retry blindly |
| Server error (5xx) | Sometimes | Retry with backoff, then escalate |
| Validation error | No | Fix input data |
| Auth error (401, 403) | No | Re-authenticate or check permissions |
// Feature flags for instant rollback
interface FeatureFlags {
useNewCheckout: boolean;
enableAISearch: boolean;
showBetaFeatures: boolean;
}
async function getFeatureFlags(userId: string): Promise<FeatureFlags> {
try {
return await flagService.getFlags(userId);
} catch {
// On failure, return safe defaults (old behavior)
return {
useNewCheckout: false,
enableAISearch: false,
showBetaFeatures: false
};
}
}