Skip to content

🚨 Issue: Incomplete README Generation Due to Single-Pass AI Request #101

@naheel0

Description

@naheel0

🚨 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ai-logicRelated to Gemini prompts, tokens, or model responses.area: backendRelated to Next.js API routes or Octokit/GitHub API.area: frontendChanges specifically for the UI/Tailwind components.bugSomething isn't workingci/cdAutomated workflows for building, testing, and deploying code.documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededpriority: highMust be fixed or built ASAP. Blocks other work.typescriptType definition fixes, interfaces, or TS configuration.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions