feat: Junie support for Windows#137
Conversation
Junie (JetBrains' AI coding agent) ships on Windows too — as a CLI and as a JetBrains IDE plugin — but coding-discovery only detected it on macOS. This adds Windows parity (config lives in %USERPROFILE%\.junie, same layout as macOS). - WindowsJunieDetector — detects ~\.junie; multi-user via is_running_as_admin scanning C:\Users. - WindowsJunieRulesExtractor — global ~\.junie\*.md + project-level .junie\*.md; project walk uses get_windows_system_directories and the is_user_level_tool_dir guard so user-scope rules aren't reported as project-scope. - WindowsJunieMCPConfigExtractor — reads ~\.junie\mcp\mcp.json per user. - Wired Windows branches into create_junie_detector and the Junie MCP/rules factories. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Global Junie rules were tagged scope="project": _detect_rule_scope did not recognize .junie. Added .junie to its user-config dir set, and pass explicit scope="user" when extracting global rules so user-level rules are classified correctly regardless of path resolution. - Admin scan in the rules extractor skipped the system/default account exclusion (Public, Default, etc.) that the detector and MCP extractor already applied. - All three Windows Junie files reinvented the admin/non-admin loop. They now use the shared scan_windows_user_directories helper, which centralises the branching, excludes system accounts, and handles PermissionError — fixing the exclusion bug and removing the duplicated logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Addressed all review feedback (commit
|
~\.junie\mcp\mcp.json needs 3 parent levels to resolve to ~ (home), matching how every other global MCP config keys its `path`. With 2 it returned ~\.junie, inconsistently keying Junie's entry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Addressed (commit
|
~/.junie/mcp/mcp.json needs 3 parent levels to resolve its reported path to ~ (home), matching every other global MCP config. Same fix applied to Windows Junie in PR #137. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Junie (JetBrains' AI coding agent) ships on Windows too — as a CLI and as a JetBrains IDE plugin — but coding-discovery only detected it on macOS. This adds Windows parity. Junie stores its config in a user-level
.juniedirectory (%USERPROFILE%\.junie), the same layout used on macOS.What's added
WindowsJunieDetector— detects~\.junie; multi-user viais_running_as_adminscanningC:\Users, else current user.WindowsJunieRulesExtractor— global rules from~\.junie\*.mdplus project-level.junie\*.md. The project walk usesget_windows_system_directoriesand theis_user_level_tool_dirguard so user-scope rules aren't misclassified as project-scope.WindowsJunieMCPConfigExtractor— reads~\.junie\mcp\mcp.jsonper user viaread_global_mcp_config.create_junie_detector,JunieMCPConfigExtractorFactory, andJunieRulesExtractorFactory.Mirrors the existing macOS Junie implementation, adapted to Windows multi-user helpers.
Test plan
WindowsJunie*classes forWindows(macOS unchanged, Linux still N/A on this base)Linear: WEB-4495
🤖 Generated with Claude Code
Greptile Summary
This PR adds Windows support for Junie (JetBrains' AI coding agent) by introducing
WindowsJunieDetector,WindowsJunieRulesExtractor, andWindowsJunieMCPConfigExtractor, all wired into the three factory methods incoding_tool_factory.py. It also fixes scope detection inwindows_extraction_helpers.pyby adding.junieto theconfig_dir_namesset so user-level Junie rules are correctly classified.scan_windows_user_directorieshelper for consistent admin/non-admin branching and system-account exclusion._PARENT_LEVELS = 3correctly resolves~\\.junie\\mcp\\mcp.jsonto the user home directory (3 levels up), consistent with how other global MCP configs are keyed.windows_extraction_helpers._detect_rule_scopesoC:\\Users\\<user>\\.junie\\*.mdfiles returnscope: \"user\"instead of\"project\".Confidence Score: 5/5
Safe to merge — the new Windows Junie classes correctly reuse shared helpers and address all previously identified issues around scope classification, parent-level path resolution, and system-account exclusion.
All four issues raised in previous review threads (system-dir exclusion in admin scan, global rules mis-scoped as project, missing use of scan_windows_user_directories, and wrong parent_levels value) are fully addressed in this revision. The remaining observations are minor style/efficiency points in the rules extractor that do not affect correctness.
scripts/coding_discovery_tools/windows/junie/junie_rules_extractor.py — missing symlink guard and per-call system_dirs instantiation, both minor.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD Factory["coding_tool_factory.py\nFactory methods"] -->|os == Windows| WD["WindowsJunieDetector"] Factory -->|os == Windows| WR["WindowsJunieRulesExtractor"] Factory -->|os == Windows| WM["WindowsJunieMCPConfigExtractor"] WD -->|uses| SUD["scan_windows_user_directories"] WR -->|global rules via| SUD WR -->|project rules via| Walk["_walk_for_junie_dirs from C-drive root"] WM -->|per user via| SUD SUD -->|admin| AllUsers["C-Users-star excludes Public and Default"] SUD -->|non-admin| CurrentUser["Path.home()"] Walk -->|found .junie dir| IsUserLevel{"is_user_level_tool_dir?"} IsUserLevel -->|Yes| Skip["Skip - handled by global extractor"] IsUserLevel -->|No| Extract["_extract_junie_dir_rules scope=project"] WR -->|global| GlobalExtract["_extract_global_rules scope=user"] WM --> ReadConfig["read_global_mcp_config parent_levels=3 path to user home"] ScopeHelper["_detect_rule_scope\nparts-3 in config_dir_names"] -->|True| ScopeUser["scope: user"] ScopeHelper -->|False| ScopeProject["scope: project"] Note["'.junie' added to config_dir_names"] -.-> ScopeHelperReviews (4): Last reviewed commit: "fix: Junie MCP parent_levels 2 -> 3 so p..." | Re-trigger Greptile