Skip to content

Instantly share code, notes, and snippets.

View valarpirai's full-sized avatar

Valar valarpirai

View GitHub Profile
@valarpirai
valarpirai / maze.py
Created October 22, 2026 11:16
Maze. Returns a 2D list of size (2*height+1) x (2*width+1)
import random
WALL, OPEN = "|", " "
def createMaze(width=10, height=10, seed=None):
"""
Returns a 2D list of size (2*height+1) x (2*width+1).
'|' = wall, ' ' = open path. No loops (spanning tree).
Entrance: left edge, first row. Exit: right edge, last row.
@valarpirai
valarpirai / setting-up-claude-ready-repos-SKILL.md
Created September 25, 2026 10:38
Audit or set up a code repository so Claude Code works efficiently in it
name setting-up-claude-ready-repos
description Audit or set up a code repository so Claude Code works efficiently in it — CLAUDE.md, path-scoped .claude/rules, subtree memory, verify scripts, pre-commit hooks, shared settings.json, agents and skills. Use this whenever the user wants to "set up a repo for Claude", "make Claude work better in this codebase", write or trim a CLAUDE.md, add .claude/rules, onboard a new or existing repo to Claude Code, review their Claude setup, or asks why Claude keeps making the same mistakes in a project — even if they don't say "audit" or "scaffold".

Setting up Claude-ready repos

A repo works well with Claude when three things hold:

  1. Claude loads only what the task needs. Small, scoped instructions beat
name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output.

Explain Diff

Please make me a rich, interactive explanation of the specified code change.

It should have these sections:

@valarpirai
valarpirai / Claude-Doc-Structure-Prompt.md
Created June 1, 2026 02:25
Organize repo documentation into a three-tier structure. Minimizes token usage. Maximizes Claude's ability to work correctly

Claude Doc Structure Prompt

Organize repo documentation into a three-tier structure. Minimizes token usage. Maximizes Claude's ability to work correctly.


The Prompt

Analyse this repo and organize its documentation into a three-tier 
@valarpirai
valarpirai / byte-buddy-guide.md
Last active May 26, 2026 07:18
Byte Buddy: A Practical Guide to Java Bytecode Instrumentation

Byte Buddy: A Practical Guide to Java Bytecode Instrumentation

Byte Buddy lets you create and modify Java classes at runtime without a compiler. You can add methods, intercept calls, inject fields, and rewrite bytecode — all after the JVM has started.

This guide walks through every major strategy with working examples, failure cases, and real-world parallels.


Table of Contents

A Shared Gradle Build System for Multi-Repo Platforms

Large Java platforms often span dozens of repositories — each with its own build files, dependency declarations, and tooling configuration. Without a unified approach, version drift creeps in, build logic gets duplicated, and a routine dependency upgrade turns into a multi-repo coordination nightmare.

This post walks through an architecture pattern that solves this using Gradle: a dedicated shared-build repository that acts as the single source of truth for build logic, dependency versions, and project conventions across every repo in the platform.


Key Principles

@valarpirai
valarpirai / ticket-booking-system-design-summary.md
Created April 22, 2026 12:50
Summary of system design round summary

Here's a clean, concise summary of the key steps to design a Ticket Booking System (like BookMyShow or Ticketmaster) in a system design interview:

1. Clarify Requirements (5–8 mins)

  • Functional: Browse/search events by city/date/category → View seat map → Select & hold seats → Make payment → Confirm booking → View/cancel bookings.
  • Non-Functional: Handle high concurrency (flash sales), prevent double-booking (strong consistency for seats), low latency, high availability (99.99%), scalability to 10k–100k+ RPS at peak.
  • Ask about scale, payment integration, cancellation rules, admin features.

2. Back-of-the-Envelope Estimation

Estimate:

  • Daily active users, peak RPS during sales.
@valarpirai
valarpirai / Build-A-Programming-Language.md
Last active May 9, 2026 15:31
How to build a programming language. Step by step guide

How to Build a Simple Programming Language

A step-by-step guide grounded in the Aether language — a complete tree-walking interpreter written in Rust.


For Beginners: Where to Start

Prerequisites

@valarpirai
valarpirai / multi-agent.md
Last active April 8, 2026 05:43
AI Agent integration with Slack bot

Product Requirements Document (PRD)

Product Name: Multi-Agent Slack Bot (OpsBot / AgentHub)
Version: 1.1
Date: April 08, 2026
Author: Grok – AI Agentic Engineer
Status: Revised & Consolidated

1. Executive Summary

@valarpirai
valarpirai / claude_god.md
Last active July 24, 2026 06:34
Claude Code God PROMPT
  • Analyse the @docs dir and claude.md
  • What can be improved in the doc files so that claude code can work better?
  • After the doc changes, review it
  • Don't try to create large files at single shot instead create them step by step
  • We must follow "this is what this does" documentation and hemingway style