Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
20.88k stars 1.93k forks source link

Custom instructions #249

Closed joshuavial closed 6 months ago

joshuavial commented 1 year ago

I have noticed a few issues (such as #248 #243 ) where people want specific behavior that might not be general enough to warrant a new feature and it's made me think about giving folks the ability to append instructions to the system prompt - similar to custom instructions in ChatGPT.

This could be a new flag in the config so set on a global, per project, or per run basis and would greatly increase the ability for people to customise aider. It might also help the folks interested in #172 get better performance out of different models without having to create and maintain lots of different system prompts.

It would be pretty easy to add in but my main concerns are

What do folks think, worthwhile feature?

harleypig commented 1 year ago

You could add an option that would dump that info out and make it easier for the submitter to copy-n-paste.

thepigeonoftime commented 7 months ago

See https://github.com/paul-gauthier/aider/issues/398#issuecomment-1975392230 for a basic PR allowing custom prompts to be defined in a yaml file

paul-gauthier commented 7 months ago

There's a FAQ entry that might contain helpful information:

https://aider.chat/docs/faq.html#can-i-change-the-system-prompts-that-aider-uses

thepigeonoftime commented 7 months ago

There's a FAQ entry that might contain helpful information:

https://aider.chat/docs/faq.html#can-i-change-the-system-prompts-that-aider-uses

Is there a way to use modified versions of these without rebuilding aider?

paul-gauthier commented 7 months ago

Aider is written in python, so there's no need to "rebuild" it. But you do need to know a bit about how to install a development version with pip install -e and then edit the python source.

https://aider.chat/docs/install.html#install-development-versions-of-aider-optional

thepigeonoftime commented 7 months ago

Aider is written in python, so there's no need to "rebuild" it. But you do need to know a bit about how to install a development version with pip install -e and then edit the python source.

https://aider.chat/docs/install.html#install-development-versions-of-aider-optional

The setup of the development instance is what I meant, 'rebuilding' is a misnomer indeed. If there's no perceived value in allowing users modification of system prompts without touching aider source files, e.g. by employing a centralized collection in a serialized data format (or allowing the specification of one for optional overrides), this issue can probably considered for closure given the above link to the system prompt FAQ entry.

paul-gauthier commented 7 months ago

A large portion of the prompt text in coders/xxx_prompts.py is very closely tied to the specifics of the python coder implementation in the matched file coders/xxx_coder.py. It would probably set a wrong expectation to break those prompts apart into a yaml file that is up for ad-hoc editing by users.

If someone wants to change the prompts, they probably need to commit to understanding what it means to modify an aider Coder first.

paul-gauthier commented 6 months ago

There's a FAQ entry that might contain helpful information:

https://aider.chat/docs/faq.html#can-i-specify-guidelines-or-conventions

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

killerapp commented 1 month ago

@paul-gauthier I believe I have a better approach to all of this. I would love to talk to you about it, I'm already talking to the author of Claude-Dev about it.. It doesn't take ANY libraries to implement, it puts the context burden on the codebase developers / team in the form of structured and unstructured context files.

https://github.com/Agentic-Insights/codebase-context-spec

A proposal for a flexible, tool-agnostic, codebase context system that helps teach AI coding tools about your codebase. Super easy to get started, just create a .context.md file in the root of your project.