NoteAI AGENTS.md

A set of repository instructions for NoteAI, a desktop application built with Tauri and Python. It explains how the project should be structured, how its parts communicate, and where prompts for language models belong.

In plain words
What is it for?
Use it when changing NoteAI code, especially its HTML, CSS, JavaScript, Python, prompts, or Tauri startup process.
Why use it?
It gives coding agents project-specific rules, reducing inconsistent code structure and incorrect ways of starting or connecting the application.

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/miles128/noteai/agents-md
Clone the repo
git clone --depth 1 https://github.com/Miles128/NoteAI

Made for: Codex, OpenCode.

Per session 3,501 This file is loaded in full into every session.
When invoked 3,501 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.03501 $0.03501
Opus 5 $0.01750 $0.01750
Sonnet 5 $0.00700 $0.00700
Haiku 4.5 $0.00350 $0.00350

Measured 2d ago against content hash 3ad13e3b2d17, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

NoteAI 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 2d 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 · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

本文件为 AI 编码助手(Claude Code、Codex、Jcode、Trae Agent 等)提供 NoteAI 仓库的工作指南。它合并了原 AGENTS.md.trae/rules/project_rules.md,以当前代码实际为准。


1. 项目规则

1.1 模块化要求

  • 项目必须模块化:每个功能模块独立成文件/目录,职责单一,禁止在单文件中混合多个不相关功能。
  • 前端模块化:JS/CSS 按功能拆分文件,通过统一入口加载,禁止所有代码堆在一个文件中。
  • 后端模块化:Python 按功能拆分模块(如 note_integration.pyweb_download.py),通过 __init__.py 统一导出。
  • 模块间通信:通过明确的接口/函数调用交互,禁止模块间直接操作彼此内部状态。

1.2 技术架构

  • 前端:Tauri v2 + 原生 HTML/CSS/JS。
  • 后端:Python sidecar,通过 stdin/stdout JSON-RPC 与前端通信。
  • 前端调用后端:统一使用 window.api 对象(定义在 webui/js/api.js),禁止使用其他兼容层。
  • 界面风格:整体对标 Obsidian 应用。

1.3 Prompt 管理

所有传递给大模型的系统提示词必须放在 prompts/ 目录下,禁止在业务代码中直接内联定义系统提示词。

  • prompts/yaml/*.yaml单一事实来源prompts/__init__.py 通过 prompts/loader.py 在导入时解析为常量。
  • 提示词中可包含占位变量(如 {topic_name}{content}),业务代码使用 .format() 填充。
  • 新增提示词:先在 prompts/yaml/ 添加 YAML,再在 prompts/__init__.py 导出对应常量。

1.4 应用启动

桌面 App 本身就是 Tauri 应用:Tauri 壳加载 webui/ 并拉起 Python sidecar。启动方式:

uv run python run.py     # 开发者启动器(推荐):检查 Python 依赖 + Tauri CLI 后执行 cargo tauri dev
cargo tauri dev          # 等效命令:依赖已就绪时直接启动 Tauri 开发模式

禁止直接用浏览器打开 webui/index.html 或用 python -m http.server 等方式启动(前端必须经由 Tauri IPC 调 sidecar)。

不要与 python/main.py(sidecar 进程入口,由 Tauri 壳拉起)混淆。

1.5 依赖管理

使用 uv 管理 Python 依赖,禁止直接使用系统 pip install

uv sync --extra dev --extra rag --extra ingest   # 安装依赖(RAG 与采集转换链默认包含)
uv run pytest                     # 运行测试

依赖声明于 pyproject.tomluv.lock 提交入库。前端依赖走 npm(package.json)。

1.6 Git 仓库配置

  • 远程仓库名NoteAI(不是 origin),SSH 地址 [email protected]:Miles128/NoteAI.git,禁止 HTTPS 推送。
  • 推送git push NoteAI <branch-name>
  • PR 流程:推送后使用 gh pr create --base main 创建 PR,再 gh pr checks 确认 CI,形成"推送 → 建 PR → 确认 CI"闭环。

2. 构建与测试

uv sync --extra dev --extra rag --extra ingest   # 安装依赖
uv run pytest                     # 运行全部测试(~69 单元 + 3 集成测试模块)
uv run python run.py              # 启动 Tauri dev 模式(检查依赖 + cargo tauri dev)

Read the full file on GitHub · 135 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. 2d ago First seen · 135 lines · 3,501 tokens per session scan A 3ad13e3b2d17

Subscribe to this mod's changes

NoteAI AGENTS.md is an instructions file published in the GitHub repository Miles128/NoteAI (5 stars, last pushed 4d ago), licensed Unlicense. It adds 3,501 tokens to every session, about $0.0175 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-31.

Related

Other instructions, from other repositories

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,182 tokens

buildNext

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

next.js 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

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

spec-kit 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,040 tokens

langchain 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,345 tokens