Add support for Junie from JetBrains tool and command generation - #853
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds support for the Junie tool: new command adapter implementation and export, registry registration, AI_TOOLS entry, legacy command path patterns, docs update, and tests verifying adapter registration. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as CLI/Generator
participant Registry as CommandAdapterRegistry
participant Adapter as junieAdapter
participant FS as FileSystem
CLI->>Registry: request adapter for "junie"
Registry-->>CLI: returns junieAdapter
CLI->>Adapter: build CommandContent + commandId
Adapter-->>CLI: filePath (".junie/commands/opsx-<id>.md") and formattedContent
CLI->>FS: write filePath with formattedContent
FS-->>CLI: write success
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
test/core/command-generation/registry.test.ts (1)
24-28: Add Junie behavior assertions, not only registry presence.Lines 24-28 and Line 63 validate registration, but they don’t verify Junie-specific path/format behavior. A broken Junie adapter implementation could still pass these tests.
Suggested test additions
@@ it('registered adapters should have working getFilePath', () => { const claudeAdapter = CommandAdapterRegistry.get('claude'); const cursorAdapter = CommandAdapterRegistry.get('cursor'); const windsurfAdapter = CommandAdapterRegistry.get('windsurf'); + const junieAdapter = CommandAdapterRegistry.get('junie'); expect(claudeAdapter?.getFilePath('test')).toContain('.claude'); expect(cursorAdapter?.getFilePath('test')).toContain('.cursor'); expect(windsurfAdapter?.getFilePath('test')).toContain('.windsurf'); + expect(junieAdapter?.getFilePath('test')).toContain('.junie'); + expect(junieAdapter?.getFilePath('test')).toContain('opsx-test.md'); }); @@ const adapters = CommandAdapterRegistry.getAll(); for (const adapter of adapters) { const output = adapter.formatFile(content); @@ } + + const junieOutput = CommandAdapterRegistry.get('junie')?.formatFile(content) ?? ''; + expect(junieOutput).toContain('description: Test desc'); + expect(junieOutput).toContain('Body content'); });Also applies to: 63-63
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/core/command-generation/registry.test.ts` around lines 24 - 28, The test currently only checks registry presence for CommandAdapterRegistry.get('junie'); extend it to exercise Junie-specific behavior by calling the adapter's public formatting/build method(s) (e.g., adapter.formatCommand(...) or adapter.buildCommand(...) — whichever the CommandAdapter interface exposes) with a representative input and assert the returned path/format/command matches Junie expectations (for example specific path prefix, file extension, or command structure) in the same test block (and similarly at the other location around line 63); keep the existing toolId assertion and add one or two focused assertions that validate Junie-specific output so a broken Junie adapter implementation will fail the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/supported-tools.md`:
- Line 39: Update the Junie table row to match the rest of the table convention
by adding the tool ID and concrete include/exclude patterns: replace the current
row containing "Junie | `.junie/skills/` | `.junie/commands/`" with a
four-column entry that includes the tool ID (e.g., "junie") and explicit pattern
entries (for example, include pattern like ".junie/**" and specific subfolder
patterns such as ".junie/skills/**" and ".junie/commands/**") so the Junie row
uses the same columns and concrete patterns as other tool rows.
In `@src/core/legacy-cleanup.ts`:
- Line 56: The Junie legacy cleanup entry currently uses the glob pattern
'.junie/commands/openspec-*.md' but Junie generator actually emits files named
'opsx-*.md' (see the 'junie' mapping in legacy-cleanup.ts); update the 'junie'
mapping's pattern to match the generated filenames (e.g., change to
'.junie/commands/opsx-*.md' or include both patterns) so stale Junie command
files are detected and removed by the cleanup flow.
---
Nitpick comments:
In `@test/core/command-generation/registry.test.ts`:
- Around line 24-28: The test currently only checks registry presence for
CommandAdapterRegistry.get('junie'); extend it to exercise Junie-specific
behavior by calling the adapter's public formatting/build method(s) (e.g.,
adapter.formatCommand(...) or adapter.buildCommand(...) — whichever the
CommandAdapter interface exposes) with a representative input and assert the
returned path/format/command matches Junie expectations (for example specific
path prefix, file extension, or command structure) in the same test block (and
similarly at the other location around line 63); keep the existing toolId
assertion and add one or two focused assertions that validate Junie-specific
output so a broken Junie adapter implementation will fail the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 038bb184-1c73-4298-a576-d6b5d537cc94
📒 Files selected for processing (7)
docs/supported-tools.mdsrc/core/command-generation/adapters/index.tssrc/core/command-generation/adapters/junie.tssrc/core/command-generation/registry.tssrc/core/config.tssrc/core/legacy-cleanup.tstest/core/command-generation/registry.test.ts
…entation accordingly
|
Hi @TabishB can you please check if everything is ok? |
Include both `junie` and `forgecode` in the tool IDs list.
…sion-AI#853) * Add support for Junie from JetBrains tool and command generation * Expand Junie support to include `opsx` file patterns and update documentation accordingly --------- Co-authored-by: TabishB <tabishbidiwale@gmail.com>
… run (Fission-AI#1492) LEGACY_SLASH_COMMAND_PATHS lists artifacts older OpenSpec versions left behind, so init and update remove whatever matches. Two entries named paths the current adapters still write to. `costrict` was a whole-directory entry for `.cospec/openspec/commands`, the folder its adapter writes `opsx-<id>.md` into, so every run deleted the directory and everything in it — including files the user put there — under a heading reading 'No user content to preserve'. It is now a file pattern for `.cospec/openspec/commands/openspec-*.md`: the only files that folder ever held before the opsx rename were openspec-proposal.md, openspec-apply.md and openspec-archive.md, written by the slash configurator added in Fission-AI#240 and dropped in Fission-AI#565. `junie` listed `.junie/commands/opsx-*.md`, its adapter's own output, next to `openspec-*.md`. Both halves arrived in Fission-AI#853 one file apart, so the entry has collided with itself since day one. Cleanup runs before migrateIfNeeded, so on a config with no `profile` key yet — the state after a first init — the deleted command files make inferDelivery read the project as skills-only and write that to the global config. The files are not regenerated, and the delivery preference changes for every other project too. The entry is removed rather than narrowed. Junie support landed in Fission-AI#853, months after Fission-AI#565 deleted the slash configurators that wrote `openspec-*` files, and no junie configurator ever existed — so `.junie/commands/openspec-*.md` is a shape OpenSpec never produced. The same reasoning already keeps `.devin/` off the list two lines above. The regression test is an invariant rather than a fixture — it writes every registered adapter's output for every workflow into a temp project and asserts detection reports nothing — and it names codex, the one legacy id with no adapter, instead of silently skipping it. Nothing else changes. The surviving `openspec-*` globs stay as broad as they have always been, since narrowing them to the three ids the pre-opsx configurators actually wrote is a separate, uniform change, and qwen's `opsx-*.toml` pair stays because its adapter emits Markdown now.
Added support for Junie, an AI agent from JetBrains
Summary by CodeRabbit