In this essay, Carson Gross argues that Markdown is now an important source artifact for software systems built with LLMs, and that, following the principle of locality, it should live in /src, alongside the code it…
99 comments
Cluttering the repo with out-dated, very wordy and quickly aging prompts will just confuse any agent tasked with looking at the repo in the future. Keeping context windows down is a real limitation to good LLM output, and this workflow may work completely against it.
- A plan.md describing the project, main abstraction idea, end costumer, and so on is great; but it should be kept minimal and up-to-date with the repo.
- Block comments on top of source-files and functions are great, and already very useful to coding agents. I don't see a value to anything more than what is already typical best practice.
If prompts are specifications for a change of the system's behavior, then it seems natural to manage them as changes and not as resources.
This would also keep them in the right "historical context" of the repo and avoid the "prompt rot" you were talking about.
Functional safety development processes often demand code-review, technical design decisions, changes of plans, or intentional compromises; to be linked together with reference IDs in the code they effect. But the workflow for this is usually extremely manual and absolute misery. But a codebase made like this is like magic to read later.
The reason is that the commit message log serves as an overview of the changes commited. That's what humans use it for, anyway: to get an idea of what happened since they last pulled, to help give an idea of where a regression might have been introduced and so on, at a glance. To that end, brevity is very useful.
My understanding is that chatbots used to perform such tasks will also benefit from brevity.
"yes claude i prefered the blue graph two months ago, how does thar help us with this json parsing bug?"
Ok I already talked myself out of this idea.
But I don't really like the "LLMs as compiler" metaphor. If you followed that logic to the end, you'd have to "rebuild" your entire project from the spec every time the spec changes. Not just would the token cost be insane, but you'd also get a completely different implementation each time, maybe with different UI and design decisions where the spec left things open.
The alternative is to see the code as the source of truth and LLMs as (extremely sophisticated) editing or refactoring tools. Then by all means, still check in your prompts, but now they are documentation on how a feature was implemented, not the source of truth themselves.
Now, if you excuse my ramblings, here are a few ideas: I think we probably need new "programming" languages that are actually specification languages: reproducible default states, deterministic spec-to-code transformation.
I am not sure we actually need the determinism, but that would be a good property to have. At least with the same model/spec/temperature.
Now, prompts mutate the spec, which can also be edited by hand. You can already do this with the final code of course, but it is tedious as it contains many trivial implementation details.
But then, how do you handle bugfixes that need to persist during re-generation? Such as "Both Foo and foo can be present in the same directory if the file system is case-sensitive". If you add them to the spec, you are micro-managing implementation details again. So I think such "bug fixes" should be part of a prompt/spec that is automatically loaded when generating similar snippets (here, file I/O). It feels like I've just reinvented the concept of software libraries, though.
For people who like this idea, or do something similar, how do you make use of prompts used to create code checked into your codebase?
I can see it valuable at the review stage, but if I was trying to trace-back a regression to a previous commit, I feel like I already have enough noise without this attached.
Any prompt-storing/sharing ideas floating around hit the same wall - they assume the text will be in English. It won't.
Our approach is to save LLM conversations but to not have them be part of the context.
have they though? I feel like 50% of the chat history is gettin in the way of the model that just created it half the time, let alone any future LLM.
Humans wont re-read an old chat history either unless very desperate for clues.
The few valuable nuggets of information in the chat history can probably be summarize into 3 bullet points and put in the docs or in code comments.
I really dont see the value.
We did put non-code into /src for a very long time: It was heredocs, multiline docs, etc. Actually my preference is to put texts close to code and only fallback to /docs/something.md at a conceptual level. Which is probably what the author proposes, given that he sees markdown as primary interface to code.
I actually miss what I had when I was playing around in TempleOS. All text in the OS is rich (you can toggle between the markup and the standard WYSIWYG view), so comments could have formatting, colours, images (bitmap or vector, great for diagrams), hell, even (aggressively spinning) 3D models.
The thing I used most was the collapsible sections, think <details> and <summary> in HTML. Although I appreciate plain text and would hate WYSIWYG rich text in my serious source code (not to mention binary data appended to the end of the source file for images and models), I can't help but pine for those features. Being able to just draw a real diagram and being able to edit it later in seconds as opposed to making some horrid ASCII art was awesome.
Read the full thread on Hacker News →
Related stories
- Markdown in /Srchtmx.orgHacker News · 1 points · 9 days ago
- Markdown in /srchtmx.orgLobsters · 13 points · 9 days ago
- Show HN: Sarala – An open-source WYSIWYG Markdown editorsarala.solancer.comHacker News · 19 points · 1 day ago
- Hacker News · 5 points · 8 days ago
- Hacker News · 1 points · 9 days ago
- Hacker News · 3 points · 5 days ago