AgentDock AGENTS.md

A project-specific instruction file for AgentDock, an Electron desktop application that manages coding-agent sessions, projects, and related data.

In plain words
What is it for?
Use it when changing AgentDock’s session management, project databases, development setup, worktrees, or test isolation.
Why use it?
It explains the current single-process architecture, SQLite storage, development-instance isolation, and testing rules so contributors do not rely on outdated assumptions.

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/accsci/agentdock/agents-md
Clone the repo
git clone --depth 1 https://github.com/ACCSCI/AgentDock

Made for: Codex, OpenCode.

Per session 1,485 This file is loaded in full into every session.
When invoked 1,485 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.01485 $0.01485
Opus 5 $0.00743 $0.00743
Sonnet 5 $0.00297 $0.00297
Haiku 4.5 $0.00148 $0.00148

Measured yesterday against content hash 50b7a0fd88c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

AgentDock 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 yesterday.

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 · 79 lines

How it starts

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

AGENTS

本文件是给所有 contributor(包括 AI agent)阅读的项目级指引。架构、测试、用户测试的当前规则都在这里。

架构现状

单实例架构(0.1.x 当前状态)

  • AgentDock 0.1.x 运行在 单个 Electron 进程里,所有 session/port/state 都由这个进程拥有(SessionManagerPortPool)。没有独立的 daemon 进程——DaemonStatusBar 已在 PR #108 中移除,因为单实例下这个栏位只是静态 "Running" 文字,没有信息价值。
  • 状态分两份 SQLite 存储:
    • 全局项目 DB:dev 模式在 <userDataDir>/global/projects.db,生产在 ~/.agentdock/projects.db——存已打开的项目(id, name, path, createdAt
    • 项目 DB:在 <userDataDir>/data/db.sqlite——存当前激活项目的 sessionstodos
  • SessionManager 是纯内存的,session 的生命周期状态(creating | active | deleting)和步骤进度持久化到项目 DB 的 sessions.status / sessions.steps 列,渲染端通过 db:projects:list 直接读,不需要 SSE/streaming。

Dev 模式 userData 隔离

  • AGENTDOCK_DEV_INSTANCE=<N> 环境变量(由 scripts/dev-instance.ts 设置)标记 dev 模式。
  • 设了之后,projects.db 跟随 <userData>/global/projects.db,不再用生产路径 ~/.agentdock/projects.db。这样多个 dev AgentDock 实例可以并行跑而不撞共享 SQLite 文件。
  • 不设时行为等同于生产(单实例、单全局 ~/.agentdock/projects.db)。
  • 默认保持生产行为;dev/测试需要并行时显式设 AGENTDOCK_DEV_INSTANCE=1
  • Worktree 目录(<project>/.agentdock/worktrees/)是项目级的,不跟随 userData——dev 和生产用的是同一份。
  • app.requestSingleInstanceLock()userData 为 key,所以 dev 实例只要 --user-data-dir 不同就能共存;生产单实例不变量保持不变。

测试隔离流水线

测试按"在哪跑"分成三层,不要跨层迁移

跑在哪 跑什么 触发方式
CI GitHub Actions runner typecheck + lint + unit + build push/PR 自动
本地 dev 开发者机器 unit + integration + acceptance + e2e(59 个 spec) bun run test / bun run test:e2e
用户测试 开发者机器 探索性 UI 流程测试(见下文) npx flue run user-agent

为什么 CI 不跑 e2e

GitHub runner 是共享临时虚拟机,Electron 在上面启动不稳定(字体/端口/显示系统都不可控)。CI 守住"代码能 build + 单测过"这条线就够了。

并行实例隔离规则

每个并行运行的实例(e2e test、user-agent、多 dev 窗口)启动 Electron 时必须带:

  • --user-data-dir=<独立目录> —— 隔离项目 DB(data/db.sqlite
  • AGENTDOCK_DEV_INSTANCE=1 —— 隔离全局 DB(<userData>/global/projects.db

这两个 flag 一起用能产生完全自洽的 AgentDock 实例,不与其它实例在 SQLite、端口、session 状态上冲突。

<userData>/global/projects.db 这个路径是 v9/v10 schema 迁移加的——之前共享的 ~/.agentdock/projects.db 是并行测试的撞车点。

Read the full file on GitHub · 79 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. yesterday First seen · 79 lines · 1,485 tokens per session scan A 50b7a0fd88c3

Subscribe to this mod's changes

AgentDock AGENTS.md is an instructions file published in the GitHub repository ACCSCI/AgentDock (2 stars, last pushed 1mo ago), licensed MIT. It adds 1,485 tokens to every session, about $0.0074 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.