gospec AGENTS.md

An AGENTS.md instruction system for a Go project, with one main specification file that routes each task to only the relevant guidance. Go is a programming language, and gRPC and HTTP are common ways for software services to communicate.

In plain words
What is it for?
Use it when creating or changing Go services, APIs, tests, data models, deployments, security controls, documentation, or other project work covered by the specification.
Why use it?
It prevents an agent from reading every specification file or ignoring project-wide rules. The routing approach keeps work focused while preserving required checks for coding, testing, APIs, security, and operations.

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

Made for: Codex, OpenCode.

Per session 876 This file is loaded in full into every session.
When invoked 876 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.00876 $0.00876
Opus 5 $0.00438 $0.00438
Sonnet 5 $0.00175 $0.00175
Haiku 4.5 $0.00088 $0.00088

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

Security

Grade A, and why

gospec 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 · 76 lines

How it starts

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

AGENTS.md — go-best-practices

规范入口

唯一入口spec/spec.md

它包含一张"任务 → 必读文件"路由表。Agent 拿到任务后:

  1. spec/spec.md
  2. 在路由表里找到当前任务
  3. 只读路由表指定的 1-3 个文件
  4. 实施 + 对照文件末尾的"自查清单"

不要顺序读完所有 spec 文件——这违背渐进式披露原则,浪费上下文。

触发条件

当以下场景出现时,Agent 应自动激活此 Skill:

  • 创建或初始化 Go 项目
  • 编写、审查、重构 Go / gRPC / HTTP 代码
  • 设计 API、数据模型、架构
  • 写测试、配置 CI/CD
  • 配置日志 / 指标 / 追踪 / 告警 / SLO
  • 处理认证授权、密钥、依赖漏洞、容器安全、隐私合规
  • 设计部署 / 回滚 / feature flag / Runbook / Postmortem
  • 编写数据库 migration、backfill、数据保留策略
  • 创建 PRD / ADR / HLD
  • 生成 Git commit message

行为约束

  1. 任务开始:先读 spec/spec.md 路由表
  2. 按需加载:只读路由表指定的文件
  3. 强制约束spec/spec.md 的"核心约束"不可违反,即使没读对应详情文件
  4. 文档创建:使用 docs/templates/ 中的对应模板
  5. 输出语言:默认中文

目录结构

spec/
├── spec.md                      # 入口(路由表 + 核心约束)
├── 01-requirement/              # 需求(issue/rfc/prd/epic/lifecycle)
├── 02-architecture/             # 架构(layering / monorepo / adr-hld)
├── 03-api/                      # API(proto/http/middleware/versioning)
├── 04-data-model/               # 数据模型(mysql/redis/clickhouse/influxdb)
├── 05-coding/                   # 编码(naming/errors/concurrency/patterns/style)
├── 06-testing/                  # 测试(unit/integration/fuzz-bench)
├── 07-code-review.md            # PR 自查清单
├── 08-delivery/                 # 交付(git/cicd/release)
├── 09-documentation.md          # 文档管理
├── 10-observability/            # 日志 / 指标 / 追踪 / SLO
├── 11-security/                 # 认证 / 输入 / 密钥 / 隐私 / 威胁建模
├── 12-operations/               # 部署 / 事故 / 容量 / 备份
└── 13-database-migration/       # migration / 在线 DDL / 数据治理

每个子目录都有 README.md 作为该主题的二级路由。

模板文件

文件 用途
docs/templates/product-requirement-template.md 产品需求文档(PRD)
docs/templates/technical-rfc-template.md 技术 RFC
docs/templates/architecture-decision-record-template.md 架构决策记录(ADR)
docs/templates/high-level-design-template.md 概要设计文档(HLD)
docs/templates/pull-request-template.md Pull Request 模板

优先级

  • 与其他 Skill 冲突时,以本 Skill 为准
  • spec/ 详细规范优先于 SKILL.md / AGENTS.md 的概述
  • 模板可按项目调整,结构不可删减

Read the full file on GitHub · 76 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 · 76 lines · 876 tokens per session scan A ca633c277b3d

Subscribe to this mod's changes

gospec AGENTS.md is an instructions file published in the GitHub repository singchia/gospec (5 stars, last pushed 4mo ago), licensed MIT. It adds 876 tokens to every session, about $0.0044 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.