Skip to content

docs: add CLAUDE.md guidance + apply test-writing guidelines to the suite#4

Merged
sanketsudake merged 2 commits into
mainfrom
docs/claude-guidance-and-test-guidelines
Jul 16, 2026
Merged

docs: add CLAUDE.md guidance + apply test-writing guidelines to the suite#4
sanketsudake merged 2 commits into
mainfrom
docs/claude-guidance-and-test-guidelines

Conversation

@sanketsudake

Copy link
Copy Markdown
Owner

What

Two related commits:

  1. docs: project guidance for Claude Code / AI agents.

    • CLAUDE.md — slim index pointing at .claude/resources/*, 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,development,test-writing-guidelines}.md.
    • The test-writing guidelines are adapted from the Fission conventions, keeping only what applies and noting where this repo deviates (stdlib not testify; testing.Short() not build tags).
  2. test: apply those guidelines to the existing suite.

    • Added t.Parallel() to every independent unit test and subtest across result, target, config, browser, daemon/lifecycle, and cli (61 call sites; the suite had none before).
    • Converted loop-based table tests (cookie/attr/emulate/extract/grid verbs and result.TestExitCodeFor) to named t.Run subtests.

Deliberately left sequential

Per the guidelines' own boundaries: the live-Chrome tests (shared spawned browser), profile_test.go (t.Setenv panics under parallel), and daemon_test.go (real unix-socket listeners).

Verification

  • gofmt -l internal/ clean, go vet ./... clean
  • go test -short -race ./... passes
  • go test -race ./... (full, live Chrome ran) passes — the -race run is the real proof the added parallelism is safe

🤖 Generated with Claude Code

sanketsudake and others added 2 commits July 16, 2026 11:44
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>
@sanketsudake
sanketsudake merged commit 91d9fa6 into main Jul 16, 2026
2 checks passed
@sanketsudake
sanketsudake deleted the docs/claude-guidance-and-test-guidelines branch July 16, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant