add-infra-concern
Skill2 starsChanged 33 days agoMITView on GitHub
Adds an external integration to Govern (email provider, cache, Telegram, storage, HTTP API client…): abstraction in Application.Common, implementation folder in Infrastructure, options, DI, health check, test fake. Use when a feature needs to talk to something outside the process.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-entitySkill
- add-migrationSkill
- add-use-caseSkill
- develop-featureSkill
- outdated-packagesSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read first: architecture.md (Infrastructure template), security.md (secrets), logging.md.
- Very specific: line 17
Put the messages and models it uses in Application.Common/Models/.
- Very specific: line 27
If the application can't work without it, add a health check (services.AddHealthChecks().Add...(name, tags: ["ready"])).
- Very specific: line 36
If the concern calls out to external services or handles credentials, run the security-auditor agent.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add an infrastructure concern
Reference implementation: email (IEmailService → Infrastructure/Emailing/Services/LoggingEmailService.cs, faked by tests/Govern.IntegrationTests/Fixtures/FakeEmailService.cs).
Read first: architecture.md (Infrastructure template), security.md (secrets), logging.md.
1. Abstraction: src/Govern.Application.Common/Abstractions/I[Concern]Service.cs
- Describe what the application needs ("send an email"), not the vendor API. Keep it small, async, with a
CancellationToken. - Put the messages and models it uses in
Application.Common/Models/.
2. Implementation: src/Govern.Infrastructure/[Concern]/
- The folder uses only UF sub-folders:
Services/[Vendor][Concern]Service.cs(internal sealed),Options/[Concern]Options.cs,Models/, and so on. - Options: bound from the
[Concern]config section withValidateDataAnnotations().ValidateOnStart(). Secrets (API keys) come from user-secrets locally and Key Vault in Azure. Add them toinfra/modules/keyVault.bicepand the Web App app settings as Key Vault references. Never put them in appsettings. - HTTP APIs: a typed
HttpClientviaservices.AddHttpClient<...>(), with a timeout and resilience (Microsoft.Extensions.Http.Resilience, added withdotnet add package). Nevernew HttpClient(). - Logging:
[LoggerMessage], with no secrets or personal data in logs.
3. Registration
- In
src/Govern.Infrastructure/DependencyInjection.cs, register the service. Match the lifetime to its dependencies: a singleton for stateless clients, scoped when it uses scoped services. - If the application can't work without it, add a health check (
services.AddHealthChecks().Add...(name, tags: ["ready"])).
4. Tests
- Integration tests never call the real external service. Add a fake in
tests/Govern.IntegrationTests/Fixtures/Fake[Concern]Service.csand swap it inGovernApiFactory.ConfigureWebHost(RemoveAll+AddSingleton). Assert on what the fake captured. - Unit tests only if the logic lives in
Govern.Utils.
5. Docs and infra
docs/operations/configuration.md: the new config keys and where their values come from.infra/: the new Azure resources or secrets. Keepaz bicep build --file infra/main.bicepclean.- If the concern calls out to external services or handles credentials, run the
security-auditoragent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

