agentleFS
tomasz-tomczyktomasz-tomczyk/crit/.cursor/rules/go.mdc

crit / rules

Cursor rule1.2k starsChanged 2 months agoMITView on GitHub

crit — go

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 1 mentionJun 2026: 9 mentionsJul 2026: 10 mentionsAug 2026: 11 mentionsSep 2026: 11 mentionsOct 2026: 5 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the tomasz-tomczyk/crit repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about tomasz-tomczyk/crit

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub, Bluesky and Hacker News (50 times).

On GitHub · 46

41 more on GitHub

On Hacker News · 1

The file

We split this go.mdc into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When building structs for serialization or cross-boundary transfer, verify ALL source fields are mapped.

    line 10
  2. Distinctive:

    When clearing/resetting state from a struct, enumerate ALL fields.

    line 12
  3. Very specific:

    When storing error values in shared state (atomic.Value, channels), copy the value first: e := err.

    line 13
  4. Distinctive:

    Never create wrapper functions that just call another function with the same signature.

    line 17
  5. Distinctive:

    Before implementing logic inline, search for existing helper functions that do the same thing.

    line 19
  6. Distinctive:

    After replacing a function with a new implementation, delete the old function AND its tests in the same PR.

    line 20
  7. Distinctive:

    When determining file status, always diff against baseRef consistently.

    line 23
  8. Distinctive:

    When checking if a service is alive, validate the response body, not just HTTP status.

    line 26
  9. Distinctive:

    Use table-driven tests instead of separate test functions for parameter variations.

    line 30
  10. Distinctive:

    When adding a new API endpoint, add tests for: happy path, error cases, not-found, method-not-allowed.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
go.mdc
---
description: crit — go
globs: crit/*.go,crit/**/*.go
alwaysApply: false
---

# Go Code Rules (semantic — linters handle syntax/style)

## Struct & State Integrity
- When building structs for serialization or cross-boundary transfer, verify ALL source fields are mapped. Missing fields cause silent data loss.
- For boolean config fields, always use presence tracking to distinguish "not set" from "set to false". Go's zero-value for bool is `false`, which is ambiguous.
- When clearing/resetting state from a struct, enumerate ALL fields. Review comments, file comments, and metadata must all be cleared.
- When storing error values in shared state (atomic.Value, channels), copy the value first: `e := err; store(&e)`.

## Code Organization
- This is `package main`. Do NOT export functions/types unless required by tests in `_test.go` files.
- Never create wrapper functions that just call another function with the same signature.
- Route all review file writes through `saveCritJSON()`. Never write directly.
- Before implementing logic inline, search for existing helper functions that do the same thing.
- After replacing a function with a new implementation, delete the old function AND its tests in the same PR.

## Git Operations
- When determining file status, always diff against baseRef consistently. Don't mix `git status --porcelain` (working tree) with `git diff --name-status` (branch diff).

## Daemon/Server
- When checking if a service is alive, validate the response body, not just HTTP status.
- Error paths in CLI subcommands must exit with non-zero status (`os.Exit(1)`).

## Testing
- Use table-driven tests instead of separate test functions for parameter variations.
- When adding a new API endpoint, add tests for: happy path, error cases, not-found, method-not-allowed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.