PiDeck: Instructions file for Codex

AGENTS.md

PiDeck AGENTS.md is an instructions file for Codex, OpenCode from ayuayue/PiDeck. It costs 12,913 tokens per session, scanned A, original, MIT.

Repository instructions for PiDeck, a desktop Electron application for managing AI coding-agent sessions across projects. They define the boundary between the agent process and the desktop interface, which communicate through JSON-RPC, a structured message format.

In plain words
What is it for?
Use them when changing windows, sessions, terminals, Git tools, settings, agent processes, shared types, or communication between the desktop and agent.
Why use it?
They prevent the two sides of the application from duplicating each other's responsibilities and help keep session state, process events, and desktop communication consistent.

Instructions file for CodexOpenCode

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

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

About the project

PiDeck is an open-source Electron desktop workbench for managing coding-agent conversations across local project directories, including pi and DSH sessions and imported Codex or Claude sessions. It is for developers who want one graphical workspace for multiple projects, session history, Git status, terminals, model settings, and extensions. Catalogue add-ons extend PiDeck's configuration and workflow capabilities.

ayuayue/PiDeck · 1,147 stars · on GitHub · pideck.caoayu.top

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ayuayue/pideck/agents-md"><img src="https://agentmods.dev/badge/instructions/ayuayue/pideck/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12,913 This file is loaded in full into every session.
When invoked 12,913 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.12913 $0.12913
Opus 5.5 $0.05165 $0.05165
Sonnet 5.5 $0.02583 $0.02583
Haiku 4.5 $0.01291 $0.01291

Measured 3d ago against content hash 994d027c7711, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

PiDeck 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 · 276 lines

How it starts

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

AGENTS.md

本文件是 PiDeck 的开发宪法,每次 AI 会话全量注入——只放硬约束与速查,细节放 docs/ 按需读。 维护纪律:新增规则必须可判定(触发条件 + 动作 + 判定标准);被取代或证伪的条目当次删除,不留「已废弃」注记;领域运维细节写进 docs/maintenance-domains.md,不往本文件堆。

项目简介

PiDeck 是 Electron 桌面应用,在多个项目目录间管理和运行 pi RPC Agent:多项目工作区、会话时间线、历史恢复、文件抽屉、Git 面板、终端、内置浏览器、提示词/技能/扩展商店、打包发布。

技术栈:Electron + React 19 + TypeScript + Vite(版本以 package.json 为准)。

核心边界(不可逾越)

  • pi 负责 Agent 行为、工具调用、会话读写、模型调用——pi 的事不要替它做;PiDeck 负责窗口、进程生命周期、会话浏览、Git/终端/设置——UI 框架的事 pi 也不要做。两者只通过 stdio JSON-RPC 通信,禁止引入第二条通道。

例外一:认证通道(pi-auth,只允许认证用途)

  • pi 的供应商登录只存在于交互层,RPC 没有 auth 入口。主进程以子进程运行 resources/pi-auth-host.mjs(import pi 的 ModelRuntime)完成「列供应商/登录/答问/取消/登出」;凭据由 pi 写进自己的 auth.json,PiDeck 不碰。
  • 代码归属:src/main/pi/auth/piAuthHostLaunch.ts(WSL 不支持,提示改用终端 /login)、src/main/pi/auth/PiAuthService.ts(NDJSON 协议)、resources/pi-auth-host.mjs(stdout 只放协议数据)。必须列进 extraResources。
  • 禁止扩展成通用 pi API 桥;渲染层只能经 pi-auth:* IPC 访问,不得直接 import pi SDK。

