line-persona: Instructions file for Codex

AGENTS.md

line-persona AGENTS.md is an instructions file for Codex, OpenCode from zaxardery8011-design/line-persona. It costs 8,294 tokens per session, scanned A, original, MIT.

A repository handbook for an AI coding assistant that sets up and extends a LINE AI persona, an automated chatbot that replies to people through LINE using an AI model.

In plain words
What is it for?
Use it to set up the LINE webhook, connect a cloud or local language model, edit the persona and knowledge files, and add requested extensions.
Why use it?
It explains the project structure and setup questions so the assistant can configure the chatbot without guessing about credentials, personality, or knowledge.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is zaxardery8011-design/line-persona's own configuration. It tells Codex and OpenCode how to work on line-persona itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything line-persona configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/zaxardery8011-design/line-persona/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/zaxardery8011-design/line-persona

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for line-persona AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/zaxardery8011-design/line-persona/agents-md/github.svg)](https://agentmods.dev/instructions/zaxardery8011-design/line-persona/agents-md)
Your own site
<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.

agentmods 80×15 button for line-persona AGENTS.md

Your own site · 80×15
<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>
Per session 8,294 This file is loaded in full into every session.
When invoked 8,294 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 24d ago against content hash 6d42bf0aa4c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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`)。
AGENTS.md · 288 lines

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

🛠️ 標準施工流程(使用者說「幫我架 / 設定 / 弄好」時,照這跑)

  1. 先問使用者拿 3 樣東西(缺哪個就問哪個,別自己編):
    • LINE Channel access token 和 Channel secret(到 https://developers.line.biz 申請 Messaging API)
    • 大腦選哪個:雲端(OpenAI / Gemini / Claude 的 API key)或本地(Ollama,免 key)
    • 分身的人設與知識:他是誰、做什麼、講話風格、要能回答哪些常見問題
  2. 建 .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
  3. 改人設:把使用者給的內容寫進 persona/profile.md(人格 + 邊界,務必含「不確定就說轉真人、不要亂編」)和 persona/knowledge.md(FAQ / 基本資訊)。
  4. 安裝啟動:npm install → npm start。
  5. 自驗:curl http://localhost:3000/ 應回 line-persona is running(port 被占就改 .env 的 PORT)。
  6. 開對外網址:用 tailscale funnel 3000(免費固定)或 ngrok http 3000,取得 HTTPS 網址。
  7. 告訴使用者:把 <那個網址>/webhook 貼到 LINE 後台的 Webhook URL,按驗證。注意結尾要有 /webhook。
  8. 請使用者用 LINE 傳訊息實測,回報結果。

Read the full file on GitHub · 288 lines

Changes

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.

  1. 24d ago Changed · +23 lines · +2,821 tokens per session 6d42bf0aa4c7
  2. 1mo ago Changed · -11 tokens per session 2c22abf5db63
  3. 1mo ago Changed · +199 lines · +4,062 tokens per session a72c81faf06e
  4. 2mo ago First seen · 66 lines · 1,422 tokens per session scan A 2d5178bc91fd

Subscribe to this mod's changes

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.

Related

line-persona AGENTS.md compared with instructions from other repositories

line-persona AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
line-persona AGENTS.mdzaxardery8011-design/line-personaInstructions file156d agoMITA8,294Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode