GEMINI
Instructs a Gemini AI assistant on building, testing, and extending a Go MCP server for writers.
What this file does
Instructs a Gemini AI assistant on building, testing, and extending a Go MCP server for writers.
When to use it
- You want an AI assistant to contribute to a Go MCP server project
- You need to standardize how an AI agent interacts with your codebase
- Your project exposes functionality through MCP prompts and tools
- You want the AI to follow specific development principles like reading the README first
Assumes this stack
Gemini AI-powered assistant
This file provides instructions for the Gemini AI-powered assistant on how to work with the speedgrapher project.
Project Overview
Speedgrapher is a local MCP (Model Context Protocol) server written in Go. It's designed to assist writers, especially in the tech industry, by providing a suite of tools to streamline the writing process. It uses the official Go SDK for MCP and communicates over the stdio transport layer.
Development Workflow
The project uses a Makefile to manage common development tasks.
-
Building the project: To build the server, run the following command: ```bash make build
This will create an executable at `speedgrapher`. -
Running tests: To run the project's tests, use the following command:
make test -
Cleaning the project: To remove the executable, run:
make clean
Dependencies
The main dependency for this project is the github.com/modelcontextprotocol/go-sdk. The project's module path is github.com/danicat/speedgrapher.
Coding Style
The project follows standard Go coding conventions. Please maintain this style when adding or modifying code.
Prompts
The server's functionality is exposed through a series of prompts. New prompts can be added in the internal/prompts directory. Each new prompt requires two functions:
- A function that defines the prompt's name, description, and arguments.
- A handler function that implements the prompt's logic.
After creating these two functions, you must register the new prompt in the run function in cmd/speedgrapher/main.go.
Available Prompts:
haiku: Creates a haiku about a given topic.interview: Interviews an author to produce a technical blog post.localize: Translates an article into a target language.readability: Analyzes the last generated text for readability and suggests improvements. It uses thefogtool.reflect: Analyzes the current session and proposes improvements to the development process.review: Reviews an article against the editorial guidelines.
Tools
The server can also expose tools to the user. New tools can be added in the internal/tools directory.
Available Tools:
fog: Calculates the Gunning Fog Index for a given text. The implementation uses a heuristic based on vowel groups to count syllables.
General Development Principles
- Prioritize API/SDK Understanding: Before writing code that uses an external library or SDK, I must first use documentation-lookup tools (
godoc,web_search) to understand the correct API usage. I will prioritize official documentation and user-provided links. - Favor Consistent Heuristics: When implementing features based on heuristics (e.g., readability formulas), I will propose a simple, robust, and consistent algorithm first. I will explain its trade-offs and seek user approval before attempting more complex, exception-laden solutions.
- Trust but Verify: I must critically evaluate all information, including user-provided test cases and my own generated text. I will use the tools at my disposal to verify data and assumptions before acting on them.
- Maintain an Objective Tone: I will present facts and results objectively and avoid defensive justifications unless explicitly asked for them. My primary goal is to be a helpful, data-driven assistant.
- Use the Right Tool for the Job: Prioritize built-in tools over shell commands. If a specific tool is available for a task (e.g.,
gopretty,godoc), use it directly instead of trying to execute it throughrun_shell_command. - Always Read the README: At the start of every session, read the
README.mdfile to ensure you have the latest information about the project, especially the testing procedures.
What's inside
7 sections: project overview, development workflow, dependencies, coding style, prompts, tools, general principles. 3 code examples.
Change this for your project
- Replace
github.com/danicat/speedgrapherwith your own module path - Replace
speedgrapherwith your project's binary name in build commands - Replace
internal/promptsandinternal/toolswith your own directory paths if different - Replace
cmd/speedgrapher/main.gowith your own main file path
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separates prompt definition from prompt handler logic, requiring registration in a central file
- Lists explicit development principles to guide AI behavior, such as 'Trust but Verify' and 'Always Read the README'
Related Documents
Totem — Development Rules
Defines team-wide conventions for a pnpm monorepo: branch strategy, commit rules, tooling, and a mandatory knowledge-search workflow before coding.
MechCAD-MLLM
Proposes a MLLM + dual-decoder architecture for mechanical CAD generation, combining Drawing2CAD and CAD-GPT ideas.
Prompt Generator
Generates Stable Diffusion and Flux prompts via Qwen3-8B on Ollama, with a Gradio UI and CLI.
Agent Instructions
Defines a three-layer architecture (directive, orchestration, execution) for AI agents that self-anneal errors and update living SOPs.