agentleFS
thoreinsteinthoreinstein/aix/AGENTS.md

aix

AGENTS.md16 starsChanged 10 months agoMITView on GitHub

aix is a unified Go CLI for managing AI coding assistant configurations across platforms (Claude Code, OpenCode, Codex, Gemini CLI). See docs/adr/001-unified-agent-cli.md for full architecture. Group imports in this order, separated by blank lines: Use the internal/errors package for consistent error handling and wrapping:

  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the internal/errors package for consistent error handling and wrapping:

    line 71
  2. Distinctive:

    File issues: - Create issues for remaining/discovered work

    line 243
  3. Distinctive:

    NEVER stop before pushing - that leaves work stranded locally

    line 264
  4. Distinctive:

    If push fails, resolve and retry until it succeeds

    line 265
  5. Very specific:

    NEVER use git commit --no-verify

    line 266
  6. Very specific:

    NEVER use git commit --amend

    line 267
  7. Distinctive:

    DO NOT define interfaces unless they are necessary

    line 268
  8. Distinctive:

    File issues for remaining work: - Create issues for anything that needs follow-up

    line 276
  9. Distinctive:

    Verify: - All changes committed AND pushed

    line 287
  10. Distinctive:

    NEVER say "ready to push when you are" - YOU must push

    line 293

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Instructions for aix

aix is a unified Go CLI for managing AI coding assistant configurations across platforms (Claude Code, OpenCode, Codex, Gemini CLI). See docs/adr/001-unified-agent-cli.md for full architecture.

Development Commands

Build

go build ./cmd/aix                      # Build CLI binary
go build ./...                          # Build all packages

Test

go test ./...                           # All tests
go test ./internal/skill/...            # Single package
go test -run TestSkillParser ./...      # Single test by name
go test -v -run TestSkillParser/valid ./...  # Subtest by name
go test -race ./...                     # With race detection
go test -cover ./...                    # With coverage
go test -coverprofile=coverage.out ./... && go tool cover -html=coverage.out

Lint & Format

go fmt ./...                            # Format code
goimports -w .                          # Organize imports
go vet ./...                            # Static analysis
golangci-lint run                       # Full linting suite

Code Style

Imports

Group imports in this order, separated by blank lines:

import (
    // Standard library
    "context"
    "fmt"
    "strings"

    // External dependencies
    "github.com/spf13/cobra"
    "gopkg.in/yaml.v3"

    // Internal packages
    "github.com/thoreinstein/aix/internal/config"
    "github.com/thoreinstein/aix/internal/platform"
)

Naming Conventions

ElementConventionExample
Packageslowercase, single wordplatform, skill, mcp
Interfacesnoun or -er suffixPlatform, Validator, Parser
ConstructorsNew prefixNewValidator(strict bool)
ErrorsErr prefixErrMissingName, ErrInvalidToolSyntax
Test files_test.go suffixvalidator_test.go
Test functionsTest prefixTestValidator_Validate

Error Handling

Use the internal/errors package for consistent error handling and wrapping:

import "github.com/thoreinstein/aix/internal/errors"

// Good - adds context while preserving the error chain
if err := s.loadConfig(); err != nil {
    return errors.Wrapf(err, "loading skill %s", name)
}

// Define sentinel errors in internal/errors/errors.go for common conditions
if errors.Is(err, errors.ErrNotFound) {
    // handle not found case
}

// For CLI-facing errors, use ExitError to control exit code and provide suggestions
func (cmd *MyCommand) Run() error {
    if err := validate(); err != nil {
        return errors.NewUserError(err, "Check your input and try again")
    }
    return nil
}

Types and Structs

// Use struct tags for serialization
type Skill struct {
    Name        string   `yaml:"name" json:"name"`
    Description string   `yaml:"description" json:"description"`
    Tools       []string `yaml:"tools" json:"tools"`
}

// Define interfaces in the package that uses them, not the implementer
// internal/installer/installer.go
type Platform interface {
    InstallSkill(s *skill.Skill) error
    UninstallSkill(name string) error
}

Comments

// Package skill provides Agent Skills Spec compliant skill management.
package skill

import "github.com/thoreinstein/aix/internal/validator"

// Validator validates skills against the Agent Skills Specification.
// It supports both strict and lenient validation modes.
type Validator struct {
	strict bool
}

