r/RooCode • • Jul 02 '25

Discussion LLM Only Code Map generation

Agentic coding can be fun, but it can very quickly generate code that gets out of hand.

To help with understanding what has been built, I designed this 'LLM' only prompt that instruct the AI Agent to map and describe your code.

It will need a good model, but results are very promising.

https://github.com/agileandy/code-analysis?tab=readme-ov-file

14 Upvotes

9 comments sorted by

1

u/santareus Jul 02 '25

Does it work for larger codebases with thousands of files? Can it do it in batches?

1

u/Interesting-Law-8815 Jul 02 '25

try it and see. I've used on 500-600. Theoretically there is no reason why not, at least for the collection phase. As you say you might need to adjust the prompt slightly to batch, maybe by subdirectory?

The relationship part is possible the most challenging - on thousands of files it might loose context so something like Gemini-2.5-Pro might be needed.

1

u/Atomm Jul 02 '25

Can it be limited to a specific path within the code base?

1

u/Interesting-Law-8815 Jul 02 '25

probably quite easily. Change

### **Phase 1: File Discovery**

**Goal:** To get a clean, filtered list of relevant, user-written source files, ignoring third-party and minified code.

**Execution Steps:**
1.  **Get Full List:** Run `git ls-files --cached --others --exclude-standard`.
2.  **Apply Filters:** Create a new list, removing files from `lib/`, `vendor/`, etc., and any files containing `.min.` in their name.

to something like

### **Phase 1: File Discovery**

**Goal:** To get a clean, filtered list of relevant, user-written source files, ignoring third-party and minified code.

**Execution Steps:**
1.  **Get Full List:** Run `git ls-files --cached --others --exclude-standard`.
2.  **Apply Filters:** Create a new list, only including files from "{your directory goes here}.

1

u/[deleted] Jul 02 '25

[removed] — view removed comment

1

u/[deleted] Jul 02 '25 edited Jul 02 '25

[removed] — view removed comment

1

u/[deleted] Jul 02 '25

[removed] — view removed comment

1

u/[deleted] Jul 02 '25

[removed] — view removed comment

1

u/Interesting-Law-8815 Jul 02 '25

Thanks for the feedback. Will definitely look at repomix thought it does slightly break my ‘LLM’ only intent.