Skip to content

docs(claude): refresh .claude/ rules and add testing guide - #385

Merged
MatiasOS merged 2 commits into
openscan-explorer:devfrom
MatiasOS:chore/update-claude-files
May 12, 2026
Merged

MatiasOS merged 2 commits into
openscan-explorer:devfrom
MatiasOS:chore/update-claude-files

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Description

Refreshes the .claude/ rules directory to reflect the current state of the codebase. Adds a new testing.md documenting the Vitest + Playwright model (projects, suites, mocking, CI mapping), expands the architecture and commands docs with details that have drifted (adapter coverage, the worker/ companion sub-project, additional npm scripts), and brings the top-level CLAUDE.md quick-reference in line.

Related Issue

N/A — documentation maintenance.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

.claude/rules/testing.md (new)

  • Documents the two-layer test setup: Vitest for unit tests and Playwright for e2e.
  • Describes the two Playwright projects (chromium for live RPC, mocked for hermetic specs under e2e/tests/shared/mocked/).
  • Maps the e2e/tests/ directory tree by chain family (bitcoin/, eth-mainnet/, evm-networks/, shared/, solana/, testnets/).
  • Lists per-network runner scripts, debug/UI modes, and the corresponding GitHub Actions workflows so contributors know which CI signal a given suite produces.

.claude/rules/patterns.md

  • Adds a "Testing Patterns" section summarising the hermetic-vs-live rule of thumb: deterministic specs that exercise RPC strategy / inconsistency flags / errors belong under shared/mocked/; chain-specific live specs go under eth-mainnet/, evm-networks/, etc.

.claude/rules/architecture.md

  • Enumerates every adapter with its chain IDs, splitting out BNBAdapter (56/97), PolygonAdapter (137/80002), and SolanaAdapter, and listing Arbitrum/OP-Stack testnets.
  • Points at src/services/adapters/adaptersFactory.ts and documents the three factory entry points (createAdapter, createBitcoinAdapter, createSolanaAdapter).
  • Adds a "Companion Sub-Project: worker/" section describing the Hono-based RPC proxy, its multi-platform deployment (Cloudflare Workers / Vercel Edge / Deno Deploy), and the redundancy/failover behaviour from the frontend.

.claude/rules/commands.md

  • Documents previously-missing scripts: build:development, plain build, preview, check, audit (with a note on audit.sh generating a temporary lockfile because the repo uses Bun), and publish:dist.
  • Adds focused e2e runners (test:e2e:eth-mainnet, test:e2e:evm-networks), the --project=mocked command, and a cross-link to the new testing.md.

.claude/CLAUDE.md

  • Pins the Bun version (1.1.0) and clarifies that documented npm run commands work because they invoke package.json scripts (bun run is equivalent).
  • Adds quick-reference rows for check, unit/e2e test runners, and npm run dev.
  • Registers testing.md in the modular instructions index.

Screenshots (if applicable)

N/A — documentation-only change.

Checklist

  • I have run npm run format:fix and npm run lint:fix (no-op for .md files — Biome is scoped to src/** .ts/.tsx/.json)
  • I have run npm run typecheck with no errors (no source changes)
  • I have run tests with npm run test:run (no source changes)
  • I have tested my changes locally (docs reviewed against current code: adapter factory, package.json scripts, Playwright config, e2e tree)
  • I have updated documentation if needed (this PR is the documentation update)
  • My code follows the project's architecture patterns

Additional Notes

  • Targets dev per the patch-release workflow.
  • Split into two commits for reviewability: one adds the testing rules and the references to them; the other expands the existing commands/architecture/quick-reference docs.
  • No source code changes, so the type-check / test / lint checkboxes above are effectively no-ops — included for completeness.

MatiasOS added 2 commits May 12, 2026 11:40
Adds .claude/rules/testing.md documenting the Vitest + Playwright
testing model — unit test config, the two Playwright projects
(chromium / mocked), the e2e/tests/ tree organisation, hermetic vs
live trade-offs, and CI workflow mapping.

Updates CLAUDE.md to reference testing.md in the modular instructions
index, patterns.md to add a "Testing Patterns" section pointing at
mocked vs live conventions, and commands.md with the focused per-suite
e2e runners and the mocked Playwright project command.
CLAUDE.md: pin the Bun version (1.1.0) and add quick-reference rows
for `check`, unit/e2e test runners, and `npm run dev`.

architecture.md: enumerate every adapter with chain IDs (split out
BNB/Polygon/Solana, list Arbitrum/OP-Stack testnets), point at the
adapters factory in source, and document the worker/ companion
sub-project (Hono RPC proxy, Cloudflare/Vercel/Deno deployment).

commands.md: document `build:development`, plain `build`, `preview`,
`check`, `audit` (with audit.sh note about the temporary lockfile),
and `publish:dist`.
@MatiasOS
MatiasOS requested review from AugustoL and josealoha666 May 12, 2026 14:45
@github-actions

Copy link
Copy Markdown

🚀 Preview: https://pr-385--openscan.netlify.app
📝 Commit: cefb7e08af6ee7bd5e7b6ecd9d560b8ae2777c56

@MatiasOS
MatiasOS merged commit 8ccaa32 into openscan-explorer:dev May 12, 2026
3 checks passed
@MatiasOS
MatiasOS deleted the chore/update-claude-files branch May 12, 2026 17:58
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.

2 participants