agentleFS
tomasz-tomczyktomasz-tomczyk/crit/scripts/AGENTS.md

crit / scripts

AGENTS.md1.2k starsChanged 2 months agoMITView on GitHub

End-to-end integration tests for the crit CLI to crit-web share flow. Tests the full round-trip: sharing reviews, fetching web comments, re-sharing without duplicates, and unpublishing. Build tag: //go:build integration — these tests are excluded from go test ./... and only run via go test -tags integration. Tests use --output <dir> to write .crit.json to a temp directory (not ~/.crit/reviews/), and --share-url to point at the local crit-web instance. Every test logs its review URL (t.Logf(" -> Review: ...")) so you…

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 AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every test logs its review URL (t.Logf(" -> Review: ...")) so you can open them in a browser for visual inspection.

    line 54
  2. Very specific:

    Use the helpers: critShareCmd, critUnpublishCmd, writeTestCritJSON, readCritJSON, commentsFromAPI, documentFromAPI, seedComment, …

    line 82
  3. Very specific:

    Always call logReview(t, output) after sharing so the URL is visible in test output

    line 83
  4. Very specific:

    Use writeTestCritJSON (not writeCritJSON — that name conflicts with github.go)

    line 84

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Scripts

e2e-share.sh

End-to-end integration tests for the crit CLI to crit-web share flow. Tests the full round-trip: sharing reviews, fetching web comments, re-sharing without duplicates, and unpublishing.

Prerequisites

  • A local crit-web checkout as a sibling directory (../crit-web relative to the crit repo root, or set CRIT_WEB_DIR)
  • PostgreSQL running locally (the script creates a crit_e2e database)
  • mise (for Go and Elixir toolchain management)

Usage

# Full run: build crit, start crit-web on :4001, run tests, tear down
make e2e-share
# or directly:
./scripts/e2e-share.sh

# Start crit-web for manual testing (Ctrl+C to stop)
./scripts/e2e-share.sh --serve

# Run tests against an already-running crit-web
./scripts/e2e-share.sh --skip-web

# Run a specific test
./scripts/e2e-share.sh -run TestShareSyncFullLifecycle

Environment variables

VariableDefaultDescription
CRIT_WEB_PORT4001Port for the test crit-web instance
CRIT_WEB_DIR../crit-webPath to crit-web checkout
DB_NAMEcrit_e2ePostgreSQL database name (separate from dev)

What the script does

  1. Builds crit via make build
  2. Creates/resets the crit_e2e database
  3. Starts crit-web with SELFHOSTED=true on the test port (no OAuth)
  4. Waits for GET /health to return 200
  5. Runs all TestShareSync* integration tests with CRIT_AUTH_TOKEN="" to bypass any local auth config
  6. Tears down crit-web on exit

Test file: share_integration_test.go

Build tag: //go:build integration — these tests are excluded from go test ./... and only run via go test -tags integration.

Tests use --output <dir> to write .crit.json to a temp directory (not ~/.crit/reviews/), and --share-url to point at the local crit-web instance.

Every test logs its review URL (t.Logf(" -> Review: ...")) so you can open them in a browser for visual inspection. Reviews persist on crit-web after tests run (except the unpublish test).

Test cases

TestWhat it covers
TestShareSyncIntegrationOriginal: share, seed web comment, re-share, verify content + export
TestShareSyncNoCommentsShare with zero comments, verify document on web
TestShareSyncLineCommentsLine-scoped comments: body, position, scope verified on web
TestShareSyncFileCommentFile-scoped comment: body, scope, file_path verified on web
TestShareSyncReviewLevelCommentsReview-level comments shared (tests #297 fix for CLI path)
TestShareSyncMixedCommentTypesAll 3 scopes together, each verified on web
TestShareSyncResolvedExcludedResolved comments filtered out of share payload
TestShareSyncReshareNoDuplicatesRe-share preserves comments without duplication
TestShareSyncReshareNoChangesNo-op when content unchanged (round stays same)
TestShareSyncFetchWebCommentsWeb-authored comments pulled into local .crit.json
TestShareSyncFetchWebCommentsNoDuplicatesRepeated syncs don't duplicate web comments
TestShareSyncMultipleFilesMulti-file share with per-file comment association
TestShareSyncMultipleRoundsRound progression across 3 share cycles, content verified
TestShareSyncCommentWithRepliesThreaded replies included in share
TestShareSyncUnpublishFull unpublish: web deletion + local state cleared
TestShareSyncExportExport endpoint returns .crit.json-compatible shape
TestShareSyncFetchReviewLevelWebCommentReview-level web comments merged into local ReviewComments
TestShareSyncFullLifecycleComplete round-trip: local comments with threads, share, web comments added, fetch, re-share (preserved), fetch again (no duplicates)

Adding new tests

  • Name test functions TestShareSync* so they're picked up by the -run TestShareSync filter
  • Use the helpers: critShareCmd, critUnpublishCmd, writeTestCritJSON, readCritJSON, commentsFromAPI, documentFromAPI, seedComment, seedCommentAt, seedReviewComment, logReview, extractToken
  • Always call logReview(t, output) after sharing so the URL is visible in test output
  • Use writeTestCritJSON (not writeCritJSON — that name conflicts with github.go)

e2e-roundtrip.sh and e2e-gitlab-roundtrip.sh

These are the provider-specific runners for one live roundtrip suite in internal/session. GitHub uses the e2e_github tag, CRIT_ROUNDTRIP_REPO, and authenticated gh; GitLab uses the e2e_gitlab tag, CRIT_GITLAB_ROUNDTRIP_PROJECT, and authenticated glab (plus optional CRIT_GITLAB_ROUNDTRIP_HOST for self-managed instances). Both create and clean up a temporary change request and branch. See test/roundtrip/README.md for shared setup and authoring guidance.

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.