Contributing
Thank you for your interest in contributing to aict.
Project Structure
aict/
├── cmd/aict/main.go # Entry point
├── cmd/mcp/ # MCP server implementation
├── internal/ # Shared packages
│ ├── xml/ # Output encoding (XML/JSON/plain)
│ ├── detect/ # Language & MIME detection
│ ├── path/ # Path resolution
│ ├── format/ # Size formatting
│ └── meta/ # Timestamps
└── tools/ # Individual tool implementations
└── <toolname>/
└── <toolname>.go # Tool implementation
Adding a New Tool
- Create a new directory under
tools/<toolname>/ - Implement the tool following the pattern in
CONTRIBUTING.md - Register it in
main.go:import _ "github.com/synseqack/aict/tools/toolname" - Write tests in
<toolname>_test.go
Output Requirements
All tools must:
- Output valid XML with root element named after the tool
- Include
timestampattribute (Unix epoch) - Support
--xml,--json,--plainflags - Support
AICT_XML=1environment variable - Return structured errors via
<error>elements - Use absolute paths in output
- Include human-readable companions for bytes/sizes
Testing
go test ./...
go test ./tools/toolname/
Code Style
- Use
gofmtfor formatting - Avoid external dependencies (stdlib only)
- Use lowercase for error messages (no punctuation)
- Export structs for XML marshaling
Dependencies
ALLOWED — Go standard library only.
FORBIDDEN — no external dependencies (github.com/... imports, go get, cgo).
Exception: the MCP server (cmd/mcp) uses github.com/modelcontextprotocol/go-sdk.