snowgo AGENTS.md

snowgo AGENTS.md is an instructions file for Codex, OpenCode from sy159/snowgo. It costs 794 tokens per session, scanned A, original, MIT.

Repository instructions for Snowgo, a Go software project, covering coding rules, architecture, operations, and the agent workflow.

In plain words
What is it for?
Use it when modifying Snowgo's Go services, database access code, transactions, logging, validation, concurrency, security, or tests.
Why use it?
It tells contributors where decisions belong and prevents unsafe database changes, incorrect transaction handling, and inconsistent service code.

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/sy159/snowgo/agents-md
Clone the repo
git clone --depth 1 https://github.com/sy159/snowgo

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/sy159/snowgo/agents-md.svg)](https://agentmods.dev/instructions/sy159/snowgo/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/sy159/snowgo/agents-md"><img src="https://agentmods.dev/badge/instructions/sy159/snowgo/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 794 This file is loaded in full into every session.
When invoked 794 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.00794 $0.00794
Opus 5 $0.00397 $0.00397
Sonnet 5 $0.00159 $0.00159
Haiku 4.5 $0.00079 $0.00079

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

Security

Grade A, and why

snowgo 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 · 37 lines

How it starts

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

AGENTS.md

Go Version: 1.26+ (toolchain: go1.26.7) Status: Active — single source of truth for engineering decisions.

Document Index

Document Scope
CODING.md Naming, error handling, logging, context, validation, concurrency
ARCHITECTURE.md Database design, transactions, caching, query optimization
OPERATIONS.md Security, testing, review checklist

Core Rules

  1. Never manually edit internal/dal/model/ or internal/dal/query/.
  2. Service owns transaction boundaries. DAO methods accept caller-provided *query.Query and never open transactions themselves. Multi-table mutations and audited business mutations that require operation logs use WriteQuery().Transaction(). Independent single-table writes may use a non-transactional *query.Query when atomic cross-table consistency is not required. Operation logs for audited business mutations are written synchronously within the same transaction through transaction-aware contracts or DAO methods.
  3. All DAO methods that may participate in a transaction accept *query.Query as a parameter. The DAO does not care whether it runs in a transaction — the Service layer decides: pass tx inside Transaction(), pass repo.Query() or repo.WriteQuery() outside. There is only one method per DAO operation — no separate Transaction*Xxx variants.
  4. Cache invalidation happens after DB commit, never inside a transaction.
  5. Admin endpoints require JWTAuth() after login. Add PermissionAuth(constant.PermXxx) for privileged management or scoped business data endpoints. Login-only endpoints (current user permissions, server info, allowed dictionary lookups) must be documented in route comments. Middleware in internal/router/middleware/auth.go.
  6. Service dependencies follow package boundaries: same-package services inject concrete *XxxService; cross-package service calls use stable contracts from internal/service/admin/contract when the dependency is shared infrastructure capability, and consumer-local interfaces only for narrow one-off domain dependencies. Do not call business Services inside an open transaction; only transaction-aware infrastructure contracts that receive the caller's *query.Query are allowed.
  7. Use xlogger.InfofCtx / xlogger.ErrorfCtx for all logging.
  8. Define sentinel errors in Service using pkg/xerror/ codes; compare with errors.Is.
  9. API layer validates all input before reaching Service.
  10. No panic() in API/Service/DAO for business errors.
  11. created_at mandatory for all tables; soft delete (is_deleted tinyint(1) DEFAULT 0 + deleted_at DATETIME(6) DEFAULT NULL) is optional, decide per business need. Use for tables requiring audit/compliance/user undo (e.g., orders). Skip for high-volume logs and junction tables.
  12. Run tests according to change scope before declaring complete: small, localized changes run affected package tests; broad/shared behavior changes run go test ./.... Always run make lint. Use coverage commands only when coverage is the explicit goal. Integration tests use -tags=integration; make test-integration covers pkg and Service integration tests and requires Redis/RabbitMQ plus MYSQL_DSN for Service tests.
  13. Core and complex code must have comments. Update README / AGENTS docs alongside code changes.

Read the full file on GitHub · 37 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 · 37 lines · 794 tokens per session scan A a0966f9b8e93

Subscribe to this mod's changes

snowgo AGENTS.md is an instructions file published in the GitHub repository sy159/snowgo (23 stars, last pushed 7d ago), licensed MIT. It adds 794 tokens to every session, about $0.0040 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.