agentleFS
neilghoshneilghosh/skills/skills/file-organization/SKILL.md

file-organization

Skill0 starsChanged 7 days agoMITView on GitHub

Audits, deduplicates, reorganizes, and standardizes directories and files across personal, family, financial, and medical archives. Enforces generalized naming formulas, strict content-based inspection, clinical document standards, and path-context deduplication.

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All file names are generated using consistent, predictable formulas derived from internal document content, not download, print, or scan …

    line 17
  2. Distinctive:

    Never repeat information that is already unambiguous from the folder path:

    line 72
  3. Distinctive:

    Never trust existing file names or system-assigned metadata:

    line 77
  4. Very specific:

    No spaces in non-medical filenames: Always use kebab-case (lowercase-with-hyphens).

    line 86
  5. Very specific:

    Hidden input: Always acquire passwords interactively via terminal masked prompts (getpass) so characters are not echoed to stdout.

    line 149

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

File Organization & Standardization Runbook

A fully generalized, context-aware runbook for auditing, deduplicating, categorizing, and standardizing personal, family, and institutional file archives.


1. Universal Naming Formulas

All file names are generated using consistent, predictable formulas derived from internal document content, not download, print, or scan artifacts.

A. General & Identity Files (Default: Kebab-Case)

[<date>-][<issuer>-]<document-type>[-<qualifier>][-<status>].<ext>
ComponentPurposeGuidelinesExamples
<date>Issuance, validity, or periodUse YYYY or YYYY-MM-DD. Omit if current or timeless.2024, 2023-04-01, ay-2023-24
<issuer>Issuing authority or institutionOmit if already implied by enclosing directory or document type.sbi, hdfc, cbse, epfo
<document-type>Core document category / subjectLowercase single-word or hyphenated descriptor.passport, pan, aadhaar, marksheet, statement, tax-receipt
<qualifier>Variant, level, or descriptorDistinguishes grade, variant, or account.10th, 12th, degree, pvc, learners, front
<status>Verification or state (optional)Use only when distinguishing signed/attested versions.attested, signed, masked

Generalized Category Patterns:

  • Identity & Legal:
    • [<issuer>-]<type>[-<variant>][-<status>].<ext> → pan.pdf, pan-attested.pdf, aadhaar-pvc.pdf, voter-id.pdf
    • passport[-<year>].pdf → passport.pdf, passport-2024.pdf, photo-passport-size.jpg
    • driving-license[-<variant>].pdf → driving-license.pdf, driving-license-learners.pdf
  • Academic & Career:
    • <level>-marksheet.pdf → 10th-marksheet.pdf, 12th-marksheet.pdf, degree-transcript.pdf
    • <type>-certificate.pdf → degree-certificate.pdf, birth-certificate.pdf, provisional-certificate.pdf
    • <document-type>.pdf → resume.pdf, offer-letter.pdf, relieving-letter.pdf
  • Banking, Financial & Tax:
    • statement-<period>.pdf → statement-2023-q4.pdf, statement-2024-03.pdf
    • passbook[-<issuer>].pdf → passbook-sbi.pdf, passbook.pdf
    • receipt-<type>[-<year>].pdf → property-tax-2023.pdf, fd-receipt.pdf
    • tax-return-<period>.pdf → itr-acknowledgement-ay-2023-24.pdf

B. Medical & Clinical Documents (Mandatory Exception)

To preserve clinical chronological records across multiple doctors, hospitals, and labs, medical files use a strict human-readable pattern:

YYYY-MM-DD - <Patient Name> - <Record Type> - <Provider or Test Name>.pdf
Record TypeThird Token RuleExample
Lab / Diagnostic TestSpecific test name(s)YYYY-MM-DD - <Patient Name> - Lab - Complete Blood Count.pdf
Consultation / PrescriptionPhysician's title and full nameYYYY-MM-DD - <Patient Name> - Prescription - Dr Physician Name.pdf
Hospital / InpatientHospital or clinic nameYYYY-MM-DD - <Patient Name> - Discharge Summary - Hospital Name.pdf
Billing / InsuranceHospital / provider nameYYYY-MM-DD - <Patient Name> - Bill - Hospital Name.pdf

Event Date Rule: Always use the date the medical encounter or test took place, never the scan date, download date, or report printing date.


2. Generalization & Deduplication Principles

A. Path-Context Deduplication (Eliminate Redundancy)

Never repeat information that is already unambiguous from the folder path:

  1. Never repeat person/owner names: Inside any personal or individual directory (e.g., <Workspace>/Identity/Passport/), use passport-2024.pdf, NEVER <Person Name> Passport 2024.pdf.
  2. Never repeat parent folder tokens: Inside <Workspace>/Identity/Aadhaar/, use aadhaar.pdf or pvc.pdf, NEVER aadhaar-aadhaar.pdf. Inside <Workspace>/Identity/PAN/, use pan.pdf, NEVER pan-card.pdf.

