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.08294 | $0.08294 |
| Opus 5.5 | $0.03318 | $0.03318 |
| Sonnet 5.5 | $0.01659 | $0.01659 |
| Haiku 4.5 | $0.00829 | $0.00829 |
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 24d 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 — 288 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)、1:1 私訊「輸入中」動畫(LINE_LOADING_SECONDS,0=關;對方要開著聊天室、用 LINE iOS/Android 13.16.0+ 才看得到,LINE 不回報有沒有顯示)
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
src/escalation.js ── 【選配·預設關閉】轉真人閉環。沒開時 brain.js 與 server.js(私訊媒體)的呼叫直接返回
src/history.js ── 【選配·預設關閉】多輪對話記憶(只在記憶體)。沒開時 brain.js 只送當句
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 傳訊息實測,回報結果。
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.
- 24d ago Changed · +23 lines · +2,821 tokens per session 6d42bf0aa4c7
- 1mo ago Changed · -11 tokens per session 2c22abf5db63
- 1mo ago Changed · +199 lines · +4,062 tokens per session a72c81faf06e
- 2mo 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 (15 stars, last pushed 6d ago), licensed MIT. It adds 8,294 tokens to every session, about $0.0332 per session on Opus 5.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.
line-persona AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| line-persona AGENTS.mdzaxardery8011-design/line-persona | Instructions file | 15 | 6d ago | MIT | A | 8,294 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |