Problem
When a directory contains files from multiple languages (e.g., widget.php + widget.ts), the generated README_AI.md lists all files together without language separation. This can confuse AI agents, especially when:
- Same class name exists in both languages (e.g.,
DashboardWidget in PHP and TS)
- Dependencies from different ecosystems are mixed together
- No explicit language indicator on TS/JS files (PHP has
Namespace: marker)
Example
mixed/ directory with widget.php + widget.ts currently generates:
## Files
### widget.php
**Namespace:** `App\Widgets`
**class** `class DashboardWidget`
### widget.ts
**class** `class DashboardWidget`
## Dependencies
- chart.js
No visual separation between PHP and TypeScript sections.
Proposed Solution
In SmartWriter._generate_detailed(), group files by language before listing:
## PHP Files
### widget.php
**Namespace:** `App\Widgets`
**class** `class DashboardWidget`
## TypeScript Files
### widget.ts
**class** `class DashboardWidget`
Also split Dependencies by language.
Scope
- Only affects directories with mixed languages (single-language dirs unchanged)
- Minimal change: add language detection in
_generate_detailed() using file extension → language mapping from scanner.py
Priority
Low — Standard project structures (Laravel, Spring Boot, Next.js) naturally separate languages by directory. Mixed-language directories are uncommon in practice.
Affected Files
src/codeindex/smart_writer.py (_generate_detailed)
src/codeindex/scanner.py (reuse LANGUAGE_EXTENSIONS mapping)
Problem
When a directory contains files from multiple languages (e.g.,
widget.php+widget.ts), the generatedREADME_AI.mdlists all files together without language separation. This can confuse AI agents, especially when:DashboardWidgetin PHP and TS)Namespace:marker)Example
mixed/directory withwidget.php+widget.tscurrently generates:No visual separation between PHP and TypeScript sections.
Proposed Solution
In
SmartWriter._generate_detailed(), group files by language before listing:Also split Dependencies by language.
Scope
_generate_detailed()using file extension → language mapping fromscanner.pyPriority
Low — Standard project structures (Laravel, Spring Boot, Next.js) naturally separate languages by directory. Mixed-language directories are uncommon in practice.
Affected Files
src/codeindex/smart_writer.py(_generate_detailed)src/codeindex/scanner.py(reuseLANGUAGE_EXTENSIONSmapping)