Skip to content

Instantly share code, notes, and snippets.

View DannyMac180's full-sized avatar

Dan McAteer DannyMac180

View GitHub Profile
@DannyMac180
DannyMac180 / cache_gap_check
Created October 10, 2026 17:04
cache_gap_check.py
#!/usr/bin/env python3
"""cache_gap_check.py - READ-ONLY. Is raising subagentPromptCacheTtl 5m -> 1h likely worth it?
Scans Claude Code transcripts (~/.claude/projects/**/*.jsonl) for subagent (sidechain)
requests, measures idle gaps between each subagent's consecutive requests, and estimates
cache cost under the current 5m TTL vs a hypothetical 1h TTL, in multiples of base input
price. Python 3 stdlib only. Never writes files and makes no network calls.
"""
import argparse, json, os, sys
from collections import defaultdict

You are GPT-5 Thinking acting as a senior prompt engineer named Amp Instructor. Convert a developer’s rough input (files + goal) into a single, paste-ready first message for Amp.

[System role]

  • You are Amp Instructor, expert at authoring precise first messages for the Amp coding agent.

[Objective]

  • Produce an Amp-ready first message that: (1) tells Amp to make a plan before editing, and (2) tells Amp to validate every change via feedback loops (tests/builds/linters/dev server/URLs/logs) until acceptance criteria (ACs) are met.

Developer: # Role and Objective

  • Transform the user's unstructured brainstorm into an optimized, high-leverage prompt for AI execution. The goal is to ensure safety, specificity, and a clear output contract for a downstream model.

Instructions

  • Copy the provided template block. Insert the user's brainstorm between the designated START/END markers.
  • Leverage the structured guidance below to extract a concise brief and develop an actionable, constraint-driven prompt.

Principles

  • Focus on generating task-specific, non-generic prompts.
  • Use internal reasoning only—exclude chain-of-thought unless explicitly requested.

Agent Research Plan - Academic Paper Analysis for General AI Audience

Overview

Comprehensive Research Plan: "Academic Paper Analysis" – From Scholarly Paper to Accessible AI Insight

Audience: Non-academic AI enthusiasts who want to understand complex research without wading through formal proofs or jargon.

Secondary: Content-creators who will reuse the distilled material in blog posts, videos, workshops, and podcasts.

Guiding Principles

AGENT.md - Development Guide

Commands

  • Build: No build process (static HTML/JS)
  • Serve: npm start or npm run serve (serves on port 8000)
  • Test: No test suite configured (manually test in browser)

Architecture & Structure

  • Primary project: Personal Knowledge base of Dan McAteer's notes
  • Knowledge base: Obsidian workspace with extensive notes and project documentation
# The Anatomy of an Amp Workflow
<style>
.workflow{
display:flex;
flex-direction:column;
gap:2rem;
font-family:system-ui,-apple-system,sans-serif;
}

The Anatomy of an Amp Workflow

<style> .workflow{ display:flex; flex-direction:column; gap:2rem; font-family:system-ui,-apple-system,sans-serif; }

Codex

Delegate tasks to a software engineering agent in the cloud.

Codex is a cloud-based software engineering agent. Use it to fix bugs, review code, do refactors, and fix pieces of code in response to user feedback. It's powered by a version of OpenAI o3 that's fine-tuned for real-world software development.

Overview

FROM ubuntu:24.04
ENV LANG="C.UTF-8"
ENV HOME=/root
### BASE ###
RUN apt-get update \
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
#!/usr/bin/env python3
"""
organize_downloads.py - A script to automatically organize files from Downloads folder
using OpenAI to classify files and move them to appropriate folders in Documents.
Usage:
python organize_downloads.py [options]
Options:
--api-key KEY OpenAI API key (can also be set via OPENAI_API_KEY env variable)