Agent SkillsDetachHead/rebased › remote-dev

remote-dev

GitHub

提供 IntelliJ 远程开发模块的结构化指南,规范前后端分离架构、RPC 通信及序列化规则,指导插件开发者正确拆分模块并实现跨进程交互。

.claude/skills/remote-dev/SKILL.md DetachHead/rebased

Trigger Scenarios

开发 IntelliJ 远程开发功能 重构插件以支持远程开发

Install

npx skills add DetachHead/rebased --skill remote-dev -g -y
More Options

Non-standard path

npx skills add https://github.com/DetachHead/rebased/tree/master/.claude/skills/remote-dev -g -y

Use without installing

npx skills use DetachHead/rebased@remote-dev

指定 Agent (Claude Code)

npx skills add DetachHead/rebased --skill remote-dev -a claude-code -g -y

安装 repo 全部 skill

npx skills add DetachHead/rebased --all -g -y

预览 repo 内 skill

npx skills add DetachHead/rebased --list

SKILL.md

Frontmatter
{
    "name": "remote-dev",
    "description": "Guidelines for structuring and developing IntelliJ remote development modules. Use when working on Remote Development features."
}

Remote Development

Basics

  • Structure modules using proper suffixes:
    • .frontend - UI code that runs on client side
    • .backend - computation code that runs on server side
    • .shared - code common to both frontend and backend
  • Use RPC for frontend-backend communication:
    • Create interfaces with @Rpc annotation in shared module
    • Implement interfaces on backend side
    • Use RemoteApiProvider to register implementations
    • All RPC methods must be suspend functions
    • All parameters and return values must be @Serializable
  • When working with backend objects on frontend:
    • Use ID serialization (e.g., VirtualFile.rpcId() and VirtualFileId.virtualFile())
    • For state synchronization, use StateFlow and Flow
  • Don't access on frontend:
    • PSI, indexes, file system (directly), VCS
    • Debugger, build systems, modules
    • Any backend-only services and APIs

Documentation

Detailed documentation in docs/IntelliJ-Platform/4_man/Remote-Development/:

External: Remote Development Overview (user documentation)

Creating Remote Development Modules

Module Types and Naming Conventions

  • Standard Module: intellij.<pluginGroup>.<frameworkName> Example: intellij.java.dsm, intellij.cidr.debugger

  • Remote Development Modules (split architecture):

    • Shared Module: intellij.<feature>
    • RPC Module: intellij.<feature>.rpc (for RPC interfaces)
    • Backend Module: intellij.<feature>.backend
    • Frontend Module: intellij.<feature>.frontend
    • Split Modules: intellij.<feature>.frontend.split, intellij.<feature>.backend.split

For Platform Modules

  1. Shared Module:
  • If working with existing module: Keep as is
  • For new module: Create in platform/feature/ following V2 plugin format
  1. RPC Module (if needed):
  • Create in platform/feature-rpc/ for RPC interfaces
  • Extract all @Rpc interfaces, DTOs, and supporting classes
  • Add dependencies on required serialization libraries
  • This module should have no implementation logic
  1. Backend Module:
  • Create in platform/feature/backend/
  • Include intellij.platform.feature.backend.xml in resources
  • Add dependency on intellij.platform.backend
  • Add to essential-modules.xml
  1. Frontend Module:
  • Create in platform/feature/frontend/
  • Include intellij.platform.feature.frontend.xml in resources
  • Add dependency on intellij.platform.frontend
  • Add to essential-modules.xml and intellij.platform.frontend.main.iml
  • Add to JetBrains Client's product-modules.xml
  1. Frontend Split Module (if needed):
  • Create in remote-dev/feature/frontend.split
  • Configure as V2 plugin module
  • Add to product-modules.xml and JetBrainsClientPlugin.xml

For Plugins in Monorepo

  1. Shared Module:
  • Keep shared code in main plugin module
  • Register in appropriate product-modules.xml for bundling
  1. RPC Module:
  • Create with .rpc suffix for RPC interfaces
  • Contains only RPC interfaces, DTOs, and supporting classes
  • Register in plugin.xml
  • Both frontend and backend modules depend on this
  1. Backend Module:
  • Create with .backend suffix as V2 plugin module
  • Add dependency on intellij.platform.backend and .rpc module
  • Register in plugin.xml
  1. Frontend Module:
  • Create with .frontend suffix as V2 plugin module
  • Add dependency on intellij.platform.frontend and .rpc module
  • Register in plugin.xml
  1. Frontend Split Module:
  • Create with .frontend.split suffix in appropriate location
  • Add dependency on intellij.platform.frontend.split
  • Register in plugin.xml

