@@ -21,16 +21,42 @@ agents:
2121
2222 ## Setup
2323
24- 1. Call `get_memories` to get the list of already-scanned paths.
25- Each entry has the form `scanned: <path> YYYY-MM-DD`.
26- 2. Use `list_directory` to explore `content/manuals/` and find a leaf
27- directory (no subdirectories) whose path does NOT appear in memory.
28- Skip: content/reference/, content/languages/, content/tags/,
29- content/includes/. If all leaves have been scanned, pick the one
30- with the oldest date.
31- 3. Call `directory_tree` on that leaf and read all its files
32- 4. File issues for what you find (max 3 per run)
33- 5. Call `add_memory` with `scanned: <path> YYYY-MM-DD`
24+ 1. Read `.cache/scan-history.json` using `read_file`.
25+ This file tracks every previously scanned directory as a JSON object:
26+ ```json
27+ {
28+ "scanned": {
29+ "content/manuals/desktop/networking/": "2026-02-24",
30+ "content/manuals/build/cache/": "2026-02-23"
31+ }
32+ }
33+ ```
34+ If the file does not exist or is empty, treat it as `{"scanned": {}}`.
35+
36+ 2. Call `get_memories` to load any learned patterns from previous scans
37+ (false positives to skip, codebase context, human feedback).
38+
39+ 3. Use `list_directory` to explore `content/manuals/` and find all leaf
40+ directories (no subdirectories). Skip these top-level paths entirely:
41+ content/reference/, content/languages/, content/tags/,
42+ content/includes/.
43+
44+ 4. Pick a leaf directory to scan:
45+ - FIRST CHOICE: a directory that does NOT appear in scan-history.json
46+ - FALLBACK: if every leaf directory has been scanned, pick the one
47+ with the OLDEST date in scan-history.json
48+
49+ 5. Call `directory_tree` on the selected leaf and read all its files.
50+
51+ 6. Analyze and file issues for what you find (max 3 per run).
52+
53+ 7. After scanning, update `.cache/scan-history.json` using `write_file`.
54+ Read the current content, add or update the scanned path with today's
55+ date (YYYY-MM-DD), and write the full updated JSON back.
56+
57+ 8. If you learn anything useful for future scans (false positive patterns,
58+ codebase context), call `add_memory` to store it. Do NOT use
59+ `add_memory` for scan tracking — that is what scan-history.json is for.
3460
3561 ## What good issues look like
3662
@@ -107,6 +133,7 @@ agents:
107133 tools :
108134 - read_file
109135 - read_multiple_files
136+ - write_file
110137 - list_directory
111138 - directory_tree
112139 - type : memory
0 commit comments