Commit 221bcb78 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

update AGENTS.md

parent f3f15d28
Loading
Loading
Loading
Loading
+24 −10
Original line number Diff line number Diff line
# AGENTS.md

This file is a working guide for agents modifying the `go_port` implementation of `climax`.
This file is a working guide for agents modifying `climax`.

## Mission

Maintain the Go port as a CLI-compatible implementation of the Python `climax` app, while preserving behavior and output expectations validated in this workspace.
Maintain `climax` as a stable CLI app, while preserving behavior and output expectations validated in this workspace.

## Scope Constraints

- Port target is `src/climax` behavior.
- Do not reintroduce removed features:
  - `gui` command
  - `crash` command
  - `--show-completion` flag
  - `--install-completion` flag
- Do not port Python-only files previously excluded from porting:
  - `gui.py`
  - `eggs.py`

## CLI Compatibility Rules

- Keep command names and options compatible with existing Go implementation and prior Python behavior.
- Keep command names and options compatible with existing behavior.
- Keep `templates-list` and `static-list` output as plain line-by-line paths (no table reformat).
- `bundles-list`, `bundles-add`, and `bundles-remove` must keep the same output style.
- `info` and `projects` are expected to render styled tables (unless JSON mode is explicitly selected).
@@ -57,9 +53,27 @@ Maintain the Go port as a CLI-compatible implementation of the Python `climax` a
  2. `CLIMAX_LANG`
  3. `LANG`
  4. fallback to `fr`
- Any new user-facing string in `main.go` should go through `T("...")` with keys in `i18n.go`.
- Any new user-facing string in Go source should go through `T("...")` with keys in `i18n.go`.
- Keep command outputs stable while localizing.

## Go Source Layout

- The Go CLI is split by concern rather than kept in one large `main.go`:
  - `main.go`: shared constants, shared data shapes, and startup.
  - `cli.go`: Cobra command construction.
  - `commands.go`: command implementations for ordinary CLI actions.
  - `config.go`: MaX config parsing, release lookup, and version helpers.
  - `projects.go`: project registry and project validation/loading helpers.
  - `sync.go`: MaX instance creation/sync and bundle sync.
  - `java.go`: Java runtime discovery and BaseX command construction.
  - `server.go`: start/stop server helpers.
  - `freeze.go`: freeze server/crawler/link rewriting.
  - `download.go`: cached downloads and progress reporting.
  - `archive.go`: filesystem helpers and archive extraction.
  - `paths.go`: CLI data/cache path initialization.
  - `ui.go`: tables, help rendering, prompts, and confirmations.
- Keep new code in the file matching its concern; avoid moving unrelated code during focused bug fixes.

## Build, Test, and Packaging

- Dependencies are vendored. Prefer `-mod=vendor` in tests/build checks.
@@ -67,8 +81,8 @@ Maintain the Go port as a CLI-compatible implementation of the Python `climax` a
  - `gofmt -w ...`
  - `go test -mod=vendor ./...`
  - `make test`
- `make test` intentionally includes explicit main-file test invocation:
  - `go test -mod=vendor main.go i18n.go main_test.go`
- `make test` intentionally includes an explicit `main_test.go` invocation with all non-test Go sources:
  - `go test -mod=vendor $(GO_SOURCES) main_test.go`
- Packaging targets:
  - `make build` (linux/amd64, darwin/arm64, windows/amd64)
  - `make installer-windows` (NSIS)