file-classification

Classify and organize Korean law study files into subject folders using keyword routing rules.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/kmjy98-sketch/khulaw --skill file-classification-kmjy98-sketch
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: file-classification
Source: https://github.com/kmjy98-sketch/khulaw/tree/main/.agent/skills/file-classification
Command: npx skills add https://github.com/kmjy98-sketch/khulaw --skill file-classification-kmjy98-sketch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymupdf, and includes scripts (resource) and references (resource) components.

What problem does it solve? Unsorted uploads pile up in an inbox folder, and manually sorting law school materials (textbooks, transcripts, exams) into the right subject and instructor folders is repetitive and error-prone. This Skill automates that classification with deterministic rules, dry-run previews, and lock-based protection against rework. ## Core Features & Use Cases - Domain-separated classification: Routes files into legal domains (민사/형사/공법/선택법) or the admission domain (로스쿨입시/LEET) based on filename keywords, with instructor-specific routing overrides. - Safe execution model: Defaults to DRY-RUN, excludes protected roots (shared drives, trash, RAG data, original archives), and supports a lock registry keyed by relative path plus mtime to skip completed files and flag modified ones for re-review. - Naming and rule references: Ships classification rules and naming conventions (고유명사 vs 일반명사, mandatory year suffixes, folder-based type management) as reference documents. - Use Case: After uploading a batch of lecture PDFs and transcripts to 5.기타/_inbox, run the v3 script in dry-run mode to preview where each file will move, then execute to relocate them into the correct subject and instructor folders. ## Quick Start Ask the AI to run the file-classification script in dry-run mode on the inbox folder for the legal domain, review the planned moves, and then execute the classification.

Frequently Asked Questions about file-classification

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically classify files into folders with Python?▼

Run classification_v3.py with a domain flag such as --domain legal to scan the inbox folder and route files by filename keywords. It defaults to dry-run mode, printing planned moves as PLAN_MOVE lines before any changes are applied with --execute.

How to preview file moves before actually renaming or moving files?▼

Use the script's default dry-run mode, which prints a status table of planned moves without touching the filesystem. Only when you pass --execute does it create target directories and move files with shutil.

Can the classifier skip folders like trash or shared drives?▼

Yes, a global protected-root guard automatically excludes shared drives, the .agent directory, trash, RAG data folders, and original archives from processing. Both source and destination paths are checked against these protected roots.

How do I prevent already-organized files from being reprocessed?▼

Use --mark-complete with a file path to register a lock keyed by relative path and modification time. Matching locks are skipped as SKIP_LOCKED, and if the file's mtime changes it is flagged as REVIEW_REQUIRED for re-examination.

What happens to HWP files during classification?▼

Files with .hwp or .hwpx extensions are routed directly to the _원본보관/hwp_전체 originals archive folder regardless of other keyword matching. This keeps original Hangul documents preserved separately from classified study materials.

Why are some inbox files skipped during classification?▼

Files under temporary transcription directories or with audio and pipeline extensions are skipped as SKIP_INBOX_TEMP by default. Pass --include-inbox-temp to include them, or check for keyword mismatches reported as SKIP_DOMAIN.