Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.6 KB

CLAUDE.md

File metadata and controls

35 lines (28 loc) · 1.6 KB

CLAUDE.md - IOTA SDK Guide

Overview

The project follows DDD principles. DO NOT COMMENT EXECESSIVELY. Instead, write clear and concise code that is self-explanatory.

Tool use

  • DO NOT USE sed for file manipulation

Build/Lint/Test Commands

  • After changes to css or .templ files: make generate && make css
  • After changes to Go code: go vet ./...
  • Run all tests: make test or go test -v ./...
  • Run single test: go test -v ./path/to/package -run TestName
  • Run specific subtest: go test -v ./path/to/package -run TestName/SubtestName
  • Linting translation files: make run-iota-linter
  • Apply migrations: make migrate up

Code Style Guidelines

  • Use go fmt for formatting. Do not indent code manually.
  • Use Go v1.23.2 and follow standard Go idioms
  • File organization: group related functionality in modules/ or pkg/ directories
  • Naming: use camelCase for variables, PascalCase for exported functions/types
  • Testing: table-driven tests with descriptive names (TestFunctionName_Scenario)
  • Error handling: use pkg/serrors for standard error types
  • Type safety: use strong typing and avoid interface{} where possible
  • Follow existing patterns for database operations with jmoiron/sqlx
  • For UI components, follow the existing templ/htmx patterns
  • NEVER read *_templ.go files, they contain no useful information since they are generated by templ generate (make generate) command from .templ files

UI Implementation Guidelines

HTMX Best Practices

  • Use htmx.IsHxRequest(r) to check if a request is from HTMX
  • Use htmx.SetTrigger(w, "eventName", payload) for setting HTMX response triggers