finfocus copilot-instructions.md

A development guide for FinFocus, a command-line tool that estimates cloud infrastructure costs from Pulumi definitions. Pulumi is a tool for describing cloud resources as code.

In plain words
What is it for?
It is for building FinFocus and its plugins, running unit or integration tests, checking code quality, and validating Pulumi cost calculations.
Why use it?
It puts the project's build, test, lint, validation, architecture, and integration requirements in one place, including checks that need cloud credentials.

Instructions file for GitHub Copilot

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 instructions/rshade/finfocus/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/rshade/finfocus

Made for: GitHub Copilot.

Per session 2,105 This file is loaded in full into every session.
When invoked 2,105 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.02105 $0.02105
Opus 5 $0.01052 $0.01052
Sonnet 5 $0.00421 $0.00421
Haiku 4.5 $0.00211 $0.00211

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

Security

Grade A, and why

finfocus copilot-instructions.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 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.

.github/copilot-instructions.md · 168 lines

How it starts

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

FinFocus Development Instructions

FinFocus is a CLI tool for calculating cloud infrastructure costs from Pulumi infrastructure definitions. It uses a plugin-based architecture to query multiple cost data sources via gRPC.

Build, Test, and Lint Commands

make build                              # Build binary to bin/finfocus
make build-all                          # Build binary + all plugins (recorder, Pulumi tool)
make clean                              # Remove build artifacts

make test                               # Run unit tests (fast, default)
go test ./internal/cli/...              # Test specific package
go test -run TestName ./...             # Run single test by name
go test -v -run TestName ./internal/engine/...  # Single test in one package

make test-race                          # Run with race detector
make test-integration                   # Integration tests (slower)
make test-e2e                           # E2E tests (requires AWS credentials)

make lint                               # golangci-lint v2.9.0 + markdownlint + actionlint
make validate                           # go mod tidy -diff + go vet
make docs-lint                          # Lint documentation only

go test -coverprofile=coverage.out ./...  # Coverage report
go tool cover -html=coverage.out

Always run make lint and make test before committing.

Architecture

Pulumi JSON → Ingestion → Resource Descriptors → Router → Engine → Plugins (gRPC) / Specs (YAML) → Output

Dual-Mode Binary

The finfocus binary runs as both a standalone CLI and a Pulumi tool plugin. Mode is detected via binary name (pulumi-tool-finfocus) or FINFOCUS_PLUGIN_MODE=true. This changes the Use string and examples but shares all subcommands.

Core Components

  1. CLI (internal/cli/) — Cobra commands: overview, cost projected|actual|recommendations|budget|estimate, plugin *, config *, analyzer serve
  2. Engine (internal/engine/) — Orchestrates cost calculation. Tries plugins first, falls back to local YAML specs in specs/. Uses hoursPerMonth = 730. Supports table, JSON, NDJSON output. Includes batch processing (threshold: 100 resources), caching, and budget forecasting.
  3. Router (internal/router/) — Routes resource types to the correct plugin based on provider patterns, priority rules, and config-driven routing from ~/.finfocus/config.yaml.
  4. Proto Adapter (internal/proto/) — Bridge between engine and plugins. Converts ResourceDescriptor to protobuf requests, performs pre-flight validation via pluginsdk, extracts SKU/Region from resource Inputs, and aggregates errors with CostResultWithErrors.
  5. Plugin Host (internal/pluginhost/) — gRPC plugin lifecycle. ProcessLauncher (TCP) and StdioLauncher (stdin/stdout). 10-second timeout, 100ms retry. Always call cmd.Wait() after Kill() to prevent zombies.
  6. Registry (internal/registry/) — Discovers plugins at ~/.finfocus/plugins/<name>/<version>/. Optional plugin.manifest.json validation.
  7. Ingestion (internal/ingest/) — Parses pulumi preview --json. Must inspect newState to extract Inputs — without this, property extraction fails and plugins return InvalidArgument.
  8. Analyzer (internal/analyzer/) — Implements pulumirpc.AnalyzerServer for zero-click cost estimation during pulumi preview. Prints ONLY port number to stdout (Pulumi handshake). All logs go to stderr. ADVISORY enforcement only.
  9. Config (internal/config/) — Manages ~/.finfocus/config.yaml including plugin routing rules, budget definitions, and dismissed recommendation state (~/.finfocus/dismissed.json).
  10. TUI (internal/tui/) — Bubble Tea + Lip Gloss with adaptive color schemes.

Read the full file on GitHub · 168 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 · 168 lines · 2,105 tokens per session scan A 50834e9efcea

Subscribe to this mod's changes

finfocus copilot-instructions.md is an instructions file published in the GitHub repository rshade/finfocus (5 stars, last pushed 16d ago), licensed Apache-2.0. It adds 2,105 tokens to every session, about $0.0105 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.

Related

Other instructions, from other repositories

costory-finops-mcp-skills AGENTS.md

AGENTS.md instructions for costory-io/costory-finops-mcp-skills, covering agents.md — conventions for ai coding agents in this repo, layout, skill id mapping (costory mcp), when changing a skill and when adding a new skill.

costory-io/costory-finops-mcp-skills · 1,611 tokens

ai-pricing-hub-mcp CLAUDE.md

Claude Code instructions for OptimNow/ai-pricing-hub-mcp, covering claude.md - ai pricing hub mcp app, what this project does, architecture, data sources and the fallback chain and project structure.

OptimNow/ai-pricing-hub-mcp · 7,347 tokens

ai-pricing-hub-mcp AGENTS.md

AGENTS.md instructions for OptimNow/ai-pricing-hub-mcp: Before writing code, first explore the project structure, then invoke the chatgpt-app-builder skill for documentation.

OptimNow/ai-pricing-hub-mcp · 22 tokens

insideout-power AGENTS.md

Instructions for luthersystems/insideout-power, covering insideout — riley infrastructure agent, what riley can do for you, how to invoke riley, via remote mcp (preferred — use this first) and via agent skills.

luthersystems/insideout-power · 1,155 tokens

cloud-mcp-server CLAUDE.md

Claude Code instructions for alexei-led/cloud-mcp-server, covering aws mcp server development guide, build & test commands, architecture, server (server.py) and sandbox (sandbox.py).

alexei-led/cloud-mcp-server · 1,114 tokens

langchain-aws AGENTS.md

Instructions for langchain-ai/langchain-aws, covering global development guidelines for the langchain monorepo, project architecture and context, langchain-aws structure, key components and langgraph-checkpoint-aws structure.

langchain-ai/langchain-aws · 1,740 tokens