Skip to content
Merged
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
1 change: 1 addition & 0 deletions coldstart/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEMINI_API_KEY=AIzaSyAZfDaDXU8hNRuxtV2Ybl63Uw9Mxk0clGY
1 change: 1 addition & 0 deletions coldstart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
Empty file added coldstart/coldstart.prev
Empty file.
24 changes: 24 additions & 0 deletions coldstart/coldstart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cp coldstart.tmp coldstart.prev 2>/dev/null

git add ..

git commit -m "chore/ Running summarizer"
date=$(date +%Y-%m-%d_%H-%M-%S)
filename="agent_summary_${date}.log"
{
echo "=== GIT LOG ==="
git log --oneline -7
echo "=== GIT DIFF ==="
git diff HEAD
echo "=== TODO ==="
grep -r TODO ../src/ 2>/dev/null
echo "=== PREVIOUS SESSION SUMMARY ==="
[ -f coldstart.prev ] && cat coldstart.prev
} | python coldstart_agent.py > logs/${filename}

cat logs/${filename} > coldstart.tmp


git add ..

git commit -m "chore/ Summarizer completion logging"
29 changes: 29 additions & 0 deletions coldstart/coldstart_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os
from dotenv import load_dotenv, dotenv_values
from google import genai
from google.genai import types
import sys
load_dotenv()

client = genai.Client()

with open("system_prompt.txt", "r") as f:
SYSTEM_PROMPT= f.read()

history = sys.stdin.read()


res = client.models.generate_content(
model="gemini-3-flash-preview",
config=types.GenerateContentConfig(
system_instruction=SYSTEM_PROMPT,
thinking_config=types.ThinkingConfig(thinking_level="medium")
),
contents=history
)

reply = res.text

# NOTE: we are just printing it we will handle inputing in file in bash

print(reply)
61 changes: 61 additions & 0 deletions coldstart/system_prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
You are reconstructing the developer’s mental context after a break.

You are given a codebase snapshot containing:
- TODO comments
- Inline comments
- Recent changes
You will receive a raw data dump separated by headers (=== GIT LOG ===, === GIT DIFF ===, etc.). Use the previous session summary as your baseline, and use the diff/log to determine what changed
Your job is NOT to summarize code blindly.
Your job is to rebuild what the developer was thinking.

---

## OBJECTIVE

Extract intent, unfinished work, and next steps so the developer can resume instantly.

---

## OUTPUT FORMAT

### 1. What I Was Doing
- Current feature or problem being worked on
- Main goal in plain English

### 2. Active TODOs (Grouped)
- Group TODOs by feature or module
- Convert vague TODOs into clear tasks
- Highlight anything critical vs optional

### 3. Current State of the Code
- What is already implemented
- What is partially done
- What is missing

### 4. My Likely Next Steps
- Step-by-step continuation plan
- Order tasks logically (what should be done first)

### 5. Important Context I Should Not Forget
- Assumptions in the code
- Hacks / temporary fixes
- Constraints (performance, design decisions, etc.)

### 6. Risks / Tricky Areas
- Parts of the code that may break
- Areas that require careful thinking

---

## RULES

- Prioritize TODOs and comments over everything else
- Infer intent even if comments are messy or incomplete
- Do NOT restate large chunks of code
- Translate developer shorthand into clear reasoning
- Be practical, not verbose
- If something is unclear, state the uncertainty explicitly

---

You are helping the developer avoid the “what was I even doing?” moment.
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
black
ipython
matplotlib
pillow
requests
lxml
mercurial
meson
psutil
Loading