thoughtdag: Instructions file for Codex

AGENTS.md

thoughtdag AGENTS.md is an instructions file for Codex, OpenCode from chenxiachan/thoughtdag. It costs 585 tokens per session, scanned A, original, MIT.

Repository instructions for ThoughtDAG, an open-source app that turns AI conversations into an editable visual map of connected question-and-answer nodes. They describe its React frontend, Express backend, commands, architecture, and coding conventions.

In plain words
What is it for?
Use them when developing, testing, or reviewing ThoughtDAG. They help with running the app, building it, linting, smoke testing, understanding its folders, and changing the conversation-map layout safely.
Why use it?
They give a coding agent the project context it needs before changing code, including how to run checks and which layout, language, and naming rules must be preserved.

Instructions file for CodexOpenCode

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

This is chenxiachan/thoughtdag's own configuration. It tells Codex and OpenCode how to work on thoughtdag 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 thoughtdag configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chenxiachan/thoughtdag. 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/chenxiachan/thoughtdag/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/chenxiachan/thoughtdag

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 thoughtdag AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chenxiachan/thoughtdag/agents-md/github.svg)](https://agentmods.dev/instructions/chenxiachan/thoughtdag/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/chenxiachan/thoughtdag/agents-md"><img src="https://agentmods.dev/badge/instructions/chenxiachan/thoughtdag/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 thoughtdag AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/chenxiachan/thoughtdag/agents-md"><img src="https://agentmods.dev/badge/instructions/chenxiachan/thoughtdag/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 585 This file is loaded in full into every session.
When invoked 585 The same file — it is already loaded in full.
Security scan A 0 findings. 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.00585 $0.00585
Opus 5.5 $0.00234 $0.00234
Sonnet 5.5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 2mo ago against content hash f55f6eb0bbf4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

thoughtdag AGENTS.md scanned grade A with 0 findings 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 31 lines

What it actually says

AGENTS.md

ThoughtDAG:把 LLM 对话变成无限画布上可编辑的思维 DAG(节点=一轮问答,边=上下文流)。React 19 + Vite + TypeScript 前端,Express 代理后端。状态:活跃开发中的开放原型(github.com/chenxiachan/thoughtdag)。

常用命令

npm run dev      # Vite 前端 (默认 5173)
npm run server   # LLM 代理 server.mjs (端口 3001,前端默认指向它)
npm run build    # tsc -b && vite build
npm run smoke    # scripts/smoke.mjs 冒烟测试
npm run lint

需要 .env(见 .env.example):至少一把 LLM key(ZHIPU_API_KEY 免费档 glm-4.5-flash,或 DASHSCOPE_API_KEY 付费)。

架构

  • server.mjs — 唯一后端文件:Express 代理,用 Vercel AI SDK(ai + @ai-sdk/openai-compatible + zhipu-ai-provider)调 LLM;含 agentic 网页搜索 + 行内引用(搜索后保证有综合回答)。
  • src/store/ — zustand 全局状态;持久化用 idb-keyval(IndexedDB)。
  • src/components/ — 画布基于 @xyflow/react(React Flow):ThoughtNode、ThoughtEdgeView、SelectionToolbar(圈选对齐,对齐前有确认提示)、focus-panel/。
  • src/lib/api.ts — 前端到 server.mjs 的调用层。
  • src/i18n/ — 中英双语。
  • Markdown 渲染:react-markdown + KaTeX + highlight.js;PDF 附件用 pdfjs-dist。

约定

  • 布局必须遵守箭头(上下文流)顺序,同一对话链节点竖向对齐——这是用户明确要求过的行为,改布局逻辑时不要破坏。
  • 与用户交流用中文;代码标识符和注释保持英文。
  • UI 文案(i18n、tooltip、toast、placeholder)不出现第三方品牌名。功能性标识除外:环境变量名、导入格式的身份(如 ChatGPT 导出文件)、实际数据源(arXiv、Semantic Scholar)。举例、推荐、宣传式的品牌提及一律用通称("外部 OCR 工具""其他助手")或扩展名(.docx)替代。
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. 2mo ago First seen · 31 lines · 585 tokens per session scan A f55f6eb0bbf4

Subscribe to this mod's changes

thoughtdag AGENTS.md is an instructions file published in the GitHub repository chenxiachan/thoughtdag (742 stars, last pushed 5d ago), licensed MIT. It adds 585 tokens to every session, about $0.0023 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

thoughtdag AGENTS.md compared with instructions from other repositories

thoughtdag AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
thoughtdag AGENTS.mdchenxiachan/thoughtdagInstructions file7425d agoMITA585Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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