claude-code-autoconfig 1.0.108 → 1.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ <!-- @screenshotDir -->
1
2
  Get the latest screenshot(s) and display them.
2
3
 
3
4
  Usage:
@@ -5,51 +6,83 @@ Usage:
5
6
  - `/gls-2` - Get and display the 2 most recent screenshots
6
7
  - `/gls-3` - Get and display the 3 most recent screenshots
7
8
  - `/gls-N` - Get and display the N most recent screenshots
9
+ - `/gls /path/to/dir` - Use a specific directory and save it
8
10
 
9
- ## Step 1: Detect screenshot directory
11
+ ## Step 1: Check for saved path
10
12
 
11
- Find the screenshot directory by checking these paths in order. Use the Bash tool with `ls -d` to test existence. Stop at the **first match**.
13
+ Check the `@screenshotDir` comment on line 1 of THIS file. If it has a path (not empty), use that path and skip to Step 3.
12
14
 
13
- **macOS:**
14
- 1. Run `defaults read com.apple.screencapture location 2>/dev/null` — if it returns a path that exists, use it
15
- 2. `~/Desktop`
16
- 3. `~/Pictures/Screenshots`
15
+ If it's empty (i.e., `<!-- @screenshotDir -->`), continue to Step 2.
17
16
 
18
- **Windows (Git Bash / MSYS paths):**
19
- 1. `~/OneDrive/Pictures/Screenshots*` (glob — OneDrive creates numbered variants like `Screenshots 1`)
20
- 2. `~/Pictures/Screenshots`
21
- 3. `~/Desktop`
17
+ ## Step 2: Detect screenshot directory
22
18
 
23
- **Linux:**
24
- 1. Check `$XDG_PICTURES_DIR/Screenshots` if `XDG_PICTURES_DIR` is set
25
- 2. `~/Pictures/Screenshots`
26
- 3. `~/Pictures`
27
- 4. `~/Desktop`
19
+ If the user provides a path as an argument (e.g., `/gls /path/to/dir`), use that path and skip to Step 2b.
28
20
 
29
- Detect the OS using `uname -s` (Darwin = macOS, Linux = Linux, MINGW*/MSYS*/CYGWIN* = Windows).
21
+ Otherwise, detect the OS and find the screenshot directory. Run this **single Bash command** which finds all candidate directories and reports the newest screenshot in each:
30
22
 
31
- If no candidate directory exists, tell the user: "Could not find a screenshot directory. Set one with `/gls /path/to/screenshots`."
23
+ ```bash
24
+ OS=$(uname -s); echo "OS=$OS"; for d in \
25
+ "$HOME/OneDrive/Pictures/Screenshots"* \
26
+ "$HOME/Pictures/Screenshots" \
27
+ "$HOME/Desktop" \
28
+ "$HOME/Pictures" \
29
+ "$HOME/Videos/Captures"; do \
30
+ [ -d "$d" ] || continue; \
31
+ newest=$(ls -t "$d"/*.png "$d"/*.jpg "$d"/*.jpeg "$d"/*.bmp "$d"/*.webp "$d"/*.gif 2>/dev/null | head -1); \
32
+ if [ -n "$newest" ]; then \
33
+ echo "HAS_IMAGES: $d | newest: $newest"; \
34
+ else \
35
+ echo "EMPTY: $d"; \
36
+ fi; \
37
+ done; \
38
+ [ "$OS" = "Darwin" ] && defaults read com.apple.screencapture location 2>/dev/null && echo "(macos-custom)"; \
39
+ [ "$OS" = "Linux" ] && [ -n "$XDG_PICTURES_DIR" ] && [ -d "$XDG_PICTURES_DIR/Screenshots" ] && echo "EXISTS: $XDG_PICTURES_DIR/Screenshots"
40
+ ```
32
41
 
33
- If the user provides a path as an argument (e.g., `/gls /path/to/dir`), use that path directly and skip detection.
42
+ Pick the screenshot directory using these rules:
34
43
 
35
- ## Step 2: List screenshots
44
+ 1. **macOS only**: If `(macos-custom)` appears in the output, prefer that path.
45
+ 2. Among all `HAS_IMAGES` directories, pick the one whose newest screenshot has the **most recent modification time** (the file paths are shown after `newest:`— compare them).
46
+ 3. If no directories have images, fall back to the first `EMPTY` directory (screenshots will land there eventually).
47
+ 4. If there are no candidate directories at all, detection has failed.
36
48
 
37
- List all image files (*.png, *.jpg, *.jpeg, *.bmp, *.webp) in the detected directory, sorted by modification time (newest first). Use `ls -t` via Bash.
49
+ ### If detection fails
38
50
 
39
- ## Step 3: Select screenshots
51
+ Ask the user:
40
52
 
41
- - If command is `/gls`, get the 1 most recent screenshot
42
- - If command is `/gls-N` (e.g., `/gls-2`), get the N most recent screenshots
53
+ > Unable to detect your screenshot directory. Please enter your screenshot path to continue:
43
54
 
44
- ## Step 4: Display
55
+ Wait for the user to respond with a path, then use that path.
45
56
 
46
- Use the Read tool to display each screenshot. Display in order from newest to oldest.
57
+ ### Step 2b: Save the path
47
58
 
48
- ## Step 5: Wait
59
+ Use the Edit tool to update line 1 of THIS file, replacing the empty `@screenshotDir` tag with the detected (or user-provided) path. For example:
49
60
 
50
- Wait for the user to tell you what to do with the screenshot(s). Do not make assumptions about what they want done.
61
+ `<!-- @screenshotDir /c/Users/jane/Pictures/Screenshots -->`
51
62
 
52
- Important:
53
- - Always use the Read tool to display screenshots (not Bash cat/echo)
54
- - Display screenshots in order from newest to oldest
55
- - After displaying, wait for user instructions
63
+ This ensures detection only happens once per project.
64
+
65
+ ## Step 3: List screenshots
66
+
67
+ Run this command (substitute the resolved directory for `$DIR`):
68
+
69
+ ```bash
70
+ ls -t "$DIR"/*.png "$DIR"/*.jpg "$DIR"/*.jpeg "$DIR"/*.bmp "$DIR"/*.webp "$DIR"/*.gif 2>/dev/null | head -20
71
+ ```
72
+
73
+ If no images are found, tell the user the directory exists but contains no screenshots. Suggest taking a screenshot first or specifying a different directory with `/gls /path/to/dir`.
74
+
75
+ ## Step 4: Select screenshots
76
+
77
+ - `/gls` → 1 most recent
78
+ - `/gls-N` (e.g., `/gls-2`) → N most recent
79
+
80
+ ## Step 5: Display
81
+
82
+ Use the **Read tool** to display each screenshot file. Display in order from newest to oldest.
83
+
84
+ IMPORTANT: Always use the Read tool — never use Bash cat/echo to display images.
85
+
86
+ ## Step 6: Wait
87
+
88
+ Wait for the user to tell you what to do with the screenshot(s). Do not make assumptions about what they want.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-autoconfig",
3
- "version": "1.0.108",
3
+ "version": "1.0.109",
4
4
  "description": "Intelligent, self-configuring setup for Claude Code. One command analyzes your project, configures Claude, and shows you what it did.",
5
5
  "author": "ADAC 1001 <info@adac1001.com>",
6
6
  "license": "MIT",