finfocus
AGENTS.md11 starsChanged 13 days agoApache-2.0View on GitHub
Repository guidelines for AI agents working with the FinFocus codebase
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 53
Avoid init() and global variables (lint rule).
- Distinctive: line 71
Prefer early returns to reduce nesting.
- Distinctive: line 72
Use context cancellation and return partial results where sensible.
- Very specific: line 76
Use internal/logging for structured logging.
- Very specific: line 79
Use Debug for detailed flow, Info for milestones, Warn for recoverable issues.
- Distinctive: line 84
Test both success and failure paths, especially file I/O and validation.
- Very specific: line 85
Use fixtures from testdata/ or examples/ over large literals.
- Very specific: line 86
Use integration tests in examples/ for HTTP/CRUD flows.
- Very specific: line 92
CRITICAL: All Go tests must use testify/assert and testify/require.
- Very specific: line 103
Use require.* for setup failures and nil checks, assert.* for value comparisons.
- Very specific: line 109
Run make docs-lint after Markdown edits.
- Distinctive: line 116
Avoid bundling unrelated changes.
- Very specific: line 117
Run make lint and make test before committing.
- Very specific: line 121
Never commit secrets; use FINFOCUS_PLUGIN_* env vars or ~/.finfocus/config.yaml.
- Very specific: line 133
Create unit tests in internal/engine/types_test.go.
- Very specific: line 134
Create integration tests in internal/conformance/.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Guidelines
Table of Contents:
- Project Snapshot
- Build, Lint, and Test Commands
- Go Formatting and Imports
- Types, Naming, and API Surface
- Error Handling and Control Flow
- Logging Expectations
- Testing Guidelines
- Testify Assertions (Required)
- Documentation and Markdown
- Commit and PR Guidance
- Security and Configuration
- Common Workflows
- Current Stack
- Cursor/Copilot Rules
- Active Technologies
- Recent Changes
Project Snapshot
- Go CLI for finfocus in
cmd/finfocuswith unexported logic ininternal/. - Fixtures live in
examples/,testdata/, andtest/e2e/fixtures/. - Docs are in
docs/; scripts inscripts/; build artifacts inbin/.
Build, Lint, and Test Commands
make tools: Install the toolchain pinned inmise.toml(single source of truth for tool versions; runmise installdirectly if preferred).make build: Build thefinfocusbinary intobin/with version metadata.make run/make dev: Build then run the CLI;make inspectlaunches MCP inspector.make test|make test-race: Run unit tests (optionally with race detector).go test ./...: Run the full Go test suite.go test -run TestName ./path/to/package: Run a single test in one package.go test -v ./... -run TestFunc: Run a single test across all packages.make lint: Rungolangci-lintv2.13.2 plusmarkdownlint.make validate: Rungo mod tidy -diffandgo vetchecks.make docs-lint: Lint docs when editing Markdown.
Go Formatting and Imports
- Go 1.27.3+; use tabs for indentation and run
gofmton Go files. - Imports grouped as: standard library, third-party, internal packages.
goimports/golinesenforced viagolangci-lint; keep lines tidy.- Avoid
init()and global variables (lint rule). //nolint:linternameonly when required and with justification.
Types, Naming, and API Surface
- Package names lowercase and short (
engine,config,pluginhost). - Custom domain types preferred (
type Duration time.Duration). - Exported identifiers require Go doc comments when part of CLI surface.
- Struct tags use JSON/YAML tags (
yaml:"field_name"). - CLI flags are kebab-case; env/config keys uppercase snake (
FINFOCUS_*). - Define interfaces before implementations; keep interfaces small.
- Pass
context.Contextthrough request lifecycles.
Error Handling and Control Flow
- Wrap errors with
%w:fmt.Errorf("operation failed: %w", err). - Sentinel errors are
var ErrName = errors.New("description"). - Validate inputs early and return descriptive errors.
- Prefer early returns to reduce nesting.
- Use context cancellation and return partial results where sensible.
Logging Expectations
- Use
internal/loggingfor structured logging. - Fetch logger from context:
log := logging.FromContext(ctx). - Include
componentandoperationfields for traceability. - Use
Debugfor detailed flow,Infofor milestones,Warnfor recoverable issues.
Testing Guidelines
- Table-driven tests with clear
wantErr/errContainsfields. - Test both success and failure paths, especially file I/O and validation.
- Use fixtures from
testdata/orexamples/over large literals. - Use integration tests in
examples/for HTTP/CRUD flows. - Plugins: add conformance coverage in
internal/conformanceand targeted tests ininternal/engineorinternal/registry.
Testify Assertions (Required)
CRITICAL: All Go tests must use testify/assert and testify/require.
Required imports:
import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)Use require.* for setup failures and nil checks, assert.* for value comparisons.
Documentation and Markdown
- Docs use frontmatter with
title,description, andlayout. - Frontmatter
titleis the H1; content must start with H2 or body text. - Run
make docs-lintafter Markdown edits. markdownlintruns as part ofmake lint.
Commit and PR Guidance
- Conventional Commits required (
feat:,fix:,chore:...). - PRs include summary, linked issues, and a test plan (e.g.,
make test). - Avoid bundling unrelated changes; call out breaking changes.
- Run
make lintandmake testbefore committing.
Security and Configuration
- Never commit secrets; use
FINFOCUS_PLUGIN_*env vars or~/.finfocus/config.yaml. - Plugins live in
~/.finfocus/plugins/<name>/<version>/. - Validate plugins with
finfocus plugin validateandfinfocus plugin certify. - Scrub Pulumi plan fixtures if identifiers appear.
Common Workflows
Adding Resource Types
- Declare a resource type in
internal/engine/types.go. - Implement validation in the resource's
Validate()method. - Provide pricing data in
specs/or via plugin support. - Create unit tests in
internal/engine/types_test.go. - Create integration tests in
internal/conformance/.
User-Facing CLI Features
- Constitution Principle VII (Web Parity): the spec has a
Web UI Fitsection, aninternal/webuihook that calls the CLI's Go method is part of the feature, and a UX-onlyweb-uifollow-up issue is filed on completion. A feature with no web surface recordsNot applicableand a reason instead. - Layout:
docs/src/content/docs/architecture/web-ui.md.
Plugin Development
finfocus plugin initscaffolds new plugins.- Implement the protocol from finfocus-spec.
- Install to
~/.finfocus/plugins/<name>/<version>/.
Current Stack
- Go 1.27.1 with
github.com/Masterminds/semver/v3and finfocus plugin SDK. - charmbracelet/lipgloss v1.0.0 and golang.org/x/term v0.37.0.
- Tool versions (Go, golangci-lint, node, markdownlint, actionlint, shellcheck,
govulncheck, specify-cli) are pinned in
mise.toml; runmake toolsto install. - Plugin directory:
~/.finfocus/plugins/<plugin-name>/<version>/.
Cursor/Copilot Rules
- No
.cursor/rules/,.cursorrules, or.github/copilot-instructions.mdfound.
Active Technologies
- 631-carbon-plugin (implemented): Go 1.27.1, finfocus-spec v0.7.6, static CCF data, and generic carbon enrichment.
- Go 1.27.1 + finfocus-spec SDK, Cobra CLI, zerolog, gRPC, pluginsdk (001-plugin-init-recorder)
- Local filesystem for fixture downloads and recorded request output (001-plugin-init-recorder)
Recent Changes
- 001-plugin-init-recorder: Added Go 1.27.1 + finfocus-spec SDK, Cobra CLI, zerolog, gRPC, pluginsdk
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- pick-issueSkill
- promote-issueSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- agentic-workflow-designerSkill
- agentic-workflowsSkill
- code-reviewSkill
- jqschemaSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

