Borrowing it
Nothing to install: this file belongs to phuhao00/greatestworks. 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/phuhao00/greatestworks/main/.github/instructions/gw.instructions.mdgit clone --depth 1 https://github.com/phuhao00/greatestworksWrote 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/phuhao00/greatestworks/gw)<a href="https://agentmods.dev/instructions/phuhao00/greatestworks/gw"><img src="https://agentmods.dev/badge/instructions/phuhao00/greatestworks/gw.svg" alt="Measured on agentmods" 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.02438 | $0.02438 |
| Opus 5 | $0.01219 | $0.01219 |
| Sonnet 5 | $0.00488 | $0.00488 |
| Haiku 4.5 | $0.00244 | $0.00244 |
Grade A, and why
greatestworks gw.instructions.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 5d 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 — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GreatestWorks 项目 AI 协作说明(必读)
本文件为 AI 与协作者在本仓库中进行代码生成、变更评审与文档撰写时的统一约束与上下文指引。请严格遵循以下规范,确保改动与项目架构、风格和运行形态保持一致。
工作流程补充要求
每次开始编写新功能或进行较大改动时,需先列出本次开发的 todo list(任务清单),明确拆分为具体、可执行的小步骤,并在开发过程中逐项完成和勾选。todo list 应包含:
- 主要功能点拆解(如领域模型、应用服务、接口适配、配置变更等)
- 相关协议/配置/文档同步
- 单元测试与集成验证
- 变更影响面评估与回滚方案
todo list 可在 PR 描述、评论或协作工具中展示,便于团队成员跟进进度与评审。
项目上下文速览
- 语言与版本:Go 1.24(见
go.mod) - 架构风格:DDD(领域驱动)+ 分层架构 + 微服务
- 服务与入口:
- 认证服务:
cmd/auth-service/main.go(HTTP: 8080) - 网关服务:
cmd/gateway-service/main.go(TCP: 9090) - 游戏服务:
cmd/game-service/main.go(Go 原生 RPC: 8081) - 其他服务:
cmd/scene/main.go、cmd/replication/main.go(保留/扩展)
- 认证服务:
- 配置位置:
configs/*.yaml(支持 dev/prod/docker 等环境示例) - 数据存储:MongoDB(主存储)+ Redis(缓存)
- 协议与通信:
- 客户端 → 认证:HTTP
- 客户端 → 网关:TCP(自定义二进制协议,参考
internal/network与proto/) - 网关 ↔ 游戏:Go 原生 RPC
- 协议定义:根目录
proto/*.proto(以及internal/proto/*目录结构),存在独立 proto 模块替换:replace github.com/phuhao00/greatestworks-proto => ../greatestworks-proto - 压测/集成测试工具:
tools/simclient(支持 E2E/压测/功能验证场景) - 容器与脚本:
Dockerfile、docker-compose.yml、scripts/*、Makefile
代码组织与分层约定(DDD)
- 领域层:
internal/domain/*- 聚合根/实体/值对象仅暴露必要行为,字段使用小写私有化,保持不变式。
- 领域服务仅聚焦业务规则,不做基础设施细节。
- 领域事件放在
internal/domain/events。
- 应用层:
internal/application/*- 命令/查询处理器与应用服务;通过
services.ServiceRegistry进行装配。 - 面向用例编排,不直接依赖具体基础设施实现,依赖接口。
- 命令/查询处理器与应用服务;通过
- 基础设施层:
internal/infrastructure/*- 持久化、缓存、消息、日志、配置、网络等适配与实现。
- 仓储实现放于
infrastructure/persistence/*,接口在领域层定义。
- 接口层:
internal/interfaces/{http,tcp,rpc}/*- 将传输协议与应用层解耦;在此完成 DTO/协议消息 ↔ 领域模型映射。
新增功能时遵循“自内向外”原则:先领域模型与用例,再接口适配与基础设施实现,最后编排到入口服务。
依赖与模块策略
- 优先使用标准库与现有依赖,不轻易新增第三方库;如需新增必须:
- 说明动机与替代方案;2) 版本固定并最小化;3) 兼容 Go 1.24。
- 修改依赖后执行
go mod tidy保持清洁;不要引入需要 CGO 的库(跨平台/容器化负担)。 - 保留并尊重
go.mod中的replace github.com/phuhao00/greatestworks-proto,该仓库用于统一管理协议代码;不要在本仓库内随意复制粘贴生成代码覆盖。
协议与兼容性(Proto/TCP)
- 修改
.proto前务必确认兼容性策略:- 仅追加字段,避免复用/更改现有 tag;删除请改为
reserved。 - 变更需同步网关与游戏服务的处理逻辑,保持向后兼容。
- 仅追加字段,避免复用/更改现有 tag;删除请改为
- 生成代码:优先使用
scripts/generate_proto.bat(Windows)或scripts/generate_proto.sh(Unix);不要手工在internal/proto下散落生成物。 - TCP 二进制协议格式固定(见 README);非兼容性变更需评审并更新
internal/network与模拟客户端映射。
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.
- 5d ago First seen · 148 lines · 2,438 tokens per session scan A cee3a42c0b55
greatestworks gw.instructions.md is an instructions file published in the GitHub repository phuhao00/greatestworks (290 stars, last pushed 10mo ago), licensed MIT. It adds 2,438 tokens to every session, about $0.0122 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-09-01.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.