This document contains common guidelines for AI assistants working on the aqua project. Individual AI-specific documents (like CLAUDE.md, CLINE.md) should reference this guide.
This project uses English for all code comments, documentation, and communication.
Follow Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary toolsci: Changes to CI configuration files and scripts
feat: add GitHub token management via keyring
fix: handle empty configuration file correctly
docs: add function documentation to controller package
chore(deps): update dependency aquaproj/aqua-registry to v4.403.0
After making code changes, always run the following commands to validate and test:
cmdx l
# or
cmdx lintThis command runs golangci-lint run with all configured linters. The configuration is in .golangci.yml.
cmdx v
# or
cmdx vetThis command runs go vet ./... to check for common Go mistakes.
cmdx t
# or
cmdx testThis command runs all tests in the project with race detection enabled.
All commands should pass before committing changes.
.
├── cmd/ # Command-line applications
│ ├── aqua/ # Main aqua CLI application
│ └── gen-jsonschema/ # JSON schema generator
├── pkg/ # Core packages and business logic
│ ├── cli/ # CLI commands and routing
│ ├── config/ # Configuration handling
│ ├── controller/ # Main business logic controllers
│ ├── domain/ # Core domain models
│ ├── download/ # Package download functionality
│ ├── install-registry/ # Registry installation
│ ├── checksum/ # Checksum validation
│ └── ... # Other packages
├── scripts/ # Build and utility scripts
├── tests/ # Integration and e2e tests
├── json-schema/ # JSON schema definitions
├── cmdx.yaml # Task runner configuration
├── go.mod & go.sum # Go module dependencies
├── .golangci.yml # Linting configuration
└── .goreleaser.yml # Release configuration
Command-line interface layer that handles command parsing, flag processing, and routing to appropriate subcommands. Uses urfave/cli/v3 framework.
Configuration management including:
- Reading and parsing aqua.yaml configuration files
- Config validation and merging
- Environment variable handling
- Global and local config support
Main business logic controllers for aqua operations:
install: Package installation logicupdate: Package update functionalityupdatechecksum: Checksum update operationsexec: Command execution wrapperwhich: Path resolution for installed tools- Each controller coordinates between different components
Core domain models and types:
- Package definitions
- Registry structures
- Configuration models
- Common interfaces
GitHub API client integration:
- Release artifact downloading
- GitHub authentication management
- API rate limiting handling
- Release and tag fetching
Package download functionality:
- HTTP client for downloading packages
- Progress tracking
- Retry logic
- Cache management
Checksum validation and management:
- SHA256/SHA512 verification
- Checksum file parsing
- Security verification
Registry installation and management:
- Registry downloading
- Registry validation
- Local registry cache
- Run all tests with race detection:
cmdx torgo test ./... -race -covermode=atomic - Run specific package tests:
go test ./pkg/controller/install -race - Run coverage test:
cmdx coverage <target>orbash scripts/coverage.sh <target> - Coverage reports are saved to
.coverage/directory
This project uses:
- Follow standard Go conventions
- Use meaningful variable and function names
- Add comments for exported functions and types
- Keep functions focused and small
- Handle errors explicitly
- Use context for cancellation and timeouts
- Always end files with a newline character
- Create a feature branch from
main - Make changes and ensure all checks pass:
cmdx lint- Run lintingcmdx vet- Run go vetcmdx test- Run tests
- Write clear commit messages following Conventional Commits
- Create PR with descriptive title and body
- Wait for CI checks to pass
- Request review if needed
# Run linting (golangci-lint)
cmdx l
# or
cmdx lint
# Validate code (go vet)
cmdx v
# or
cmdx vet
# Run tests with race detection
cmdx t
# or
cmdx test
# Run coverage test for specific target
cmdx c <target>
# or
cmdx coverage <target>
# Build the project
cmdx build
# or directly:
go build -o dist/aqua ./cmd/aqua
# Build and install locally
cmdx i
# or
cmdx install
# Generate JSON schema
cmdx js
# Validate aqua.yaml and registry.yaml with JSON Schema
cmdx validate-js
# Run wire for dependency injection
cmdx w
# or
cmdx wire
# Run aqua locally via go run
cmdx run [args]
# or directly:
go run ./cmd/aqua [args]
# Test in clean Docker container
cmdx docker
# Format and tidy dependencies
go fmt ./...
go mod tidy