360 Secure SkillHub
360 安全技能中心

DreamCycle

面向 AI agent 的回顾式调试工具:以 Python 命令行扫描 JSON 会话日志,提取 failure/pattern/lesson 信号,识别出现 2 次以上的复发模式及其升降趋势,并为已知失败模式给出带置信度的修复建议;首次运行建立基线,趋势数据保存在本地历史文件中。

qize-auto
qize-auto
热度 29.04
最近更新 2026-05-11 17:47:56
分类:开发依赖:代码执行 / 读写文件应用场景:调试排错 / 数据处理 / 报告撰写 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add dreamcycle
Metadata
name
dreamcycle
description
AI Agent Self-Reflection Engine — scan session logs, detect failure patterns, analyze recurrence trends, and suggest automated fixes.
version
0.1.0
metadata
{"openclaw":{"requires":{"bins":["python3"],"anyBins":["pip3","pip"]},"primaryEnv":"","emoji":"🔄","homepage":"https://github.com/qize-auto/dreamcycle","tags":["agent-self-reflection","debugging","auto-fix","session-analysis","failure-detection"],"category":"development"}}

DreamCycle

Detect, analyze, and auto-repair failure patterns from AI agent session logs.

When to use

Use DreamCycle when:

  • An agent has been running for a while and you want to check for recurring failures
  • Session logs are accumulating and you want trend analysis
  • You suspect the same error keeps happening but no one is tracking it
  • You want automated fix suggestions for known failure patterns
  • After making changes to agent configuration, to verify nothing regressed

How it works

DreamCycle is a retrospective debugger for AI agents. It scans your agent's session log files in three phases:

Session Logs → Scan → Analyze → Fix
  1. Scan — Extracts failure, pattern, and lesson signals from JSON session files
  2. Analyze — Detects recurring patterns (appearing 2+ times) and trends (up/down/stable compared to previous scans)
  3. Fix — Maps known failure patterns to automated fix suggestions with confidence scores

Installation

pip install dreamcycle

Usage

# Basic diagnostic: scan last 2 days of sessions
dreamcycle diagnose ~/.openclaw/sessions/

# Scan last 7 days
dreamcycle diagnose ~/my-agent/logs/ --days 7

# JSON output for programmatic use
dreamcycle diagnose ./sessions/ --output json

# Version info
dreamcycle version

Example output

━━━ DreamCycle Diagnose ━━━
Scanned:    42 sessions (last 2 days)
Signals:    156 total (failures: 78, patterns: 52, lessons: 26)
━━━━━━━━━━━━━━━━━━━━━━━━━━

🔄 Top Recurring Patterns
  [12x] "timeout" → ⚡ high
    Fix: add retry_with_backoff (confidence: 85%)
  [8x]  "ModuleNotFoundError" → ⚡ high
    Fix: pip install <module> (confidence: 95%)

📈 Trends
  ↑ timeout: 12x (up from 5x last scan)
  ↓ ModuleNotFoundError: 8x (down from 15x)

🔧 Auto-Fix Summary
  ✅ 2/4 patterns have automated fixes
  ❌ 2 patterns need manual review

Requirements

Only python3 and pip. Zero external dependencies — DreamCycle uses only the Python standard library.

Notes

  • Session files must be JSON format with a messages array containing role/content fields
  • First run establishes a baseline; trends appear starting from the second run
  • Trend data is stored at ~/.dreamcycle/scan_history.json