Skip to content

Instantly share code, notes, and snippets.

View Nishkalkashyap's full-sized avatar

Nishkal Kashyap Nishkalkashyap

View GitHub Profile
name git-change-simplifier
description Review local Git changes and simplify newly added code while preserving behavior. Use when asked to clean up a working tree diff before commit or PR by removing unnecessary type aliases, thin abstractions, one-time constants, unused exports, unused public service methods, duplicated helpers, and non-essential or outdated implementations.

Git Change Simplifier

Overview

Simplify only code introduced or changed in the local diff. Preserve behavior, keep edits small, and favor deletion over abstraction.

@Nishkalkashyap
Nishkalkashyap / refactor-and-simplify-prompt.txt
Last active March 6, 2026 10:48
Code Simplification prompt
You are performing a **Staff Engineer–level cleanup and refactor** of a TypeScript monorepo built with:
* Next.js (App Router)
* React
* Convex
* Turborepo
Your goal is to:
* **simplify the codebase**
@Nishkalkashyap
Nishkalkashyap / puppeteer-architecture-blog.md
Last active February 22, 2026 12:49
Puppeteer Memory: Giving AI Agents Long-Term Memory Without the Context Window Tax (WIP)

Puppeteer Memory: Giving AI Agents Long-Term Memory Without the Context Window Tax

TL;DR: We built a two-agent architecture where a "Puppeteer" agent manages memory (timeline checkpoints + learned knowledge) and directs a stateless "Executor" agent. The executor is a Boltzmann brain—spawned fresh each run with no concept of history. But to the user, the system appears to have perfect memory.


The Problem: AI Agents Forget

Every AI agent has a fundamental constraint: limited context windows.

@Nishkalkashyap
Nishkalkashyap / gemini.object-converter.ts
Last active October 23, 2025 20:33
Zod Schema Converter for Google Generative AI Compatibility
/**
* Gemini generated object to original schema compatible object converter
*
* Utility to convert Gemini generated objects back to their original schema format.
* Pairs with gemini.schema-converter.ts
*/
import { z } from "zod";
function findDiscriminatorKey(schema: z.ZodTypeAny): string | null {
if (schema instanceof z.ZodUnion) {