Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions aider/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,26 @@ def cmd_edit(self, args=""):
"Alias for /editor: Open an editor to write a prompt"
return self.cmd_editor(args)

def cmd_summarize(self, args):
"Create a technical summary of the chat and work done so far"
from datetime import datetime

filename = args.strip()
today = datetime.now().strftime("%Y-%m-%d")

if filename:
file_instruction = f"Save this summary into `{filename}`."
else:
file_instruction = (
"Save this summary into a new Markdown file named "
f"`SUMMARY-{today}-description.md`, replacing 'description' "
"with a 3-5 word slug representing our task."
)

prompt = prompts.summarize_command_prompt.format(file_instruction=file_instruction).strip()

return self._generic_chat_command(prompt, self.coder.main_model.edit_format)

def cmd_think_tokens(self, args):
"""Set the thinking token budget, eg: 8096, 8k, 10.5k, 0.5M, or 0 to disable."""
model = self.coder.main_model
Expand Down
14 changes: 14 additions & 0 deletions aider/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,17 @@
"""

summary_prefix = "I spoke to you previously about a number of things.\n"

# /summarize
summarize_command_prompt = """
Act as a senior software engineer. Create a detailed technical summary of our entire conversation and the work performed so far. {file_instruction}

The summary must include:
1. **Project Context**: The high-level goal of the current session.
2. **Work Completed**: Specific changes made, including key functions or files modified.
3. **Technical Discoveries**: Non-obvious insights gained about the codebase, logic constraints, or bugs identified during development.
4. **Architectural Decisions**: Why specific approaches were taken over alternatives.
5. **Pending Work**: A 'Next Steps' section with enough detail for a developer to resume immediately.

Preserve all critical technical details and specific implementation patterns discussed. Write the output as a Markdown file.
"""