Conventions that have worked well for go-based CLIs #2
rianjs
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
CLI Development Conventions
Breadcrumbs for Claude (and humans) to follow when working on this codebase.
Design Principles
Composability & Orthogonality
Commands should be independent, single-purpose units that don't overlap:
gro mail search/gro mail read/gro mail thread- each does one thingjtk issue list/jtk issue get/jtk issue create- CRUD as separate commandscfl page viewvscfl page edit- reading vs writing are distinctsfdc bulk import/sfdc bulk export- large data ops separate from CRUDPatterns Before API Surface
Establish infrastructure before writing feature commands:
Standard Command Conventions
Setup & Config Pattern:
Resource Commands Pattern:
Workflow
Issue → PR → Close → Next
Atomic units of work:
TDD Assessment Gate
Before merging significant features:
Commit Message Conventions
Commits should never include any mention of Claude, Anthropic, or any other AI tool. Consider creating a precommit hook like this:
Testing Patterns
Table-Driven Tests
HTTP Mocking with httptest
Injectable Dependencies for Testability
What NOT To Do
Architecture
Directory Structure
Register Pattern
Each command package exports a Register function:
CI/CD & Repository Settings
Branch Protection (main)
Merge Settings
Cross-Platform Support
Beta Was this translation helpful? Give feedback.
All reactions