by SaladDay
600 行 TypeScript 写成的超级迷你版 pi,让你轻松从 0 写出属于你的 pi-agent
# Add to your Claude Code skills
git clone https://github.com/SaladDay/pi-from-scratchGuides for using ai agents skills like pi-from-scratch.
pi-from-scratch is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by SaladDay. 600 行 TypeScript 写成的超级迷你版 pi,让你轻松从 0 写出属于你的 pi-agent. It has 92 GitHub stars.
pi-from-scratch's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/SaladDay/pi-from-scratch" and add it to your Claude Code skills directory (see the Installation section above).
pi-from-scratch is primarily written in TypeScript. It is open-source under SaladDay on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh pi-from-scratch against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
从零手写一个能读文件、改代码、执行命令的 TypeScript coding agent。
项目沿着 pi 的数据流拆解,需要什么、我们造什么,所有组件都是符合直觉的。
删除 pi 的工程细节,留下 pi 的核心思想。
放轻松,这是一篇文章,不是一本书,你会很容易看懂。
网站把文章和源码放在一起。阅读推进时,右侧编辑器会逐步补全代码,当你看完的时候,nano-pi 的代码也会全部呈现在编辑器中。
同时设计了一个 Trace 跟踪,可以打断点逐行过代码,希望能帮助大家理解代码执行流。
文章保留古法手敲,尽可能没有ai味,希望大家读的开心。
需要 Node.js 22 或更高版本,以及一个 OpenAI 兼容 API。
npm install
export NANOPI_API_KEY=your-api-key
npm run dev
可选环境变量:
NANOPI_MODEL:模型名NANOPI_BASE_URL:OpenAI 兼容接口地址,默认 https://api.openai.com/v1线上 trace 是预先生成的静态数据,浏览网站不会发起模型请求。
cd web
npm install
npm run dev
npm test
cd web && npm test