thoughtdag AGENTS.md

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/chenxiachan/thoughtdag/agents-md
Clone the repo
git clone --depth 1 https://github.com/chenxiachan/thoughtdag

Made for: Codex, OpenCode.

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. Scan, not verified.
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 $0.00585 $0.00585
Opus 5 $0.00293 $0.00293
Sonnet 5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 3d ago against content hash f55f6eb0bbf4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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):ThoughtNodeThoughtEdgeViewSelectionToolbar(圈选对齐,对齐前有确认提示)、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. 3d 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 (313 stars, last pushed 3d ago), licensed MIT. It adds 585 tokens to every session, about $0.0029 per session on Opus 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.