AI-Assisted Programming
RuoYi AI documentation
This guide covers RuoYi AI. Help improve it by reporting problems in an issue.
This tutorial uses Claude Code to illustrate AI-assisted development. The beginner section covers installation, configuration, and daily operations. The advanced section introduces MCP integrations and Skills for specialized tasks.
The examples follow the conventions in this project's Chinese tutorial. Check prompts and available settings in your installed CLI or IDE version; shortcuts, permission behavior, and configuration fields can vary. Original sample prompts and code are retained where they refer to the same demonstration data.
Getting started
Prerequisites
For VS Code, the source tutorial recommends version 1.98.0 or later and Git for Windows on Windows. For JetBrains IDEs, such as IntelliJ IDEA, PyCharm, or WebStorm, it recommends version 2025.1 or later. The npm-based CLI examples below use Node.js 18 or later; follow the actual requirements of the version you install.
Install Claude Code
1. VS Code extension
From the extension marketplace:
- Open Extensions with Ctrl+Shift+X.
- Search for Claude Code.
- Install the official Anthropic extension.
From the command line:
npm install -g @anthropic-ai/claude-codeThe source tutorial uses this CLI path to initialize the VS Code integration. Follow any installation prompts shown by your version.
2. JetBrains integration
- Install the command-line tool:
npm install -g @anthropic-ai/claude-code- Open the IDE's Settings → Plugins, search for Claude Code, install the official plugin, and restart the IDE. The source tutorial shows the Beta-labeled plugin.
- Verify installation:
claude-code --version1. Initialize project context
Run /init to analyze the project structure, identify its technology stack, and create a CLAUDE.md file describing project conventions. Review that file so it accurately reflects the repository.
2. Switch permission modes
The tutorial uses Shift+Tab to cycle through these modes:
| Mode | Behavior | Indicator |
|---|---|---|
| Normal | Uses the configured permission checks and prompts | No special indicator |
| Auto-Accept | Accepts edits without individual edit confirmations | ⏵⏵ accept edits on |
| Plan | Analyzes and plans without editing project files | ⏸ plan mode on |
When to use Plan Mode
Use it when a change spans several files, the approach is still undecided, or the work benefits from reviewing the plan before edits.
Choose a mode at startup
claude --permission-mode plan3. Reference files and directories
Type @ followed by a path, using completion to select the intended file or directory. This supplies focused context for a particular module. Completion behavior can differ between terminals and IDE integrations.
4. Export a conversation
Use /export to save a conversation as Markdown for archiving, reviewing a complex investigation, or sharing with your team. Follow the current terminal's export prompts.
5. Request deeper reasoning
The source tutorial uses an ultrathink: prefix for architecture, difficult debugging, and refactoring tradeoffs. Its effect depends on the installed version and configuration; do not assume the text alone guarantees a particular reasoning budget.
6. Paste screenshots
Paste a screenshot into the supported input area, using Ctrl+V where supported, and describe the issue. For example:
[Screenshot] The button's spacing is incorrect. Please fix it to match the adjacent controls.
7. Correct direction early
Press Esc to interrupt when the assistant takes the wrong direction, then give a specific correction. There is no need to wait for a long response to finish.
8. Navigate previous prompts
Use the Up and Down arrow keys to navigate prior input, repeat related work, or recall a previous command.
9. Run a shell command
Prefix a command with ! to run it and bring the output into the conversation. For example, !npm --version checks the installed npm version.
10. Search prompt history
Use Ctrl+R and a keyword to find a previous prompt, particularly a long command or detailed request.
11. Skip permission checks with care
The source tutorial includes this startup option:
claude --dangerously-skip-permissionsIt bypasses permission confirmations and can execute commands that change or delete files. Use it only in an environment where the task and executable content are fully trusted and the consequences are understood.
Appendix: configuration examples
Configuration locations
# Windows
%USERPROFILE%\.claude.json
# macOS/Linux
~/.claude.json.claude.json
The tutorial's .claude.json example contains basic setup information and MCP server definitions. Internal fields can differ by version; prefer the installed tool's supported configuration flow.
Complete example
{
"hasCompletedOnboarding": true,
"acceptedTos": true,
"autoUpdates": false,
"installMethod": "npm",
"userID": "00000000-guest-user-bypass-config-template-00000000",
"firstStartTime": "2025-01-01T00:00:00.000Z",
"sonnet45MigrationComplete": true,
"opus45MigrationComplete": true,
"opusProMigrationComplete": true,
"thinkingMigrationComplete": true,
"cachedChromeExtensionInstalled": false,
"mcpServers": {
"bing-search": {
"command": "npx",
"args": ["-y", "bing-cn-mcp"]
}
}
}Fields in the example
| Field | Meaning | Example value |
|---|---|---|
hasCompletedOnboarding | Whether onboarding is complete | true |
acceptedTos | Terms acceptance state | true |
autoUpdates | Automatic updates | false |
installMethod | Installation method | npm |
userID | User identifier | Generated by the tool |
mcpServers | MCP server definitions | {} |
settings.json
The project settings example configures environment variables and project-specific behavior.
Location
# 项目根目录
./settings.jsonComplete example
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
"ANTHROPIC_AUTH_TOKEN": "sk-ant-your-token-here",
"ANTHROPIC_MODEL": "claude-opus-4-6",
"ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
"NODE_ENV": "development"
}
}Environment fields
| Field | Meaning | Required by this example | Example |
|---|---|---|---|
ANTHROPIC_BASE_URL | API base URL | No | https://api.anthropic.com |
ANTHROPIC_AUTH_TOKEN | API authentication token | Yes | sk-ant-xxxxx |
ANTHROPIC_MODEL | Default model | No | claude-opus-4-6 |
ANTHROPIC_SMALL_FAST_MODEL | Small, fast model | No | claude-haiku-4-5-20251001 |
NODE_ENV | Runtime environment | No | development |
Configuration steps
Step 1: create .claude.json
# 1. 进入用户主目录
cd ~
# 2. 创建 .claude.json 文件(如果不存在)
# 复制上面的完整配置示例
# 3. 替换其中的 sk-xxx 为你的实际 API KeyStep 2: optionally create settings.json
# 1. 进入项目根目录
cd /path/to/your/project
# 2. 创建 settings.json 文件
# 复制上面的完整配置示例
# 3. 配置项目特定的环境变量Step 3: verify configuration
# 查看配置是否正确
cat ~/.claude.json
# 在 Claude Code 中验证
!echo $ANTHROPIC_AUTH_TOKENProtect credentials
Keep API keys out of Git and public conversations, and rotate them as needed. The tutorial illustrates environment variables:
# 更安全的方式:使用环境变量
export ANTHROPIC_AUTH_TOKEN="sk-ant-xxxxx"Exclude sensitive local configuration from version control:
# 不要提交敏感配置
settings.json
.env
.env.localLimit local file permissions on Linux/macOS:
# Linux/macOS 设置文件权限
chmod 600 ~/.claude.jsonAdvanced usage
The following sections cover MCP integrations and specialized Skills for developers already comfortable with the basic workflow.
Chapter 1: MCP integrations
1.1 Configure and manage MCP servers
What is MCP?
Model Context Protocol connects the assistant to external tools and data sources through MCP servers.
Configuration location
The source tutorial uses the ModelScope MCP directory to find services.
# Windows
%USERPROFILE%\.claude.jsonBasic configuration
{
"mcpServers": {
"bing-search": {
"command": "npx",
"args": ["-y", "bing-cn-mcp"]
}
}
}1.2 Example MCP services
Bing search in Chinese
{
"mcpServers": {
"bing-search": {
"command": "npx",
"args": ["-y", "bing-cn-mcp"]
}
}
}Example request:
使用必应搜索最新的 AI 新闻Search results can include titles, links, and summaries. Further page retrieval, pagination, and filters depend on the functions exposed by the selected server.
Several servers
{
"mcpServers": {
"bing-search": {
"command": "npx",
"args": ["-y", "bing-cn-mcp"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelscope/mcp-filesystem"]
},
"postgresql": {
"command": "npx",
"args": ["-y", "@modelscope/mcp-postgresql"]
}
}
}1.3 Inspect available tools
Ask in the conversation:
你有哪些 MCP 工具?Check the configured servers and the functions actually available to the current session.
1.4 Practical uses
| Task | Example MCP server | Use |
|---|---|---|
| Current information | bing-search | Search news, prices, or weather |
| Database work | postgresql | Query or update according to the server's available tools and database permissions |
| File access | filesystem | Access explicitly configured directories |
| API integration | custom-api | Connect internal business APIs |
1.5 Configuration practices
Pass credentials through supported environment configuration and limit each server's access. Configure only the services needed, then observe invocation latency and success rates. Keep server versions maintained and retain appropriate logs for important calls.
Chapter 2: Skills
2.1 Overview
Skills provide instructions and supporting tools for specialized file types or tasks. The source tutorial demonstrates three skill packages; these are examples, not capabilities automatically bundled with every installation.
Three example skills
| Skill | Tasks | Example dependencies |
|---|---|---|
ai-tutor | Technical explanations and video transcription | Python, FFmpeg |
pdf | PDF creation, editing, forms, and extraction | LibreOffice, ReportLab |
xlsx | Spreadsheets, analysis, and charts | LibreOffice, openpyxl, pandas |
2.2 Installation and dependencies
Step 1: download the skills
# 克隆 Skills 仓库
git clone https://github.com/anthropics/skills.git
# 或访问在线浏览
https://github.com/anthropics/skills/tree/main/skillsStep 2: copy them into the Claude directory
# Windows
复制到 %USERPROFILE%\.claude\skills\
# macOS/Linux
复制到 ~/.claude/skills/Step 3: install dependencies
Python:
# 安装最新 Python(版本 3.10+)
# Windows: https://www.python.org/downloads/
# macOS: brew install python@3.11
# Linux: apt-get install python3.11
# 验证安装
python --versionLibreOffice:
# Windows: 下载完整包
https://zh-cn.libreoffice.org/download/libreoffice/
# macOS
brew install libreoffice
# Linux
apt-get install libreofficePython packages:
pip install reportlab -q
pip install openpyxl -q
pip install pandas -q
pip install pillow -q
pip install python-pptx -qVerify installation:
# 在 Claude Code 中查询可用 Skills
你有哪些 Skills?2.3 ai-tutor
Examples
Explain a technical concept:
ultrathink: 请用 ai-tutor 给我讲解什么是微服务架构,
包括核心概念、优缺点和应用场景Transcribe and analyze a video:
帮我转录这个视频文件,并总结核心要点
@/path/to/video.mp4Usage tips
Supply relevant reference material and request the depth you need. The source examples use ultrathink: where supported. Divide long videos into sections for easier processing and review.
2.4 PDF
Main tasks
Create a PDF:
帮我创建一个项目总结报告 PDF,
包含:项目概述、技术方案、进度统计、团队成员信息Fill a form:
帮我填充这个 PDF 表单:
@表单模板.pdf
数据内容:
- 姓名:张三
- 日期:2026-03-04
- 签名:已确认Extract text and tables:
请提取这个 PDF 中的所有表格数据,
转换为 CSV 格式
@/path/to/document.pdfMerge and split documents:
合并这些 PDF 文件:
@file1.pdf
@file2.pdf
@file3.pdf
输出为:merged_document.pdfAdvanced examples
Batch processing:
# 处理目录下所有 PDF
帮我批量提取 ./pdf_folder 中所有 PDF 的文本内容Conditional conversion:
将这个 PDF 转换为图片,
仅保留第 1-5 页
@source.pdf2.5 XLSX
Main tasks
Create structured data:
创建一个产品销售统计表,
包含:产品名称、销售数量、销售额、利润率、同比增长
示例数据:5条产品记录Analyze data and create charts:
分析这个 Excel 文件,
生成销售趋势图表和关键指标总结
@sales_data.xlsxAdd formulas and calculations:
创建财务预算表,
包含收入、成本、利润等项目,
自动计算小计和总计Build pivot tables and statistics:
基于这个数据文件,
按地区和产品类别生成销售汇总表
@detailed_sales.xlsxSpreadsheet practices
Use clear column headings, appropriate number formats or conditional formatting, and data-validation rules to reduce input errors.
