docs: add CLAUDE.md guidance + apply test-writing guidelines to the suite#4
Merged
Merged
Conversation
Add repo guidance for Claude Code / AI agents: - CLAUDE.md: slim index calling out the two load-bearing invariants (the result envelope is public API; the CLI never connects to Chrome directly — capabilities go through the chrome.Browser seam). - AGENTS.md: symlink to CLAUDE.md. - .claude/resources/architecture.md: envelope/exit-code contract, the internal/ package map, DI seams, and the daemon/connection model. - .claude/resources/development.md: build/test/lint commands, what CI runs, live-Chrome test behavior, and the release flow. - .claude/resources/test-writing-guidelines.md: adapted from the Fission conventions, keeping only what applies and noting where this repo deviates (stdlib not testify; testing.Short() not build tags). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply the test-writing guidelines to the existing suite: - Add t.Parallel() to every independent unit test and subtest across the result, target, config, browser, daemon/lifecycle, and cli packages. - Convert loop-based table tests (cookie/attr/emulate/extract/grid verbs and result.TestExitCodeFor) to named t.Run subtests. Left sequential on purpose: the live-Chrome tests (shared browser), profile_test.go (t.Setenv), and daemon_test.go (real socket listeners). Verified: gofmt clean, go vet clean, and the full `go test -race ./...` (live Chrome included) passes — proving the added parallelism is safe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related commits:
docs:project guidance for Claude Code / AI agents.CLAUDE.md— slim index pointing at.claude/resources/*, calling out the two load-bearing invariants (theresultenvelope is public API; the CLI never connects to Chrome directly — capabilities go through thechrome.Browserseam).AGENTS.md— symlink toCLAUDE.md..claude/resources/{architecture,development,test-writing-guidelines}.md.testify;testing.Short()not build tags).test:apply those guidelines to the existing suite.t.Parallel()to every independent unit test and subtest acrossresult,target,config,browser,daemon/lifecycle, andcli(61 call sites; the suite had none before).result.TestExitCodeFor) to namedt.Runsubtests.Deliberately left sequential
Per the guidelines' own boundaries: the live-Chrome tests (shared spawned browser),
profile_test.go(t.Setenvpanics under parallel), anddaemon_test.go(real unix-socket listeners).Verification
gofmt -l internal/clean,go vet ./...cleango test -short -race ./...passesgo test -race ./...(full, live Chrome ran) passes — the-racerun is the real proof the added parallelism is safe🤖 Generated with Claude Code