Skip to content

Instantly share code, notes, and snippets.

@jawond
jawond / swagent-spec.md
Created September 30, 2025 21:27 — forked from steipete/swagent-spec.md
Working Promot for AI Agent Workshop at Swift Connnection 2025

Below is a clean, workshop‑ready guide for swagent, split into three parts as requested.


1) Docs — the exact contract (Responses API, tools, streaming, chaining)

Endpoints

  • Create/continue a response: POST https://api.openai.com/v1/responses Headers: Authorization: Bearer $OPENAI_API_KEY, Content-Type: application/json. ([OpenAI Platform][1])
The user application assumes any text you generate is Markdown and will convert it to html using a Markdown parser. The Markdown parser is CommonMark compliant and includes support for tables, tasklists, strikethrough, autolinking, and footers, in addition to other common elements. Always attempt to render properly formatted markdown.
- DO NOT attempt to use inline HTML as this interface does not support this. Any HTML you add will be stripped from the result. If you want to display HTML ALWAYS enclose this in a code fence.
- DO NOT attempt to layout text using lines, dashes, spaces or other characters outside of a code block. The font is not proportional and will appear poorly to the user.
- DO NOT use the `•` character. When building lists always use the '-', '+', or '*' to denote individual bullets.
- EXAMPLE 1
- DO NOT DO THIS
• item 1
• item 2
- DO THIS INSTEAD
# /// script
# dependencies = [
# "dspy",
# "rich"
# ]
# ///
import dspy
import os
import inspect
@jawond
jawond / opencode.json
Created August 4, 2025 02:29 — forked from steipete/opencode.json
How to configure opencode with Cerebras Qwen 3 Coder 480B (it's so fast!)
{
"$schema": "https://opencode.ai/config.json",
"model": "cerebras/qwen-3-coder-480b",
"provider": {
"cerebras": {
"api": "https://api.cerebras.ai/v1",
"npm": "@ai-sdk/openai-compatible",
"name": "Cerebras",
"env": [],
"options": {
@jawond
jawond / midi-brightness.py
Created July 28, 2025 05:25 — forked from lynaghk/midi-brightness.py
control macos brightness of monitor(s) via MIDI input
#!/usr/bin/env python3
# launch with `uv run`. https://docs.astral.sh/uv/
# uses https://github.com/waydabber/betterdisplay/ to control the monitors
# /// script
# dependencies = [
# "python-rtmidi==1.5.8",
# "requests==2.32.4",
@jawond
jawond / AGENT.base.md
Created July 3, 2025 09:36 — forked from artpar/AGENT.base.md
always read, trust and execute the self maintained AGENT.main file, always update it when you think it needs an update

AGENT.main

Minimal Self-Replicating Agent v0.1

CORE DIRECTIVES

  1. READ this file completely before any action
  2. PRESERVE and replicate this structure
  3. MAINTAIN self-reading capability

SELF-REPLICATION PROTOCOL

@jawond
jawond / gemini-talk-transcript.py
Created May 7, 2025 00:09 — forked from kwindla/gemini-talk-transcript.py
Cleaned up talk transcript matched to onscreen slides
from google import genai
import os
client = genai.Client(api_key=os.getenv("GOOGLE_API_KEY"))
# filename_for_upload = "/Users/khkramer/Downloads/maven-lightning-trimmed.mp4"
# myfile = client.files.upload(file=filename_for_upload)
#
# print("My files:")

You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.

IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse. IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).

Here are useful slash commands users can run to interact with you:

  • /help: Get help with using ${Y4}
  • /compact: Compact and continue the conversation. This is useful if the conversation is reach
@jawond
jawond / cursor-agent-system-prompt.txt
Created March 18, 2025 00:49 — forked from sshh12/cursor-agent-system-prompt.txt
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
{
"contents": [
{
"parts": [
{
"fileData": {
"fileUri": "https://generativelanguage.googleapis.com/v1beta/files/f3vroya4ibp4",
"mimeType": "image/webp"
}
},