sofagent: Instructions file for Gemini CLI

GEMINI.md

sofagent GEMINI.md is an instructions file for Gemini CLI from KongFangXun/sofagent. It costs 468 tokens per session, scanned A, original, MIT.

A GEMINI.md instruction file for Sofagent, an adapter that connects the Sofagent rules and tools to Gemini CLI. It defines the order for loading instructions, knowledge, audits, and MCP tools.

In plain words
What is it for?
Configuring Sofagent for Gemini CLI, loading its layered instructions, running commit audits, and connecting to the Sofagent MCP server.
Why use it?
It ensures Gemini CLI sessions use the intended project rules and required checks rather than relying on incomplete or duplicated guidance.

Instructions file for Gemini CLI

Written for Gemini CLI: the file is GEMINI.md. Also seen: mentions Gemini CLI.

This is KongFangXun/sofagent's own configuration. It tells Gemini CLI how to work on sofagent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sofagent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to KongFangXun/sofagent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/KongFangXun/sofagent/main/GEMINI.md
Clone the repo
git clone --depth 1 https://github.com/KongFangXun/sofagent

Made for: Gemini CLI.

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 sofagent GEMINI.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kongfangxun/sofagent/gemini-md/github.svg)](https://agentmods.dev/instructions/kongfangxun/sofagent/gemini-md)
Your own site
<a href="https://agentmods.dev/instructions/kongfangxun/sofagent/gemini-md"><img src="https://agentmods.dev/badge/instructions/kongfangxun/sofagent/gemini-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sofagent GEMINI.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/kongfangxun/sofagent/gemini-md"><img src="https://agentmods.dev/badge/instructions/kongfangxun/sofagent/gemini-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 468 This file is loaded in full into every session.
When invoked 468 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00468 $0.00468
Opus 5.5 $0.00187 $0.00187
Sonnet 5.5 $0.00094 $0.00094
Haiku 4.5 $0.00047 $0.00047

Measured 27d ago against content hash 8872a8b9e631, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sofagent GEMINI.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 27d 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.

GEMINI.md · 34 lines

What it actually says

GEMINI.md · sofagent Gemini CLI 适配(薄挂载)

本文件是 Gemini CLI 的分层上下文挂载点(GEMINI.md 约定),不含规范内容——四层加载链的规范资产唯一来源是 sofagent 的 SKILL/ 目录(单一真相源)。规则更新只发生在 SKILL/,本文件永不复制它们。

会话开始时按序加载(四层加载链)

一、读取已安装的 SKILL.md 作为系统提示词(L1 硬约束——Gemini CLI 将本文件与引用内容一并注入系统上下文):

~/.sofagent/skills/sofagent/SKILL.md

(若用 bash install.sh --platform gemini 安装,则为 ~/.gemini/skills/sofagent/SKILL.md。)

二、读取用户工作规则(L2):~/.sofagent/skills/sofagent/fde.md

三、读取反思区(L3):~/.sofagent/skills/sofagent/think.md

四、知识库(L4):~/.sofagent/skills/sofagent/knowledge/ 目录,按任务关键词检索加载。

审计强制(平台无关)

约束是建议性的,审计是强制性的——提交前审计走 git hook(sofagent audit --install-hook),与宿主平台无关:28 条 git diff 规则 + HMAC 链审计在 Gemini CLI 下同样生效。

连接 MCP Server

Gemini CLI 的 MCP 配置(settings.json)指向 sofagent MCP Server(stdio):

{ "mcpServers": { "sofagent": { "command": "sofagent mcp" } } }

104 个 tool(run_audit / worklog_query / snapshot_restore / workflow_export 等)经 MCP 协议面暴露——适配器只依赖 @public API 子集,@internal 破坏性变更不影响本挂载。

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. 27d ago Changed 8872a8b9e631
  2. 1mo ago Changed · -1 tokens per session 59066e394509
  3. 1mo ago Changed 0ab997aa5031
  4. 1mo ago Changed 5d4b9e5b9a55
  5. 1mo ago Changed 632bd35fbe74
  6. 1mo ago Changed b47e60953eb7
  7. 1mo ago Changed · +5 tokens per session 58a22c9782bd
  8. 1mo ago Changed 059b998e5fdd
  9. 1mo ago Changed 75ee2292de5c
  10. 2mo ago First seen · 34 lines · 464 tokens per session scan A 0380f3ca2012

Subscribe to this mod's changes

sofagent GEMINI.md is an instructions file published in the GitHub repository KongFangXun/sofagent (55 stars, last pushed yesterday), licensed MIT. It adds 468 tokens to every session, about $0.0019 per session on Opus 5.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.

Related

sofagent GEMINI.md compared with instructions from other repositories

sofagent GEMINI.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sofagent GEMINI.mdKongFangXun/sofagentInstructions file55yesterdayMITA468Gemini CLI
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode