This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
mdex is a Markdown Exporter to Notion. It converts Markdown files and exports them to Notion pages.
go vet ./...- Check for compile errors (do NOT usego buildfor verification)go test ./...- Run all testsgo test ./path/to/package- Run tests for a specific packagego fmt ./...- Format codegolangci-lint run ./...- Lint checkgosec -exclude-generated -quiet ./...- Security check
Always run these checks:
go vet ./...go fmt ./...golangci-lint run ./...gosec -exclude-generated -quiet ./...go test ./...
main.go- Entry point, callspkg/clipkg/cli/- CLI command definitions using urfave/cli v3pkg/domain/- Domain models and interfacespkg/usecase/- Application use cases / business logicpkg/infra/- Infrastructure adapters (external APIs, storage)pkg/utils/- Shared utility functions
- Uses
github.com/urfave/cli/v3 - Root command is created in
pkg/cli/cli.goviacli.New()
- Use
github.com/m-mizutani/goerr/v2for error handling - Wrap errors with
goerr.Wrapto maintain error context - Add variables with
goerr.Vfor debugging - NEVER check error messages with
strings.Contains(err.Error(), ...) - ALWAYS use
errors.Isorerrors.Asfor error type checking
- Use
github.com/m-mizutani/gtfor type-safe testing - Prefer Helper Driven Testing over Table Driven Tests
- Test package must be
package {name}_test(external test package) - Test file naming:
xyz.go→xyz_test.go(no other naming patterns) - Use
export_test.gofor items that need to be exposed only for testing - NEVER use
t.Skip()except for missing environment variables - NEVER comment out test assertions
- Do not expose unnecessary methods, structs, or variables
- Use
export_test.gofor test-only exports
- All comments and string literals in source code must be in English