Skip to content

Commit 09e50a0

Browse files
kdeldyckegithub-actions[bot]
authored andcommitted
Format Markdown
1 parent 2094a54 commit 09e50a0

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

dotfiles/.claude/skills/rename-with-dates/SKILL.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ Period documents that cover a date range (statement exports, period reports) may
3939
## Workflow
4040

4141
1. **List files** in the target directory (default: current working directory, or `$ARGUMENTS` if provided)
42+
4243
2. **Skip** files that already follow the `YYYY-MM-DD - Title.ext` pattern (but offer to clean up their titles if needed). A bare date with no title (like `2023-08-17.pdf`) is not compliant — read the file and add the missing title (often just `Invoice` or `Receipt` inside a provider folder, where the folder name already gives context)
44+
4345
3. **Read each file** to find the effective date and understand the content:
46+
4447
- **For PDFs**:
4548
- Look for explicit "Effective from..." or "Effective date" statements — prefer these
4649
- Look for version dates in footers (e.g., "08/2025", "v. August 14, 2023")
@@ -55,24 +58,33 @@ Period documents that cover a date range (statement exports, period reports) may
5558
- If the image contains visible dates in its content, prefer those
5659
- If no date can be found, ask the user
5760
- Match the date precision to what the document provides: use `YYYY-MM-DD` for exact dates, `YYYY-MM` for month-only, `YYYY` for year-only
61+
5862
4. **Choose a clear title**:
63+
5964
- Use sentence case: capitalize only the first word and proper nouns
6065
- Be descriptive but concise (e.g., "Credit card fees and charges", not "popularbankname_credit_card_fees_charges")
6166
- For screenshots: summarize what the image shows (e.g., "Rewards program earning structure", "Account balance overview")
6267
- Keep well-known abbreviations uppercase: KFS, FAQ, T&C
6368
- Remove redundant institution names if the folder context already makes it clear
6469
- When two documents of the same type share the same effective date but cover different product segments, disambiguate in the title (like `KFS - Credit cards (Skywards, Cash+ and Live+)` vs `KFS - Credit cards (Private Bank, Premier and Advance)`)
6570
- Manuals and spec sheets: title as `Brand Model - Doc type` (like `Gorenje WHT923E5XUK - Cooker hood manual`); vendor doc codes often embed the publication date (Grohe `…/02.19` = February 2019)
71+
6672
5. **Present a summary table** showing current name, detected date, and proposed new name
73+
6774
6. **Rename all files** after presenting the plan. On case-insensitive filesystems (macOS APFS), a case-only rename fails with "are the same file" — do it in two steps through a temporary name
75+
6876
7. **Post-rename analysis** — after renaming, scan the folder for cleanup opportunities and present a report with three sections:
77+
6978
- **Duplicates**: Compare files with similar titles using MD5 checksums (`md5 -r`). Files with identical hashes are exact duplicates. Propose keeping one and trashing the others. If an undated file is an exact duplicate of an already-compliant one, do **not** rename it into a name collision — leave its name untouched and propose trashing it. Also compare content when hashes differ but titles match: re-downloads of the same document often differ only in PDF metadata. Printed document numbers (invoice number, receipt number, DocuSign envelope ID) are reliable fingerprints for catching these content-duplicates.
79+
7080
- **Superseded documents**: Identify files that are older versions of the same document type (e.g., "Personal banking general T&C" from 2023 vs 2025). The newer version supersedes the older. Propose trashing the older version.
81+
7182
- **Expired documents**: For time-bound documents (campaigns, offers, promotions) that specify a validity period (e.g., "1 November 2025 – 31 December 2025"), check if the end date has passed relative to today. Propose trashing expired ones. Do **not** flag standing T&Cs, KFS documents, or privacy policies — only documents with explicit campaign/offer end dates.
7283

7384
- **Not applicable**: documents covering products or services the user does not hold (other product tiers' T&C, KFS for products never subscribed, forms for other customer segments). Ask the user to confirm their actual holdings, then propose trashing the rest — documents for held products stay, as they are the contractual record of the terms in force.
7485

7586
When the user approves trashing, move the files into a dated subfolder like `~/.Trash/{folder} cleanup YYYY-MM-DD/` so the whole batch stays grouped and recoverable. Writing into `~/.Trash` is typically blocked by the command sandbox — run that step outside the sandbox.
87+
7688
8. **Verify** by listing the final result with plain binaries — `ls` may be aliased (eza, lsd) and print nothing when piped — and run a compliance sweep: `/usr/bin/find . -type f | sed 's|.*/||' | grep -Ev '^[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?(--[0-9]{4}-[0-9]{2}-[0-9]{2})? - '` should return only intentionally held files
7789

7890
## Multi-language PDF stripping
@@ -110,12 +122,12 @@ Many legal/banking documents repeat the same content translated across several l
110122

111123
This skill depends on third-party CLI tools. At the start of execution, check if each is available and propose to install any that are missing via `brew install`.
112124

113-
| Tool | Brew package | Used for |
114-
| ----------- | ------------ | ------------------------------------------------------------------------------------ |
125+
| Tool | Brew package | Used for |
126+
| ----------- | ------------ | ------------------------------------------------------------------------------------------ |
115127
| `qpdf` | `qpdf` | Extracting page ranges from PDFs (multi-language stripping), page counts (`--show-npages`) |
116-
| `pdftoppm` | `poppler` | Rendering PDF pages — the Read tool depends on it to view PDFs at all |
117-
| `pdftotext` | `poppler` | Extracting text per page for language detection in large PDFs |
118-
| `exiftool` | `exiftool` | Reading PDF metadata (CreationDate, ModDate) as date fallback |
128+
| `pdftoppm` | `poppler` | Rendering PDF pages — the Read tool depends on it to view PDFs at all |
129+
| `pdftotext` | `poppler` | Extracting text per page for language detection in large PDFs |
130+
| `exiftool` | `exiftool` | Reading PDF metadata (CreationDate, ModDate) as date fallback |
119131

120132
`mdls` (macOS built-in) can also be used for metadata and does not need installation.
121133

dotfiles/.claude/skills/session-title/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ When the user asks to refresh or rename the current session's title:
1111
Use sentence case. Capitalize the first word and proper nouns only.
1212

1313
2. **Determine the session_id and transcript path.**
14+
1415
- `session_id` is in the env var `CLAUDE_SESSION_ID` if set, otherwise: take the basename (without `.jsonl`) of the most recently modified `*.jsonl` file directly under `~/.claude/projects/<sanitized-cwd>/` where `<sanitized-cwd>` is the current working directory with `/` replaced by `-`.
1516
- The transcript path is `~/.claude/projects/<sanitized-cwd>/<session_id>.jsonl`.
1617

0 commit comments

Comments
 (0)