This document provides guidelines for AI coding agents working in this repository.
## Project Overview
Motr Enclave is an Extism WebAssembly plugin written in Go, compiled with Go 1.25+ for the `wasip1` target. It provides encrypted key storage for the Nebula wallet with an embedded SQLite database.
## Build Commands
```bash
# Build WASM plugin (primary build command)
make build
# Build with debug symbols
make build-debug
# Build optimized (requires wasm-opt)
make build-opt
# Generate SQLC database code
make generate
# Full rebuild
make clean && make generate && make build
```
## Test Commands
```bash
# Run all tests
make test
# Run tests with coverage
make test-cover
# Run a single test
go test -v -run TestFunctionName ./...
# Run tests in a specific package
go test -v ./db/...
# Test the compiled plugin with Extism CLI
make test-plugin
```
## Lint and Format
```bash
# Run all linters
make lint
# Format code
make fmt
# Run go vet
make vet
# Run all checks (fmt, vet, lint, test)
make verify
```
## Code Style Guidelines
### Imports
Order imports in three groups separated by blank lines: