From 5fb3524a649c55bd9500c5b651d15614a19c5a20 Mon Sep 17 00:00:00 2001 From: Aakarsh Kashyap Date: Tue, 31 Mar 2026 00:11:17 +0530 Subject: [PATCH 1/4] chore/ Running summarizer --- coldstart/.env | 1 + coldstart/coldstart.sh | 23 ++++++++++++++ coldstart/coldstart_agent.py | 29 +++++++++++++++++ coldstart/system_prompt.txt | 61 ++++++++++++++++++++++++++++++++++++ requirements.txt | 9 ++++++ 5 files changed, 123 insertions(+) create mode 100644 coldstart/.env create mode 100755 coldstart/coldstart.sh create mode 100644 coldstart/coldstart_agent.py create mode 100644 coldstart/system_prompt.txt create mode 100644 requirements.txt diff --git a/coldstart/.env b/coldstart/.env new file mode 100644 index 0000000..b58096d --- /dev/null +++ b/coldstart/.env @@ -0,0 +1 @@ +GEMINI_API_KEY=AIzaSyAZfDaDXU8hNRuxtV2Ybl63Uw9Mxk0clGY diff --git a/coldstart/coldstart.sh b/coldstart/coldstart.sh new file mode 100755 index 0000000..269844d --- /dev/null +++ b/coldstart/coldstart.sh @@ -0,0 +1,23 @@ +cp coldstart.tmp coldstart.prev 2>/dev/null + +git add .. + +git commit -m "chore/ Running summarizer" + +{ + 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" diff --git a/coldstart/coldstart_agent.py b/coldstart/coldstart_agent.py new file mode 100644 index 0000000..bf0a74f --- /dev/null +++ b/coldstart/coldstart_agent.py @@ -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) diff --git a/coldstart/system_prompt.txt b/coldstart/system_prompt.txt new file mode 100644 index 0000000..4ba15aa --- /dev/null +++ b/coldstart/system_prompt.txt @@ -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. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d55a677 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +black +ipython +matplotlib +pillow +requests +lxml +mercurial +meson +psutil From f0ddebccaa0fc89584e725e770b00c838b71452b Mon Sep 17 00:00:00 2001 From: Aakarsh Kashyap Date: Tue, 31 Mar 2026 00:11:57 +0530 Subject: [PATCH 2/4] chore/ Running summarizer --- coldstart/coldstart.prev | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 coldstart/coldstart.prev diff --git a/coldstart/coldstart.prev b/coldstart/coldstart.prev new file mode 100644 index 0000000..e69de29 From d6f6bfe8757aa39be4523c593c4c478bbf535ac3 Mon Sep 17 00:00:00 2001 From: Aakarsh Kashyap Date: Tue, 31 Mar 2026 00:13:59 +0530 Subject: [PATCH 3/4] chore/ Running summarizer --- coldstart/coldstart.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coldstart/coldstart.sh b/coldstart/coldstart.sh index 269844d..8b3c45f 100755 --- a/coldstart/coldstart.sh +++ b/coldstart/coldstart.sh @@ -3,7 +3,8 @@ 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 From 868ee1b6a534998056df5169e36065c84a89d1a9 Mon Sep 17 00:00:00 2001 From: Aakarsh Kashyap Date: Tue, 31 Mar 2026 00:21:59 +0530 Subject: [PATCH 4/4] Cold start agent seems to be working --- coldstart/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 coldstart/.gitignore diff --git a/coldstart/.gitignore b/coldstart/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/coldstart/.gitignore @@ -0,0 +1 @@ +.env