specstory-organize
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSpecStory Organize
SpecStory 历史整理
Organizes your directory by moving session files into subdirectories based on the timestamp in each filename.
.specstory/historyYYYY/MM/将你的目录中的会话文件,根据文件名中的时间戳移动到子目录中。
.specstory/historyYYYY/MM/How It Works
工作原理
- Scans for markdown files
.specstory/history/ - Extracts the date from filenames (e.g., )
2026-01-22_19-20-56Z-fix-bug.md - Creates year/month folders (e.g., )
2026/01/ - Moves files into the appropriate subdirectory
- Reports what was moved
- 扫描目录下的markdown文件
.specstory/history/ - 提取文件名中的日期(例如:)
2026-01-22_19-20-56Z-fix-bug.md - 创建年/月文件夹(例如:)
2026/01/ - 移动文件到对应的子目录
- 报告已移动的文件
Why Organize?
为什么需要整理?
Over time, your history directory can accumulate hundreds of session files. Organizing by date makes it easier to:
- Find sessions from a specific time period
- Archive old sessions
- Keep your project directory clean
随着时间推移,你的历史目录会积累数百个会话文件。按日期整理后,你可以更轻松地:
- 查找特定时间段的会话
- 归档旧会话
- 保持项目目录整洁
Usage
使用方法
Slash Command
斜杠命令
| User says | Action |
|---|---|
| Organize all files (default) |
| Preview changes without moving |
| Preview changes without moving |
| 用户指令 | 操作 |
|---|---|
| 整理所有文件(默认) |
| 预览更改但不实际移动文件 |
| 预览更改但不实际移动文件 |
Direct Script Usage
直接运行脚本
bash
undefinedbash
undefinedFrom project root
从项目根目录运行
python skills/specstory-organize/scripts/organize.py
python skills/specstory-organize/scripts/organize.py
Preview what would be moved (no changes made)
预览将要移动的文件(不进行实际修改)
python skills/specstory-organize/scripts/organize.py --dry-run
undefinedpython skills/specstory-organize/scripts/organize.py --dry-run
undefinedOutput
运行输出
SpecStory History Organizer
===========================
Found 47 files to organize in .specstory/history/
Moving files:
2026-01-15_10-30-22Z-refactor-auth.md -> 2026/01/
2026-01-15_14-22-01Z-fix-tests.md -> 2026/01/
2026-01-22_19-20-56Z-add-feature.md -> 2026/01/
2025-12-28_09-15-33Z-cleanup.md -> 2025/12/
...
Summary:
--------
Files moved: 47
2026/01/: 23 files
2025/12/: 18 files
2025/11/: 6 files
Your history is now organized!SpecStory History Organizer
===========================
Found 47 files to organize in .specstory/history/
Moving files:
2026-01-15_10-30-22Z-refactor-auth.md -> 2026/01/
2026-01-15_14-22-01Z-fix-tests.md -> 2026/01/
2026-01-22_19-20-56Z-add-feature.md -> 2026/01/
2025-12-28_09-15-33Z-cleanup.md -> 2025/12/
...
Summary:
--------
Files moved: 47
2026/01/: 23 files
2025/12/: 18 files
2025/11/: 6 files
Your history is now organized!Dry Run Output
试运行输出
When using :
--dry-runSpecStory History Organizer (DRY RUN)
=====================================
Would organize 47 files in .specstory/history/
Preview:
2026-01-15_10-30-22Z-refactor-auth.md -> 2026/01/
2026-01-15_14-22-01Z-fix-tests.md -> 2026/01/
...
No files were moved. Run without --dry-run to apply changes.当使用参数时:
--dry-runSpecStory History Organizer (DRY RUN)
=====================================
Would organize 47 files in .specstory/history/
Preview:
2026-01-15_10-30-22Z-refactor-auth.md -> 2026/01/
2026-01-15_14-22-01Z-fix-tests.md -> 2026/01/
...
No files were moved. Run without --dry-run to apply changes.Present Results to User
向用户展示结果
After running the organize script:
- Confirm success - Tell the user how many files were organized
- Show the breakdown - List how many files went to each month
- Note any skips - If files couldn't be parsed (no date in filename), mention them
运行整理脚本后:
- 确认成功 - 告知用户已整理的文件数量
- 展示分类明细 - 列出每个月份的文件数量
- 说明跳过的文件 - 如果存在无法解析的文件(文件名中无日期),需提及这些文件
Example Response
示例回复
Done! I organized 47 session files in your `.specstory/history/` directory:
- **2026/01/**: 23 files
- **2025/12/**: 18 files
- **2025/11/**: 6 files
Your history files are now sorted by year and month, making it much easier
to find sessions from specific time periods.Done! I organized 47 session files in your `.specstory/history/` directory:
- **2026/01/**: 23 files
- **2025/12/**: 18 files
- **2025/11/**: 6 files
Your history files are now sorted by year and month, making it much easier
to find sessions from specific time periods.Notes
注意事项
- Files without a recognizable date pattern in the filename are skipped
- The script uses the filename timestamp, not the file's modification time
- Already-organized files (in subdirectories) are not moved again
- Compatible with Python 2.7+ and Python 3.x
- 文件名中无可识别日期格式的文件会被跳过
- 脚本使用文件名中的时间戳,而非文件的修改时间
- 已整理到子目录中的文件不会被重复移动
- 兼容Python 2.7+和Python 3.x版本