rayvise-project

A project ruleset describing the architecture and conventions of rayvise-cli, a Cobra-based Go command-line tool for generating AI prompts through the OpenRouter API. It covers packages, configuration priority, output lengths, model selection, streaming, and project-context files.

In plain words
What is it for?
Use it as a reference when working on rayvise-cli's commands, configuration, API client, prompt handling, clipboard support, project-context discovery, and shared types.
Why use it?
It gives coding agents the project context needed to make changes that fit the existing design. It prevents inconsistent choices about configuration, model resolution, output size, and context loading.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/rayvise/rayvise-cli/rayvise-project
Clone the repo
git clone --depth 1 https://github.com/rayvise/rayvise-cli

Made for: Cursor.

Per session 915 This file is loaded in full into every session.
When invoked 915 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00915 $0.00915
Opus 5 $0.00458 $0.00458
Sonnet 5 $0.00183 $0.00183
Haiku 4.5 $0.00092 $0.00092

Measured 2d ago against content hash 143cb431466b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rayvise-project 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 2d 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.

.cursor/rules/rayvise-project.mdc · 116 lines

How it starts

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

rayvise-cli Project Context

Architecture Overview

CLI Tool: Cobra-based CLI for generating AI-optimized prompts via OpenRouter API with automatic project context awareness

Key Packages:

  • cmd/ - Cobra commands (root, generate, interactive)
  • internal/config/ - Viper config + model registry
  • internal/llm/ - OpenRouter client with streaming
  • internal/prompts/ - Prompt templates + store
  • internal/projectcontext/ - Project context detection and loading
  • internal/clipboard/ - Cross-platform clipboard ops
  • pkg/types/ - Shared types

Core Concepts

Output Lengths: Control response size via max_tokens + system prompt directives

  • short: 300 tokens, concise prompts
  • medium: 800 tokens, balanced detail
  • long: 1500 tokens, comprehensive

Model Resolution: Custom models → DefaultModels → treat as OpenRouter ID

Config Hierarchy: CLI flags → env vars (RAYVISE_*) → ~/.rayvise/config.yaml → defaults

Streaming: SSE parsing for interactive mode, non-streaming for generate command

Project Context Awareness: Automatically discovers and loads context from .cursor/rules/, CLAUDE.md, or AGENTS.md files (in priority order). Context is injected into the system prompt via {{.Context}} template variable, allowing generated prompts to be aware of project conventions and architecture.

Code Patterns

Error Handling:

// Network errors: retry once
if err != nil || resp.StatusCode >= 500 {
    time.Sleep(1 * time.Second)
    resp, err = client.Do(req)
}

// User-facing errors: clear, actionable
return fmt.Errorf("API key not found. Set RAYVISE_API_KEY or add to config.yaml")

Config Access:

cfg := config.GetConfig()
apiKey := cfg.GetAPIKey()  // Falls back to env var
model := cfg.GetDefaultModel()  // Falls back to "cerebras-llama-8b"

Prompt Rendering:

store, _ := prompts.NewStore()
systemPrompt, _ := store.Render("metaprompt", types.OutputLengthMedium)
// Template {{.LengthDirective}} auto-replaced
// Template {{.Context}} auto-replaced with project context (if found)

Read the full file on GitHub · 116 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. 2d ago First seen · 116 lines · 915 tokens per session scan A 143cb431466b

Subscribe to this mod's changes

rayvise-project is a cursor rule published in the GitHub repository rayvise/rayvise-cli (8 stars, last pushed 4mo ago), licensed MIT. It adds 915 tokens to every session, about $0.0046 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-31.