Skip to content

Commit 2da13f5

Browse files
committed
Align project agents with Geocoding.net workflows
Root cause: the repo's custom agents and owned skills were copied from Exceptionless-specific workflows and still referenced invalid skills, paths, secret storage, and handoff semantics for this codebase.
1 parent 949c594 commit 2da13f5

7 files changed

Lines changed: 334 additions & 433 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: geocoding-library
3+
description: >
4+
Use this skill when implementing, reviewing, or triaging changes in Geocoding.net. Covers
5+
provider isolation, shared geocoding abstractions, provider-specific address and exception
6+
types, xUnit test strategy, API-key-backed test constraints, backward compatibility, and the
7+
sample web app's role in the repository.
8+
---
9+
10+
# Geocoding.net Library Patterns
11+
12+
## When to Use
13+
14+
- Any change under `src/`, `test/`, `samples/`, `.claude/`, or repo-owned customization files
15+
- Bug fixes that may repeat across multiple geocoding providers
16+
- Code reviews or triage work that needs repo-specific architecture context
17+
18+
## Architecture Rules
19+
20+
- Keep shared abstractions in `src/Geocoding.Core`
21+
- Keep provider-specific request/response logic inside that provider's project
22+
- Do not leak provider-specific types into `Geocoding.Core`
23+
- Prefer extending an existing provider pattern over inventing a new abstraction
24+
- Keep public async APIs suffixed with `Async`
25+
- Keep `CancellationToken` as the final public parameter and pass it through the call chain
26+
27+
## Provider Isolation
28+
29+
- Each provider owns its own address type, exceptions, DTOs, and request logic
30+
- If a bug or improvement appears in one provider, compare sibling providers for the same pattern
31+
- Shared helpers should only move into `Geocoding.Core` when they truly apply across providers
32+
33+
## Backward Compatibility
34+
35+
- Avoid breaking public interfaces, constructors, or model properties unless the task explicitly requires it
36+
- Preserve existing provider behavior unless the task is a bug fix with a documented root cause
37+
- Keep exception behavior intentional and provider-specific
38+
39+
## Testing Strategy
40+
41+
- Extend existing xUnit coverage before creating new test files when practical
42+
- Prefer targeted test runs for narrow changes
43+
- Run the full `Geocoding.Tests` project when shared abstractions, common test bases, or cross-provider behavior changes
44+
- Remember that some provider tests require local API keys in `test/Geocoding.Tests/settings-override.json` or `GEOCODING_` environment variables; keep the tracked `settings.json` placeholders empty
45+
- For bug fixes, add a regression test when the affected path is covered by automated tests
46+
47+
## Validation Commands
48+
49+
```bash
50+
dotnet build Geocoding.slnx
51+
dotnet test --project test/Geocoding.Tests/Geocoding.Tests.csproj
52+
dotnet build samples/Example.Web/Example.Web.csproj
53+
```
54+
55+
## Sample App Guidance
56+
57+
- `samples/Example.Web` demonstrates the library; it should not drive core design decisions
58+
- Only build or run the sample when the task actually touches the sample or requires manual verification there
59+
60+
## Customization Files
61+
62+
- `.claude/agents` and repo-owned skills must stay Geocoding.net-specific
63+
- Reference only skills that exist in `.agents/skills/`
64+
- Reference only commands, paths, and tools that exist in this workspace
65+
- Keep customization workflows aligned with AGENTS.md

.agents/skills/security-principles/SKILL.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
---
22
name: security-principles
33
description: >
4-
Use this skill when handling secrets, credentials, PII, input validation, or any
5-
security-sensitive code. Covers secrets management, secure defaults, encryption, logging
6-
safety, and common vulnerability prevention. Apply when adding authentication, configuring
7-
environment variables, reviewing code for security issues, or working with sensitive data.
4+
Use this skill when handling provider API keys, external geocoding responses, request
5+
construction, logging safety, or other security-sensitive code in Geocoding.net. Apply when
6+
reviewing secrets handling, input validation, secure transport, or safety risks around
7+
external provider integrations and sample/test configuration.
88
---
99

1010
# Security Principles
1111

1212
## Secrets Management
1313

14-
Secrets are injected via Kubernetes ConfigMaps and environment variables never commit secrets to the repository.
14+
Provider credentials belong in local override files or environment variables and must never be committed to the repository.
1515

16-
- **Configuration files** — Use `appsettings.yml` for non-secret config
17-
- **Environment variables** — Secrets injected at runtime via `EX_*` prefix
18-
- **Kubernetes** — ConfigMaps mount configuration, Secrets mount credentials
16+
- **Tracked placeholders**`test/Geocoding.Tests/settings.json` is versioned and should contain placeholders only; do not put real keys there
17+
- **Test credentials** — Keep provider API keys in `test/Geocoding.Tests/settings-override.json` or via `GEOCODING_` environment variables
18+
- **Sample configuration** — Use placeholder values only in `samples/Example.Web/appsettings.json`
19+
- **Environment variables** — Use environment variables for CI or local overrides when needed
1920

2021
```csharp
21-
// AppOptions binds to configuration (including env vars)
22-
public class AppOptions
22+
public sealed class ProviderOptions
2323
{
24-
public string? StripeApiKey { get; set; }
25-
public AuthOptions Auth { get; set; } = new();
24+
public string? ApiKey { get; set; }
2625
}
2726
```
2827

@@ -31,24 +30,25 @@ public class AppOptions
3130
- Check bounds and formats before processing
3231
- Use `ArgumentNullException.ThrowIfNull()` and similar guards
3332
- Validate early, fail fast
33+
- Validate coordinates, address fragments, and batch sizes before sending requests
3434

3535
## Sanitize External Data
3636

37-
- Never trust data from queues, caches, user input, or external sources
37+
- Never trust data from geocoding providers, user input, or sample configuration
3838
- Validate against expected schema
39-
- Sanitize HTML/script content before storage or display
39+
- Handle missing or malformed response fields without assuming provider correctness
4040

4141
## No Sensitive Data in Logs
4242

43-
- Never log passwords, tokens, API keys, or PII
43+
- Never log passwords, tokens, API keys, or raw provider payloads
4444
- Log identifiers and prefixes, not full values
4545
- Use structured logging with safe placeholders
4646

4747
## Use Secure Defaults
4848

49-
- Default to encrypted connections (SSL/TLS enabled)
50-
- Default to restrictive permissions
51-
- Require explicit opt-out for security features
49+
- Default to HTTPS provider endpoints
50+
- Avoid disabling certificate or transport validation
51+
- Require explicit opt-out for any non-secure development-only behavior
5252

5353
## Avoid Deprecated Cryptographic Algorithms
5454

@@ -64,9 +64,15 @@ Use modern cryptographic algorithms:
6464

6565
## Input Bounds Checking
6666

67-
- Enforce minimum/maximum values on pagination parameters
67+
- Enforce minimum/maximum values on pagination or batch parameters
6868
- Limit batch sizes to prevent resource exhaustion
69-
- Validate string lengths before storage
69+
- Validate string lengths before request construction
70+
71+
## Safe Request Construction
72+
73+
- URL-encode user-supplied address fragments and query parameters
74+
- Do not concatenate secrets or untrusted input into URLs without escaping
75+
- Preserve provider-specific signing or authentication requirements without leaking secrets into logs
7076

7177
## OWASP Reference
7278

0 commit comments

Comments
 (0)