8000 certwiz/AGENTS.md at main · trahma/certwiz · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 2.15 KB

AGENTS.md

File metadata and controls

37 lines (31 loc) · 2.15 KB

Repository Guidelines

Project Structure & Module Organization

  • main.go: Entry point that wires CLI.
  • cmd/: Cobra commands (e.g., inspect.go, generate.go). One file per verb/feature plus tests.
  • pkg/: Reusable packages (pkg/cert, pkg/ui). Keep public APIs small and documented.
  • internal/testutil: Test helpers not exported.
  • testdata/: Sample certs/keys used by tests (generated by script).
  • docs/: User and contributor docs; prefer updating when behavior changes.

Build, Test, and Development Commands

  • make build: Compile binary to ./cert.
  • make run: Build then run locally.
  • make test: Generate test certs and run go test ./....
  • make test-coverage: Run tests with coverage, write coverage.out.
  • make test-coverage-html: Produce coverage.html report.
  • make fmt / make vet: Format and static checks.
  • make clean: Remove build/coverage artifacts.
  • make build-all: Cross-compile into ./dist/ for major platforms.

Coding Style & Naming Conventions

  • Go 1.20+. Follow standard Go conventions: exported names in CamelCase, receivers concise (c *Cert), package names short, lower-case.
  • Tabs for Go files (size 4). YAML/JSON/MD use 2 spaces. LF line endings, trailing whitespace trimmed (see .editorconfig).
  • Keep commands in cmd/ small; move logic to pkg/. Prefer pure functions in pkg/cert with clear inputs/outputs.

Testing Guidelines

  • Framework: go test. Tests live alongside code in *_test.go with TestXxx functions.
  • Data: testdata/ is auto-prepared by make test via testdata/generate_test_certs.sh.
  • Coverage: aim for meaningful coverage of critical paths; verify with make test-coverage.

Commit & Pull Request Guidelines

  • Use Conventional Commits: feat:, fix:, docs:, refactor:, etc.
  • PRs: include purpose, approach, and user-facing impact. Link issues. Add before/after CLI examples or screenshots when output changes. Update docs/ as needed.

Security & Configuration Tips

  • Do not commit real private keys or secrets. Only use/generated fixtures in testdata/.
  • Installer (install.sh) may prompt for sudo; review diffs when changing install paths or permissions.
0