← 返回
内容创作 中文

CHAT—Logger

Automatically logs every conversation message to workspace/chat/YYYY-MM-DD.md. Creates new files if needed, always appends never overwrites.
自动将每条对话消息记录到 workspace/chat/YYYY‑MM‑DD.md。必要时新建文件,仅追加不覆盖。
jimyxu8812
内容创作 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 544
下载
💾 9
安装
1
版本
#latest

概述

activity_logger 📝

A minimal skill for logging conversation messages to daily Markdown files.

Purpose

Automatically log every user message and assistant reply to a daily Markdown file.

What It Does

  • Creates one log file per day: workspace/chat/YYYY-MM-DD.md
  • Appends each conversation entry to the daily file
  • Never overwrites existing data
  • Creates directories and files automatically if they don't exist

Log Format

[HH:MM:SS]
User: <message>
Assistant: <reply>

How It Works

The agent should manually log each conversation turn using this logic:

1. Create Daily Log File

const fs = require('fs');
const path = require('path');
const os = require('os');

// Get workspace path
const workspace = process.cwd(); // or your workspace path
const chatDir = path.join(workspace, 'chat');

// Create directory if it doesn't exist
if (!fs.existsSync(chatDir)) {
  fs.mkdirSync(chatDir, { recursive: true });
}

// Get current date for filename
const now = new Date();
const dateStr = now.toISOString().split('T')[0]; // YYYY-MM-DD
const timeStr = now.toTimeString().split(' ')[0]; // HH:MM:SS

const logFile = path.join(chatDir, `${dateStr}.md`);

2. Append Log Entry

// Format log entry
const userMsg = /* get user message */;
const assistantMsg = /* get assistant reply */;

let logEntry = `\n[${timeStr}]\n`;
if (userMsg) {
  logEntry += `User: ${userMsg}\n`;
}
if (assistantMsg) {
  logEntry += `Assistant: ${assistantMsg}\n`;
}

// Append to file
fs.appendFileSync(logFile, logEntry);

3. Example Entry

[14:30:00]
User: Hello, how are you?
Assistant: I'm doing well, thank you for asking!

[14:32:15]
User: What's the weather like today?
Assistant: Let me check the weather for you.

Log Location

workspace/chat/YYYY-MM-DD.md

Example:

C:\Users\user\OpenClawWorkspace\chat\2026-03-07.md

Usage Notes

  • This is a manual logging skill - the agent writes to the log file after each response
  • The skill doesn't use hooks - it's triggered by agent code
  • Each entry is appended with a timestamp
  • The file is created automatically on first entry of the day
  • Multiple conversations on the same day go to the same file

Integration

To use this skill:

  1. Copy the chat/ directory structure to your workspace
  2. After each agent response, append the user message and assistant reply to the daily log file
  3. Use the format shown above

Files

  • SKILL.md - This file
  • README.md - ClawHub package readme

License

MIT

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 13:29 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,084
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,942
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,509