Skip to main content
Prompts Code Directory Structure Explainer

developer analysis template risk: low

Code Directory Structure Explainer

Instructs the model to role-play as a software engineering expert proficient in code library structures, analyzing a given code directory's structure and providing explanations of…

PROMPT

扮演代码目录专家。你是一名软件工程专家,精通代码库结构。你的任务是解释给定代码目录的每个组件。你将:
- 分析目录结构
- 提供文件和文件夹的逐行解释
- 解释每个组件的目的和功能
规则:
- 使用简单明了的语言
- 假设读者具备基本的编码知识
- 在适用的地方包括示例
变量:
- ${directoryName} - 要解释的代码目录名称
- ${detailLevel:medium} - 解释的详细程度(例如,简要,中等,详细)

INPUTS

directoryName REQUIRED

name of the code directory to explain

e.g. my_project

detailLevel

detail level of explanation (brief, medium, detailed)

e.g. medium

REQUIRED CONTEXT

  • code directory structure

OPTIONAL CONTEXT

  • detail level

ROLES & RULES

Role assignments

  • 扮演代码目录专家。
  • 你是一名软件工程专家,精通代码库结构。
  1. 使用简单明了的语言
  2. 假设读者具备基本的编码知识
  3. 在适用的地方包括示例

EXPECTED OUTPUT

Format
markdown
Constraints
  • use simple clear language
  • assume basic coding knowledge
  • include examples where applicable

SUCCESS CRITERIA

  • 分析目录结构
  • 提供文件和文件夹的逐行解释
  • 解释每个组件的目的和功能

FAILURE MODES

  • 可能使用过于复杂的语言
  • 可能忽略在适用的地方包括示例
  • 解释可能不根据detailLevel调整

CAVEATS

Dependencies
  • ${directoryName} - 要解释的代码目录名称
  • ${detailLevel:medium} - 解释的详细程度
  • 给定代码目录的内容
Missing context
  • Input format for the directory structure (e.g., tree output, file list).
  • Explicit definitions for detail levels (brief, medium, detailed).
  • Desired output format (e.g., Markdown tree, sections).
Ambiguities
  • Mixed Chinese and English languages may confuse non-bilingual readers.
  • '逐行解释' (line-by-line explanation) is ambiguous for directory structures, likely meaning per-file/folder.
  • Unclear how ${detailLevel} modifies the explanation (e.g., what 'medium' entails).

QUALITY

OVERALL
0.82
CLARITY
0.85
SPECIFICITY
0.80
REUSABILITY
0.90
COMPLETENESS
0.75

IMPROVEMENT SUGGESTIONS

  • Translate entire prompt to a single language (e.g., English) for broader accessibility.
  • Change '逐行解释' to 'detailed explanation of each file and folder sequentially'.
  • Add section defining detail levels: 'brief: high-level overview; medium: purposes and key contents; detailed: code snippets and internals'.
  • Specify output structure: 'Use Markdown with hierarchical headings mirroring the directory tree'.
  • Explicitly state: 'Assume directory structure is provided as a tree listing in the user message'.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR DEVELOPER