This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Gabel is a CLI tool that helps users copy GitHub labels between repositories with an interactive picker.
# Build
go build -o gabel
# Run
./gabel owner/source owner/dest
# Test
go test ./...
# Test with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outSimple Go CLI that wraps GitHub CLI (gh):
main.go- CLI entry point using cobralabels.go- GitHub API calls viagh apipicker.go- Interactive selection using promptuidisplay.go- Terminal colors and formatting
- Uses
gh apifor all GitHub operations - no API tokens needed - Interactive picker shows unified view of labels from both repos
- Never overwrites without explicit user confirmation
- Minimal dependencies: cobra for CLI, promptui for picker, fatih/color for colors
- Fail Fast, Fail Clearly: Never swallow errors. Let processes die with actionable error messages
- Observable by Default: User-facing logs for progress, DEBUG for developer details
- Test-Driven Development: Write tests first, mock external dependencies
- Composable Unix Philosophy: Support pipes, meaningful exit codes, streamable output
- Strict Meaningful Types: Use type safety to your advantage
- Generic Infrastructure: Keep non-functional code domain-agnostic. Use generic examples (foo/bar) in tests, utilities, and infrastructure
- Focus comments on WHY not WHAT. Document architectural decisions
- Error messages: include a suggestion to fix the problem if possible
- Use golangci-lint
- DEBUG - Development details, hidden by default (enabled with -d flag)
- INFO - User progress updates (printed to stdout)
- ERROR - Problems that prevent operation (printed to stderr)
Note: Go doesn't have built-in log levels like WARN. We use fmt.Printf for INFO and fmt.Fprintf(os.Stderr) for ERROR.
- 80% code coverage target
Coverage Pragmatism: The 80% target balances thoroughness with practicality. Integration tests provide additional confidence beyond unit test coverage. Focus testing on business logic and error paths.
- No emojis in console output. Use plain ASCII or common Unicode when necessary
- Use color for emphasis and clarity
- For status indicators, use text like
[OK],[ERROR],>>instead of emoji
Prefer simple, common words:
- "need" not "necessary"
- "use" not "utilize"
- "help" not "assist"
- "start" not "commence"
Follow these principles:
- Concise and Direct: Begin each comment with the main point or rationale
- Avoid Jargon Unless Essential: Use acronyms or industry-specific terms only when essential
- Document Lessons Learned: Include reasoning behind decisions
- Colocate Comments: Place comments close to the relevant code
- Focus on Why, Not What: Explain rationale rather than stating the obvious
- Highlight Non-Obvious Details: Clarify units, contexts, or gotchas
- Warn About Risks: Clearly highlight critical sections
- No Emojis in Code: Use ASCII. Prefer "TODO", "FIXME", "[OK]", "[FAIL]" over emoji