You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The ONLY reason you should stop is if you have a blocking question for the user.
4
4
5
5
---
6
6
7
-
# TrimTrailingWhitespace - AI Agent Guide
7
+
# Whitespace - AI Agent Guide
8
8
9
9
Smart case-aware search and replace across code and files with atomic apply and undo.
10
10
@@ -22,7 +22,7 @@ They should be mentioned in any package files, copyright notices, etc.
22
22
23
23
## Deliverables
24
24
25
-
- Rust core library and CLI (`trim-trailing-whitespace-core`, `trim-trailing-whitespace-cli`)
25
+
- Rust core library and CLI (`whitespace-core`, `whitespace-cli`)
26
26
- VS Code extension (TypeScript) that shells out to the CLI
27
27
- MCP server (TypeScript) that wraps the CLI and exposes tools for Cursor or other MCP clients
28
28
@@ -45,16 +45,16 @@ They should be mentioned in any package files, copyright notices, etc.
45
45
- JSON for plan and history
46
46
- TypeScript for VS Code extension and MCP wrapper
47
47
-`ts-rs` for automatic TypeScript type generation from Rust structs
48
-
- Types are generated as ambient `.d.ts` files in `trim-trailing-whitespace-core/bindings/`
48
+
- Types are generated as ambient `.d.ts` files in `whitespace-core/bindings/`
49
49
- VS Code and MCP projects include these bindings directly in their tsconfig
50
50
- Optional Node bindings in future via `napi-rs` if needed
51
51
52
52
## Functional scope
53
53
54
54
- Case styles: snake_case, kebab-case, camelCase, PascalCase, SCREAMING_SNAKE_CASE, Title Case, Train-Case, dot.case
55
-
- Plan: generate all old variants, map to new variants, create a single search program, scan once, write `.trim-trailing-whitespace/plan.json`
55
+
- Plan: generate all old variants, map to new variants, create a single search program, scan once, write `.whitespace/plan.json`
56
56
- Apply: update file contents, then rename files and directories, all atomically
57
-
- Undo and redo: `.trim-trailing-whitespace/history.json` with checksums
57
+
- Undo and redo: `.whitespace/history.json` with checksums
58
58
- Conflicts: re-validate hunks, auto-resolve simple formatting shifts, stop on real conflicts unless forced
59
59
- Respect ignore files by default (`.gitignore`, `.ignore`, `.rgignore`, `.rnignore`), allow include and exclude globs
60
60
- Exclude binary files by default
@@ -68,10 +68,10 @@ They should be mentioned in any package files, copyright notices, etc.
68
68
69
69
## Repo layout
70
70
71
-
-`trim-trailing-whitespace-core` - core logic
72
-
-`trim-trailing-whitespace-cli` - CLI frontend
73
-
-`trim-trailing-whitespace-mcp` - MCP server
74
-
-`trim-trailing-whitespace-vscode` - VS Code extension
71
+
-`whitespace-core` - core logic
72
+
-`whitespace-cli` - CLI frontend
73
+
-`whitespace-mcp` - MCP server
74
+
-`whitespace-vscode` - VS Code extension
75
75
-`docs` - Starlight documentation
76
76
77
77
## Agent roles and behavior
@@ -97,27 +97,27 @@ They should be mentioned in any package files, copyright notices, etc.
97
97
- Snapshot tests for plans and diffs
98
98
- Fuzz tests for regex generation to prevent backtracking issues
99
99
- Cross platform tests including Windows path edge cases
100
-
- Lock signal integration tests rely on the `wait_for_lock_state` polling helper (see `trim-trailing-whitespace-cli/src/test_lock_signals.rs`); avoid reintroducing fixed sleeps that cause macOS flakes
100
+
- Lock signal integration tests rely on the `wait_for_lock_state` polling helper (see `whitespace-cli/src/test_lock_signals.rs`); avoid reintroducing fixed sleeps that cause macOS flakes
101
101
102
102
## CLI contract
103
103
104
-
Binary: `trim-trailing-whitespace`
104
+
Binary: `whitespace`
105
105
106
106
Commands:
107
107
108
-
-`trim-trailing-whitespace plan <old> <new> [opts]`
108
+
-`whitespace plan <old> <new> [opts]`
109
109
-`--include``--exclude``--respect-gitignore` (default true, respects all ignore files)
- Project configuration including atomic identifiers
142
142
-`atomic = ["DocSpring", "GitHub", "GitHub"]` - identifiers treated as indivisible units
@@ -151,7 +151,7 @@ Exit codes:
151
151
6. For file and directory names, detect and schedule renames with depth ordering
152
152
7. Emit `plan.json` and fast summary stats
153
153
154
-
-`--ignore-ambiguous` now prunes ambiguous identifiers (plain words that map to multiple styles) before matching or renaming; make sure new search variants respect this toggle and keep tests in `trim-trailing-whitespace-core/tests/ignore_ambiguous_test.rs` passing.
154
+
-`--ignore-ambiguous` now prunes ambiguous identifiers (plain words that map to multiple styles) before matching or renaming; make sure new search variants respect this toggle and keep tests in `whitespace-core/tests/ignore_ambiguous_test.rs` passing.
155
155
156
156
- Implementation note: `scan_repository_multi` pre-filters candidate files with an `AhoCorasick` automaton, processes them in parallel via `rayon`, and only runs the expensive compound identifier scan on lines discovered by direct variant hits or token heuristics. When adjusting matching logic, keep the `token_line_hits` bookkeeping in sync with the `additional_lines` fed into `find_enhanced_matches`.
0 commit comments