Thanks for your interest in improving Stock Tracker! This is a small, dependency-free Go project — contributions of all sizes are welcome.
git clone <your-fork-url>
cd stock-tracker
go build -o stock-tracker .
# local config (git-ignored)
cp .env.example .env
cp resources/positions.example.json resources/positions.jsonRequires Go 1.25+. There are no external dependencies — only the standard library.
Please make sure all of these pass:
go build ./... # compiles
go vet ./... # static checks
gofmt -l . # must print nothing (run `gofmt -w .` to fix)
go test ./... # all tests greenA one-liner:
go build ./... && go vet ./... && test -z "$(gofmt -l .)" && go test ./...- Formatting: always
gofmt. CI/reviewers will reject unformatted code. - No new dependencies without discussion — staying stdlib-only is a design goal.
- Tests live next to code as
*_test.goin the same package (Go convention), so they can exercise unexported functions. Add or update tests for any behavior change. - Keep it DRY: shared math lives in
internal/num; the Yahoo/OpenAI clients and formatting each have a single home. Prefer extending those over copying. - Comments explain why, not what. Match the surrounding style.
| Package | Responsibility |
|---|---|
main |
CLI entry point and command dispatch |
internal/config |
.env loader |
internal/stock |
Yahoo Finance client (quotes + hourly bars) |
internal/analyze |
trend / volume / signal math |
internal/positions |
position & P&L math |
internal/monitor |
pass orchestration, formatting, change detection |
internal/cache |
per-day AI explanation cache (cost control) |
internal/ai |
optional OpenAI news step |
internal/num |
shared numeric helpers |
- Never commit secrets or personal data.
.envandresources/positions.jsonare git-ignored on purpose; edit the*.example.*templates instead. - Mind LLM cost. The
internal/aicalls are paid. Any change there must keep the gating + caching ininternal/monitorintact (see the README's "Caching & LLM cost control" section). - Market data is public and unauthenticated — be considerate of Yahoo's endpoint (the client already sets a timeout and a User-Agent).
Open an issue with: what you ran, what you expected, what happened, and the relevant output (redact any personal position figures).