finfocus-dev

A development guide for contributing to FinFocus, a Go command-line application for analyzing cloud infrastructure costs.

In plain words
What is it for?
Use it when adding CLI commands, fixing bugs, writing tests, building the project, or running linting and validation.
Why use it?
It explains the project's coding patterns, common commands, and required checks so changes fit the existing codebase.

Skill for Claude CodeCodex

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 skills/rshade/finfocus/finfocus-dev
Any agent
npx skills add rshade/finfocus --skill finfocus-dev
Clone the repo
git clone --depth 1 https://github.com/rshade/finfocus

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 819 The whole file, excluding the scripts and references it only reads on demand.
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.00074 $0.00819
Opus 5 $0.00037 $0.00409
Sonnet 5 $0.00015 $0.00164
Haiku 4.5 $0.00007 $0.00082

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

Security

Grade A, and why

finfocus-dev 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.

.claude/skills/finfocus-dev/finfocus-dev/SKILL.md · 106 lines

How it starts

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

FinFocus Development Workflow

Quick Reference

make build          # Build binary to bin/finfocus
make test           # Unit tests (fast, default)
make lint           # golangci-lint + markdownlint (5+ min, use extended timeout)
make validate       # go mod tidy + go vet
make test-race      # Race detector
make test-integration  # Cross-component tests (10min timeout)
make build-all      # Build binary + all plugins

Critical rules: Always run make lint and make test before claiming success. Never run git commit (user commits manually). Never modify .golangci.yml.

Adding a CLI Command

  1. Create internal/cli/your_command.go
  2. Follow constructor pattern:
func NewYourCmd() *cobra.Command {
    var flagVar string
    cmd := &cobra.Command{
        Use:   "your-command",
        Short: "Description",
        RunE: func(cmd *cobra.Command, args []string) error {
            // Use cmd.Printf() not fmt.Printf()
            return nil
        },
    }
    cmd.Flags().StringVar(&flagVar, "flag", "", "description")
    return cmd
}
  1. Register in parent command (e.g., root.go or cost.go)
  2. Use RunE (not Run) for error handling
  3. Defer cleanup immediately: defer cleanup()

Resource Processing Pipeline

All cost commands follow:

ingest.LoadPulumiPlan(path) -> ingest.MapResources() -> registry.Open(ctx, adapter)
  -> engine.GetProjectedCost/GetActualCost() -> engine.RenderResults(format, results)

Testing Standards

  • Use testify/assert and testify/require exclusively (never manual if/t.Errorf)
  • require.* for setup that must succeed; assert.* for value checks
  • Table-driven tests for variations
  • Package suffix _test for black-box testing
  • t.TempDir() for temporary files (auto-cleanup)
  • Capture output: cmd.SetOut(&buf) and cmd.SetErr(&buf)
  • Target 80% coverage minimum, 95% for critical paths

See references/testing-patterns.md for detailed test patterns and examples.

Read the full file on GitHub · 106 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 106 lines · 74 tokens per session scan A 1050581098f5

Subscribe to this mod's changes

finfocus-dev is a skill published in the GitHub repository rshade/finfocus (5 stars, last pushed 16d ago), licensed Apache-2.0. It adds 74 tokens to every session and 819 once invoked, about $0.0004 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 skills, from other repositories

aws-cost-ops

AWS Cost Explorer — spending analysis, service breakdowns, forecasts, cost anomalies. Use when analyzing AWS spending, investigating cost spikes, reviewing network cost drivers like NAT Gateway, or forecasting next month's bill.

automateyournetwork/netclaw · 45 tokens

dashboards

Use when creating or extending Costory dashboards, generating interesting FinOps overviews (suggestgroupby + suggestusagemetrics + text widgets), adding or replacing widgets, copying widgets between dashboards, editing dashboardContext (global filter / period / groupBy) via updatedashboard, or applying shared-context…

costory-io/costory-finops-mcp-skills · 92 tokens

reports

Use when creating, previewing, updating, scheduling, or exploring Costory reports. Route by intent: scheduled Slack/Teams/email sharing (Schedule — ask before build) vs explain last-month cost with preview-first DIGEST (Explain — chat preview required; not query+compare). Workflows are named, never lettered. DIGEST AI…

costory-io/costory-finops-mcp-skills · 136 tokens

query

Use when exploring Costory cost, usage, metric, formula, budget, or external-metric data with the query tool — scope vs split (filterCel / groupBy), explorer PoP comparison, CEL discovery, unit economics, budgets. Not for one-shot "what changed last month" change trees — those use recipes explain-period-change /…

costory-io/costory-finops-mcp-skills · 93 tokens

cost-change-investigation

Use when investigating a cost change to explain what changed, when, and the best-supported drivers with contribution, timing, usage, metric, event, alert, and terminology evidence. Call getskill with skillId "cost-change-investigation" before starting the investigation.

costory-io/costory-finops-mcp-skills · 57 tokens

runway

Show current cloud credit and spend numbers - how much credit was granted, how much is used, how much is left, when it expires, and where the money went. Use whenever the user asks about cloud spend, cloud costs, credits, AWS/Azure/GCP spend, "how much have I spent", "how much is left", "what's my burn", "what's my…

ozkilim/runway · 123 tokens