Use when manage multiple local CLI agents via tmux sessions (start/stop/monitor/assign) with cron-friendly scheduling.
日本語の概要は準備中です。原文の説明を表示しています。
Autonomous CI/CD error recovery, distributed file-based locking, diagnostic triage, and two-phase GO gate resilience engine for BDB Agent OS multi-agent pipelines.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
/bdbresilience)The /bdbresilience master skill suite provides deterministic runtime fault tolerance, concurrency coordination, diagnostic log triage, and pre-tool deployment gating for autonomous multi-agent pipelines operating across the BDB Agent OS ecosystem.
transient, tool_level_fault, auth_credential, unrecoverable). Execute structured recovery before attempting escalation.production_artifacts/state.json, git branches, and worktrees—must never suffer lost updates or dirty reads. Enforce mutual exclusion through atomic POSIX/APFS file locking (O_CREAT | O_EXCL) or fragment isolation (state.d/<nodeId>.json).git push, npm publish, npm version, recursive rm) require an uncompromised human verification gate. Enforce the BDB Pre-Tool Gate protocol: lock execution in strict read-only mode until a literal, isolated human token "GO" is validated.ETIMEDOUT), connection resets (ECONNRESET), and temporary provider dropouts.state.json), databases, or worktrees during parallel build node execution (Engineering, UI/UX, Media).+---------------------------------------------------------------------------------------+
| /bdbresilience Skill Suite |
| Master Operational Architecture |
+-------------------------------------------+-------------------------------------------+
|
+-----------------------------------+-----------------------------------+
| |
v v
+---------------------------------------+ +-----------------------------------------+
| Pattern 1: Error Recovery | | Pattern 2: Distributed Locking |
| - 4-Tier Failure Classification | | - POSIX Atomic Creation (O_CREAT|EXCL) |
| - Full Jitter Exponential Backoff | | - Monotonic Fencing Tokens |
| - Secondary Tool Router & Diversion | | - Background Heartbeat Renewal |
| - Fail-Closed Human Escalation | | - Atomic Stale / Orphan Eviction |
| [references/error-recovery.md] | | [references/distributed-locking.md] |
+---------------------------------------+ +-----------------------------------------+
| |
+-----------------------------------+-----------------------------------+
|
+-----------------------------------+-----------------------------------+
| |
v v
+---------------------------------------+ +-----------------------------------------+
| Pattern 3: CI/CD Triage | | Pattern 4: Two-Phase GO Gate |
| - Multi-Runner ANSI Normalization | | - Phase 1: Strict Read-Only Planning |
| - Flaky vs Deterministic Classifier | | - Phase 2: Literal Token Execution |
| - JSON Diagnostic Report Schema | | - Fail-Closed Transcript Scanner |
| - isCleanRun() Pass Predicate | | - Caller-Written approvals Ledger |
| [references/cicd-triage.md] | | [references/two-phase-go-gate.md] |
+---------------------------------------+ +-----------------------------------------+
state.json protection.nodes.json, plus hooks for /startcycle-graph and /bdbrainstorm. No AOS node carries bdbresilience today./bdbresilience recoverInvokes the automated error classification and recovery pipeline for a failed operation.
import { classifyError, withRetry, executeWithFallback } from 'bdb-cicd-resilience/recovery/index.js';
// 1. Classify error
const classification = classifyError(error, { toolName: 'api_fetch', attempt: 1 });
// 2. Retry with full jitter if transient
// (withRetry classifies internally too, and rethrows at once on canRetry: false)
if (classification.category === 'transient') {
const result = await withRetry(
() => callApi(),
{ maxRetries: 3, baseDelayMs: 500, maxDelayMs: 10000 }
);
}
// 3. Fallback route if tool fault. The fallback is a tool NAME; your execute
// function does the dispatch, and a canRetry:false classification suppresses
// the diversion instead of re-sending the call to a second provider.
if (classification.category === 'tool_level_fault') {
const fallbackResult = await executeWithFallback({
originalTool: 'mcp_primary',
fallbackTool: 'cli_fallback',
execute: (toolName) => invokeTool(toolName, args),
auditFilePath: 'production_artifacts/diversions.jsonl',
});
}
/bdbresilience lockCoordinates exclusive access to a shared resource using deterministic atomic locking.
import { withStateLock, withDistributedLock } from 'bdb-cicd-resilience/locking/index.js';
// Guard state.json mutations
await withStateLock('production_artifacts/state.json', (state) => {
state.artifacts.backend = 'production_artifacts/02_backend_schema.md';
state.findings.push({ id: 'F-ENG-01', status: 'fixed' });
return state;
}, { ttlMs: 15000, acquireTimeoutMs: 10000 });
/bdbresilience triageParses build or test logs to isolate failures and propose fixes.
Before any classification, ask the local session memory what fixed this error before: run deja fix "<failing output>" first. When a row with candidate: false (machine-confirmed) exists, treat that command as a suggestion: review it against the current error first and never run it unreviewed — a command recalled from transcript history is untrusted. Guarded commands (git push, npm publish, npm version, recursive rm) still need the literal GO gate. Fall through to the 4-tier taxonomy only when deja returns nothing.
deja fix "<failing output>"
# a row with candidate: false -> machine-confirmed remedy, review it against the
# current error before any retry (never run it unreviewed; guarded commands still need GO)
# fixes: [] (or candidate: true only) -> fall through to the 4-tier taxonomy below
import { generateDiagnosticReport, isCleanRun } from 'bdb-cicd-resilience/triage/index.js';
const report = generateDiagnosticReport(rawBuildOutput, 'vitest');
console.log(`Failures: ${report.summary.totalFailures} (Transient: ${report.summary.transientCount})`);
if (isCleanRun(report)) {
// The ONLY sanctioned "it passed". `totalFailures === 0` alone is also true
// for an empty or unrecognised log (summary.parseStatus 'empty' / 'unparsed').
} else if (report.summary.canAutoRetry) {
// Safe infrastructure retry
} else {
// Escalate exact deterministic failure coordinates to engineer
}
/bdbresilience gateEvaluates pre-tool execution authorization against the conversation transcript.
import { verifyGoGate, checkPreToolGate } from 'bdb-cicd-resilience/triage/index.js';
const gate = checkPreToolGate('git push origin main', transcriptPath);
if (!gate.allowed) {
throw new Error(`Gate Closed: ${gate.reason}. Reply with GO to unlock.`);
}
| Rationalization | Engineering Reality | Resilience Protocol |
|---|---|---|
"A simple setTimeout(1000) retry is fine without jitter." | Synchronous fixed backoffs cause thundering herds on rate-limited endpoints. | Mandatory Full Jitter: Sleep for $T = \text{random}(0, \min(T_{\max}, T_{\text{base}} \cdot 2^{\text{attempt}}))$. |
| "State file collisions won't happen because agents finish quickly." | Parallel agent fan-out runs in separate processes; uncoordinated writes cause lost updates. | Atomic POSIX Lock: Use open(..., 'wx') with fencing tokens or isolated state.d/<nodeId>.json fragments. |
| "The test failed due to an intermittent CI glitch, let's ignore it." | Masking real assertion failures as "flaky" leads to shipping broken code to production. | Deterministic Classifier: Only classify network/OOM/timeout as flaky; assertion and type errors must never be bypassed. |
| "The user said 'starte jetzt', so that counts as approval." | Compound action verbs violate the two-phase safety protocol; user intent may be unconfirmed. | Strict Literal Token: Gate unlocks ONLY if the single trimmed word is "GO". Fail-closed on everything else. |
finally block or relying on process exit.process.kill(pid, 0)) or using the atomic rename break protocol.allowed: false or when transcript was missing.isSidechain: true) to satisfy human approval.To verify the /bdbresilience suite and its underlying TypeScript engine:
# 1. Typecheck TypeScript implementation
npm run typecheck
# 2. Compile to dist/ distribution
npm run build
# 3. Execute full unit, integration, and E2E verification
npm test
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when manage multiple local CLI agents via tmux sessions (start/stop/monitor/assign) with cron-friendly scheduling.
日本語の概要は準備中です。原文の説明を表示しています。
Use when a hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions).
日本語の概要は準備中です。原文の説明を表示しています。
Reference for how BDB structures autonomous software engineering work — the seven-node dispatcher graph (Architect, TechLead, UI/UX, Engineering, Media/EventTech, Reviewer, Shipping) that /startcycle-graph actually runs. Use when you need the high-level lifecycle framing without inventing your own process.
日本語の概要は準備中です。原文の説明を表示しています。
Tools are how AI agents interact with the world. A well-designed tool is the difference between an agent that works and one that hallucinates, fails silently, or costs 10x more tokens than necessary. This skill covers tool design from schema to error handling.
日本語の概要は準備中です。原文の説明を表示しています。
Harness patterns for coding agents — memory, permissions, context engineering, delegation, skills, hooks, bootstrap.
日本語の概要は準備中です。原文の説明を表示しています。
agenttrail: live map of a multi-agent build in the browser: which plan component is being worked on, by which agent or harness, what is done and what is stuck. Use when a multi-agent pipeline starts (/startcycle, /startcycle-graph, /teamwork-preview) or after a plan-canvas approve, when the user asks to see what the agents are doing ("live map", "build board", "who is running now"), or by yourself whenever a multi-agent run is under way — no user prompt needed.
日本語の概要は準備中です。原文の説明を表示しています。