Files
rui-docs/backend/guides/gitnexus-guide.md
T
vifo 19de7e24ec docs: 迁移 spring-ai 通用文档到 rui-docs
从 docs-local 迁移以下文档:

- backend/guides/: AI开发环境配置、Nacos配置、GitNexus指南、OpenCode工作流等

- backend/templates/: Superpowers设计模板、计划模板、审查清单

- backend/config-templates/: 应用配置模板、Nacos配置

- backend/design/: 数据库表结构规划

- backend/specs/: 项目文档治理、MQ统一推送设计

- backend/: 代码分析报告、Feign分析报告、文档治理报告

- frontend/design/: Admin-UI分模块打包设计
2026-06-04 09:34:03 +08:00

53 lines
2.5 KiB
Markdown

# GitNexus — Code Intelligence 使用指南
> **项目索引**: spring-ai (2690 symbols, 5387 relationships, 218 execution flows)
## 基本概念
GitNexus 是一个代码智能工具,通过索引代码库构建知识图谱,帮助开发者理解代码、评估影响、安全导航。
## 核心原则
### Always Do
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `gitnexus_impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
- **MUST run `gitnexus_detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows.
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
- When exploring unfamiliar code, use `gitnexus_query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `gitnexus_context({name: "symbolName"})`.
### Never Do
- NEVER edit a function, class, or method without first running `gitnexus_impact` on it.
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
- NEVER rename symbols with find-and-replace — use `gitnexus_rename` which understands the call graph.
- NEVER commit changes without running `gitnexus_detect_changes()` to check affected scope.
## 资源速查
| Resource | Use for |
|----------|---------|
| `gitnexus://repo/spring-ai/context` | Codebase overview, check index freshness |
| `gitnexus://repo/spring-ai/clusters` | All functional areas |
| `gitnexus://repo/spring-ai/processes` | All execution flows |
| `gitnexus://repo/spring-ai/process/{name}` | Step-by-step execution trace |
## 技能参考
| 场景 | 技能文件 |
|------|---------|
| 架构理解 / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
| 影响分析 / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
| Bug 追踪 / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
| 重构 / "Rename this function" | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
| 工具参考 | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
| CLI 命令 | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
## 索引维护
如果 GitNexus 工具提示索引过期,执行:
```bash
npx gitnexus analyze
```