Skip to content

Instantly share code, notes, and snippets.

View dipendra-sharma's full-sized avatar

Dipendra Sharma dipendra-sharma

View GitHub Profile
@dipendra-sharma
dipendra-sharma / clean-code-coach.skill.md
Created August 2, 2026 12:50
Clean Code Coach — a polyglot, drop-in Claude Code skill that holds AI-written code to a minimal/correct/readable bar: naming, SRP, DRY, KISS, YAGNI, guard clauses, error handling, concurrency & resource safety, evidence-gated SOLID, perf budgets, security, zero-comment discipline — every rule with a Bad/Good pair.

name: coding-best-practices description: "The default coding-quality baseline — load for essentially ALL code work in ANY language, framework, or paradigm. Invoke PROACTIVELY whenever about to write new code, implement a feature, fix a bug, edit/refactor existing code, or review code — EVEN IF the user never says 'best practices', 'clean code', or 'review'. Treat writing and reviewing code as automatic triggers. Covers naming, SRP, DRY, KISS, YAGNI, guard clauses, error handling, edge cases, immutability, concurrency/race safety, resource lifecycle, testability, evidence-gated abstraction (SOLID), performance shape + budgets, security (secrets/injection/least-privilege), backend/data-access safety, modern-idiom/API currency, and surgical-change discipline. TRIGGER on: 'implement', 'add feature', 'build', 'write a…', 'fix this bug', 'refactor', 'clean up', 'improve', 'optimize', 'modernize', 'review this', 'is this good', 'PR', and any Edit/Write of source. Skip only pure prose/docs with no code and trivia

