go-help/CLAUDE.md
Snider 142567a8f5 docs: graduate TODO/FINDINGS into production documentation
Replace internal task tracking (TODO.md, FINDINGS.md) with structured
documentation in docs/. Trim CLAUDE.md to agent instructions only.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:01:55 +00:00

43 lines
1.5 KiB
Markdown

# CLAUDE.md
Module: `forge.lthn.ai/core/go-help`
## Commands
```bash
go test ./... # Run all tests
go test -v -run Name # Run single test
go test -bench=. -benchmem ./... # Run benchmarks
go vet ./... # Lint
```
## Architecture
See `docs/architecture.md` for full details.
- `Topic` — help entry with title, body, sections, tags, related topics
- `Catalog` — in-memory store; `Add`, `List`, `Get`, `Search`
- `Parser` — YAML frontmatter + Markdown section extraction
- `Search` — inverted index with stemming, fuzzy, phrase, and prefix matching
- `Stemmer` — lightweight Porter-style suffix stripping (English)
- `RenderMarkdown` — goldmark with GFM + Typographer
- `Server` — six-route HTTP server (3 HTML, 3 JSON)
- `Templates` — embedded dark-theme HTML templates
- `Generate` — static site output with client-side JS search
- `Ingest` — CLI help text → Topic conversion
## Coding Standards
- UK English
- EUPL-1.2 licence header on every new file: `// SPDX-Licence-Identifier: EUPL-1.2`
- `go test ./...` and `go vet ./...` must pass before commit
- Conventional commits: `type(scope): description`
- Co-Author: `Co-Authored-By: Virgil <virgil@lethean.io>`
- Test suffix pattern: `_Good` (happy path), `_Bad` (errors), `_Ugly` (edge cases)
- Benchmarks use `b.Loop()` (Go 1.25) and `b.ReportAllocs()`
## Reference
- `docs/architecture.md` — full architectural reference
- `docs/development.md` — development guide and standards
- `docs/history.md` — completed phases and known limitations