|
| 1 | +# Polyline Algorithm Agents Instructions |
| 2 | + |
| 3 | +## Purpose |
| 4 | +This document provides clear instructions for automated agents (bots, CI, and code review tools) and contributors interacting with the Polyline Algorithm library. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## General Guidelines |
| 9 | + |
| 10 | +- All contributions and automation **must adhere to the project's code style**, enforced via `.editorconfig` and `dotnet format`. |
| 11 | +- **Unit tests are mandatory** for new features and bug fixes. Use the `tests/` directory and follow existing naming conventions. |
| 12 | +- **Benchmarks** must be updated or added for significant performance changes. Use the `benchmarks/` directory. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Pull Requests |
| 17 | + |
| 18 | +Agents should: |
| 19 | +- **Attach benchmark results** if encoding/decoding performance is affected. |
| 20 | +- Ensure **public API changes are documented** in code comments and `api-reference/`. |
| 21 | +- Run code format and static analysis tools before submitting (`dotnet format`, analyzers). |
| 22 | +- Update **README.md** and `/samples` for new or changed public APIs. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Error Handling and Logging |
| 27 | + |
| 28 | +- All new code must: |
| 29 | + - Throw **descriptive exceptions** for invalid input or edge cases. |
| 30 | + - Use internal logging helpers for operational status (`LogInfoExtensions`, `LogWarningExtensions`). |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Encoding/Decoding Agents |
| 35 | + |
| 36 | +- Use the abstraction interfaces (`IPolylineEncoder`, and *if available* `IPolylineDecoder`). |
| 37 | +- Prefer extension methods for collections and arrays. |
| 38 | +- Validate latitude and longitude ranges to avoid malformed polylines. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Issue and PR Templates |
| 43 | + |
| 44 | +Agents should reference standardized templates from `.github` as appropriate. Contributors should always use these for new issues or PRs. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Extensibility |
| 49 | + |
| 50 | +- When adding encoding schemes or new coordinate types, **use separate classes/files** and register via a factory pattern. |
| 51 | +- Do not mix logic between Google Polyline versions or custom coordinate types. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Future-proofing |
| 56 | + |
| 57 | +- If adding support for precision, custom coordinate fields, or options, update `PolylineEncodingOptions` and provide clear doc comments. |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## Documentation |
| 62 | + |
| 63 | +- Keep XML comments, `api-reference/`, and `README.md` up-to-date. |
| 64 | +- Add code samples for any new features. |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Agent File Format (for `.github/agents`) |
| 69 | + |
| 70 | +Each file must specify: |
| 71 | + |
| 72 | +``` |
| 73 | +# AGENT INSTRUCTIONS |
| 74 | +
|
| 75 | +- Purpose and scope |
| 76 | +- Required tools/commands |
| 77 | +- Coding and testing requirements |
| 78 | +- Logging/error handling expectations |
| 79 | +- Documentation or samples to update |
| 80 | +``` |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Contact & Questions |
| 85 | + |
| 86 | +For questions or clarifications, please open a GitHub issue and tag `@petesramek`. |
| 87 | + |
| 88 | +--- |
0 commit comments