violet AGENTS.md

Repository instructions for Violet, a full-stack blog platform organized as a monorepo, meaning one repository containing several related applications. They describe its Go backend, React frontend, architecture boundaries, and Makefile-based workflow.

In plain words
What is it for?
Use them when changing the API or web application, especially when deciding where shared code, domain logic, feature code, middleware, or development commands belong.
Why use it?
They clarify where backend and frontend logic belongs and which tools and package manager the project expects, reducing architectural mistakes.

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/vod-studio/violet/agents-md
Clone the repo
git clone --depth 1 https://github.com/VOD-Studio/violet

Made for: Codex, OpenCode.

Per session 6,358 This file is loaded in full into every session.
When invoked 6,358 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.06358 $0.06358
Opus 5 $0.03179 $0.03179
Sonnet 5 $0.01272 $0.01272
Haiku 4.5 $0.00636 $0.00636

Measured 2d ago against content hash 2e5cef7bdf7c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

violet 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 2d 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 · 313 lines

How it starts

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

violet (blog-project)

全栈博客平台 monorepo。

架构与代码边界

  • 后端 (api/): Go 1.26, Chi 路由, PostgreSQL 16, Redis 7。
    • 关键: 后端为 DDD 单一架构: internal/{domain,application,infrastructure,interfaces,app}(旧 handler/service/repository 分层已移除)。依赖注入为 app/ 下手工容器装配(*Container + container.go 聚合,不使用 wire)。
  • 前端 (web/): React 19, Vite, Tailwind CSS v4。
    • 关键: 使用 pnpm 作为包管理器,切勿使用 npmyarn
    • 状态管理: Zustand + TanStack Query。

架构耦合约束

这是代码组织原则,不是 commit 拆分规则。规则 1(公共组件单独提交)管「commit 怎么拆」,本节管「代码该放哪一层」。两者分开理解。

  • 前端公共层不夹带 feature 业务逻辑web/src/shared/(ui/lib/api/config/server/vendor)只放跨 feature 通用件,不写 posts / comments / editor 等特定 feature 的业务逻辑。FSD 分层(sharedentitiesfeatureswidgets)约束依赖方向,shared 不反向依赖 features
  • 后端各层各司其职:领域逻辑进 domain,用例编排进 application,基础设施细节进 infrastructure,HTTP 适配进 interfaces;internal/middleware/ 只放通用横切中间件(auth/cors/csrf/ratelimit 等)。通用基础设施(错误码、observability、通用中间件)不夹带具体业务实体逻辑。
  • 判断「是否公共」看是否被多个 feature/domain 引用,而非位置。某 feature 私有逻辑一旦被第二个 feature 复用,应先 refactor: 将 X 从 features/A 提到 shared/ 落定代码归属(提交规则见规则 1),再在新 feature 接入。

开发流与命令 (Makefile)

所有核心操作都通过根目录的 Makefile 统管:

  • 启动本地开发: make dev (一键启动 Postgres、Redis、API 和 Web)
  • 数据库迁移: make migrate (使用 golang-migrate)

后端 (api/) 须知

  • 环境依赖: 后端需要 Go 1.26。本机无 Go 时不擅自安装,按 .agents/skills/api-toolchain 的流程问用户一次并记住决定(本地安装或容器执行)。
  • 测试: make api-test (本机无 Go 时按上方容器方式执行,下同)
  • 代码检查: make api-lint (使用 golangci-lint)

前端 (web/) 须知

  • 代码检查与格式化: 使用 Biome (非 ESLint/Prettier)。命令: make web-lintmake web-format
  • 类型检查: make web-typecheck
  • 测试: make web-test
  • Tailwind CSS v4: 支持任意数字值简写 (例如 max-w-50 = 200px 替代 max-w-[200px])。详见 tailwind-canonical-classes skill。
  • 前端动笔前读 skill:新建或编辑前端代码(组件/hook/util/测试)前读 frontend-conventions,编辑 className 前读 tailwind-canonical-classes——触发即读,不凭记忆;写完对照 skill 关键规则自查(TSDoc 标签形态、canonical 类形态)。

分支命名

每个新任务 / feature 先从 release/2.0 新建分支完成,不在 release/2.0 上直接开发。

Read the full file on GitHub · 313 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. 2d ago First seen · 313 lines · 6,358 tokens per session scan A 2e5cef7bdf7c

Subscribe to this mod's changes

violet AGENTS.md is an instructions file published in the GitHub repository VOD-Studio/violet (2 stars, last pushed 2d ago), licensed MIT. It adds 6,358 tokens to every session, about $0.0318 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.