jetbrains-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

JetBrains Skill

JetBrains Skill

Quick start

快速开始

Goal: use JetBrains IDE features (index, inspections, refactoring, run configurations, integrated terminal) as tools for an external client, while keeping changes auditable and safe.
notes + tool list (condensed):
skills/jetbrains-skill/references/jetbrains-skill.md
.
目标:将JetBrains IDE的功能(索引、检查、重构、运行配置、集成终端)作为外部客户端的工具使用,同时确保变更可审计且安全。
说明 + 工具列表(精简版):
skills/jetbrains-skill/references/jetbrains-skill.md

Connection & modes

连接与模式

Client setup (done in the IDE)

客户端设置(在IDE中完成)

  • Settings → Tools → MCP Server
  • Enable MCP Server
  • Use “Auto-configure” for supported clients (updates their JSON config), or copy SSE / Stdio config for manual setup
  • Restart the external client to apply changes
  • 设置 → 工具 → MCP Server
  • 启用MCP Server
  • 对支持的客户端使用“自动配置”(会更新其JSON配置),或复制SSE / Stdio配置进行手动设置
  • 重启外部客户端以应用更改

Brave Mode (no confirmations)

无畏模式(无需确认)

The IDE can allow running shell commands / run configurations without per-action confirmation (“Brave mode”). This increases automation power but also increases risk. Require explicit user confirmation before enabling/disabling it.
IDE可允许在无需每次操作确认的情况下运行shell命令/运行配置(“无畏模式”)。 这会提升自动化能力,但也会增加风险。启用/禁用该模式前需获得用户明确确认。

Workflow decision tree

工作流决策树

  1. Do I need IDE-grade analysis/refactoring?
  • File diagnostics:
    get_file_problems
  • Symbol semantics / docs:
    get_symbol_info
  • Safe rename across project:
    rename_refactoring
    (prefer over plain text replace)
  • Indexed search:
    search_in_files_by_text
    /
    search_in_files_by_regex
  • Find files:
    find_files_by_name_keyword
    (fast, name-only) or
    find_files_by_glob
    (path glob)
  1. Do I just need file operations in the project?
  • Read file text:
    get_file_text_by_path
  • Create file:
    create_new_file
  • Targeted replace:
    replace_text_in_file
    (auto-saves)
  • Open in editor:
    open_file_in_editor
  • Reformat:
    reformat_file
  1. Do I need to run something?
  • List run configs:
    get_run_configurations
  • Run a config (wait for completion):
    execute_run_configuration
  • Run a terminal command in IDE:
    execute_terminal_command
    (may require confirmation; output is capped)
  1. 我是否需要IDE级别的分析/重构?
  • 文件诊断:
    get_file_problems
  • 符号语义/文档:
    get_symbol_info
  • 项目内安全重命名:
    rename_refactoring
    (优先于纯文本替换)
  • 索引搜索:
    search_in_files_by_text
    /
    search_in_files_by_regex
  • 查找文件:
    find_files_by_name_keyword
    (快速,仅按名称)或
    find_files_by_glob
    (路径通配符)
  1. 我是否仅需要项目中的文件操作?
  • 读取文件文本:
    get_file_text_by_path
  • 创建文件:
    create_new_file
  • 定向替换:
    replace_text_in_file
    (自动保存)
  • 在编辑器中打开:
    open_file_in_editor
  • 重新格式化:
    reformat_file
  1. 我是否需要运行某些内容?
  • 列出运行配置:
    get_run_configurations
  • 运行配置(等待完成):
    execute_run_configuration
  • 在IDE中运行终端命令:
    execute_terminal_command
    (可能需要确认;输出有上限)

Constraints (avoid common mistakes)

约束条件(避免常见错误)

  • Always pass
    projectPath
    when known to avoid ambiguity.
  • Many tools require paths relative to the project root and only operate on project files.
  • Line/column positions are 1-based for location-based tools.
  • Prefer controlling output with
    maxLinesCount
    +
    truncateMode
    ; do not rely on defaults for large outputs.
  • Terminal commands and running configurations are high-risk; require explicit confirmation for any potentially destructive command. Brave Mode removes guardrails.
  • 当已知
    projectPath
    时,务必传入该参数以避免歧义。
  • 许多工具要求路径相对于项目根目录,且仅对项目文件生效。
  • 基于位置的工具,其行/列位置为1起始。
  • 优先使用
    maxLinesCount
    +
    truncateMode
    控制输出;对于大输出,不要依赖默认设置。
  • 终端命令和运行配置具有高风险;对于任何可能具有破坏性的命令,需获得明确确认。无畏模式会移除这些防护措施。

Recommended high-value patterns

推荐的高价值使用模式

Debug via inspections first

先通过检查进行调试

  1. get_file_problems
    to find errors/warnings → 2)
    get_symbol_info
    to understand the code → 3)
    rename_refactoring
    for renames → 4)
    replace_text_in_file
    only for truly textual changes.
  1. 使用
    get_file_problems
    查找错误/警告 → 2) 使用
    get_symbol_info
    理解代码 → 3) 使用
    rename_refactoring
    进行重命名 → 4) 仅对纯文本变更使用
    replace_text_in_file

Use indexed search for scale

使用索引搜索实现规模化

Prefer
search_in_files_by_text
/
search_in_files_by_regex
since it uses IDE search/indexing and highlights matches with
||
.
优先使用
search_in_files_by_text
/
search_in_files_by_regex
,因为它们利用IDE的搜索/索引功能,并使用
||
高亮匹配结果。

Running and output control

运行与输出控制

Use
execute_run_configuration
with a sane
timeout
(ms). For terminal commands use
execute_terminal_command
, but remember output caps; for huge output, redirect to a file and read it via file tools.
使用
execute_run_configuration
时设置合理的
timeout
(毫秒)。对于终端命令,使用
execute_terminal_command
,但需注意输出上限;若输出量极大,可将其重定向到文件,再通过文件工具读取。

References

参考资料

  • notes + tool list (condensed):
    skills/jetbrains-skill/references/jetbrains-skill.md
  • 说明 + 工具列表(精简版):
    skills/jetbrains-skill/references/jetbrains-skill.md