←back to thread

70 points alexmolas | 2 comments | | HN request time: 0s | source
1. dheera ◴[] No.43646339[source]
I often do the reverse -- have LLMs insert docstrings into large, poorly commented codebases that are hard to understand.

Pasting a piece of code into an LLM with the prompt "comment the shit out of this" works quite well.

replies(1): >>43646447 #
2. simonw ◴[] No.43646447[source]
Matheus Pedroni released a really clever plugin for doing that with LLM the other day: https://mathpn.com/posts/llm-docsmith/

You run it like this:

  llm install llm-docsmith
  llm docsmith ./scripts/main.py
And it uses a Python concrete syntax tree (with https://pypi.org/project/libcst/) to apply changes to just the docstrings without risk of editing any other code.