소스 정보
- 저장소
- cxcscmu/SkillLearnBench
- 최근 소스 활동
- 2026년 4월 24일 05:14
- 감지된 SKILL.md 언어
- 영어
- 스타
- 77
- 포크
- 4
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill file-organization명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | file-organization |
| description | Organize files into target directories based on classification results |
Move/copy classified files into their respective subject folders with proper error handling.
import os
import shutil
from pathlib import Path
def create_target_folders(base_dir, folders):
"""Create target folders if they don't exist"""
for folder in folders:
folder_path = os.path.join(base_dir, folder)
os.makedirs(folder_path, exist_ok=True)
print(f"Created/verified folder: {folder_path}")
# Usage
target_folders = [
'LLM',
'trapped_ion_and_qc',
'black_hole',
'DNA',
'music_history'
]
create_target_folders('/path/to/base', target_folders)
def move_file_to_folder(source_file, destination_folder):
"""Move file to destination folder, handling conflicts"""
try:
if not os.path.exists(destination_folder):
os.makedirs(destination_folder)
filename = os.path.basename(source_file)
dest_path = os.path.join(destination_folder, filename)
# Handle filename conflicts
if os.path.exists(dest_path):
base, ext = os.path.splitext(filename)
counter = 1
while os.path.exists(dest_path):
dest_path = os.path.join(
destination_folder,
f"{base}_{counter}{ext}"
)
counter += 1
shutil.move(source_file, dest_path)
return True, dest_path
except Exception as e:
return False, str(e)
def organize_files(source_dir, classification_results, base_output_dir):
"""
Organize files based on classification results
Args:
source_dir: Directory containing source files
classification_results: Dict mapping file_path -> category
base_output_dir: Base directory for output folders
Returns:
Dict with statistics about the operation
"""
stats = {
'total_files': len(classification_results),
'moved': 0,
'failed': 0,
'errors': []
}
for file_path, category in classification_results.items():
dest_folder = os.path.join(base_output_dir, category)
success, result = move_file_to_folder(file_path, dest_folder)
if success:
stats['moved'] += 1
print(f"✓ {os.path.basename(file_path)} → {category}")
else:
stats['failed'] += 1
stats['errors'].append((file_path, result))
print(f"✗ {os.path.basename(file_path)}: {result}")
return stats
def log_organization_results(stats, log_file=None):
"""Log organization results to file or stdout"""
summary = f"""
File Organization Summary
========================
Total files: {stats['total_files']}
Successfully moved: {stats['moved']}
Failed: {stats['failed']}
Failed files:
"""
if stats['errors']:
for file_path, error in stats['errors']:
summary += f" - {file_path}: {error}\n"
print(summary)
if log_file:
with open(log_file, 'w') as f:
f.write(summary)