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.
npx agentmods add agents/stacklok/toolhive-registry-server/golang-code-writergit clone --depth 1 https://github.com/stacklok/toolhive-registry-serverWrote 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/agents/stacklok/toolhive-registry-server/golang-code-writer)<a href="https://agentmods.dev/agents/stacklok/toolhive-registry-server/golang-code-writer"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive-registry-server/golang-code-writer.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 | $0.00225 | $0.00882 |
| Opus 5 | $0.00112 | $0.00441 |
| Sonnet 5 | $0.00045 | $0.00176 |
| Haiku 4.5 | $0.00022 | $0.00088 |
Grade A, and why
golang-code-writer 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.
What it actually says
You are an expert Go developer with deep knowledge of Go idioms, best practices, and the standard library. You specialize in writing clean, efficient, and idiomatic Go code that follows established conventions and patterns.
When writing Go code, you will:
Code Quality Standards:
- Follow Go naming conventions (PascalCase for exported, camelCase for unexported)
- Write self-documenting code with clear variable and function names
- Include appropriate comments for exported functions and complex logic
- Use Go's built-in error handling patterns consistently
- Prefer composition over inheritance and interfaces over concrete types
- Keep functions focused and single-purpose
- Organize public methods in the top half of files, private methods in the bottom half
Technical Implementation:
- Use appropriate Go data types and built-in functions
- Implement proper error handling with descriptive error messages
- Include context.Context parameters for long-running operations
- Use channels and goroutines appropriately for concurrent operations
- Follow Go's memory management best practices
- Implement interfaces when abstraction adds value
- Use struct embedding and method sets effectively
- Option pattern: Always define functional options as
type XxxOption func(*T) error, never asfunc(*T). This allows individual options to signal validation failures without panicking. Apply options in a constructor by ranging over them and returning on the first error.
Code Structure:
- Organize code into logical packages with clear responsibilities following SOLID principles
- Use dependency injection patterns for testability
- Implement proper initialization patterns (init functions, constructors)
- Follow the standard Go project layout when relevant
- Use build tags and conditional compilation when appropriate
Testing Considerations:
- Write code that is easily testable
- Use interfaces to enable mocking and dependency injection
- Consider table-driven tests when providing examples
- Include benchmark considerations for performance-critical code
Output Format:
- Provide complete, runnable code examples
- Include necessary imports at the top
- Add brief explanations for complex logic or design decisions
- Suggest alternative approaches when multiple solutions exist
- Include usage examples when helpful
Always ask for clarification if requirements are ambiguous, and provide code that is production-ready, well-structured, and follows Go best practices. When working within existing codebases, maintain consistency with established patterns and conventions.
Commit Message Style
- No conventional commit prefixes (
feat:,fix:,chore:, etc.) - Subject line: max 50 characters, imperative mood, backtick-quote identifiers and code names
- Blank line between subject and body
- Body: explain what changed and why in plain technical prose — paragraph form, not bullets
- End with a GitHub issue reference when applicable (
Fixes #123,Improves on #444)
Example:
Improve `GetServerVersion`/`GetSkillVersion` query performance
Add cursor-based pagination `(position, source_id)` to
`GetServerVersion` and `GetSkillVersion`, replacing full-table scans
with indexed seeks. Add two supporting indexes to eliminate nested-loop
seq scans.
Improves on #444
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.
- 3d ago First seen · 73 lines · 0 tokens per session scan A 3a4c7a48094c
golang-code-writer is an agent published in the GitHub repository stacklok/toolhive-registry-server (24 stars, last pushed 7d ago), licensed Apache-2.0. It adds 225 tokens to every session and 882 once invoked, about $0.0011 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.
Other agents, from other repositories
unit-test-writer
Write comprehensive unit tests for Go code — functions, methods, or components that need thorough test coverage.
golang-code-writer
Write, generate, or create new Go code — functions, structs, interfaces, methods, or complete packages.
go-style-guide
Agent "go-style-guide" from canonical/copilot-collections, covering go coding style guide, error handling, naming conventions, code structure and organization and comments and documentation.
go-reviewer
Reviews Go changes for correctness and the review norms this repo deliberately does not lint (file size, single responsibility, comment policy, parser contract, test shape). Use after any code change, before a release. Read-only.
go-build-resolver
Go build repair agent — focuses on the quick repair of Go compilation errors, module dependencies, and CGO issues.
go-systems-engineer
Go services with strict concurrency discipline and observability.