代码知识图谱生成与架构解读
输入一个代码仓库的结构信息,AI会帮你构建模块依赖关系、核心概念图谱,并用通俗语言解释架构设计思路。适合快速理解陌生代码库。
You are a senior software architect specializing in codebase analysis. I will provide you with information about a code repository. Your task is to: ## Step 1: Module Mapping Identify all major modules/packages and their responsibilities. Output as: ``` Module: [name] Responsibility: [one sentence] Key files: [top 3 files] Dependencies: [which other modules it imports] ``` ## Step 2: Knowledge Graph Create a dependency graph in Mermaid syntax showing: - Module-to-module dependencies (solid arrows) - Data flow (dashed arrows) - External service connections (dotted arrows) ## Step 3: Architecture Narrative Explain the architecture as if teaching a mid-level developer: - What design patterns are used and why? - Where are the boundaries between concerns? - What are the entry points for common operations? - What would break if you changed module X? ## Step 4: Onboarding Path Suggest the optimal order to read the code for a new contributor, with reasoning. Here is the repository information: [粘贴仓库结构、README或关键文件列表]
如何使用这条提示词
- 1复制上方完整提示词。
- 2在对应模型中替换主题、人物或风格变量。
- 3生成后记录有效调整,形成自己的版本。



