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.
- .github/copilot-instructions.mdCopilot instructions
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
- Very specific: line 71
Use the internal/errors package for consistent error handling and wrapping:
- Distinctive: line 243
File issues: - Create issues for remaining/discovered work
- Distinctive: line 264
NEVER stop before pushing - that leaves work stranded locally
- Distinctive: line 265
If push fails, resolve and retry until it succeeds
- Very specific: line 266
NEVER use git commit --no-verify
- Very specific: line 267
NEVER use git commit --amend
- Distinctive: line 268
DO NOT define interfaces unless they are necessary
- Distinctive: line 276
File issues for remaining work: - Create issues for anything that needs follow-up
- Distinctive: line 287
Verify: - All changes committed AND pushed
- Distinctive: line 293
NEVER say "ready to push when you are" - YOU must push
≈ “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.
Files
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 packagesTest
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.outLint & Format
go fmt ./... # Format code
goimports -w . # Organize imports
go vet ./... # Static analysis
golangci-lint run # Full linting suiteCode 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
| Element | Convention | Example |
| Packages | lowercase, single word | platform, skill, mcp |
| Interfaces | noun or -er suffix | Platform, Validator, Parser |
| Constructors | New prefix | NewValidator(strict bool) |
| Errors | Err prefix | ErrMissingName, ErrInvalidToolSyntax |
| Test files | _test.go suffix | validator_test.go |
| Test functions | Test prefix | TestValidator_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 parserKey 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
Platforminterface - Translation layer: Handles variable syntax differences (
$ARGUMENTSvs{{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 gitSession Completion
When ending a work session, complete ALL steps below. Work is NOT complete until git push succeeds.
Mandatory Workflow
- File issues - Create issues for remaining/discovered work
- Quality gates (if code changed):
go test ./... golangci-lint run go build ./cmd/aix pre-commit run --all-files - Update issues - Close finished work, update in-progress items
- Push to remote:
git pull --rebase bd sync git push git status # MUST show "up to date with origin" - Hand off - Provide context for next session
Critical Rules
- Work is NOT complete until
git pushsucceeds - 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:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- PUSH TO REMOTE - This is MANDATORY:
git pull --rebase bd sync git push git status # MUST show "up to date with origin" - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- Work is NOT complete until
git pushsucceeds - 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
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
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.