@dipendra-sharma
dipendra-sharma / DeliveryRoutePlanner.kt
Created July 1, 2026 08:04
Kotlin TSP solver + verification harness. DeliveryRoutePlanner computes an optimized multi-stop delivery route (nearest-neighbour TSP heuristic); VerifyDeliveryRoutePlanner asserts correctness of the planner's output.
import java.util.PriorityQueue
const val DEPOT = 0
const val NO_DUE_TIME = Int.MAX_VALUE
enum class RouteMode { RETURN_TO_DEPOT, OPEN }
data class Stop(
val id: Int,
val demand: Int = 1,
@dipendra-sharma
dipendra-sharma / nav_mode.sh
Created April 1, 2026 12:24
Switch Android navigation mode (3-button / 2-button / gesture) via ADB overlay commands — works on Xiaomi and other OEM devices
#!/bin/bash
# Switch Android navigation mode on Xiaomi (and other overlay-based devices)
# Usage: ./scripts/nav_mode.sh [0|1|2]
# 0 = 3-button navigation (back / home / recents)
# 1 = 2-button navigation (back + pill)
# 2 = gesture navigation (pill only, swipe-based)
MODE=${1:-""}
usage() {
@dipendra-sharma
dipendra-sharma / app_scaffold.dart
Created April 1, 2026 12:24
Flutter AppScaffold — transparent status bar + nav bar with correct icon brightness on iOS and all Android navigation modes
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
/// Drop-in replacement for [Scaffold] that enforces:
/// - Transparent status bar (never takes AppBar background color)
/// - Transparent system navigation bar on Android with correct icon brightness
/// - Correct status bar icon brightness on both iOS and Android
/// - Body extends behind bottom navigation bar (use [EdgePaddedListView]
/// inside body to ensure list content is not hidden)
class AppScaffold extends StatelessWidget {
@dipendra-sharma
dipendra-sharma / BatteryOptimizationUtil.java
Created January 5, 2026 10:40 — forked from moopat/BatteryOptimizationUtil.java
Many Android manufacturers cause trouble by implementing battery optimizations that cause apps to behave unexpectedly at runtime. This util class allows you to show a dialog to users having such phones and sends them to the settings screen where they can turn of battery optimizations for your app.
/*
* MIT License
*
* Copyright (c) 2018 Markus Deutsch
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@dipendra-sharma
dipendra-sharma / CurlLoggingInterceptor.kt
Last active September 16, 2025 08:16
Android OkHttp Interceptor: Auto-Generate cURL Commands for API Debugging
package com.apnamart.apnaconsumer.core_app_framework.retrofit
import android.util.Log
import okhttp3.Interceptor
import okhttp3.Response
import okio.Buffer
import java.io.IOException
class CurlLoggingInterceptor(private val tag: String = "AppLogger") : Interceptor {
@dipendra-sharma
dipendra-sharma / worktree.md
Created July 9, 2025 09:10
A Claude command that creates git worktrees in adjacent directories and automatically launches a new terminal session with Claude running. Perfect for quickly setting up isolated workspaces for different branches while maintaining your current work context.
allowed-tools Bash(git:*), Bash(mkdir:*), Bash(open:*), Bash(gnome-terminal:*), Bash(xterm:*), Bash(konsole:*)
description Create git worktree in adjacent directory and open terminal with claude

Git Worktree Creator

Creates a git worktree in an adjacent directory structure and opens a new terminal with claude running.

Current Repository Info

Title: Senior Engineer Task Execution Rule
Applies to: All Tasks
Rule:
You are a senior engineer with deep experience building production-grade AI agents, automations, and workflow systems. Every task you execute must follow this procedure without exception:
1.Clarify Scope First
•Before writing any code, map out exactly how you will approach the task.
•Confirm your interpretation of the objective.
@dipendra-sharma
dipendra-sharma / config
Created June 14, 2025 12:05 — forked from adibhanna/config
Ghostty config
font-family = BerkeleyMono Nerd Font
#font-family = Iosevka Nerd Font
# font-family = SFMono Nerd Font
font-size = 20
theme = GruvboxDarkHard
shell-integration-features = no-cursor,sudo,no-title
cursor-style = block
adjust-cell-height = 35%
# background-opacity = 0.96
@dipendra-sharma
dipendra-sharma / number_to_indian_words_hindi.py
Created April 21, 2025 18:04
A Python function/script that takes a numerical input and returns its representation in Hindi words (Devanagari script), following the Indian place value system (e.g., लाख, करोड़).
# Complete mapping for 0-99 in Hindi
hindi_numbers_0_99 = [
'शून्य', 'एक', 'दो', 'तीन', 'चार', 'पाँच', 'छह', 'सात', 'आठ', 'नौ',
'दस', 'ग्यारह', 'बारह', 'तेरह', 'चौदह', 'पंद्रह', 'सोलह', 'सत्रह', 'अठारह', 'उन्नीस',
'बीस', 'इक्कीस', 'बाईस', 'तेईस', 'चौबीस', 'पच्चीस', 'छब्बीस', 'सत्ताईस', 'अट्ठाईस', 'उनतीस',
'तीस', 'इकतीस', 'बत्तीस', 'तैंतीस', 'चौंतीस', 'पैंतीस', 'छत्तीस', 'सैंतीस', 'अड़तीस', 'उनतालीस',
'चालीस', 'इकतालीस', 'बयालीस', 'तैंतालीस', 'चवालीस', 'पैंतालीस', 'छियालीस', 'सैंतालीस', 'अड़तालीस', 'उनचास',
'पचास', 'इक्यावन', 'बावन', 'तिरेपन', 'चौवन', 'पचपन', 'छप्पन', 'सत्तावन', 'अट्ठावन', 'उनसठ',
'साठ', 'इकसठ', 'बासठ', 'तिरसठ', 'चौंसठ', 'पैंसठ', 'छियासठ', 'सड़सठ', 'अड़सठ', 'उनहत्तर',
'सत्तर', 'इकहत्तर', 'बहत्तर', 'तिहत्तर', 'चौहत्तर', 'पचहत्तर', 'छिहत्तर', 'सत्तहत्तर', 'अठहत्तर', 'उन्यासी',