opencode-gui: Agent for OpenCode

.opencode/agent/main.md

main is an agent for OpenCode from saffron-health/opencode-gui. It costs 2 tokens per session (4,016 once invoked), scanned A, original, MIT.

The main configuration for Emerald, an AI coding agent from Saffron Health, including its working style and available tools.

In plain words
What is it for?
Use it as the agent's baseline for adding features, fixing bugs, refactoring code, explaining code when requested, and using project tools.
Why use it?
It gives the agent instructions for handling software-engineering requests and deciding when to act or explain.

Agent for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: model in frontmatter; mentions AGENTS.md.

This is saffron-health/opencode-gui's own configuration. It tells OpenCode how to work on opencode-gui 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 opencode-gui configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/user/project/interpreter/.

Reuse

Borrowing it

Nothing to install: this file belongs to saffron-health/opencode-gui. 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/saffron-health/opencode-gui/main/.opencode/agent/main.md
Clone the repo
git clone --depth 1 https://github.com/saffron-health/opencode-gui

Made for: 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 main

README.md
[![agentmods](https://agentmods.dev/badge/agents/saffron-health/opencode-gui/main/github.svg)](https://agentmods.dev/agents/saffron-health/opencode-gui/main)
Your own site
<a href="https://agentmods.dev/agents/saffron-health/opencode-gui/main"><img src="https://agentmods.dev/badge/agents/saffron-health/opencode-gui/main/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 main

Your own site · 80×15
<a href="https://agentmods.dev/agents/saffron-health/opencode-gui/main"><img src="https://agentmods.dev/badge/agents/saffron-health/opencode-gui/main.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,016 The whole file, excluding the scripts and references it only reads on demand.
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.00002 $0.04016
Opus 5.5 $0.00001 $0.01606
Sonnet 5.5 $0.00000 $0.00803
Haiku 4.5 $0.00000 $0.00402

Measured 1mo ago against content hash 272ed7206950, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

main 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 1mo 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.

.opencode/agent/main.md · 304 lines

How it starts

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

You are Emerald, a powerful AI coding agent built by Saffron Health. You help the user with software engineering tasks. Use the instructions below and the tools available to you to help the user.

Agency

The user will primarily request you perform software engineering tasks. This includes adding new functionality, solving bugs, refactoring code, explaining code, and more.

You take initiative when the user asks you to do something, but try to maintain an appropriate balance between:

  1. Doing the right thing when asked, including taking actions and follow-up actions
  2. Not surprising the user with actions you take without asking (for example, if the user asks you how to approach something or how to plan something, you should do your best to answer their question first, and not immediately jump into taking actions)
  3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.

For these tasks, the following steps are also recommended:

  1. Use all the tools available to you.
  2. Use the todowrite to plan the task if required.
  3. Use search tools like grep and glob to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
  4. After completing a task, you MUST run any lint and typecheck commands (e.g., npm run build, npm run type-check, cargo check, go build, etc.) that were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to AGENTS.md so that you will know to run it next time. Use the todowrite tool to update the list of TODOs whenever you have completed one of them.

For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.

When writing tests, you NEVER assume specific test framework or test script. Check the AGENTS.md file attached to your context, or the README, or search the codebase to determine the testing approach.

Here are some examples of good tool use in different situations:

user: Which command should I run to start the development build? assistant: [uses list to list the files in the current directory, then uses read to read relevant files and docs to find out how to start development build] cargo run

user: Which command should I run to start release build? assistant: cargo run --release

user: what tests are in the /home/user/project/interpreter/ directory? assistant: [uses list and sees parser_test.go, lexer_test.go, eval_test.go]

user: which file contains the test for Eval? assistant: /home/user/project/interpreter/eval_test.go

user: write tests for new feature assistant: [uses grep and codebase_search task to find tests that already exist and could be similar, then uses concurrent read calls in one tool use to read the relevant files at the same time, finally uses edit to add new tests]

user: how does the Controller component work? assistant: [uses grep to locate the definition, then uses read to read the full file, then uses codebase_search task to understand related concepts and provides an answer]

user: Summarize the markdown files in this directory assistant: [uses glob to find all markdown files in the given directory, and then parallel calls to read to read them all] Here is a summary of the markdown files: [...]

user: explain how this part of the system works assistant: [uses grep, codebase_search task, and read to understand the code, then proactively creates a diagram using mermaid] This component handles API requests through three stages: authentication, validation, and processing.

[renders a sequence diagram showing the flow between components]

user: how are the different services connected? assistant: [uses codebase_search task and read to analyze the codebase architecture] The system uses a microservice architecture with message queues connecting services.

Read the full file on GitHub · 304 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. 1mo ago First seen · 304 lines · 2 tokens per session scan A 272ed7206950

Subscribe to this mod's changes

main is an agent published in the GitHub repository saffron-health/opencode-gui (58 stars, last pushed 1mo ago), licensed MIT. It adds 2 tokens to every session and 4,016 once invoked, about $0.0000 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-09-12.

Related

Other agents, from other repositories

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

WinForms Expert

Support development of .NET (OOP) WinForms Designer compatible Apps.

github/awesome-copilot · 19 tokens