B. Content-First Ground Truth

Never trust existing file names or system-assigned metadata:

  1. Inspect internal text via CLI tools (pdftotext, strings) or render the first page to image (pdftoppm) for OCR inspection.
  2. Verify:
    • True subject / owner of the document.
    • Issuing organization or provider.
    • Actual transaction, exam, or encounter date.
    • Document classification.

C. Normalization & Hygiene

  • No spaces in non-medical filenames: Always use kebab-case (lowercase-with-hyphens).
  • Sanitize corruptions: Strip duplicate extensions (.pdf.pdf, .jpg.pdf, .png.pdf).
  • Remove trailing spaces: Fix spaces before extensions (name .pdf → name.pdf).
  • Correct spelling errors: Normalize typos (Propety → property, Finacials → financials).

3. Directory Layout Archetypes

A. Individual Workspace (<Root>/<Individual-Identifier>/)

<Individual-Root>/
├── Career/                 # Resumes, offers, relieving letters, contracts
├── Certificates/           # Academic transcripts, degrees, diplomas, awards
├── Financial/
│   ├── Banking/            # Statements, passbooks, check records
│   ├── Investments/        # Fixed deposits, mutual funds, equity portfolios
│   ├── Property-Tax/       # Municipal tax receipts, property assessments
│   └── Taxes/              # Annual tax returns (ITR, Form 16, AIS, 26AS)
├── Identity/
│   ├── Aadhaar/            # Regular, PVC, e-Aadhaar
│   ├── Driving-License/    # Permanent DL, learner's license
│   ├── PAN/                # PAN card copies, e-PAN
│   └── Passport/           # Passports, visa stamp copies
├── Medical/                # Clinical records, chronologically organized
│   ├── Lab-Reports/
│   ├── Prescriptions/
│   └── Vaccines/
├── Vehicles/               # Registration certificates (RC), insurance, emission
└── Travel/                 # Visas, itineraries, tickets

B. Shared / Group Archives (<Root>/Shared/ or <Root>/Family/)

Store records that naturally encompass multiple individuals in shared domain roots:

  • Shared/Insurance/: Multi-member floater health policies, umbrella policies.
  • Shared/Property/: Joint title deeds, sale agreements, floor plans, mutations.
  • Shared/Reference/: General manuals, health guides, emergency contacts.

4. Deduplication Protocol

  1. Size Grouping: Index files by exact byte size to quickly isolate candidate collisions.
  2. Binary Hashing: Compute MD5 / SHA-256 checksums (md5 -r <file>).

    Cloud Storage / FileProvider Note: When files are stored in on-demand cloud storage (e.g. Google Drive, iCloud, OneDrive), use native shell commands (md5, cmp) to trigger transparent on-demand hydration.

  3. Collision Resolution:
    • Prune download duplicates (e.g., (1), (2), -copy).
    • Prune OS prefixes (e.g., Copy of ..., DUPLICATE_...).
    • Prune zero-byte and corrupted remnants.
    • Retain the cleanest, most descriptive filename and remove identical binary duplicates.


5. Encrypted PDF Handling & Password Removal

Personal archives frequently contain password-protected PDFs (e-Aadhaar, bank statements, salary slips, Form 16, insurance policies). Encrypted PDFs cannot be inspected via pdftotext or indexed.

A. Security Requirements

  1. Never hardcode, store, or log passwords: Passwords must never appear in transcripts, commit messages, or plaintext log files.
  2. Hidden input: Always acquire passwords interactively via terminal masked prompts (getpass) so characters are not echoed to stdout.
  3. Session reuse: Within a single execution session, cache verified passwords in memory to unlock other files using the same credentials (e.g. repeated DOB or PAN) without repeated prompts.

B. Bundled Utility: scripts/unlock_pdf.py

The skill provides a turnkey decryption utility:

# 1. Prerequisite (fastest engine):
# macOS: brew install qpdf
# Linux: sudo apt install qpdf
# Fallback: pip install pypdf

# 2. Scan for locked PDFs without prompting (dry run):
python3 scripts/unlock_pdf.py /path/to/archive --dry-run

# 3. Securely unlock in-place (prompts via getpass; caches session password):
python3 scripts/unlock_pdf.py /path/to/archive --in-place

6. Execution Workflow

[Scan & Index Directory Tree]
        │
        ▼
[Detect Encrypted PDFs ──▶ Run unlock_pdf.py (Secure getpass Prompt)]
        │
        ▼
[Inspect Content via pdftotext / Page Render]
        │
        ▼
[Resolve True Owner & Route to Individual Workspace]
        │
        ▼
[Deduplicate via Exact Binary Hash]
        │
        ▼
[Apply Universal Naming Formula & Strip Redundancy]
        │
        ▼
[Relocate into Domain Archetype Hierarchy]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.