A comprehensive, step-by-step guide to rebuild the Tweet Curator application from scratch. This app imports a Twitter/X archive, lets you curate tweets via a Tinder-style swipe interface, manages tags with AI assistance, schedules blog posts to Substack, and broadcasts short-form content to Bluesky, LinkedIn, Threads, and Instagram.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { spawnSync } from "node:child_process"; | |
| import fs from "node:fs"; | |
| import os from "node:os"; | |
| import path from "node:path"; | |
| import type { ExtensionAPI, SessionEntry } from "@mariozechner/pi-coding-agent"; | |
| import type { AssistantMessage } from "@mariozechner/pi-ai"; | |
| function getLastAssistantText(branch: SessionEntry[]): string | undefined { | |
| for (let i = branch.length - 1; i >= 0; i--) { | |
| const entry = branch[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior | |
| # | |
| # What this does: | |
| # Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance | |
| # system prompt instructions that cause the model to cut corners, simplify | |
| # excessively, and defer complicated work. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The most atomic way to train and inference a GPT LLM in pure, dependency-free Python. | |
| Differences from GPT-2 are minor: rmsnorm instead of layer norm, no biases, square ReLU instead of GeLU nonlinearity. | |
| The contents of this file is everything algorithmically needed to train a GPT. Everything else is just efficiency. | |
| Art project by @karpathy. | |
| """ | |
| import os # for os.path.exists | |
| import math # for math.log, math.exp | |
| import random # for random.seed, random.choices |
Below is a clean, workshop‑ready guide for swagent, split into three parts as requested.
Endpoints
- Create/continue a response:
POST https://api.openai.com/v1/responsesHeaders:Authorization: Bearer $OPENAI_API_KEY,Content-Type: application/json. ([OpenAI Platform][1])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # dependencies = [ | |
| # "dspy", | |
| # "rich" | |
| # ] | |
| # /// | |
| import dspy | |
| import os | |
| import inspect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$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": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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", |
NewerOlder