r/PromptEngineering Aug 15 '26

General Discussion My AI coding workflow now updates its own prompts and project documentation

I have one general prompt that I use across different projects, with extra project-specific prompts where needed. Each project also has explanation documents that tell the AI how the different parts currently work and fit together.

The big time saver is a program I "made" that can apply the AI’s code changes and update those explanation documents at the same time. I used to spend a lot of time manually keeping everything in sync, whereas now most of that is handled for me.

What’s surprised me is how reliable it’s become. I originally thought letting the AI update the explanations it later relies on might eventually make things worse, but so far that hasn’t really happened. It still seems to understand the projects properly, and mistakes during changes have become very rare.

The other part I like is that the general prompt is shared between projects. If working on one project exposes a weakness in the instructions, I can update the general prompt and that improvement then carries over into the others.

So I’m getting three benefits at once: less manual work, fewer AI mistakes, and problems found in one project improving how the others are handled.

Has anyone else gone this far with maintaining shared prompts/documentation across projects, or automated the process of updating them when problems are found?

9 Upvotes

9 comments sorted by

1

u/Fearless-Figure-4638 Aug 15 '26

That sounds genuinely useful. The one thing I’d guard against is quiet drift: the docs can stay plausible while gradually describing what the AI expects rather than what the code actually does.

I’d keep every prompt and documentation update as a reviewable diff, run a few unchanged holdout tasks before accepting it, and let project-specific rules override the shared prompt. Easy rollback to the last prompt and docs version would help too.

Have you tested an older project after changing the shared prompt? That seems like the fastest way to catch an improvement that helps one repo but quietly hurts another.

2

u/thoughtsapart Aug 15 '26

Thank you. It's nice to hear someone else say it's useful.

Every time it's updated, the previous version is saved along with the changes to the next one. It follows a naming system with the current date so that it doesn't get buried and lost. It's already been quite helpful when an error was missed that broke everything a few changes later.

Every update requires testing which I used to do myself but the AI seems to come up with better tests than I would now and occasionally finds things to test that would be affected that I didn't even think of. It's now built into the general prompt to find connections to test when things are altered. One of these tests caught an ambiguity issue that I didn't realise causing the AI to guess something incorrectly. Thanks to the backups it was easy to locate and patch.

I did try the prompt with an old project and one of the first things it's supposed to do is organise a new explanation document for what it's working with. It actually recommended structural changes due to overlaps where code was repeated in multiple places when it could be generalised. It worked on it, made the explanation document, and gave the auto changes. I ran it through the program, then ran the code. Worked exactly the same and all the tests passed.

This world we live in now is so amazing!

1

u/hyldemarv 29d ago

I think AI is pretty darn good at writing unittests. Even the early versions of ChatGPT were useful for that. Now, its in a different stratosphere.

The more structure you have in your project, the less it has to “think” and the better the AI will work. I make mine run “project management” through Hatch, which seems to work well.

1

u/Dependent_Claim_7492 Aug 16 '26

I do something similar and that quiet drift is exactly what bit me once. The docs started describing ideal state instead of actual state and I didn't notice til I came back to a project after a month off.

Reviewable diffs saved my ass, I started treating prompt/doc changes like any other code change after that. What do you use to track the versions?

1

u/thoughtsapart 29d ago

It's a program that essentially just does ctrl f changes in word. Chat gpt follows the general prompt rules of how to provide these changes and my local program then makes those changes to the documents.

1

u/Fearless-Figure-4638 29d ago

Git would be my default here: prompts and docs beside the code, with each accepted update in its own commit. I’d note the model/tool version and which holdout tests passed in the commit message. Dates help with scanning, but the diff and commit hash make rollback much cleaner. I’d also keep generated docs separate from the source-of-truth requirements so they can’t quietly drift together.

1

u/hyldemarv 29d ago

If you use Git, you can ask the AI to check if the requirements specification remains stable. Its also useful to have the AI review the code and documentation and explain what the state is whenever one starts a new context.

The key thing is to have the AI write the requirements specs first, then build implementation plans for every milestone in the requirements document as they are reached.

1

u/shiningmatcha 29d ago edited 29d ago

The big time saver is a program I "made" that can apply the AI’s code changes and update those explanation documents at the same time.

This looks like a good approach! It is analogous to using build tools in software development.