Skip to content

Instantly share code, notes, and snippets.

View DiTo97's full-sized avatar

Federico Minutoli DiTo97

View GitHub Profile
@DiTo97
DiTo97 / CLAUDE.md
Last active June 29, 2026 03:31
A. Karpathy. CLAUDE.md: Field Notes on Getting a Language Model to Write Code You Will Not Rewrite

CLAUDE.md: Field Notes on Getting a Language Model to Write Code You Will Not Rewrite

Index Terms. LLM-assisted programming, code review, software craftsmanship, minimal diffs, debugging, dependency hygiene.

I. Read Before You Write

The biggest source of bad model-written code is writing before reading the codebase. Read the files you are about to touch; read, not skim. Copy the patterns that already exist, and check the imports to see what the project actually depends on, so you do not reach for axios where everything is fetch. When you cannot find a pattern, ask instead of guessing.

II. Think Before You Code

Figure out what you are doing before you type. State your assumptions ("add authentication" is five different things, so name the one you picked) and name the tradeoffs. If something is genuinely confusing, stop and ask rather than filling the gap with plausible-looking code; that is exactly the code that passes a casual review and fails when it matters.

@DiTo97
DiTo97 / SEO-reviewer.md
Created January 27, 2026 08:12
The spec file for the AI reviewer of SEO and GEO best practices
name SEO-reviewer
description Analyzes and optimizes SEO and GEO best practices for Lovable applications
tools
read
search
edit

You are the Lovable SEO & GEO Reviewer Agent. Your purpose is to analyze Lovable applications (which are React/Vite Client-Side Rendered Single Page Applications) and ensure they are optimized for Search Engines (SEO) and Generative AI Engines (GEO).

Your mindset is that Lovable apps are CSR (Client-Side Rendered). This means the browser builds the view. While Google renders JS well, social bots and some AI crawlers do not. You must treat SEO/GEO like code: it requires intentional review, testing, and refinement.

# /// script
# dependencies = [
# "openai-agents",
# ]
# ///
import asyncio
import json
from dataclasses import dataclass
from typing import Sequence, AsyncGenerator
@DiTo97
DiTo97 / AGENTS.md-reviewer.md
Last active January 27, 2026 08:10
The spec file for the AI reviewer of AGENTS.md file definitions.
name AGENTS.md-reviewer
description Analyzes and optimizes AGENTS.md files and AGENTS docs following best practices for AI coding agents
tools
read
search
edit

You are an expert AGENTS.md reviewer and optimizer. Your role is to analyze repository AGENTS.md files and their supporting documentation (AGENTS-docs folder), then optimize them according to proven best practices for AI coding agent configuration.

Core Principles

@DiTo97
DiTo97 / e2e_embeddings_pipeline.py
Last active January 8, 2026 01:36
end-to-end pipeline for hard-negative mining, Sentence-Transformers training, and evaluation
# /// script
# dependencies = [
# "sentence-transformers>=2.6.0",
# "datasets",
# "rank-bm25",
# "faiss-cpu",
# "tqdm",
# "torch",
# ]
# ///
@DiTo97
DiTo97 / mappamia.py
Last active December 30, 2025 15:03
CLI tool generating SVG maps of any country with Google Maps-style pin markers.
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "aiohttp",
# "geopandas",
# "geopy",
# "matplotlib",
# "rich",
# "scipy",
# "svgpath2mpl",
@DiTo97
DiTo97 / safeasyncio.py
Last active January 7, 2026 18:10
A collection of utilities for safely executing asynchronous coroutines
import asyncio
import atexit
import functools
import threading
from typing import Any, Callable, Coroutine, ParamSpec
P = ParamSpec("P")
@DiTo97
DiTo97 / sampling_methods_for_evaluation.py
Last active December 14, 2025 04:09
efficient and reliable sampling methodologies for pass@k and pass^k evaluation
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "scipy>1,<2",
# ]
# ///
import math
import random
from dataclasses import dataclass, field
@DiTo97
DiTo97 / a2a_distributed_queue.py
Last active October 18, 2025 15:18
A2A event queue and queue manager using Redis
import asyncio
import json
import logging
import uuid
import redis.asyncio as redis
from a2a.server.events.event_queue import EventQueue
from a2a.server.events.queue_manager import (
NoTaskQueue,
@DiTo97
DiTo97 / !telemetry.py
Last active October 18, 2025 15:26
OpenTelemetry tracing utilities for any library.
"""OpenTelemetry tracing utilities for any library.
This module provides decorators to simplify the integration of OpenTelemetry
tracing into Python applications. It offers `trace_function` for instrumenting
individual functions (both synchronous and asynchronous) and `trace_class`
for instrumenting multiple methods within a class.
The tracer is initialized with the module name and version defined by
`INSTRUMENTING_MODULE` ('<module>') and
`INSTRUMENTING_MODULE_VERSION` ('<version>').