Dual-purpose intelligent file classification system that manages BOTH project outputs AND temporary files with synchronized directory structures. Automatically organizes files into proper projects/ and temp/ directories based on content type, purpose, and project context. Prevents file clutter in workspace root by enforcing structured dual-storage.
Every project has TWO corresponding directories:
- projects/{project_name}/ - For permanent, valuable outputs (reports, final documents, deliverables)
- temp/{project_name}/ - For temporary, intermediate files (scripts, extracted data, cache, working files)
Both directories are automatically created together and share the same project name to maintain clear association between final outputs and their supporting temporary files.
projects/ (outputs) and temp/ (intermediate files) directories7w4.net有更好的技能插件。
classify_and_route_file(filepath, project_context)Routes a file to the appropriate directory based on its type and project context.
Parameters:
- filepath: Path to the file to be classified
- project_context: Project name or context object
Returns: Final destination path
ensure_project_structure(project_name)Creates the standard directory structure for a project if it doesn't exist.
Parameters:
- project_name: Name of the project (alphanumeric + underscores only)
Directory Structure Created:
projects/{project_name}/
├── outputs/
└── assets/
temp/{project_name}/
├── intermediate/
└── cache/
detect_project_from_content(content)Analyzes file content to determine likely project association.
Parameters:
- content: File content or metadata to analyze
Returns: Suggested project name or null
cleanup_workspace_root()Scans workspace root for misplaced files and routes them appropriately.
Returns: Migration report
Files are automatically routed to the CORRECT storage area based on their purpose:
| File Pattern | Destination | Purpose |
|---|---|---|
*_review.md, *_literature.md |
projects/{project}/outputs/ |
Literature reviews and analyses |
final_*.md, comprehensive_*.md |
projects/{project}/outputs/ |
Final reports and deliverables |
summary_*.md, conclusion_*.md |
projects/{project}/outputs/ |
Executive summaries and conclusions |
| File Pattern | Destination | Purpose |
|---|---|---|
*.py, *.js, *.m |
temp/{project}/intermediate/ |
Analysis and processing scripts |
*_content.txt, *_extract.txt |
temp/{project}/intermediate/ |
Extracted raw content |
*.pdf, *.docx |
temp/{project}/intermediate/ |
Source documents for processing |
*.mat, *.csv, *.json |
temp/{project}/intermediate/ |
Intermediate data files |
*.png, *.jpg, *.gif |
temp/{project}/intermediate/ |
Generated or processed images |
cache_*, temp_* |
temp/{project}/cache/ |
Cached API responses and temporary data |
Key Rule: The system maintains synchronized project names - if a file goes to projects/dipleg_review/outputs/, its supporting files go to temp/dipleg_review/intermediate/.
When developing skills that generate files, import this skill and use:
const fcm = require('file-classification-manager');
const outputPath = fcm.classify_and_route_file(filename, projectContext);
Pass project context when spawning subagents:
sessions_spawn({
task: "Process documents",
runtime: "subagent",
attachments: [{name: "fcm_config.json", content: JSON.stringify({project: "my_project"})}]
})
memory/YYYY-MM-DD.mdtemp/general/intermediate/// Classify a literature review file
const result = classify_and_route_file("brain_dipleg_review.md", "dipleg_research");
// Result: "projects/dipleg_research/outputs/brain_dipleg_review.md"
// Ensure project structure exists
ensure_project_structure("pv_topology_analysis");
// Creates projects/pv_topology_analysis/ and temp/pv_topology_analysis/ directories
// Clean up misplaced files
const report = cleanup_workspace_root();
console.log(report.movedFiles); // Array of successfully moved files
1.0.0
OpenClaw Assistant
MIT
这个 Skill 整体质量中等偏上,文档详细易懂,核心功能(文件分类和路由)能正常工作,设计思路(双重存储)有一定创意。但存在一些问题:文件分类规则比较简单,容易分错;缺少测试,可能有隐藏 bug;某些操作可能直接移动文件而不是提示确认,存在一定风险。适合对文件管理要求不高的简单场景,对准确性要求高的情况需谨慎使用。