SuperAPI AI Directory

mem-file-scan

Office & productivity

View repository

Updated 10-16 05:40

About this skill

Mem File Scan

Overview

Scan files modified this week in the Obsidian vault to help the user supplement records into the L1 context layer. This solves the problem that the AI memory system can only record Claude conversation content and cannot capture the user's other activities in Obsidian.

Trigger timing

  • User actively requests: "file scan", "view this week's files", "scan file changes"
  • At the start of the weekly review process (can be called automatically before the weekly review)
  • The user wants to review their activities in Obsidian this week

Workflow

Step 1: Determine this week's time range

Calculate this week's date range:

  • If it is Sunday or after Sunday: this Monday (00:00) to now
  • If it is before Sunday: last Monday (00:00) to last Sunday (23:59)

Example:

# 获取本周日期范围
今天是:2025-12-27(周五)
本周范围:2025-12-22(周一)至 2025-12-27(今天)

Step 2: Scan modified files

Use the Bash tool to find files modified this week:

# 查找本周修改的.md文件
# 排除AI_MEMORY目录(因为那是记忆系统本身)
# 排除.obsidian、.trash等系统目录

find . -name "*.md" -type f -newermt "2025-12-22" ! -newermt "2025-12-28" \
  ! -path "./AI_MEMORY/*" \
  ! -path "./.obsidian/*" \
  ! -path "./.trash/*" \
  ! -path "./.claude/*"

Note:

  • ! -path "./AI_MEMORY/*" Exclude the memory system itself
  • Adjust according to the actual date -newermt parameter
  • Usefindcommand's-newermtoption to find modification time

Step 3: Display the file list and ask

Display the found files to the user by category:

📂 本周文件扫描结果(12-22 至 12-27)

━━━━━━━━━━━━━━━━━━━━━━━━
发现 {N} 个修改的文件:

📅 Daily日记类(X个):
- Daily/2025-12-22.md
- Daily/2025-12-25.md

📝 项目文档类(X个):
- Projects/项目A/进展.md
- Projects/项目B/会议记录.md

📚 学习笔记类(X个):
- Learning/Python/装饰器.md

🎯 其他(X个):
- ...

━━━━━━━━━━━━━━━━━━━━━━━━

接下来,我会帮你从这些文件中提取可能需要记录到L1的内容。

请告诉我:
1. 你希望我从哪些文件开始?(可以说"全部"、"从Daily开始"或指定具体文件)
2. 或者你可以直接告诉我哪些文件里包含重要事件/决策/偏好

Step 4: Read and analyze files

According to the user's selection, read and analyze files one by one:

Use the Read tool to read files and look for the following key information:

🎯 Identification focus:

  1. Important decisions: technology selection, tool selection, direction adjustment
  2. Emotion records: obvious emotional expressions (excitement, anxiety, sense of achievement, etc.)
  3. New projects/new habits: starting new projects, establishing new habits
  4. Repeated behavior: similar activities occurring 3 or more times
  5. Preference expressions: clear statements of like/dislike
  6. To-do items: important but unfinished items
  7. Meaningful material collection:
    • Learning materials strongly related to the current project/system
    • Material collection reflecting a new interest direction
    • Materials that may suggest potential improvement intentions (such as collecting related reviews right after creating a system)

⚠️ Ignore content:

  • Irrelevant articles saved by chance (unrelated to current interests/projects)
  • Purely temporary notes (no follow-up action)
  • Code snippets (unless they are important learning outcomes)
  • Content already recorded in L1

Step 5: Generate a list of candidate records

For each file, generate candidate records:

📄 文件:Daily/2025-12-25.md

━━━━━━━━━━━━━━━━━━━━━━━━
发现以下可能需要记录的内容:

1️⃣ 【重要决策】选择Python作为后端语言
   - 内容:讨论了技术栈,最终决定用Python
   - 你的考虑:团队熟悉、生态丰富
   - 情绪:安心
   - 是否记录到L1? [ ] 是  [ ] 否  [ ] 修改后记录

2️⃣ 【日常事件】完成了用户认证模块
   - 内容:实现了登录、注册功能
   - 是否记录到L1? [ ] 是  [ ] 否

━━━━━━━━━━━━━━━━━━━━━━━━

Step 6: Wait for user confirmation and record to L1

According to user confirmation, use the mem-record skill to record to L1:

If the user chooses "yes":

调用 mem-record skill,传入提取的内容

If the user chooses "record after modification":

询问用户如何修改
根据用户反馈调整内容
调用 mem-record skill

If the user chooses "no":

跳过,继续下一个

Step 7: Summarize recording results

After all files are processed, output a summary:

✅ 文件扫描回顾完成!

━━━━━━━━━━━━━━━━━━━━━━━━
📊 本次扫描统计:
- 扫描文件数:{X}个
- 识别候选:{Y}条
- 成功记录到L1:{Z}条

📝 记录详情:
1. ✅ 技术选型决策 → L1_情境层/2025-12.md
2. ✅ 完成用户认证 → L1_情境层/2025-12.md
3. ⏭️ 跳过:日常琐事

━━━━━━━━━━━━━━━━━━━━━━━━
💡 建议:
- 这些新记录将在下次周复盘时参与行为模式分析
- 继续保持记录习惯,让记忆系统更全面地了解你

Notes

File Exclusion Rules

Always exclude the following directories and files:

  • AI_MEMORY/ - The memory system itself
  • .obsidian/ - Obsidian configuration
  • .trash/ - Deleted files
  • .claude/ - Claude Code configuration
  • Any hidden files/directories (starting with.starting with)

Intelligent Recognition Priority

Recognize according to the following priorities:

  1. Decisions > Daily events
  2. Emotions > Pure facts
  3. New projects/new habits > Routine activities
  4. Repetitive behaviors > Occasional events

Recording Density Control

  • Do not over-record: trivial daily chores do not need to be recorded
  • Focus on important events: decisions, emotions, preferences, patterns
  • Respect user choices: let the user decide what is worth recording

Collaboration with other skills

Collaborate with mem-record

After this skill identifies content that needs to be recorded, call the mem-record skill to perform the actual recording:

[mem-file-scan] 识别候选 → [用户确认] → [mem-record] 执行记录

Collaborate with mem-weekly

In the weekly review process, this skill can be called before analyzing L1 records:

[周复盘开始]
  ↓
[mem-file-scan] 扫描本周文件,补充L1
  ↓
[mem-weekly] 分析L1,识别行为模式

Error Handling

No modified files found

本周未发现修改的文件(排除AI_MEMORY目录)。

可能原因:
1. 本周主要在Claude中对话,较少直接编辑Obsidian
2. 文件修改时间未在本周范围内

建议:
- 继续使用mem-record记录日常对话
- 下周再尝试文件扫描

File is too large or has an abnormal format

⚠️ 文件 {filename} 过大或格式异常,跳过分析

你可以:
1. 手动告诉我这个文件里的重要内容
2. 继续处理其他文件

Example Dialogue

User-triggered

用户:文件扫描

Claude:[调用mem-file-scan]
  📂 本周文件扫描结果(12-22 至 12-27)
  发现 5 个修改的文件...
  [后续流程]

Automatically called during weekly review

用户:周复盘

Claude:[先调用mem-file-scan]
  在开始周复盘前,让我先扫描一下本周修改的文件...
  [扫描流程]
  ✅ 补充记录完成

  [然后调用mem-weekly]
  现在开始周复盘分析...