Skip to content

Instantly share code, notes, and snippets.

@0xfauzi
0xfauzi / v2.md
Last active February 12, 2026 11:17

DeckBuilder v2: Architectural Principles

Version: 1.2 Date: February 12, 2026 Status: Active — governing all architectural decisions Audience: Architecture review boards, engineering leadership, development team


Purpose

@0xfauzi
0xfauzi / token_management.py
Created October 31, 2025 23:04
Dynamic Token Management in Python
"""Utilities for dynamic token management with OpenAI Responses API and tiktoken.
This module counts tokens, trims/summarizes history to fit a context window,
and computes a safe max_output_tokens honoring application and provider caps.
It also reserves optional reasoning headroom for thinking models.
"""
# pip install openai tiktoken
import os
from typing import List, Dict, Any, Optional, Tuple
import tiktoken
@0xfauzi
0xfauzi / agents-md-best-descriptions.md
Created October 17, 2025 11:13
Agents.md descriptions

Codex CLI Agents Repository and Workflow – Detailed Plan

Overview and Goals

You propose establishing a dedicated internal GitHub repository to share AGENTS.md files and related documentation for using OpenAI’s Codex CLI within the company. The goal is to standardize how developers leverage Codex by providing:

  • Global Agents workflows: e.g. a two-stage “plan then implement” agent setup.
  • Project-level Agents.md templates: standardized formats for common project types (Python/FastAPI services, Terraform IaC, front-end UI projects, AWS Lambdas, etc.).
  • Usage documentation: a guide on installing and using Codex CLI (with company-specific tips).
  • Integration ideas: potential future integrations (e.g. Slack bots, CI/CD automation) to extend Codex’s usefulness.

Repository Structure and Standardization

  • Repository Scope: This will be an internal GitHub repo (accessible only within the company). We don’t have an existing repo for this, so we’ll create it from scratch. Keeping it internal avoids any confi
@0xfauzi
0xfauzi / agents-md-best-practices.md
Created October 17, 2025 11:08
Agents.md best practices

AGENTS.md Best Practices for AI Coding Assistants: Comprehensive Guide

AGENTS.md has emerged as the de facto open standard for guiding AI coding assistants, now adopted by over 20,000 repositories and formalized in August 2025 through collaboration between OpenAI, Google, Cursor, Factory, and Sourcegraph. This file acts as a "README for machines"—providing structured, technical context that helps AI assistants write better code from the start. For Python + AWS + Terraform projects, a well-crafted AGENTS.md dramatically reduces friction, ensuring generated code follows your conventions, uses the right tools, and adheres to security requirements.

What is AGENTS.md and why it matters

AGENTS.md is a dedicated Markdown file that complements, not replaces, README.md. While README targets human developers with project overviews and quick-start guides, AGENTS.md contains detailed technical instructions specifically for AI coding agents. Think of it as onboarding documentation for an AI team member: ex