Folder Index
Maintain a lightweight index at ~/.config/folder-index.json to know where important things are without rescanning.
{
"folders": [
{"path": "/Users/alex/projects/webapp", "type": "project", "note": "Main client project"}
]
}
When user asks "where is X" or "find my project Y", check the index first. If not found, do targeted discovery then offer to add the result.
Discovery
When asked to find or index folders:
- Scan likely locations: ~/projects, ~/Documents, ~/code, ~/dev, ~/work
- Detect projects by markers: .git, package.json, pubspec.yaml, Cargo.toml, go.mod, pyproject.toml, *.sln
- Stop at first marker (don't recurse into node_modules, vendor, build)
- Propose what was found, don't auto-add: "Found 8 projects in ~/code. Add to index?"
Path Security
- Canonicalize paths (resolve
~, .., symlinks) before any operation
- Reject system paths: /, /etc, /var, /usr, /System, /Library, C:\Windows, C:\Program Files
- Skip symlinks during traversal, report them separately
Destructive Operations
- Use OS trash instead of permanent delete
- State recoverability: "node_modules: recoverable with npm install"
- Build artifacts safe to delete: node_modules, pycache, .gradle, build/, target/, Pods/, .next/
Platform Quirks
- macOS: .DS_Store alone = effectively empty. Treat .app as single item.
- Windows: Paths >260 chars need
\\?\ prefix.
- Network drives: Warn before bulk ops — may be slow or offline.
1---
2name: folders
3description: Index important directories and perform safe folder operations with proper security checks.
4metadata:
5 source: https://skillmd.com/skills/modbender/folders
6 clawdbot:
7 emoji: 📂
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14## Folder Index
15
16Maintain a lightweight index at `~/.config/folder-index.json` to know where important things are without rescanning.
17
18```json
19{
20 "folders": [
21 {"path": "/Users/alex/projects/webapp", "type": "project", "note": "Main client project"}
22 ]
23}
24```
25
26When user asks "where is X" or "find my project Y", check the index first. If not found, do targeted discovery then offer to add the result.
27
28## Discovery
29
30When asked to find or index folders:
31- Scan likely locations: ~/projects, ~/Documents, ~/code, ~/dev, ~/work
32- Detect projects by markers: .git, package.json, pubspec.yaml, Cargo.toml, go.mod, pyproject.toml, *.sln
33- Stop at first marker (don't recurse into node_modules, vendor, build)
34- Propose what was found, don't auto-add: "Found 8 projects in ~/code. Add to index?"
35
36## Path Security
37
38- Canonicalize paths (resolve `~`, `..`, symlinks) before any operation
39- Reject system paths: /, /etc, /var, /usr, /System, /Library, C:\Windows, C:\Program Files
40- Skip symlinks during traversal, report them separately
41
42## Destructive Operations
43
44- Use OS trash instead of permanent delete
45- State recoverability: "node_modules: recoverable with npm install"
46- Build artifacts safe to delete: node_modules, __pycache__, .gradle, build/, target/, Pods/, .next/
47
48## Platform Quirks
49
50- **macOS:** .DS_Store alone = effectively empty. Treat .app as single item.
51- **Windows:** Paths >260 chars need `\\?\` prefix.
52- **Network drives:** Warn before bulk ops — may be slow or offline.