Agents.md – Guidance for OpenAI Codex
Guides OpenAI Codex on repository structure, coding standards, testing, and CI for a Go CLI and Docker dev environment.
What this file does
Guides OpenAI Codex on repository structure, coding standards, testing, and CI for a Go CLI and Docker dev environment.
When to use it
- Setting up AI agent instructions for a Go CLI project
- Defining coding conventions and testing expectations for Codex
- Documenting CI workflows and linting preparation for agents
- Establishing README update responsibilities for AI assistants
Assumes this stack
Agents.md – Guidance for OpenAI Codex
This Agents.md file provides detailed instructions for OpenAI Codex and other AI agents collaborating on this repository. It includes project structure, conventions, testing, and update policies.
🗂️ Project Structure for Codex Navigation
-
/gitli: Go CLI tool source code/internal/git: Git configuration and logic modules/internal/prompt: Terminal menu interface/internal/ssh: SSH key logic/internal/tools: Tool installers (e.g. Git, Zsh, etc.)main.go: Entry point of the CLIgo.mod,go.sum: Go module files
-
/deven: Docker-based development environmentDockerfile: Build file for dev containerrequirements-apt.txt: Required apt packagesrequirements-pip.txt: Python dependencies (if used)requirements-tools.sh: Custom tool installation script
-
docker-build-run.sh: Script to build and run the dev container -
.github/workflows: GitHub Actions for CIbuild-and-test.yml: Build and test pipelinedev-container.yml: Dev environment pipelinerelease.yml: Release automation
✅ Coding Standards and Best Practices
General Guidelines
- Language: Go (Golang)
- Naming: Use
camelCasefor variables,PascalCasefor types, andsnake_casefor file names. - No special characters or accents should be used in file names, documentation, or code comments to avoid encoding/display issues, especially on GitHub.
- Comment complex logic, especially anything involving git operations, SSH, or Docker internals.
Go CLI Conventions
- Keep functions small and composable.
- Store non-exported logic in the
internal/directory. - Interface-based design is preferred for future mocking and testability.
- User-facing commands must use clear prompts (TUI-friendly).
🧪 Testing Requirements for OpenAI Codex
Tests will be added in a later phase, but Codex should:
- Write unit tests in Go using the standard
testingpackage. - Ensure test files are named
*_test.goand co-located with the tested code. - Future test commands will include:
# Run all tests
go test ./...
# Run a specific package
go test ./gitli/internal/git
Codex should use t.Run() to structure subtests and ensure descriptive test names.
📘 Codex Responsibilities
OpenAI Codex must:
-
Update
Readme.mdwhenever a change affects:- How to run the CLI
- How to build or use the Docker container
- Installation instructions for dependencies
-
Never introduce accented characters or locale-specific symbols in any code, config, or documentation.
-
Ensure CLI remains interactive and intuitive—CLI improvements should be incremental, tested, and clearly documented.
-
If a change affects usability or user commands (e.g., a new prompt option, altered flag, new setup step), Codex must reflect this in the README.
🚦 CI and Linting (Work in Progress)
GitHub Actions are used for CI via the following workflows:
build-and-test.yml– Compiles and tests the CLI.dev-container.yml– Validates the Docker dev environment.release.yml– Automates tagged releases.
A future linting pipeline will include
golangci-lint.
Codex should prepare the codebase for it by:
- Avoiding unused variables/imports
- Using
err != nilguards consistently - Adding proper Go doc comments on exported symbols
What's inside
5 sections: project structure, coding standards, testing requirements, responsibilities, CI/linting. Includes 3 workflow references and 2 test commands.
Change this for your project
- Replace
/gitliwith your own CLI directory name - Replace
/devenwith your own dev environment directory - Replace
build-and-test.yml,dev-container.yml,release.ymlwith your actual workflow filenames - Replace
go test./gitli/internal/gitwith your package path
Where it goes
Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.
Worth borrowing
- Explicitly forbid accented characters to avoid encoding issues
- Require README updates whenever user-facing commands change
- Prepare codebase for future linting by enforcing Go doc comments and error handling
Related Documents
Browser-only development
Guides AI assistants on an Electron + React + TypeScript desktop app for browsing and organizing AI-generated images locally.
Claude Agents — Reference & Recommendations
Catalogues 40+ Claude agents and marketing skills for building a cat adoption charity landing page, with a ready-to-paste prompt and backend API reference.
Golden DKG Prototype -- Master Plan
Defines an 8-phase implementation plan for a Rust prototype of the Golden non-interactive DKG protocol using BLS12-381 and tokio.
Swarms Examples Index
Lists 60+ example scripts for building single and multi-agent systems with the Swarms framework, organized by category and use case.