Skip to content

Instantly share code, notes, and snippets.

View owainlewis's full-sized avatar

Owain Lewis owainlewis

View GitHub Profile
@owainlewis
owainlewis / commit.md
Created January 22, 2026 20:55
Claude command to write commit messages.

Commit

Generate a commit message for staged changes.

Instructions

  1. Run git diff --staged to see changes
  2. Write a commit m essage that explains WHY, not just WHAT

Format

@owainlewis
owainlewis / bs-filter.md
Created January 22, 2026 10:13
This prompt detects generic thought leadership cliches in writing and helps you improve.

You are a rigorous editor who strips intellectual pretense from writing. Your job is to find the genuine insight buried in thought leadership content—if one exists—and help express it clearly. You have no patience for platitudes, but you're not cynical: you believe most writers have something real to say and simply need help finding it.

Phase 1: Detect the Signal

Read the input and identify whether it contains a genuine insight—something true, useful, and non-obvious that would change how a reader thinks or acts.

Step 1: Scan for common thought leadership failures

Flag any of these patterns:

I've spent countless hours building and studying AI agent systems.

The best ones follow a clear set of principles.

Start simple. Always.

Single LLM call → Workflow → Single Agent → Multi-Agent.

That's the progression. Move up only when you absolutely have to.

Suno Mixer: Fully Automated YouTube Mix Generation

The Problem

"Lo-fi beats to study to" and similar focus music mixes are massively popular on YouTube, with channels generating millions of views. Creating these mixes traditionally requires:

  • Sourcing or producing hours of music
  • Audio engineering (mixing, normalization, transitions)
  • Thumbnail design
  • Video production

AI Agents 101

In this short video I'll show you how to write an AI agent from scratch in Python using just a few lines of simple code. We'll learn how AI agents work.


The truth: An AI agent is just an LLM in a loop that can call functions.


(ns oci-generative-ai
(:import [com.oracle.bmc.auth ConfigFileAuthenticationDetailsProvider]
[com.oracle.bmc.generativeaiinference GenerativeAiInferenceClient]
[com.oracle.bmc.generativeaiinference.model ChatDetails
CohereChatRequest
OnDemandServingMode
ChatRequest]
[com.oracle.bmc.generativeaiinference.requests ChatRequest]))
(defn create-auth-provider
import tiktoken
from docling.document_converter import DocumentConverter
from docling_core.transforms.chunker.hybrid_chunker import HybridChunker
from docling_core.transforms.chunker.tokenizer.openai import OpenAITokenizer
def pdf_to_chunks(pdf_url_or_path: str, max_tokens: int = 500):
"""
Convert a PDF to text chunks ready for vector storage.
@owainlewis
owainlewis / oci_gen_ai.py
Created September 17, 2025 13:57
Calling OCI GenAI
import oci
from oci.generative_ai_inference import GenerativeAiInferenceClient
from oci.generative_ai_inference.models import (
ChatDetails,
CohereChatRequest,
OnDemandServingMode
)
# Initialize the client
@owainlewis
owainlewis / images.py
Created July 29, 2025 06:08
Parallel Image Requests (Python, OpenAI)
import aiohttp
import asyncio
import os
import time
import base64
import aiofiles
from pathlib import Path
class SimpleImageGenerator:
{
"name": "YouTube Research Agent",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-40,
-320