PiDeck AGENTS.md

PiDeck AGENTS.md is an instructions file for Codex, OpenCode from ayuayue/PiDeck. It costs 7,571 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

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/ayuayue/pideck/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 7,571 This file is loaded in full into every session.
When invoked 7,571 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.07571 $0.07571
Opus 5 $0.03785 $0.03785
Sonnet 5 $0.01514 $0.01514
Haiku 4.5 $0.00757 $0.00757

Measured 3d ago against content hash 651ad5ba2c8f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 · 286 lines

How it starts

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

AGENTS.md

项目简介

PiDeck 是一个面向本地开发工作的 Electron 桌面应用,用于在多个项目目录之间管理和运行 pi RPC Agent。应用提供多项目工作区、会话时间线、历史会话恢复、文件抽屉、Git 面板、模型选择、工具调用展示、内置浏览器、中文提示词精选、技能/扩展商店以及打包发布能力,目标是让用户可以在桌面端更稳定地管理多个 pi 编码助手会话。

技术栈:Electron 38 + React 19 + TypeScript + Vite。

核心边界(不可逾越):

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

代码结构与跨层契约

本项目只维护项目根目录这一份 AGENTS.md;除非用户明确要求,不要再在子目录生成同名规则文件。docs/开发规范.md 中仍有历史架构表述,若与本文件或实际类型/API 冲突,以本文件和代码为准。

  • src/shared/ 是跨进程纯契约层:共享类型按 shared/types/*.ts 拆分,shared/types.ts 仅做兼容导出;IPC 名称只定义在 shared/ipc.ts
  • src/main/ 是唯一可访问 Node/Electron 主进程能力的业务层。main/<domain>/ 拥有领域行为,main/ipc/*Ipc.ts 只做输入校验和适配,main/index.ts 只增装配,不新增业务。
  • src/preload/index.ts 通过 contextBridge 暴露最小 PiDesktopApi;新增 IPC 必须同步共享通道、main handler、preload 方法三处,订阅 API 必须返回 unsubscribe。
  • src/renderer/ 只通过 desktopApi/preload 调用桌面能力。跨组件状态使用 Jotai atom,副作用放 hook,视图放 component;不得直接 import Node/Electron 或新增第二种全局状态方案。
  • SessionRecord.id 是跨重启的稳定会话身份,agentId 仅表示当前 pi 子进程。所有 runtime 命令和事件都必须带 sessionId + agentId + runtimeGeneration,拒绝旧 runtime 的迟到结果。
  • pi 只通过 stdio JSON-RPC 与 PiDeck 通信;PiDeck 不复刻 pi 的 Agent/工具/会话行为,也不为访问 pi 引入第二条通信通道。
  • 持久化结构、设置和 session catalog 变更必须兼容旧数据;listener、timer、子进程、terminal 和 watcher 必须在同一模块找到配对清理路径。
src/
├── main/              # Electron 主进程
│   ├── pi/            # pi RPC 进程管理、消息解析
│   ├── sessions/      # 会话扫描、导入、摘要缓存、SessionRuntimeCoordinator
│   ├── git/           # GitService(status/diff/commit/cherry-pick 等)
│   ├── prompts/       # PromptManager(本地模板)+ XuePromptManager(SQLite 中文精选)
│   ├── skills/        # SkillManager
│   ├── extensions/    # ExtensionManager
│   ├── settings/      # SettingsStore + DesktopProxy
│   ├── terminal/      # 终端会话管理(node-pty)
│   ├── pet/           # 桌面宠物
│   ├── feishu/        # 飞书集成(FeishuBridge + FeishuConnection)
│   ├── ipc/           # ★ IPC 域注册(sessionIpc/systemIpc/gitIpc/storeIpc/...)
│   └── web/           # Web 服务管理
├── preload/           # preload 脚本,经 contextBridge 暴露受限 IPC API
├── renderer/
│   └── src/
│       ├── atoms/         # Jotai 状态(session-first)
│       ├── components/
│       │   ├── ui-shadcn/  # 共享 UI 原语(button/dialog/input/select 等)
│       │   ├── session/   # 会话视图族(SessionView/Composer*/Timeline*)
│       │   ├── sidebar/   # 左侧栏
│       │   ├── workspace/ # 右侧抽屉(files/git/browser/editor)
│       │   └── app/       # 业务组件
│       ├── hooks/         # 渲染层 hooks(useWorkspacePanels/useSessionComposerController 等)
│       ├── i18n/          # 文案(zh-CN / en-US,rendererCopy.*.ts)
│       └── styles/        # 按域拆分的样式 + 语义 token
└── shared/            # 主/渲染共享类型(按域拆分)与 IPC 通道定义

Read the full file on GitHub · 286 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 First seen · 286 lines · 7,571 tokens per session scan A 651ad5ba2c8f

Subscribe to this mod's changes

PiDeck AGENTS.md is an instructions file published in the GitHub repository ayuayue/PiDeck (709 stars, last pushed 3d ago), licensed MIT. It adds 7,571 tokens to every session, about $0.0379 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.