Reactive Programming Patterns for Remote Development

Key Patterns for Reactive State in Remote Development

The following patterns are essential when implementing reactive UI components for Remote Development:

  1. Backend StateFlow with Initial Value Transfer:
  • Use StateFlow for all mutable state on the backend
  • Add initial values in DTOs to avoid blocking calls on the frontend
  • Use .toRpc() extension to convert StateFlow to RpcFlow for RPC transfer
  1. Converting RpcFlow to StateFlow on Frontend:
  • Use toFlow().stateIn() pattern to convert RpcFlow to StateFlow
  • Always provide initial values from DTO to ensure immediate UI feedback
  • Use SharingStarted.Eagerly for UI components that need immediate updates
  1. Example: Reactive Breakpoint DTO

    // Flow-based DTO with initial values
    @Serializable
    data class XBreakpointDto(
      // Static properties
      val displayText: String,
      val iconId: IconId,
      val sourcePosition: XSourcePositionDto?,
    
      // Initial values for immediate use
      val initialEnabled: Boolean,
      val initialSuspendPolicy: SuspendPolicy,
    
      // Reactive flow fields
      val enabledState: RpcFlow<Boolean>,
      val suspendPolicyState: RpcFlow<SuspendPolicy>,
    )
    
  2. Example: Frontend Component with Reactive State

    class FrontendXBreakpointProxy(
      private val project: Project,
      private val cs: CoroutineScope,
      private val dto: XBreakpointDto
    ) {
      // Convert RpcFlow to StateFlow with initial values
      val enabled: StateFlow<Boolean> = dto.enabledState.toFlow()
        .stateIn(cs, SharingStarted.Eagerly, dto.initialEnabled)
    
      // Access current value from StateFlow
      fun isEnabled(): Boolean = enabled.value
    }
    

Version History

  • 1f8708d Current 2026-08-16 15:39

Same Skill Collection

.agents/skills/actions/SKILL.md
.agents/skills/code-style/SKILL.md
.agents/skills/commits/SKILL.md
.agents/skills/debugging/SKILL.md
.agents/skills/driver-ui-tests/SKILL.md
.agents/skills/eel/SKILL.md
.agents/skills/extract-module/SKILL.md
.agents/skills/module-dependencies/SKILL.md
.agents/skills/module-set-pluginization/SKILL.md
.agents/skills/notebook-for-experiment/SKILL.md
.agents/skills/pseudo-kmp/SKILL.md
.agents/skills/registry/SKILL.md
.agents/skills/remote-dev/SKILL.md
.agents/skills/safe-push/SKILL.md
.agents/skills/ssr/SKILL.md
.agents/skills/testing-internals/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/ui-accessibility/SKILL.md
.agents/skills/writing-tests/SKILL.md
.claude/skills/actions/SKILL.md
.claude/skills/code-style/SKILL.md
.claude/skills/commits/SKILL.md
.claude/skills/debugging/SKILL.md
.claude/skills/driver-ui-tests/SKILL.md
.claude/skills/eel/SKILL.md
.claude/skills/extract-module/SKILL.md
.claude/skills/jewel-pr-preparer/SKILL.md
.claude/skills/jewel-release-helper/SKILL.md
.claude/skills/managing-youtrack/SKILL.md
.claude/skills/module-dependencies/SKILL.md
.claude/skills/module-set-pluginization/SKILL.md
.claude/skills/notebook-for-experiment/SKILL.md
.claude/skills/pseudo-kmp/SKILL.md
.claude/skills/registry/SKILL.md
.claude/skills/safe-push/SKILL.md
.claude/skills/ssr/SKILL.md
.claude/skills/testing-internals/SKILL.md
.claude/skills/testing/SKILL.md
.claude/skills/ui-accessibility/SKILL.md
.claude/skills/writing-tests/SKILL.md

Metadata

Files
0
Version
1f8708d
Hash
4ce47609
Indexed
2026-08-16 15:39

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 16:41
浙ICP备14020137号-1 $mapa de visitantes$