AgentSkillsCN

cipherclaw

零依赖 AI 代理调试工具集。可追踪错误、构建因果关系图、检测异常,并在各代理会话中监控行为漂移。

SKILL.md
--- frontmatter
name: cipherclaw
description: Zero-dependency AI agent debugging toolkit. Trace errors, build causal graphs, detect anomalies, and monitor behavioral drift across agent sessions.
version: 1.0.2
metadata:
  openclaw:
    emoji: "🔍"
    homepage: https://github.com/Alexi5000/CipherClaw
    requires:
      bins:
        - node
    install:
      - id: npm
        kind: node
        package: cipherclaw
        bins: []
        label: Install CipherClaw (npm)

CipherClaw Skill

Debug AI agent behavior using CipherClaw's modular engine. Start a session, log events, and get structured analysis.

Quick Start

typescript
import { CipherClawEngine } from 'cipherclaw';

const engine = new CipherClawEngine();
const session = engine.startSession({ domain: 'reasoning' });

Log an Error

typescript
engine.logError(session.id, {
  message: 'Agent hallucinated a citation',
  severity: 'high',
  domain: 'reasoning',
  context: { prompt: 'Summarize paper', output: 'Cited non-existent study' }
});

Build Causal Graph

After logging errors, retrieve the causal graph for root cause analysis:

typescript
const graph = engine.getCausalGraph(session.id);
// { nodes, edges, rootCauses, impactedNodes, criticalPath }

Detect Anomalies

typescript
engine.logAnomaly(session.id, {
  metric: 'response_latency',
  value: 4500,
  threshold: 2000,
  domain: 'performance'
});

Monitor Soul Integrity

Compare defined personality against observed behavior:

typescript
const report = engine.analyzeSoulIntegrity(session.id, soulDefinition, observedBehavior);
// { overallScore, violations, recommendations }

Memory Health

typescript
const health = engine.checkMemoryHealth(session.id, 'all');
// { overallHealth, tiers: { shortTerm, longTerm, episodic, semantic } }

Predictions

typescript
const predictions = engine.getPredictions(session.id);
// [{ pattern, probability, timeframe, suggestedAction }]

Complete Session

typescript
const report = engine.completeSession(session.id);
// Full debug report with all findings

Commands

ActionMethod
Find root causesgetCausalGraph(sessionId), getRootCauses(sessionId)
Classify errorclassifyError(message)
Profile behaviorcomputeCognitiveFingerprint(sessionId, agentId)
Check soul driftanalyzeSoulIntegrity(sessionId, soul, behavior)
Predict failuresgetPredictions(sessionId)
Check memorycheckMemoryHealth(sessionId, tier)
Cross-domaindetectCrossDomainCorrelations(sessionId)
Generate testssynthesizeFlowTest(sessionId, traceId)
Full reportcompleteSession(sessionId)
Self-diagnoseselfDebug(sessionId)

Defaults

Anomaly threshold: 2.5 standard deviations. Cascade window: 30s. Soul drift threshold: 15 (0-100). Max snapshots: 50 per session.

Requirements

Node.js 18+. No API keys. No external dependencies. Install: pnpm add cipherclaw.