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 1,422 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 1,422 This file is loaded in full into every session.
When invoked 1,422 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.01422 $0.01422
Opus 5 $0.00711 $0.00711
Sonnet 5 $0.00284 $0.00284
Haiku 4.5 $0.00142 $0.00142

Measured 11d ago against content hash 2d5178bc91fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 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`)。
AGENTS.md · 66 lines

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

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

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

🔧 擴充任務(使用者要求時才做,預設保持最簡 §最小主義)

  • 蒸餾大量資料:使用者有一堆雜亂原始資料 → 用已內建的 distill.jsnode 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,可加排程推播。

Read the full file on GitHub · 66 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. 11d 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 (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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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.

langchain-ai/langchain · 4,469 tokens

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

microsoft/vscode · 5,001 tokens