-
Notifications
You must be signed in to change notification settings - Fork 6
🚨 Issue: Incomplete README Generation Due to Single-Pass AI Request #101
Description
🚨 Issue: Incomplete README Generation Due to Single-Pass AI Request
📌 Summary
The current README generation pipeline uses a single, large AI request to generate the entire document. This often results in truncated or incomplete outputs, especially for repositories with richer metadata or larger inferred structures.
⚠️ Problem Details
-
README generation is handled in one API call
-
Prompt includes:
- Repository metadata
- File structure
- Detailed formatting instructions
-
This leads to:
- Token limit exhaustion
- Partial or cut-off responses
- Inconsistent output quality
🔍 Observed Behavior
- README stops mid-section (commonly during Installation / License)
- Missing sections despite strict prompt instructions
- Output varies depending on repo size
🎯 Expected Behavior
-
Complete, well-structured README generated consistently
-
All required sections present:
- Header
- Overview
- Features
- Tech Stack
- Installation
- License
💡 Proposed Solution (Recommended)
Refactor the generation pipeline to a multi-step / section-based approach:
Step 1: Structure Planning
Generate a list of README sections:
- Introduction
- Features
- Installation
- Usage
- License
Step 2: Section-wise Generation
Generate each section independently using smaller prompts:
- Improves reliability
- Avoids token overflow
- Enables retries for failed sections
Step 3: Final Assembly
Combine all generated sections into a single Markdown output.
🚀 Benefits
- Eliminates truncation issues
- Better control over output quality
- Scalable for larger repositories
- Easier debugging and retry logic
🛠️ Additional Improvements (Optional)
- Add continuation fallback for incomplete responses
- Limit file list size in prompt
- Reduce prompt verbosity to save tokens
📎 Impact
This change will significantly improve:
- User experience
- Output consistency
- Reliability of the core feature
🙋 Notes
This is a foundational improvement and aligns the project with production-grade AI generation patterns.