Borrowing it
Nothing to install: this file belongs to Ciao1019/Petrichor. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Ciao1019/Petrichor/master/AGENTS.mdgit clone --depth 1 https://github.com/Ciao1019/PetrichorWrote 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.
[](https://agentmods.dev/instructions/ciao1019/petrichor/agents-md)<a href="https://agentmods.dev/instructions/ciao1019/petrichor/agents-md"><img src="https://agentmods.dev/badge/instructions/ciao1019/petrichor/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.
<a href="https://agentmods.dev/instructions/ciao1019/petrichor/agents-md"><img src="https://agentmods.dev/badge/instructions/ciao1019/petrichor/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02544 | $0.02544 |
| Opus 5.5 | $0.01018 | $0.01018 |
| Sonnet 5.5 | $0.00509 | $0.00509 |
| Haiku 4.5 | $0.00254 | $0.00254 |
Grade A, and why
Petrichor 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex 项目级说明(petrichor / dosphere)
本文件适用于当前 Petrichor 仓库及其子目录。它用于补充全局规则; 若与更深层目录的
AGENTS.md冲突,优先遵循更具体的规则。
语言与协作
- 默认使用中文沟通、解释和记录关键决策。
- 新增代码注释和文档优先使用中文;仅在库 API、协议字段或既有英文命名要求下使用英文。
- 修改前先理解现有实现和调用链,保持变更范围小而完整。
- 不提交密钥、连接串、Cookie、Token、私有 API Key 或
.env.local内容。
项目概览
- 仓库根目录提供统一命令;
apps/web是独立 Bun package,依赖、锁文件和补丁均保存在 Web 目录;apps/api是独立 Go module。 apps/web是 Bun + React + Vite + TypeScript 客户端 SPA,入口为apps/web/src/main.tsx,页面路由由react-router-dom管理。apps/api是 Go + Gin API 服务,接管/api/*和/healthz。- 全部 Agent 工具循环统一使用 Pi Agent Core;Go 的
internal/piruntime通过私有 stdio 调用tools/pi-agent,保留模型凭据、权限、证据与业务工具。API/Worker 镜像均内置运行器。 - 生产环境由
apps/web/Caddyfile托管 Vite 静态资源并反代 Go API;apps/web/server.ts仅用于本地 Bun 运行。 - 数据层使用启用
pg_trgm与vector扩展的 PostgreSQL 16+,完整结构由apps/api/migrations/202608270002_init.sql定义,并由 Go 服务启动时自动执行。 - 认证使用 Sa-Token-Go 的 Gin 集成,token 状态由
sa_token_storage持久化到 PostgreSQL; 业务用户只保存在petrichor_user。 - 上传和公开文件访问使用 S3 兼容对象存储。
- 生产部署统一使用根目录
compose.yaml:Caddy、Go API、统一 Asynq Worker、本地 Redis 与仅回环地址开放的 asynqmon;Redis 使用go-redis/v9,通过 Asynq 承载知识构建和视觉导入队列,并保存视觉导入任务、页进度和死信状态;前台问答、正文划词问 AI 与语义检索的 IP/浏览器指纹限流由internal/ratelimit(ulule/limiter)计数在同一 Redis。
常用命令
在仓库根目录执行:
bun install --cwd apps/web
bun run install:agent
bun dev
cd apps/api && go run ./cmd/server
bun run build
bun run test
bun run typecheck
bun run lint
docker compose up -d --build
只针对 Web 应用执行时使用:
bun run --cwd apps/web dev
bun run --cwd apps/web test
bun run --cwd apps/web typecheck
bun run --cwd apps/web lint
bun run --cwd apps/web build
查看数据库迁移状态使用纯 Go 命令:
cd apps/api && go run ./cmd/migrate status
目录约定
apps/api/cmd/server/:Go API 生产入口。apps/api/cmd/migrate/:Goose 数据库迁移命令入口。apps/api/cmd/worker/:统一 Asynq Worker 入口,分别消费知识构建与视觉文档导入队列。apps/api/internal/:Go 鉴权、业务、数据库、存储、缓存和 Agent 实现。apps/api/tools/pi-agent/:Pi TypeScript 运行器、独立bun.lock与消息协议测试。apps/api/migrations/:随 Go 二进制内嵌的 Goose 初始化 SQL。apps/api/config.example.toml:Go 运行配置模板;本地真实配置为忽略提交的config.toml。apps/web/src/main.tsx:Vite 客户端入口。apps/web/server.ts:本地 Bun Web 静态服务与 Go API 同源反代入口。apps/web/Caddyfile:生产静态资源服务、压缩、缓存与 Go API 同源反代。apps/web/src/client-app.tsx:客户端路由总入口。apps/web/src/features/pages/:业务页面组件。apps/web/src/components/:通用组件、编辑器组件、shadcn/ui、第三方 UI 迁移组件。apps/web/src/lib/:浏览器侧工具、API client、路由工具。apps/web/bun.lock、apps/web/patches/:Web 依赖锁文件与本地依赖补丁。docs/:数据库、Agent、模型配置和设计说明。
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.
- 1mo ago Changed · +6 lines · +160 tokens per session 0ec1777187b4
- 2mo ago Changed · +20 lines · +550 tokens per session a7208ba7205c
- 2mo ago First seen · 139 lines · 1,834 tokens per session scan A 608f71ff4e27
Petrichor AGENTS.md is an instructions file published in the GitHub repository Ciao1019/Petrichor (154 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 2,544 tokens to every session, about $0.0102 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.
Petrichor AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Petrichor AGENTS.mdCiao1019/Petrichor | Instructions file | 154 | 1mo ago | Apache-2.0 | A | 2,544 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |