Petrichor AGENTS.md

Petrichor AGENTS.md is an instructions file for Codex, OpenCode from Ciao1019/Petrichor. It costs 2,384 tokens per session, scanned A, original, Apache-2.0.

A project guide for a Bun, React, Vite, and TypeScript web application called Petrichor. It explains the app structure, server routes, database, authentication, file storage, language conventions, and commands.

In plain words
What is it for?
Use it to run the app, build and test it, check types and lint, find API and database code, and follow the repository's collaboration rules.
Why use it?
It gives agents the project context needed to make focused changes without overlooking how the frontend, server, database, and storage fit together.

Instructions file for CodexOpenCode

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

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/ciao1019/petrichor/agents-md
Clone the repo
git clone --depth 1 https://github.com/Ciao1019/Petrichor

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ciao1019/petrichor/agents-md.svg)](https://agentmods.dev/instructions/ciao1019/petrichor/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/ciao1019/petrichor/agents-md"><img src="https://agentmods.dev/badge/instructions/ciao1019/petrichor/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,384 This file is loaded in full into every session.
When invoked 2,384 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.1 $0.02384 $0.02384
Opus 5 $0.01192 $0.01192
Sonnet 5 $0.00477 $0.00477
Haiku 4.5 $0.00238 $0.00238

Measured today against content hash a7208ba7205c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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 today.

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

How it starts

The opening of the file, as written. The whole thing — 159 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
  • 生产环境由 apps/web/Caddyfile 托管 Vite 静态资源并反代 Go API;apps/web/server.ts 仅用于本地 Bun 运行。
  • 数据层使用启用 pg_trgmvector 扩展的 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 承载知识构建和视觉导入队列,并保存视觉导入任务、页进度和死信状态。

常用命令

在仓库根目录执行:

bun install --cwd apps/web
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/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.lockapps/web/patches/:Web 依赖锁文件与本地依赖补丁。
  • docs/:数据库、Agent、模型配置和设计说明。

Read the full file on GitHub · 159 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. today Changed · +20 lines · +550 tokens per session a7208ba7205c
  2. 6d ago First seen · 139 lines · 1,834 tokens per session scan A 608f71ff4e27

Subscribe to this mod's changes

Petrichor AGENTS.md is an instructions file published in the GitHub repository Ciao1019/Petrichor (127 stars, last pushed yesterday), licensed Apache-2.0. It adds 2,384 tokens to every session, about $0.0119 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.