emperor-agent: Instructions file for Codex

AGENTS.md

emperor-agent AGENTS.md is an instructions file for Codex, OpenCode from TheSyart/emperor-agent. It costs 2,670 tokens per session, scanned A, original, MIT.

A Chinese collaboration guide for Emperor Agent, a locally run TypeScript and Electron desktop AI assistant. It explains the product, its main technologies, where data is stored, and which files agents should read first.

In plain words
What is it for?
Use it when developing Emperor Agent, especially its chat, memory, tools, scheduler, MCP, team, attachment, and desktop-interface features.
Why use it?
It provides project-specific context and boundaries, helping agents preserve the current TypeScript architecture and local data model.

Instructions file for CodexOpenCode

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

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

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/anhuike/Documents/workspace/emperor-agent/assets.

Reuse

Borrowing it

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

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 emperor-agent AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/thesyart/emperor-agent/agents-md"><img src="https://agentmods.dev/badge/instructions/thesyart/emperor-agent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,670 This file is loaded in full into every session.
When invoked 2,670 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.02670 $0.02670
Opus 5 $0.01335 $0.01335
Sonnet 5 $0.00534 $0.00534
Haiku 4.5 $0.00267 $0.00267

Measured 9d ago against content hash 05d9f3869f75, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

emperor-agent 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 9d 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 · 145 lines

How it starts

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

AGENTS.md · Emperor Agent 协作指南

本文件固定保存在仓库根目录,供 Codex 和其他受控 Agent 在开发 Emperor Agent 时读取。普通用户说明以 README.mddocs/user/ 为准;面向人工开发者的操作指南以 docs/development/ 为准。

0. 沟通与原则

  • 默认使用中文沟通;命令、路径、配置 key 保留英文原文。
  • 这是可持续迭代的个人 Agent 工程,不是 demo。改动要优先考虑长期可维护性、可验证性和磁盘数据兼容。
  • 当前主线已经退役 Python runtime:不要新增 agent/tests/requirements*.txtpyproject.toml 或 Python Web/CLI fallback。

1. 项目定位

Emperor Agent 是一个本地运行的 TypeScript / Electron 智能体系统:

  • Electron main 进程内托管 @emperor/core,renderer 通过 preload IPC 调用 CoreApi。
  • Vue 3 + TypeScript + Tailwind 桌面端提供 Chat / Build 多会话、项目级记忆、工具调用、Scheduler、MCP、Team、Ask / Plan、附件与桌宠 companion。
  • 运行数据落在本地全局私有目录(stateRoot,默认 ~/.emperor-agent)里的 memory/model_config.jsonmcp_config.jsonemperor.local.json 等文件中,不写入仓库或项目源码目录。
  • 旧 Python 版只作为迁移背景,不再是可运行产品线;公共仓库不维护旧实现的任务清单或源码对账文档。

2. 先看哪里

  1. README.md + docs/README.md
  2. docs/architecture/overview.md + docs/development/README.md
  3. packages/core/src/api/core-api.ts + packages/core/src/api/services/*
  4. packages/core/src/agent/loop.ts + packages/core/src/agent/runner.ts
  5. packages/core/src/config/* + packages/core/src/model/* + packages/core/src/providers/*
  6. packages/core/src/tools/* + packages/core/src/subagents/* + packages/core/src/extensions/*
  7. packages/core/src/control/* + packages/core/src/permissions/* + packages/core/src/plans/*
  8. packages/core/src/memory/* + packages/core/src/sessions/* + packages/core/src/runtime/*
  9. packages/core/src/scheduler/* + packages/core/src/watchlist/*
  10. packages/core/src/team/* + packages/core/src/mcp/*
  11. desktop/src/main/* + desktop/src/preload/*
  12. desktop/src/renderer/src/api/* + desktop/src/renderer/src/composables/* + desktop/src/renderer/src/runtime/*
  13. desktop/src/renderer/src/components/* + desktop/src/renderer/src/views/*

3. 关键目录

  • packages/core/:核心 Agent runtime、CoreApi、模型/provider、工具、记忆、会话、Scheduler、Team、MCP、权限、计划与项目工作台系统。
  • desktop/:Electron app。src/main 托管 CoreApi 和 app:// 协议;src/preload 暴露 Core IPC;src/renderer 是 Vue 桌面应用。
  • desktop/src/pet/:主进程内托管的可选桌宠 companion;生产包仅内嵌其 allowlist 资源,不存在独立桌宠 runtime。
  • templates/:系统提示词、初始化用户档案和记忆模板。
  • skills/:项目内技能包。少数技能自带 Python helper 脚本属于技能资产,不是主 runtime。
  • assets/:品牌、桌宠、生成素材;生成素材必须记录到对应 PROMPTS.md
  • docs/user/:面向当前产品入口的完整用户手册。
  • docs/architecture/:当前系统边界、执行链路、权限、Goal 与全局存储架构。
  • docs/development/:源码开发和跨层扩展清单。
  • docs/release/:当前 Preview、安全说明、冻结 Stable 流程和工具供应链审核。
  • private-docs/:仓库根目录下的本地个人开发资料,保存实施计划、审计、研究、进度和外部源码借鉴材料;整个目录被 Git 忽略。
  • memory/:旧版本地运行数据残留位置,永不提交。当前默认私有数据根是 ~/.emperor-agentstateRoot,可用 EMPEROR_CONFIG_DIR 覆盖),不再默认写入这里或项目源码目录,详见 docs/architecture/global-state-store.md

Read the full file on GitHub · 145 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. 9d ago First seen · 145 lines · 2,670 tokens per session scan A 05d9f3869f75

Subscribe to this mod's changes

emperor-agent AGENTS.md is an instructions file published in the GitHub repository TheSyart/emperor-agent (184 stars, last pushed 27d ago), licensed MIT. It adds 2,670 tokens to every session, about $0.0134 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.

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

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

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

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