core-libraries

A reference for the libraries and utilities required in Compozy's Go applications, including tools for HTTP APIs, databases, validation, logging, testing, and command-line interfaces.

In plain words
What is it for?
It helps select Gin for HTTP APIs, PostgreSQL and Redis clients, Testify for tests, Validator for input checks, Charm logging, and Cobra for CLI commands.
Why use it?
It prevents developers from choosing incompatible or unapproved libraries for common application tasks.

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/compozy/gograph/core-libraries
Clone the repo
git clone --depth 1 https://github.com/compozy/gograph

Made for: Cursor.

Per session 515 This file is loaded in full into every session.
When invoked 515 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.00515 $0.00515
Opus 5 $0.00258 $0.00258
Sonnet 5 $0.00103 $0.00103
Haiku 4.5 $0.00052 $0.00052

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

Security

Grade A, and why

core-libraries 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/core-libraries.mdc · 82 lines

How it starts

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

Core Libraries & Project Utilities

Required Libraries

<library_requirements type="web_framework"> Web Framework:

  • MUST use: gin-gonic/gin for HTTP APIs </library_requirements>

<library_requirements type="database"> Database:

  • PostgreSQL: jackc/pgx/v5
  • Redis: redis/go-redis/v9
  • Always use connection pooling and proper cleanup </library_requirements>

<library_requirements type="testing"> Testing:

  • MUST use: stretchr/testify for assertions and mocks
  • Import as: github.com/stretchr/testify/assert, github.com/stretchr/testify/mock
  • STANDARDIZE: Replace all custom mocks with testify/mock implementations </library_requirements>

<library_requirements type="validation"> Validation:

  • MUST use: go-playground/validator/v10 for input validation </library_requirements>

<library_requirements type="logging"> Logging:

  • MUST use: charmbracelet/log
  • NEVER use: fmt.Printf or log.Printf for application logging </library_requirements>

<library_requirements type="cli"> CLI:

  • MUST use: spf13/cobra for commands </library_requirements>

<library_requirements type="documentation"> Documentation:

  • MUST use: swaggo/swag for API documentation </library_requirements>

Project Utilities

<utility_pattern type="core_types">

// Use project core types
var taskID core.ID  // UUIDs
var reference core.Ref  // Polymorphic references

</utility_pattern>

<utility_pattern type="test_helpers">

// Use project test utilities
func TestService(t *testing.T) {
    t.Run("Should setup test environment", func(t *testing.T) {
        db := utils.SetupTest()
        defer db.Close()

        fixture := utils.SetupFixture("user_data.json")
        // test implementation
    })
}

</utility_pattern>

<utility_pattern type="template_engine">

// Use pkg/tplengine for dynamic configurations
engine := tplengine.New()
result, err := engine.Process(template, variables)

</utility_pattern>

Read the full file on GitHub · 82 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 · 82 lines · 515 tokens per session scan A 95f5629509b0

Subscribe to this mod's changes

core-libraries is a cursor rule published in the GitHub repository compozy/gograph (9 stars, last pushed 1y ago), licensed MIT. It adds 515 tokens to every session, about $0.0026 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.