chore: init project scaffolding

Go 1.26 module (somegit.dev/Owlibou/gnoma), Makefile with
build/test/lint targets, CLAUDE.md with project conventions,
placeholder main.go, and .gitignore.
This commit is contained in:
2026-04-02 18:08:40 +02:00
commit f909733bff
6 changed files with 139 additions and 0 deletions

34
.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
# Binaries
/gnoma
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test
*.test
*.out
coverage.html
coverage.txt
# Build
/bin/
/dist/
# IDE
.idea/
.vscode/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Project config with secrets
.gnoma/config.toml
# Debug
__debug_bin*

55
CLAUDE.md Normal file
View File

@@ -0,0 +1,55 @@
# Gnoma — Project Instructions
## What is this?
Provider-agnostic agentic coding assistant in Go 1.26.
Named after the northern pygmy-owl (Glaucidium gnoma).
Agents are called "elfs" (elf owl).
## Module
`somegit.dev/Owlibou/gnoma`
## Build & Test
```sh
make build # build binary to ./bin/gnoma
make test # run all tests
make lint # run golangci-lint
make cover # test with coverage report
```
## Project Essentials
Project architecture, domain model, and design decisions: `docs/essentials/INDEX.md`
Read INDEX.md before making architectural changes or adding new system boundaries.
## Conventions
### Go Style
- Go 1.26 idioms: `new(expr)`, `errors.AsType[E]`, `sync.WaitGroup.Go`
- Structured logging with `log/slog`
- Discriminated unions via struct + type discriminant (not interfaces)
- Pull-based stream iterators: `Next() / Current() / Err() / Close()`
- `json.RawMessage` for tool schemas and arguments (zero-cost passthrough)
- Functional options for complex configuration
- `errgroup` for parallel work
### Testing
- TDD: write tests first
- Table-driven tests
- Build tag `//go:build integration` for tests hitting real APIs
- `testing/synctest` for concurrent tests
- `t.TempDir()` for file system tests
### Naming
- Packages: short, lowercase, no underscores
- Interfaces: describe behavior, not implementation
- Errors: `Err` prefix for sentinel errors, `*Error` suffix for error types
### Commits
- Conventional commits (feat:, fix:, refactor:, test:, docs:, chore:)
- No co-signing
### Providers
- Mistral: `somegit.dev/vikingowl/mistral-go-sdk` (user's own SDK)
- Anthropic: `github.com/anthropics/anthropic-sdk-go`
- OpenAI: `github.com/openai/openai-go`
- Google: `google.golang.org/genai`
- Ollama/llama.cpp: via OpenAI SDK with custom base URL

36
Makefile Normal file
View File

@@ -0,0 +1,36 @@
.PHONY: build test lint cover clean fmt vet
BINARY := gnoma
BINDIR := ./bin
MODULE := somegit.dev/Owlibou/gnoma
build:
go build -o $(BINDIR)/$(BINARY) ./cmd/gnoma
test:
go test ./...
test-v:
go test -v ./...
test-integration:
go test -tags integration ./...
cover:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
lint:
golangci-lint run ./...
fmt:
gofmt -w .
vet:
go vet ./...
clean:
rm -rf $(BINDIR) coverage.out coverage.html
tidy:
go mod tidy

7
cmd/gnoma/main.go Normal file
View File

@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("gnoma — provider-agnostic agentic coding assistant")
}

5
go.mod Normal file
View File

@@ -0,0 +1,5 @@
module somegit.dev/Owlibou/gnoma
go 1.26.1
require somegit.dev/vikingowl/mistral-go-sdk v1.2.0 // indirect

2
go.sum Normal file
View File

@@ -0,0 +1,2 @@
somegit.dev/vikingowl/mistral-go-sdk v1.2.0 h1:9NEGCKzw1Bu2c8LaSEKNlpj08iMsU0fkDFJO6W1Zh+Y=
somegit.dev/vikingowl/mistral-go-sdk v1.2.0/go.mod h1:pN7nQdOIYYEMRdwye5cSfymtwhZJHd+caK6J69Z4XMY=