// Validate checks a skill for spec compliance.
// Returns a Result containing errors and warnings.
func (v *Validator) Validate(s *Skill) *validator.Result {
	// Implementation
}

Architecture

Package Layout

aix/
|-- cmd/aix/              # CLI entry point and Cobra commands
 |   |-- main.go
 |   `--- commands/         # Subcommand implementations
|-- internal/             # Private packages
 |   |-- config/           # Configuration management
 |   |-- platform/         # Platform adapters (claude, opencode, etc.)
 |   |-- skill/            # Skill parsing and validation
 |   |-- command/          # Slash command management
 |   |-- mcp/              # MCP server configuration
 |   `--- translate/        # Cross-platform translation
`--- pkg/                  # Public packages (if any)
    `--- frontmatter/      # YAML frontmatter parser

Key Interfaces

// Platform adapter interface - each AI assistant implements this
type Platform interface {
    Name() string
    InstallSkill(s *skill.Skill) error
    ConfigureMCP(server *mcp.Server) error
    TranslateVariables(content string) string
    // ... see ADR for full interface
}

Patterns

  • Adapter pattern: Each platform (Claude, OpenCode, Codex, Gemini) has its own adapter implementing the Platform interface
  • Translation layer: Handles variable syntax differences ($ARGUMENTS vs {{argument}}) and config format differences (JSON vs TOML)
  • Validation: Strong upfront validation prevents misconfiguration

Testing

Table-Driven Tests

func TestValidator_Validate(t *testing.T) {
    tests := []struct {
        name    string
        skill   *Skill
        wantErr bool
    }{
        {
            name:    "valid skill",
            skill:   &Skill{Name: "test", Description: "A test skill"},
            wantErr: false,
        },
        {
            name:    "missing name",
            skill:   &Skill{Description: "A test skill"},
            wantErr: true,
        },
    }
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			v := NewValidator(true)
    			result := v.Validate(tt.skill)
    			if result.HasErrors() != tt.wantErr {
    				t.Errorf("Validate() errors = %v, wantErr %v", result.Issues, tt.wantErr)
    			}
    		})
    	}
    }

Test Helpers

func setupTestDir(t *testing.T) string {
    t.Helper()
    dir := t.TempDir()
    // ... setup
    return dir
}

Issue Tracking

This project uses bd (beads) for issue tracking. Run bd onboard to get started.

Quick Reference

bd ready              # Find available work
bd show <id>          # View issue details
bd update <id> --status in_progress  # Claim work
bd close <id>         # Complete work
bd sync               # Sync with git

Session Completion

When ending a work session, complete ALL steps below. Work is NOT complete until git push succeeds.

Mandatory Workflow

  1. File issues - Create issues for remaining/discovered work
  2. Quality gates (if code changed):
    go test ./...
    golangci-lint run
    go build ./cmd/aix
    pre-commit run --all-files
  3. Update issues - Close finished work, update in-progress items
  4. Push to remote:
    git pull --rebase
    bd sync
    git push
    git status  # MUST show "up to date with origin"
  5. Hand off - Provide context for next session

Critical Rules

  • Work is NOT complete until git push succeeds
  • NEVER stop before pushing - that leaves work stranded locally
  • If push fails, resolve and retry until it succeeds
  • NEVER use git commit --no-verify
  • NEVER use git commit --amend
  • DO NOT define interfaces unless they are necessary

Landing the Plane (Session Completion)

When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.

MANDATORY WORKFLOW:

  1. File issues for remaining work - Create issues for anything that needs follow-up
  2. Run quality gates (if code changed) - Tests, linters, builds
  3. Update issue status - Close finished work, update in-progress items
  4. PUSH TO REMOTE - This is MANDATORY:
    git pull --rebase
    bd sync
    git push
    git status  # MUST show "up to date with origin"
  5. Clean up - Clear stashes, prune remote branches
  6. Verify - All changes committed AND pushed
  7. Hand off - Provide context for next session

CRITICAL RULES:

  • Work is NOT complete until git push succeeds
  • NEVER stop before pushing - that leaves work stranded locally
  • NEVER say "ready to push when you are" - YOU must push
  • If push fails, resolve and retry until it succeeds

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.