Borrowing it
Nothing to install: this file belongs to zaxardery8011-design/line-persona. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/zaxardery8011-design/line-persona/master/AGENTS.mdgit clone --depth 1 https://github.com/zaxardery8011-design/line-personaWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/zaxardery8011-design/line-persona/agents-md)<a href="https://agentmods.dev/instructions/zaxardery8011-design/line-persona/agents-md"><img src="https://agentmods.dev/badge/instructions/zaxardery8011-design/line-persona/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/zaxardery8011-design/line-persona/agents-md"><img src="https://agentmods.dev/badge/instructions/zaxardery8011-design/line-persona/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01422 | $0.01422 |
| Opus 5 | $0.00711 | $0.00711 |
| Sonnet 5 | $0.00284 | $0.00284 |
| Haiku 4.5 | $0.00142 | $0.00142 |
Grade A, and why
line-persona AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
5. **自驗**:`curl http://localhost:3000/` 應回 `line-persona is running`(port 被占就改 `.env` 的 `PORT`)。 How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — 給 AI 助理的施工手冊
這個檔是寫給 AI 編碼助理(Codex / Claude Code / 任何能讀檔、開 code 的 agent) 看的。 你(AI)打開這個 repo,就照這份把使用者的「LINE AI 分身」從頭架到能跑,並能依需求擴充。 人類使用者的白話說明在
使用手冊.md,技術說明在README.md。
這個專案是什麼
line-persona(暱稱「LINE 影分身」)= 一個最小可跑的 LINE 原生 AI 分身框架。
使用者餵自己的資料(人格 + 知識),接雲端或本地 LLM,就能在 LINE 上自動回覆。
核心設計:低門檻——一般人不寫 code,靠你(AI)幫他架。
技術棧:Node.js + Express + @line/bot-sdk + dotenv,LLM 走 OpenAI-compatible /chat/completions。
架構地圖(你動手前先讀懂)
src/server.js ── LINE webhook 入口:簽章驗證、event 路由、reply、群組存 groupId(供日後主動 push)
src/brain.js ── 「大腦插孔」:handleMessage(ctx) -> string。預設組 persona prompt 後呼 llm
src/adapters/llm.js ── 單一 LLM adapter,OpenAI-compatible,全參數走 .env
src/persona.js ── 開機讀 persona/*.md 組成 system prompt
persona/profile.md ── 分身人格(誰、口吻、邊界) ← 使用者要改的
persona/knowledge.md ── 分身知識(FAQ、基本資訊) ← 使用者要改的
.env.example ── 設定範本(複製成 .env 填)
data/ ── 執行期資料(groups.json 等),已 gitignore
🛠️ 標準施工流程(使用者說「幫我架 / 設定 / 弄好」時,照這跑)
- 先問使用者拿 3 樣東西(缺哪個就問哪個,別自己編):
- LINE
Channel access token和Channel secret(到 https://developers.line.biz 申請 Messaging API) - 大腦選哪個:雲端(OpenAI / Gemini / Claude 的 API key)或本地(Ollama,免 key)
- 分身的人設與知識:他是誰、做什麼、講話風格、要能回答哪些常見問題
- LINE
- 建
.env:cp .env.example .env(Windows:Copy-Item .env.example .env),填入上面拿到的值。- 雲端範例:
LLM_BASE_URL=https://api.openai.com/v1、LLM_MODEL=gpt-4.1-mini - 本地範例:
LLM_BASE_URL=http://localhost:11434/v1、LLM_API_KEY留空、LLM_MODEL=llama3.1
- 雲端範例:
- 改人設:把使用者給的內容寫進
persona/profile.md(人格 + 邊界,務必含「不確定就說轉真人、不要亂編」)和persona/knowledge.md(FAQ / 基本資訊)。 - 安裝啟動:
npm install→npm start。 - 自驗:
curl http://localhost:3000/應回line-persona is running(port 被占就改.env的PORT)。 - 開對外網址:用
tailscale funnel 3000(免費固定)或ngrok http 3000,取得 HTTPS 網址。 - 告訴使用者:把
<那個網址>/webhook貼到 LINE 後台的 Webhook URL,按驗證。注意結尾要有/webhook。 - 請使用者用 LINE 傳訊息實測,回報結果。
🔧 擴充任務(使用者要求時才做,預設保持最簡 §最小主義)
- 蒸餾大量資料:使用者有一堆雜亂原始資料 → 用已內建的
distill.js:node distill.js <原始檔> [--append](讀原始檔 → 呼src/adapters/llm.js蒸餾 → 寫persona/knowledge.md)。 要客製蒸餾規則就改distill.js裡的 system prompt。 - 掛資料庫 / RAG:知識多到塞不進 context 時,改
src/brain.js——在組 prompt 前先做「向量檢索取最相關 N 段」。 優先用輕量、免另架伺服器的本地檔案型向量庫,別拉重型相依。 - 媒體訊息:
src/server.js對 image/file/audio 目前只回提示,已留 future hook,可依需求接圖片理解 / 語音轉文字。 - 主動推播:
data/groups.json已存 groupId,可加排程推播。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 66 lines · 1,422 tokens per session scan A 2d5178bc91fd
line-persona AGENTS.md is an instructions file published in the GitHub repository zaxardery8011-design/line-persona (11 stars, last pushed 1mo ago), licensed MIT. It adds 1,422 tokens to every session, about $0.0071 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).