This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
task build- Build the ADL CLI binary tobin/adltask test- Run all teststask test:coverage- Run tests with coverage reporttask lint- Run golangci-linttask fmt- Format all Go codetask ci- Run complete CI pipeline: fmt, lint, test, build
go test -v ./cmd -run TestInit- Run specific test by namego test -v ./internal/generator- Test specific package
task dev -- init my-agent- Run CLI init commandtask dev -- generate --file agent.yaml --output ./test- Generate projecttask dev -- validate examples/go-agent.yaml- Validate ADL filetask examples:test- Validate all example ADL filestask examples:generate- Generate projects from all examples
The ADL CLI generates A2A (Agent-to-Agent) agent projects from YAML-based Agent Definition Language files.
main.go # Entry point, sets version
├── cmd/ # CLI commands (Cobra framework)
│ ├── root.go # Root command setup
│ ├── init.go # Interactive ADL manifest creation
│ ├── generate.go # Project generation from ADL
│ └── validate.go # ADL schema validation
└── internal/
├── generator/ # Code generation engine
│ ├── generator.go # Main generation logic, CI/CD generation
│ └── ignore.go # .adl-ignore handling
├── schema/ # ADL schema definitions
│ ├── types.go # All ADL type definitions (ADL, Spec, Skill, etc.)
│ └── validator.go # JSON Schema validation
├── prompt/ # Interactive prompts for `init` command
└── templates/ # Template system
├── engine.go # Template rendering with Sprig v3 functions
├── registry.go # Template loading and file mapping per language
├── headers.go # Generated file headers
├── common/ # Universal templates (config, docs, CI/CD)
├── languages/ # Language-specific templates (go/, rust/, typescript/)
└── sandbox/ # Dev environment templates (flox/, devcontainer/)
- Parse & Validate: Load ADL YAML, validate against schema, check required fields
- Template Selection: Detect language from
spec.language, build file mapping viaregistry.go - Generate: Render templates with ADL context, respect
.adl-ignore, write files - Post-Process: Run formatters (
go fmt,cargo fmt), execute custom hooks
ADL- Root structure withapiVersion,kind,metadata,specSpec- Containscapabilities,agent,skills,services,server,language,deploymentSkill- Agent capability withid,name,schema,inject(for service injection)Service- Injectable service withinterface,factory,description
Skills can inject services via the inject field. The logger service is built-in:
spec:
services:
database:
type: service
interface: DatabaseService
factory: NewDatabaseService
skills:
- id: query_database
inject:
- logger # logger is built-in
- databaseGenerated services go to internal/<service>/ with interface and factory function.
- Create
internal/templates/languages/<lang>/with templates - Add file mapping method in
registry.go(e.g.,getRustFiles) - Add language detection in
DetectLanguageFromADLanddetectLanguage - Add language config type in
schema/types.go(e.g.,RustConfig) - Add example ADL file in
examples/
- Create
cmd/<command>.gowith Cobra command - Register in
cmd/root.goviarootCmd.AddCommand() - Add tests in
cmd/<command>_test.go
- Go 1.26+ required
- Templates use Go
text/templatewith Sprig v3 functions - ADL schema version:
adl.dev/v1 - Supports Go, Rust (TypeScript planned)
- Use table-driven tests with isolated mocks