This document provides instructions for AI agents to effectively work within the git-bug-agent repository.
This is a Go project that uses mage for build automation. The main application logic is in main.go and the pkg/ directory, while build-related scripts are in magefiles/.
This project uses asdf to manage runtime and tool versions, which are defined in the .tool-versions file. To install all the required tools, run:
mage toolsThis command will run asdf install to ensure all necessary tools like Go, mage, and pre-commit are installed with the correct versions.
All project tasks are managed through mage. You must have mage installed to run these commands (see Tooling Setup).
-
Build the project:
mage build
This command compiles the Go binary and places it in the
bin/directory. -
Run tests:
mage testThis command runs the test suite. It also runs
pre-commitchecks first. -
Run linters and checks:
mage check
This runs
pre-commithooks on all files.mage lint
This runs
golangci-lint,codespell, andgovulncheck. -
Run the application:
mage run
This builds and runs the main application.
-
Clean build artifacts:
mage clean
This removes the compiled binary from the
bin/directory. -
Install the application:
mage install
This installs the binary to the user's local bin directory. Use
mage "install global=true"for a system-wide installation.
main.go: The main entry point for the application.pkg/: Contains reusable library code organized by functionality.magefiles/: Contains themagefile.gowhich defines the build, test, and run commands.go.mod,go.sum: Go module files defining project dependencies.bin/: This directory contains the compiled application binary (e.g.,bin/gba). It is created by the build process.
- The project uses
pre-committo enforce code style and quality. Runmage checkbefore submitting changes. - All build, test, and linting logic is centralized in
magefiles/magefile.go. To understand how a process works, refer to this file.
- Ensure you have
mageandpre-commitinstalled and available in yourPATH. - Always run
mage checkormage testbefore making commits to ensure your changes pass the required checks.