git clone https://github.com/jakeva/chainrecon.git
cd chainrecon
make build
make testRequires Go 1.26+.
- Create a branch off
main. - Make your changes.
- Run
make testandmake lintlocally before pushing. - Open a pull request against
main.
CI runs tests, linting, and smoke scans on every PR. All checks must pass before merge.
make test # unit tests with race detection
make lint # golangci-lint
make vet # go vet
make coverage # generate coverage report
make integration-test # integration tests (hits real APIs)cmd/chainrecon/ Entry point
internal/
cli/ Cobra commands, scan orchestration
analyzer/ Signal analyzers (provenance, identity, blast radius, etc.)
collector/ API clients (npm registry, GitHub, Scorecard)
cache/ BoltDB cache layer
model/ Shared types
output/ Table and JSON formatters
pkg/ Public library code
Go standard formatting (gofmt). The linter config handles the rest.
Keep error messages lowercase and prefixed with the package name (e.g., npm: fetch metadata for %q: %w).
Write concise commit messages that describe what changed and why. Use conventional commit prefixes: feat, fix, refactor, test, docs, perf, chore.
- Create a file in
internal/analyzer/. - Implement a function that takes the relevant model types and returns
[]model.Findingand a score. - Wire it into the scan orchestration in
internal/cli/scan.go. - Add tests.
- Create a package under
internal/collector/. - Define an interface and a constructor that takes
cache.Store. - Use
collector.NewHTTPClient()for the HTTP client (shared transport). - Cache responses using the
cache.Storewith an appropriate TTL frominternal/cache/. - Add tests using
httptest.NewServer.
Open an issue on GitHub. Include the package you scanned, the output, and what you expected.