Skip to content

feat: add support for JetBrains Junie commands - #1293

Merged
dyoshikawa merged 4 commits into
dyoshikawa:mainfrom
dacgray:add-commands-to-junie
Mar 9, 2026
Merged

feat: add support for JetBrains Junie commands#1293
dyoshikawa merged 4 commits into
dyoshikawa:mainfrom
dacgray:add-commands-to-junie

Conversation

@dacgray

@dacgray dacgray commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Implements the JunieCommand class and integrates it into the CommandsProcessor to enable command generation and import for JetBrains Junie. This allows rulesync to manage AI commands stored in the .junie/commands directory, supporting both project-level and global configurations with specific frontmatter handling.

Implements the JunieCommand class and integrates it into the CommandsProcessor to enable command generation and import for JetBrains Junie. This allows rulesync to manage AI commands stored in the .junie/commands directory, supporting both project-level and global configurations with specific frontmatter handling.
@dyoshikawa-claw

This comment has been minimized.

@github-actions

This comment has been minimized.

dacgray added 2 commits March 9, 2026 13:26
Adds test cases for body retrieval and validation skipping in Cline and Kilo commands. Refactors the Junie command test suite to use real file system utilities and provide comprehensive coverage for conversion logic and file loading.
@dacgray

dacgray commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

I've expanded test coverage.

/opencode other recommendations are out of scope for this PR.

@dyoshikawa-claw

This comment has been minimized.

@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

PR #1293 Review - JetBrains Junie Commands Support (Updated)

Overall Mergeability Verdict: CONDITIONALLY MERGEABLE

The original critical issue (test coverage significantly below standards) has been addressed. The test file expanded from ~120 lines to 352 lines with proper test utilities. One new HIGH severity finding exists, but the author has indicated additional work is out of scope for this PR.


Code Review Findings

  1. HIGH: Missing global mode tests in junie-command.test.ts

    • JunieCommand is configured with supportsGlobal: true
    • No tests for fromRulesyncCommand or fromFile with global: true
    • Other commands in this PR (cline-command.test.ts, kilo-command.test.ts) include global mode tests
    • src/features/commands/junie-command.test.ts
  2. MEDIUM: Missing validate() test for undefined frontmatter

    • Guard clause exists but isn't tested
    • src/features/commands/junie-command.ts:123-128
  3. MEDIUM: Missing getSettablePaths test with global option

    • Should test both { global: true } and { global: false }
    • src/features/commands/junie-command.test.ts:146-151
  4. LOW: Missing file not found error test

    • No test for fromFile error handling
  5. LOW: Missing validate parameter tests

    • No tests for validate: false in fromRulesyncCommand and fromFile

Security Review Findings

  1. MEDIUM: Path traversal - defense-in-depth issue

    • fromFile() doesn't validate relativeFilePath directly
    • Protected at caller level (CommandsProcessor, MCP) but lacks defense-in-depth
    • Applies to all ToolCommand subclasses, not just Junie
    • src/features/commands/junie-command.ts:156
  2. LOW: Missing path traversal tests

    • No test cases for path traversal validation in JunieCommand
  3. INFORMATIONAL: process.cwd() as default

    • Standard CLI practice - no issue

Positive Observations

✅ Test coverage significantly improved (352 lines vs ~120 original)
✅ Proper use of setupTestDirectory() and mocking
✅ Core functionality well tested (constructor, conversions, file loading)
✅ Field passthrough tests exist
✅ Implementation follows coding guidelines
✅ CommandsProcessor integration correct
✅ Strong Zod validation for frontmatter
✅ No command injection or secrets handling risks


Recommendations

github run

github run

Adds test cases to verify handling of extra frontmatter fields, global path resolution, and default frontmatter initialization. Includes an explanatory comment in the source code regarding the current directory structure logic for JetBrains Junie commands.
@dyoshikawa
dyoshikawa merged commit bab7657 into dyoshikawa:main Mar 9, 2026
6 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner

@dacgray Thank you!

@dacgray
dacgray deleted the add-commands-to-junie branch March 9, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants