-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Feature Description
Refactor the project structure to follow standard Go project layout conventions, improving code organization and maintainability.
Problem It Solves
The current project structure doesn't follow standard Go project layout conventions, which can make the codebase harder to navigate for contributors and less idiomatic.
- The
src/directory is non-standard in Go projects (Go convention usescmd/for main applications) - AI provider packages (chatgpt, claude, gemini, grok) are at the root level alongside internal utilities
- Media assets (images, GIFs) are scattered in the root directory
- There's a typo in the filename:
promt.goshould beprompt.go
Proposed Solution
Restructure the project following the standard Go project layout:
.
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── go.mod
├── go.sum
├── cmd/
│ └── <app-name>/
│ └── main.go
├── internal/
│ ├── chatgpt/
│ │ └── chatgpt.go
│ ├── claude/
│ │ └── claude.go
│ ├── gemini/
│ │ └── gemini.go
│ ├── grok/
│ │ └── grok.go
│ ├── display/
│ │ └── display.go
│ ├── git/
│ │ └── operations.go
│ ├── stats/
│ │ └── statistics.go
│ └── utils/
│ └── utils.go
├── pkg/
│ └── types/
│ ├── prompt.go
│ └── types.go
└── assets/
├── commit.gif
└── image.pngKey changes:
- src/ → cmd/ for application entry points
- AI providers moved to internal/ (unless they should be in pkg/ if meant to be importable by external projects)
- types/ moved to pkg/types/ (or internal/types/ depending on intended use)
- Media files consolidated into assets/ directory
- Fix typo: promt.go → prompt.go
Alternative Solutions
- Keep AI providers at root level: Continue with current structure, only move
src/tocmd/and createassets/. - Put AI providers in
pkg/: If the intention is to make these packages importable by other projects as reusable AI client libraries, they should go inpkg/instead ofinternal/.
Use Case
- New contributors: Can immediately understand the project structure following familiar Go conventions
- Maintainers: Easier to organize and locate code
- Go community: Project appears more professional and approachable
Implementation Ideas
Migration steps:
- Create new directory structure (cmd/, internal/, pkg/, assets/)
- Move files to their new locations
- Update all import statements to reflect new paths
- Rename promt.go to prompt.go
- Update documentation and any build scripts (if required)
- Test to ensure everything still works
Open questions:
What should the binary name be in cmd/? (needs project name)
Should types/ be in pkg/ (exportable) or internal/ (internal-only)?
Should AI provider packages be in internal/ or pkg/? (depends on whether they're meant to be reusable libraries)
I'm happy to submit a PR under hacktoberfest implementing these changes once we agree on the structure details.