Skip to content

Instantly share code, notes, and snippets.

Untested but Promising Blueprint for Writing Production-Ready Code with AI Code Generation

What's Lacking / Required:

  • Defined processes, practices, and workflows.
  • The ability to generate working or easy to debug/fix code.
  • The ability to generate working or fixable production-ready code.
  • Efficient management of code files with thousands of lines of code (loc).
  • Management of file/code history, changes, and context.

Goals:

@ditpoo
ditpoo / ai_code_gen_best_practices.md
Last active March 11, 2025 11:17
Sharing best practices I discovered/found for coding using ai based code generation

Sharing best practices I discovered/found for coding using AI based code generation

  1. Provide code base/project details and up-to-date context.
  2. Separation of concerns in different modules.
  3. Create implementation details for each PR, maintain implementation docs.
  4. Generate small, focused chunks of code (< 1k lines).
  5. Keep functions concise and small.
  6. Comment every function; add context before AI generation.
  7. Keep those comments updated with every change on that code