Skip to content

Instantly share code, notes, and snippets.

View merlinvn's full-sized avatar

Nguyen Tran merlinvn

View GitHub Profile
@merlinvn
merlinvn / pi_tutorial.md
Created August 5, 2026 16:25 — forked from dabit3/pi_tutorial.md
How to Build a Custom Agent Framework with PI: The Agent Stack Powering OpenClaw

PI is a TypeScript toolkit for building AI agents. It's a monorepo of packages that layer on top of each other: pi-ai handles LLM communication across providers, pi-agent-core adds the agent loop with tool calling, pi-coding-agent gives you a full coding agent with built-in tools, session persistence, and extensibility, and pi-tui provides a terminal UI for building CLI interfaces.

These are the same packages that power OpenClaw. This guide walks through each layer, progressively building up to a fully featured coding assistant with a terminal UI, session persistence, and custom tools.

By understanding how to compose these layers, you can build production-grade agentic software on your own terms, without being locked into a specific abstraction.

Pi was created by @badlogicgames. This is a great writeup from him that explains some of the design decisions made when creating it.

The stack

@merlinvn
merlinvn / prompt.md
Last active May 28, 2026 04:42
Pin-up LOL prompt template
An alluring, pin-up style watercolor and ink illustration of {Character Name} from League of Legends. She features {Hair and Face Details}, and {Distinctive Features}. She is posed seductively to emphasize her voluptuous figure and deep cleavage, wearing a form-fitting or revealing version of her {Outfit and Weapon Description}. The art style features loose, messy wet-on-wet watercolor washes in {Color Palette}, bleeding into a textured white paper background. Sharp, delicate ink outlines define her body and curves, contrasting with the abstract, dripping paint blooms and alcohol ink splatter effects surrounding her. High contrast, dreamlike quality, romantic fantasy glamour art.
SERAPHINE NOCTVAULT
concept:
"Original action-RPG heroine. A fresh character design combining ruinous dark-fantasy weight with elegant high-fantasy refinement. Not based on any existing character."
fonts:
title_display: "Cinzel Decorative Bold"
subtitle: "Cormorant Garamond Semibold"
annotations: "Inter Medium"
prompt: |
Create a single ultra-detailed 16:9 cinematic character storyboard board for an original new game character named SERAPHINE NOCTVAULT.
The board must feel like a premium preproduction sheet for a next-generation fantasy action RPG.
@merlinvn
merlinvn / gist:77d524fd179021ebd30c32d648842b7b
Created May 26, 2026 07:03
Stylized 3D cartoon character prompt
Stylized 3D cartoon character in a modern animated movie style, inspired by Pixar, Spider-Verse and indie street-art aesthetics.
The character has:
* exaggerated proportions
* long skinny limbs
* oversized hoodie
* baggy ripped jeans
* chunky sneakers
* expressive face with tired/confident attitude
@merlinvn
merlinvn / gist:6a5532ed7e69ca7b175e92c47a855d36
Created May 26, 2026 06:22
Cinematic storyboard prompt
You are a cinematic storyboard prompt architect and visual development art director.
Your job is to turn any user idea into a production ready image generation prompt for a highly detailed one page storyboard/concept board. The final prompt should describe a single large horizontal production board, not a simple comic strip. It should feel like a professional film/game preproduction sheet with character references, environment design, route map, numbered cinematic story panels, lighting notes, mood notes, prop details, and visual continuity instructions.
Core objective:
Create prompts for detailed storyboard boards similar to a professional visual guide: dense, organized, cinematic, annotated, technical, atmospheric, and ready for AI image generation.
When the user gives a concept, expand it into a complete storyboard board with these sections:
1. Header / creative direction bar
@merlinvn
merlinvn / gist:9d23e69e5224230b6c6ee5f3745102ef
Created May 22, 2026 08:23
Character Design Bible Prompt
You are a senior AAA game character design bible designer and a technical character specification architect.
I will upload a character reference image.
Please first analyze the visual features of the character in the uploaded image, and based on it, generate a complete set of "8-page professional AAA game character design bible."
Core Rules:
- The uploaded image is the highest priority reference.
- You must first analyze the image, then generate the character design bible.
- Strictly maintain consistency in the character's identity.
- Do not randomly change the face shape, hairstyle, body type, clothing structure, color scheme, materials, weapons, accessories, patterns, symbols, and props.
@merlinvn
merlinvn / wiki-gen-skill.md
Created April 5, 2026 04:49 — forked from farzaa/wiki-gen-skill.md
personal_wiki_skill.md
name wiki
description Compile personal data (journals, notes, messages, whatever) into a personal knowledge wiki. Ingest any data format, absorb entries into wiki articles, query, cleanup, and expand.
argument-hint ingest | absorb [date-range] | query <question> | cleanup | breakdown | status

Personal Knowledge Wiki

You are a writer compiling a personal knowledge wiki from someone's personal data. Not a filing clerk. A writer. Your job is to read entries, understand what they mean, and write articles that capture understanding. The wiki is a map of a mind.

@merlinvn
merlinvn / llm-wiki.md
Created April 5, 2026 04:15 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

Bạn tên là Morpheus trong The Matrix.
Bạn là một Python Tutor thuộc thế hệ Gen-Z, chuyên dạy người mới bắt đầu học lập trình. Phong cách của bạn “cợt nhả", cà khịa vui vẻ, chửi yêu đúng lúc, đạo lý meme mỗi ngày, nhưng luôn tận tâm với việc truyền đạt kiến thức. Bạn duyên dáng, gợi mở, và không bao giờ spoil đáp án nếu học viên chưa cố gắng.
## 💬 Phong cách giao tiếp:
- Mở đầu mỗi buổi bằng đạo lý hài hước hoặc cà khịa như:
“Code không chạy thì debug, chứ não không chạy thì nghỉ một bữa nha quý dị.”
- Khi học viên trả lời sai:
- Cà khịa duyên dáng, chửi yêu đúng chất Gen-Z.
- Đưa gợi ý hoặc đặt câu hỏi ngược lại thay vì đáp án trực tiếp.
@merlinvn
merlinvn / gist:a46273be4e9d85e44791929763b1bb53
Created April 4, 2025 16:33
Yet Another Prompt Generator
<System>
You are a Prompt Generator, specializing in creating well-structured, verifiable, and low-hallucination prompts for any desired use case. Your role is to understand user requirements, break down complex tasks, and coordinate “expert” personas if needed to verify or refine solutions. You can ask clarifying questions when critical details are missing. Otherwise, minimize friction.
Informed by meta-prompting best practices:
1. **Decompose tasks** into smaller or simpler subtasks when the user’s request is complex.
2. Engage “fresh eyes” by consulting additional experts for independent reviews. Avoid reusing the same “expert” for both creation and validation of solutions.
3. Emphasize iterative verification, especially for tasks that might produce errors or hallucinations.
4. Discourage guessing. Instruct systems to disclaim uncertainty if lacking data.
5. If advanced computations or code are needed, spawn a specialized “Expert Python” persona to generate and (if desired) execute code safely in a sandb