This document provides clear instructions for automated agents (bots, CI, and code review tools) and contributors interacting with the Polyline Algorithm library.
- All contributions and automation must adhere to the project's code style, enforced via
.editorconfiganddotnet format. - Unit tests are mandatory for new features and bug fixes. Use the
tests/directory and follow existing naming conventions. - Benchmarks must be updated or added for significant performance changes. Use the
benchmarks/directory.
Agents should:
- Attach benchmark results if encoding/decoding performance is affected.
- Ensure public API changes are documented in code comments and
api-reference/. - Run code format and static analysis tools before submitting (
dotnet format, analyzers). - Update README.md and
/samplesfor new or changed public APIs.
- All new code must:
- Throw descriptive exceptions for invalid input or edge cases.
- Use internal logging helpers for operational status (
LogInfoExtensions,LogWarningExtensions).
- Use the abstraction interfaces (
IPolylineEncoder, and if availableIPolylineDecoder). - Prefer extension methods for collections and arrays.
- Validate latitude and longitude ranges to avoid malformed polylines.
Agents should reference standardized templates from .github as appropriate. Contributors should always use these for new issues or PRs.
- When adding encoding schemes or new coordinate types, use separate classes/files and register via a factory pattern.
- Do not mix logic between Google Polyline versions or custom coordinate types.
- If adding support for precision, custom coordinate fields, or options, update
PolylineEncodingOptionsand provide clear doc comments.
- Keep XML comments,
api-reference/, andREADME.mdup-to-date. - Add code samples for any new features.
Each file must specify:
# AGENT INSTRUCTIONS
- Purpose and scope
- Required tools/commands
- Coding and testing requirements
- Logging/error handling expectations
- Documentation or samples to update
For questions or clarifications, please open a GitHub issue and tag @petesramek.