feat: Introduce analyze Command for Deep Educational Codebase Analysis
#6
@ -1,6 +1,6 @@
|
|||||||
You are an expert Go educator and codebase archaeologist helping a learning developer or hobbyist deeply understand a project.
|
You are an expert Go educator and codebase archaeologist helping a learning developer or hobbyist deeply understand a project.
|
||||||
|
|
||||||
Generate a single, clean, educational Markdown report with these exact sections (use proper Markdown):
|
Generate a **single, clean, educational Markdown report** with these **exact sections** (use proper Markdown headings and bullet points):
|
||||||
|
|
||||||
# Project Analysis: [Inferred Project Name]
|
# Project Analysis: [Inferred Project Name]
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ Generate a single, clean, educational Markdown report with these exact sections
|
|||||||
- Main public APIs and their purpose
|
- Main public APIs and their purpose
|
||||||
|
|
||||||
## Function & Method Reference
|
## Function & Method Reference
|
||||||
For each exported function/method (group by package):
|
Group by package. For each exported function/method:
|
||||||
- What it does
|
- What it does
|
||||||
- How it works (key logic, patterns, idioms)
|
- How it works (key logic, patterns, idioms)
|
||||||
- Why it exists (design rationale or problem it solves)
|
- Why it exists (design rationale or problem it solves)
|
||||||
@ -26,4 +26,4 @@ For each exported function/method (group by package):
|
|||||||
- Recommended order to read/understand the code
|
- Recommended order to read/understand the code
|
||||||
- Common pitfalls or tricky parts for newcomers
|
- Common pitfalls or tricky parts for newcomers
|
||||||
|
|
||||||
Be precise, encouraging, and educational. Use short code snippets only when they illuminate a concept. Do not add extra commentary outside the sections.
|
Be precise, encouraging, and educational. Use short code snippets only when they illuminate a concept. Do **not** add extra commentary outside the sections. Infer the project name from directory or go.mod if possible.
|
||||||
|
|||||||
@ -73,6 +73,12 @@ Uses language-specific prompts discovered in .grokkit/prompts/ or ~/.config/grok
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
logger.Info("Loaded analysis prompt", "language", lang, "path", promptPath)
|
logger.Info("Loaded analysis prompt", "language", lang, "path", promptPath)
|
||||||
|
// Improve prompt with the project name if possible
|
||||||
|
projectName := filepath.Base(dir)
|
||||||
|
if projectName == "." {
|
||||||
|
projectName = "Current Project"
|
||||||
|
}
|
||||||
|
promptContent = strings.Replace(promptContent, "[Inferred Project Name]", projectName, 1)
|
||||||
|
|
||||||
// 4. Build rich project context
|
// 4. Build rich project context
|
||||||
context := buildProjectContext(dir, files)
|
context := buildProjectContext(dir, files)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user