underscore/AGENTS.md
Ruidy d6f1e1cff5
feat: add Tap, Transpose, Unzip, ParallelReduce, and Replicate
- Add Tap: for side effects/debugging in pipelines
- Add Transpose: flip matrix rows and columns
- Add Unzip: split tuple slice into two slices
- Add ParallelReduce: parallel reduction (experimental)
- Add Replicate: create n copies of a value

Comprehensive tests included for all functions.

Resolves Issues 21, 22, 23, 24, 25

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 14:55:43 +01:00

2 KiB

Repository Guidelines

Project Structure & Module Organization

  • Source: package underscore in repo root (*.go).
  • Tests: co-located *_test.go files in root; examples in examples/.
  • Module: github.com/rjNemo/underscore (Go 1.24+).
  • Docs: Hugo site under docs/ (content, themes, public).
  • CI/Security assets: Dockerfile(s), .golangci.yml, .trivycache/.

Build, Test, and Development Commands

  • go mod download: fetch dependencies for local dev.
  • go test ./...: run unit tests locally.
  • make build: build Docker image underscore:latest.
  • make test: run tests in Docker with coverage summary.
  • make docs: serve docs locally (cd docs && hugo server -D).
  • make build-docs: build static docs site.
  • make scan / make scan-config: security scan with Trivy (image/config).

Coding Style & Naming Conventions

  • Formatting: gofmt/goimports (enforced via golangci-lint).
  • Lint: golangci-lint run (uses .golangci.yml).
  • Indentation: tabs; idiomatic Go style.
  • Naming: exported APIs use PascalCase (e.g., Filter, Map); files are lower_snake (filter.go).
  • Imports: group stdlib/external/local; local prefix github.com/rjNemo/underscore.

Testing Guidelines

  • Frameworks: Go testing with testify assertions.
  • Conventions: TestXxx functions; prefer table-driven tests.
  • Coverage: keep or increase overall coverage; make test prints summary.
  • Run subset: go test ./... -run TestFilter for focused runs.

Commit & Pull Request Guidelines

  • Commits: imperative, concise subject; include scope when helpful.
  • Before PR: golangci-lint run and make test must pass.
  • PRs: clear description, linked issues, tests for new/changed behavior, update README/docs when API changes.
  • Reviews: follow CONTRIBUTING; require two approvals before merge.

Security & Configuration Tips

  • Go 1.24+ recommended; Docker image pins Go 1.24.
  • Do not commit secrets; prefer environment variables for local runs.
  • Use make scan regularly; fix CRITICAL findings before release.