filename-formatting
Scannednpx machina-cli add skill brege/dewey-decimal-skill/filename-formatting --openclawFilename Formatting
Format: Author Last, First [Contributors] - Title (Year).ext
Author Field
Single Author
Convert to citation format: Last, First
| Input | Output |
|---|---|
| Charles Bukowski | Bukowski, Charles |
| Simone de Beauvoir | de Beauvoir, Simone |
| Aristotle | Aristotle |
Name particles (de, van, von) stay lowercase with last name. Single names (Aristotle, Plato) have no comma.
Two Authors
Format: Last1, First1 and Last2, First2
| Input | Output |
|---|---|
| Andrew Dornenburg, Karen Page | Dornenburg, Andrew and Page, Karen |
| Brian Kernighan, Dennis Ritchie | Kernighan, Brian W. and Ritchie, Dennis |
Three or More Authors
Format: Last, First et al
| Input | Output |
|---|---|
| William H. Press, Saul A. Teukolsky, ... | Press, William H. et al |
Contributors
Square brackets with role abbreviation, after author:
| Role | Format |
|---|---|
| Translator | [tr. Last, First] |
| Editor | [ed. Last, First] |
| Multiple | [tr. Last1, First1; ed. Last2, First2] |
Examples:
Aristotle [tr. Irwin, Terence] - Nicomachean Ethics (2019).pdfde Beauvoir, Simone [tr. Border, C., Malovany-Chevallier, S.] - The Second Sex (2010).epub
Title Field
Exact title as published. Subtitles: convert colon to space-dash-space.
| Original | Filename |
|---|---|
| Salt: A World History | Salt - A World History |
| Capital: A Critique of Political Economy | Capital - A Critique of Political Economy |
Edition Field
Include only for non-first editions, in square brackets before year:
Press, William H. et al - Numerical Recipes [3rd Edition] (2007).pdfKernighan, Brian W. and Ritchie, Dennis - C Programming Language [2nd Edition] (1988).pdf
Omit for first editions.
Year Field
Parentheses: (YYYY)
Use publication year of THIS edition/translation.
File Extension
Preserve original: .epub, .pdf, .mobi, .djvu
Complete Examples
Bukowski, Charles - Love Is A Dog From Hell (2007).epub
Kernighan, Brian W. and Ritchie, Dennis - C Programming Language (1988).pdf
Aristotle [tr. Irwin, Terence] - Nicomachean Ethics (2019).pdf
Marx, Karl [tr. Fowkes, Ben] - Capital - A Critique of Political Economy, Volume 1 (1867).epub
Hippo, St. Augustine of [tr. Chadwick, Henry] - The Confessions (2008).epub
Hegel, Georg W. F. [tr. Miller, A.V.] - Phenomenology of Spirit (1977).mobi
Edge Cases
Nobility/Religious Titles
Convert to citation form:
- St. Augustine of Hippo:
Hippo, St. Augustine of - Saint Thomas Aquinas:
Aquinas, Thomas
Multi-Volume Works
Include volume in title:
Capital - Volume 1: A Critique of Political Economy
Solutions Manuals
Include type in title:
Griffiths, David Jeffrey - Solutions Manual for Introduction to Quantum Mechanics (1995).pdf
Forbidden Characters
Do not use these characters in filenames:
:(colon) – convert to space-dash-space in titles (see Title Field rules above)\(backslash)*(asterisk)?(question mark)"(quote)<>(angle brackets)|(pipe)- ASCII control characters (U+0000–U+001F)
- Trailing space
- Trailing dot
Remove forbidden characters from titles and other fields (except colons, which convert to -).
Examples:
How Should a Person Be?→How Should a Person BeSalt: A World History→Salt - A World History(colon converts to dash)What's the "Real" Point*→What's the Real Point
Source
git clone https://github.com/brege/dewey-decimal-skill/blob/main/skills/filename-formatting/SKILL.mdView on GitHub Overview
This skill formats ebook filenames using a citation-style structure: Author - Title (Year).ext, with support for single, two, or multiple authors, translators/editors in brackets, and optional edition information. It helps library catalogs maintain consistent, searchable filenames across collections.
How This Skill Works
The process converts the author field into citation form (Last, First for single authors, Last, First and Last, First for two authors, or Last, First et al for three or more). Contributors such as translators or editors are added in brackets after the author (e.g., [tr. Last, First] or [ed. Last, First]). The title is kept exactly as published, with colons converted to a space-dash-space, and the edition (if not the first) is placed in square brackets before the year. The year is enclosed in parentheses, and the original file extension is preserved. Forbidden characters are removed, with colon handling limited to its title-format transformation.
When to Use It
- Adding a new ebook to a library catalog with standardized metadata
- Normalizing a batch of downloaded ebooks for a unified collection
- Renaming translated works to include the translator in the filename
- Formatting multi-author books using et al for three or more authors
- Including non-first editions with edition brackets before the year
Quick Start
- Step 1: Convert the author field to citation form (Last, First; or Last, First et al).
- Step 2: Add translators/editors in brackets after the author if applicable; adjust the title by replacing colons with a dash.
- Step 3: Append edition (if not first) in brackets before the year, then add the year in parentheses and preserve the extension.
Best Practices
- Always format the author field as Last, First (or Last, First et al for 3+ authors) before adding title or contributors
- Place translators and editors in brackets after the author in the form [tr. Last, First] or [ed. Last, First]
- Convert colon in the title to a dash (Title: Subtitle -> Title - Subtitle); do not leave colons in the filename
- Add edition information in square brackets before the year for non-first editions
- Preserve the original extension and remove forbidden characters from all fields
Example Use Cases
- Bukowski, Charles - Love Is A Dog From Hell (2007).epub
- Kernighan, Brian W. and Ritchie, Dennis - C Programming Language (1988).pdf
- Aristotle [tr. Irwin, Terence] - Nicomachean Ethics (2019).pdf
- Marx, Karl [tr. Fowkes, Ben] - Capital - A Critique of Political Economy, Volume 1 (1867).epub
- Hippo, St. Augustine of [tr. Chadwick, Henry] - The Confessions (2008).epub