2026-02-19 16:09:11 +00:00
|
|
|
# CLAUDE.md
|
|
|
|
|
|
2026-02-20 15:01:55 +00:00
|
|
|
Module: `forge.lthn.ai/core/go-webview` — Chrome DevTools Protocol client for browser automation.
|
2026-02-19 16:09:11 +00:00
|
|
|
|
|
|
|
|
## Commands
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-02-20 15:01:55 +00:00
|
|
|
go test ./... # Run all tests (must pass before commit)
|
|
|
|
|
go test -v -run Name # Run a single test
|
|
|
|
|
gofmt -w . # Format code
|
2026-02-19 16:09:11 +00:00
|
|
|
```
|
|
|
|
|
|
2026-02-20 15:01:55 +00:00
|
|
|
## Coding Standards
|
2026-02-19 16:09:11 +00:00
|
|
|
|
2026-02-20 15:01:55 +00:00
|
|
|
- UK English in all comments, docs, and commit messages
|
|
|
|
|
- EUPL-1.2 licence header (`// SPDX-License-Identifier: EUPL-1.2`) in every Go file
|
|
|
|
|
- Conventional commits: `type(scope): description`
|
|
|
|
|
- Co-author trailer on every commit: `Co-Authored-By: Virgil <virgil@lethean.io>`
|
|
|
|
|
- Test naming: `_Good` (happy path), `_Bad` (expected errors), `_Ugly` (panics/edge cases)
|
2026-02-19 16:09:11 +00:00
|
|
|
|
|
|
|
|
## Key API
|
|
|
|
|
|
|
|
|
|
```go
|
2026-02-20 15:01:55 +00:00
|
|
|
wv, err := webview.New(webview.WithDebugURL("http://localhost:9222"))
|
2026-02-19 16:09:11 +00:00
|
|
|
defer wv.Close()
|
|
|
|
|
wv.Navigate("https://example.com")
|
|
|
|
|
wv.Click("#submit")
|
|
|
|
|
wv.Type("#input", "text")
|
|
|
|
|
screenshot, _ := wv.Screenshot()
|
|
|
|
|
```
|
|
|
|
|
|
2026-02-20 15:01:55 +00:00
|
|
|
## Docs
|
2026-02-19 16:09:11 +00:00
|
|
|
|
2026-02-20 15:01:55 +00:00
|
|
|
- `docs/architecture.md` — CDP connection, DOM queries, console capture, Angular helpers
|
|
|
|
|
- `docs/development.md` — prerequisites, build/test, coding standards, adding actions
|
|
|
|
|
- `docs/history.md` — completed phases, known limitations, future considerations
|
|
|
|
|
|
|
|
|
|
## Forge Push
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
git push ssh://git@forge.lthn.ai:2223/core/go-webview.git HEAD:main
|
|
|
|
|
```
|