session-logger
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSession Logger
Session Logger
A skill for automatically saving conversation history to persistent session log files.
一款用于将会话历史自动保存到持久化会话日志文件的Skill。
When This Skill Activates
技能触发时机
This skill activates when you:
- Say "保存对话信息" or "保存对话"
- Say "记录会话内容" or "保存session"
- Say "save session" or "save conversation"
- Ask to save the current conversation
当你执行以下操作时,该技能会被激活:
- 说出“保存对话信息”或“保存对话”
- 说出“记录会话内容”或“保存session”
- 说出“save session”或“save conversation”
- 请求保存当前会话
Session File Location
会话文件位置
All sessions are saved to:
sessions/YYYY-MM-DD-{topic}.md所有会话都会保存至:
sessions/YYYY-MM-DD-{topic}.mdWhat Gets Logged
日志记录内容
For each session, log:
-
Metadata
- Date and duration
- Context/working directory
- Main topic
-
Summary
- What was accomplished
- Key decisions made
- Files created/modified
-
Actions Taken
- Checklist of completed tasks
- Pending follow-ups
-
Technical Notes
- Important code snippets
- Commands used
- Solutions found
-
Open Questions
- Issues to revisit
- Follow-up tasks
每个会话会记录以下内容:
-
元数据
- 日期和时长
- 上下文/工作目录
- 主题
-
摘要
- 完成的工作内容
- 做出的关键决策
- 创建/修改的文件
-
已执行操作
- 已完成任务清单
- 待跟进事项
-
技术笔记
- 重要代码片段
- 使用的命令
- 找到的解决方案
-
待解决问题
- 需要回顾的问题
- 后续任务
Session Template
Session Template
markdown
undefinedmarkdown
undefinedSession: {Topic}
Session: {Topic}
Date: {YYYY-MM-DD}
Duration: {approximate}
Context: {project/directory}
Date: {YYYY-MM-DD}
Duration: {approximate}
Context: {project/directory}
Summary
Summary
{What was accomplished in this session}
{What was accomplished in this session}
Key Decisions
Key Decisions
- {Decision 1}
- {Decision 2}
- {Decision 1}
- {Decision 2}
Actions Taken
Actions Taken
- {Completed action 1}
- {Completed action 2}
- {Pending action 3}
- {Completed action 1}
- {Completed action 2}
- {Pending action 3}
Technical Notes
Technical Notes
{Important technical details}
{Important technical details}
Open Questions / Follow-ups
Open Questions / Follow-ups
- {Question 1}
- {Question 2}
- {Question 1}
- {Question 2}
Related Files
Related Files
- - {what changed}
{file-path}
undefined- - {what changed}
{file-path}
undefinedHow to Use
使用方法
Option 1: Automatic Logging
选项1:自动记录
Simply say:
"保存对话信息"The skill will:
- Review the conversation history
- Extract key information
- Create/update the session file
只需说出:
"保存对话信息"该技能会:
- 回顾会话历史
- 提取关键信息
- 创建/更新会话文件
Option 2: With Topic
选项2:指定主题
Specify the session topic:
"保存对话,主题是 skill-router 创建"指定会话主题:
"保存对话,主题是 skill-router 创建"Option 3: Manual Prompt
选项3:手动提示
If auto-extraction misses something, provide details:
"保存对话,重点是:1) 创建了 skill-router,2) 修复了 front matter"如果自动提取遗漏了内容,可以提供详细信息:
"保存对话,重点是:1) 创建了 skill-router,2) 修复了 front matter"File Naming
文件命名规则
| Input | Filename |
|---|---|
| "保存对话" | |
| "保存对话,主题是 prd" | |
| "保存今天的讨论" | |
| 输入内容 | 文件名 |
|---|---|
| "保存对话" | |
| "保存对话,主题是 prd" | |
| "保存今天的讨论" | |
Session Log Structure
会话日志结构
sessions/
├── README.md # This file
├── 2025-01-11-skill-router.md # Session about skill-router
├── 2025-01-11-prd-planner.md # Session about PRD planner
└── 2025-01-12-refactoring.md # Session about refactoringsessions/
├── README.md # This file
├── 2025-01-11-skill-router.md # Session about skill-router
├── 2025-01-11-prd-planner.md # Session about PRD planner
└── 2025-01-12-refactoring.md # Session about refactoringPrivacy Note
隐私说明
Session logs are stored in which is in .
sessions/.gitignore- Logs are NOT committed to git
- Logs contain your actual conversation
- Safe to include sensitive information
会话日志存储在已添加到的目录中:
.gitignoresessions/- 日志不会提交至git
- 日志包含实际会话内容
- 可安全存储敏感信息
Quick Reference
快速参考
| You say | Skill does |
|---|---|
| "保存对话信息" | Creates session log with today's date |
| "保存今天的对话" | Creates session log |
| "保存session" | Creates session log |
| "记录会话" | Creates session log |
| 用户指令 | 技能操作 |
|---|---|
| "保存对话信息" | 创建带当日日期的会话日志 |
| "保存今天的对话" | 创建会话日志 |
| "保存session" | 创建会话日志 |
| "记录会话" | 创建会话日志 |
Best Practices
最佳实践
- Save at key milestones: After completing a feature, fixing a bug, etc.
- Be specific with topics: Helps when searching later
- Include code snippets: Save important solutions
- Track decisions: Why did you choose X over Y?
- List pending items: What to do next time
- 关键节点保存:完成功能开发、修复bug等节点后保存
- 明确主题:便于后续搜索
- 包含代码片段:保存重要解决方案
- 记录决策过程:说明选择方案的原因
- 列出待办事项:记录下次需完成的任务
Rich Content Extraction (for Self-Improving Agent)
富内容提取(用于自改进Agent)
When triggered by other skills via hooks, session-logger extracts structured data for learning:
当被其他技能通过钩子触发时,session-logger会提取结构化数据用于学习:
Skill Context Capture
技能上下文捕获
When a skill completes, capture:
markdown
undefined当某个技能完成时,捕获以下内容:
markdown
undefinedSkill Execution Context
Skill Execution Context
Skill: {skill-name}
Trigger: {user-invoked | hook-triggered | auto-triggered}
Status: {completed | error | partial}
Duration: {approximate time}
Skill: {skill-name}
Trigger: {user-invoked | hook-triggered | auto-triggered}
Status: {completed | error | partial}
Duration: {approximate time}
Input Context
Input Context
- User request: {original request}
- Files involved: {list of files}
- Codebase patterns detected: {patterns}
- User request: {original request}
- Files involved: {list of files}
- Codebase patterns detected: {patterns}
Output Summary
Output Summary
- Actions taken: {list}
- Files modified: {list with changes}
- Decisions made: {key decisions}
- Actions taken: {list}
- Files modified: {list with changes}
- Decisions made: {key decisions}
Learning Signals
Learning Signals
- What worked well: {successes}
- What could improve: {areas for improvement}
- Patterns discovered: {new patterns}
- Errors encountered: {errors and resolutions}
undefined- What worked well: {successes}
- What could improve: {areas for improvement}
- Patterns discovered: {new patterns}
- Errors encountered: {errors and resolutions}
undefinedError Context Capture
错误上下文捕获
When a skill encounters errors:
markdown
undefined当技能遇到错误时:
markdown
undefinedError Context
Error Context
Error Type: {type}
Error Message: {message}
Stack Trace: {if available}
Error Type: {type}
Error Message: {message}
Stack Trace: {if available}
Resolution Attempted
Resolution Attempted
- Approach: {what was tried}
- Result: {success/failure}
- Root cause: {if identified}
- Approach: {what was tried}
- Result: {success/failure}
- Root cause: {if identified}
Prevention Notes
Prevention Notes
- How to avoid: {prevention strategy}
- Related patterns: {similar issues}
undefined- How to avoid: {prevention strategy}
- Related patterns: {similar issues}
undefinedPattern Extraction
模式提取
Extract reusable patterns for the self-improving-agent:
markdown
undefined为自改进Agent提取可复用模式:
markdown
undefinedExtracted Patterns
Extracted Patterns
Code Patterns
Code Patterns
- Pattern name: {name}
- Context: {when to use}
- Example: {code snippet}
- Pattern name: {name}
- Context: {when to use}
- Example: {code snippet}
Workflow Patterns
Workflow Patterns
- Trigger: {what initiates}
- Steps: {sequence}
- Outcome: {expected result}
- Trigger: {what initiates}
- Steps: {sequence}
- Outcome: {expected result}
Anti-Patterns
Anti-Patterns
- Pattern: {what to avoid}
- Why: {reason}
- Alternative: {better approach}
undefined- Pattern: {what to avoid}
- Why: {reason}
- Alternative: {better approach}
undefinedStructured Data Format
结构化数据格式
For machine-readable extraction, use YAML front matter in session logs:
yaml
---
session_type: skill_execution
skill_name: code-reviewer
trigger_source: hook
status: completed
files_modified:
- path: src/utils.ts
changes: refactored error handling
patterns_learned:
- name: error-boundary-pattern
category: error-handling
confidence: high
errors_encountered: []
learning_signals:
successes:
- "Identified code smell in utils.ts"
improvements:
- "Could have suggested more specific refactoring"
---为便于机器读取提取,在会话日志中使用YAML前置元数据:
yaml
---
session_type: skill_execution
skill_name: code-reviewer
trigger_source: hook
status: completed
files_modified:
- path: src/utils.ts
changes: refactored error handling
patterns_learned:
- name: error-boundary-pattern
category: error-handling
confidence: high
errors_encountered: []
learning_signals:
successes:
- "Identified code smell in utils.ts"
improvements:
- "Could have suggested more specific refactoring"
---Integration with Self-Improving Agent
与自改进Agent的集成
When triggered by :
self-improving-agent- Extract episodic memory: Capture the full context of what happened
- Identify semantic patterns: Tag reusable knowledge
- Update working memory: Note immediate follow-ups needed
- Signal completion: Write trigger file if skill chaining is needed
当被触发时:
self-improving-agent- 提取情景记忆:捕获事件发生的完整上下文
- 识别语义模式:标记可复用知识
- 更新工作记忆:记录需立即跟进的事项
- 发送完成信号:若需技能链式调用则写入触发文件
Auto-Trigger Behavior
自动触发行为
When invoked via hooks with :
mode: auto- Silently create/update session log
- Extract structured data without user interaction
- Append to existing session if same day/topic
- Create new session if context differs significantly
当通过钩子以模式调用时:
mode: auto- 静默创建/更新会话日志
- 无需用户交互即可提取结构化数据
- 若为同一天/同一主题则追加至现有会话
- 若上下文差异较大则创建新会话