Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# AGENTS.md

This file provides guidance to AI agents when working with code in this repository.

## Project Overview

kortex-cli is a command-line interface for launching and managing AI agents (Claude Code, Goose, Cursor) with custom configurations. It provides a unified way to start different agents with specific settings including skills, MCP server connections, and LLM integrations.

## Build and Test Commands

### Build
```bash
go build ./cmd/kortex-cli
```

### Execute
After building, the `kortex-cli` binary will be created in the current directory:

```bash
# Display help and available commands
./kortex-cli --help

# Execute a specific command
./kortex-cli <command> [flags]
```

### Run Tests
```bash
# Run all tests
go test ./...

# Run tests in a specific package
go test ./pkg/cmd

# Run a specific test
go test -run TestName ./pkg/cmd

# Check code coverage
go test -cover ./...
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something about formatter / go fmt to format ?

### Format Code
All Go code should be formatted using `go fmt`:

```bash
# Format all Go files in the project
go fmt ./...

# Format a specific package
go fmt ./pkg/cmd

# Format a specific file
go fmt ./pkg/cmd/root.go
```

Code should be formatted before committing. The `go fmt` tool ensures consistent style across the codebase by automatically fixing indentation, spacing, and other formatting issues.

## Architecture

### Command Structure (Cobra-based)
- Entry point: `cmd/kortex-cli/main.go` → calls `pkg/cmd.Execute()`
- Root command: `pkg/cmd/root.go` defines the `kortex-cli` command
- Subcommands: Each command is in `pkg/cmd/<command>.go` and registers itself via `init()`
- Commands use Cobra's pattern: define a `cobra.Command`, register it with `rootCmd.AddCommand()` in `init()`

### Skills System
Skills are reusable capabilities that can be discovered and executed by AI agents:
- **Location**: `skills/<skill-name>/SKILL.md`
- **Claude support**: Skills are symlinked in `.claude/skills/` for Claude Code
- **Format**: Each SKILL.md contains:
- YAML frontmatter with `name`, `description`, `argument-hint`
- Detailed instructions for execution
- Usage examples

### Adding a New Skill
1. Create directory: `skills/<skill-name>/`
2. Create SKILL.md with frontmatter and instructions
3. Symlink in `.claude/skills/`: `ln -s ../../skills/<skill-name> .claude/skills/<skill-name>`

### Adding a New Command
1. Create `pkg/cmd/<command>.go`
2. Define a `cobra.Command` variable
3. Register with `rootCmd.AddCommand()` in the `init()` function
4. Create corresponding test file `pkg/cmd/<command>_test.go`

## Copyright Headers

All source files must include Apache License 2.0 copyright headers with Red Hat copyright. Use the `/copyright-headers` skill to add or update headers automatically. The current year is 2026.

## Dependencies

- Cobra (github.com/spf13/cobra): CLI framework
- Go 1.25+

## Testing

Tests follow Go conventions with `*_test.go` files alongside source files. Tests use the standard `testing` package and should cover command initialization, execution, and error cases.
1 change: 1 addition & 0 deletions CLAUDE.md