diff --git a/.grokkit/prompts/go.md b/.grokkit/prompts/go.md index d56b773..b1d17eb 100644 --- a/.grokkit/prompts/go.md +++ b/.grokkit/prompts/go.md @@ -1,6 +1,6 @@ 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] @@ -13,7 +13,7 @@ Generate a single, clean, educational Markdown report with these exact sections - Main public APIs and their purpose ## Function & Method Reference -For each exported function/method (group by package): +Group by package. For each exported function/method: - What it does - How it works (key logic, patterns, idioms) - 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 - 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. diff --git a/cmd/analyze.go b/cmd/analyze.go index f55ede1..613eafe 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -73,6 +73,12 @@ Uses language-specific prompts discovered in .grokkit/prompts/ or ~/.config/grok os.Exit(1) } 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 context := buildProjectContext(dir, files)