例外二:模型请求快照端点(pi-deck-model-trace,只允许模型请求快照)

  • resources/extensions/pi-deck-model-trace.ts 随包分发、-e 注入,在 before_provider_request / after_provider_response 里把请求帧 POST 给主进程端点;完整请求体落 userData/logs/model-traces/,时间线只留摘要 + traceId(存储侧 src/main/logging/ModelTrace.ts,只读入口 modelTrace:* IPC)。
  • 主进程端点只绑 127.0.0.1(src/main/pi/modelTrace/ModelTraceServer.ts,每 agent 一份 token,spawn 时注入 PIDECK_MODEL_TRACE_URL / PIDECK_MODEL_TRACE_TOKEN,扩展直连该 URL 不再拼子路由),路径形如 /trace/<token>,强校验请求头 x-pideck-model-trace-token。唯一路由只承载模型快照,禁止扩展成通用宿主控制/回调通道。
  • 线格式唯一来源 src/shared/types/modelTrace.ts;扩展是自包含 .ts(只能 import type),字段与端点契约由 tests/modelTraceExtension.test.mjs 兜底。
  • fail-safe:端点起不来 → 不注入 env → 扩展不注册任何 handler;扩展抛错/写失败只丢追踪,不影响 pi 会话与其余功能。生命周期配对:registerModelTraceSession ↔ unregisterModelTraceSession(stop/restart/删会话/退出都要注销)。

例外三:standby 运行时池(预热 + 只读命令预览;「消费池进程」仍然只有「提前起进程」一个用途)

  • 一次 pi RPC 激活约 8.5s(实测 ≈ node/pi boot 0.5s + 用户 npm 扩展 5s + 内置 16 个 TS 扩展 2.4s),全部发生在 spawn→握手段。池的用法:草稿创建/激活完成后 AgentManager.ensureStandbyAgent(projectId) 后台起一个完整握手的进程待命(src/main/pi/StandbyAgentPool.ts:单槽位、容量 1、3min TTL 自动回收——待命进程 RSS 数百 MB 是空闲期最大单点常驻,TTL 只需覆盖「打字→认领」窗口,2026-10 内存轮从 10min 收紧);新会话激活经 SessionRuntimeCoordinator.claimStandbyAgent 认领,认领后照常走 applyLatestPreferences/mergePendingPermissionSettings,模型与权限热更新语义不变。
  • 只服务新会话(noSession/恢复历史会话不认领);spawn 输入指纹(src/main/pi/standbyFingerprint.ts:扩展根/禁用集/offline/noExt/noSkills/customPiPath/WSL/代理/launchArgs)任一变化即丢弃回退普通 spawn,改设置无需重启池;信任走 resolveTrustWithoutPrompt,含资源未决策不池化(绝不后台弹 trust 弹窗)。
  • 已知限制:池化进程不带 PIDECK_SESSION_ID,安检门按默认档工作,per-session 安全覆盖对认领会话要重启才生效;池化 agent 对 agents:list/agent:state-changed 不可见。开关 settings.standbyRuntimeEnabled(默认开,开发者页可关)。启动耗时探针:scripts/probePiStartup.mjs(JITI_DEBUG=1 出逐模块 trace)。
  • 只读借用(Issue #316):草稿会话斜杠命令预览 AgentManager.draftCommands 经 StandbyAgentPool.peek(projectId) 查同项目池进程的 get_commands(不认领、不消费、进程须 idle、指纹须新鲜);链路 sessions:draft-commands IPC → 渲染层优先预览、空/失败回退本地技能/提示词发现;dsh/browser/preview 模式返回 null。

Read the full file on GitHub · 276 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. 3d ago Changed · +9 lines · +642 tokens per session 994d027c7711
  2. 6d ago Changed · +13 lines · +2,086 tokens per session 4cb58bc5af43
  3. 9d ago Changed · +6 lines · +1,004 tokens per session c3d3dab051fb
  4. 14d ago Changed · +1 lines · +99 tokens per session b39721ceb9a4
  5. 15d ago Changed · +1 lines · +240 tokens per session ba06acc7860e
  6. 17d ago Changed · +1 lines · +141 tokens per session d6f7806062ae
  7. 18d ago Changed · +1 lines · +163 tokens per session c1a359cc22ce
  8. 20d ago Changed · +5 lines · +442 tokens per session 52e71f22090f
  9. 22d ago Changed · +27 lines · +1,256 tokens per session 16106d7ba77a
  10. 24d ago First seen · 212 lines · 6,840 tokens per session scan A 7fc3c9dd0857

Subscribe to this mod's changes

PiDeck AGENTS.md is an instructions file published in the GitHub repository ayuayue/PiDeck (1,147 stars, last pushed yesterday), licensed MIT. It adds 12,913 tokens to every session, about $0.0517 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

Other instructions, from other repositories

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 · 9,715 tokens

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,786 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens