@cassiomc1/forgeloop 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.github/copilot-instructions.md +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CLAUDE.md +1 -1
  4. package/CONTRIBUTING.md +90 -0
  5. package/DOCS_INDEX.md +13 -11
  6. package/ENG/c-development-eng.md +112 -0
  7. package/ENG/cpp-development-eng.md +109 -0
  8. package/ENG/dotnet-aspnetcore-development-eng.md +401 -0
  9. package/ENG/go-development-eng.md +103 -0
  10. package/ENG/java-development-eng.md +125 -0
  11. package/ENG/nodejs-backend-development-eng.md +605 -0
  12. package/ENG/php-development-eng.md +104 -0
  13. package/ENG/rust-development-eng.md +422 -0
  14. package/ENG/sql-development-eng.md +108 -0
  15. package/ENG/swift-development-eng.md +111 -0
  16. package/ENG/typescript-development-eng.md +108 -0
  17. package/GUIDE_ROUTER.md +418 -9
  18. package/QUALITY_SCORECARD.md +1 -0
  19. package/README.md +44 -33
  20. package/THIRD_PARTY_NOTICES.md +19 -7
  21. package/completions/_forgeloop +3 -3
  22. package/completions/forgeloop.bash +3 -3
  23. package/completions/forgeloop.fish +7 -0
  24. package/docs/AGENT_PROTOCOL_SUMMARY.md +55 -2
  25. package/docs/CLI_REFERENCE.md +28 -6
  26. package/docs/DOCUMENTATION_GUIDE.md +2 -1
  27. package/docs/GETTING_STARTED.md +59 -0
  28. package/docs/PACKAGE_CONTENTS.md +28 -14
  29. package/docs/RECIPES.md +23 -0
  30. package/docs/RELEASE_CHECKLIST.md +30 -2
  31. package/docs/TROUBLESHOOTING.md +100 -2
  32. package/docs/documentation-manifest.json +652 -0
  33. package/docs/protocol-requirements.json +77 -0
  34. package/package.json +19 -4
  35. package/schemas/routing-input.schema.json +1 -1
  36. package/scripts/CI_VALIDATORS.md +84 -11
  37. package/scripts/generate-agent-protocol-summary.mjs +36 -0
  38. package/src/commands/next.js +19 -7
  39. package/src/commands/task-create.js +84 -25
  40. package/src/commands/task-list.js +22 -2
  41. package/src/config/guides.json +44 -0
  42. package/src/core/build-script.js +151 -0
  43. package/src/core/c-cpp-project.js +143 -0
  44. package/src/core/cli-command-definitions.js +8 -1
  45. package/src/core/command-executors.js +5 -3
  46. package/src/core/command-input.js +140 -102
  47. package/src/core/contract-presets.js +82 -0
  48. package/src/core/error-codes.js +3 -3
  49. package/src/core/filesystem.js +1 -10
  50. package/src/core/go-project.js +206 -0
  51. package/src/core/java-project.js +403 -0
  52. package/src/core/multi-language-project.js +117 -0
  53. package/src/core/next-explanation.js +63 -0
  54. package/src/core/php-project.js +85 -0
  55. package/src/core/project-detection.js +1760 -52
  56. package/src/core/reconcile-closure.js +4 -1
  57. package/src/core/router.js +156 -3
  58. package/src/core/rust-project.js +400 -0
  59. package/src/core/sql-project.js +141 -0
  60. package/src/core/swift-project.js +200 -0
  61. package/src/core/typescript-project.js +349 -0
  62. package/src/core/xml-structure.js +123 -0
@@ -0,0 +1,401 @@
1
+ ---
2
+ name: dotnet-aspnetcore-development-eng
3
+ language: en
4
+ description: "Specialist guide for architecture, implementation, testing, performance, security, data access, hosting, observability, and release of production .NET and ASP.NET Core applications."
5
+ version: "2026.09"
6
+ last-reviewed: "2026-09-11"
7
+ guide-id: dotnet
8
+ ---
9
+
10
+ # .NET and ASP.NET Core Development Engineering Guide
11
+
12
+ > Production-oriented guidance for ForgeLoop-enabled agents and developers working on SDK-style .NET applications, ASP.NET Core services, workers, Razor, Blazor, and conditional ABP applications.
13
+ >
14
+ > This guide is activated by structural project evidence: an SDK-style `*.csproj`, `*.fsproj`, or `*.vbproj` using a deliberate supported SDK allowlist (`Microsoft.NET.Sdk` family, `Aspire.AppHost.Sdk`, or `MSTest.Sdk`). A web, Razor, Blazor, or `Microsoft.AspNetCore.App` signal confirms ASP.NET Core context. `Volo.Abp.*` package references add the ABP overlay. A README, source comment, Dockerfile, lockfile, directory name, or package name alone does not activate this guide.
15
+ >
16
+ > This guide complements, rather than replaces, ForgeLoop's general engineering guides. Use `clean-code-eng.md` for maintainability, `test-code-eng.md` for verification, `sec-code-eng.md` for trust boundaries, `perf-code-eng.md` for measured optimization, `documentation-quality-eng.md` for technical docs, and the interface guides when the application has a user-facing surface.
17
+ >
18
+ > Tooling policy: inspect the repository and use already-available tools first. Do not install an SDK, workload, package, database, container runtime, analyzer, or global utility merely to satisfy a check. Installation or environment mutation requires authority. If a required check cannot run, report it as `NOT_VERIFIED`; never claim it passed.
19
+
20
+ ## 1. Mission
21
+
22
+ The .NET specialist exists to make changes that are:
23
+
24
+ - correct for the repository's actual target frameworks, SDK, hosting model, and package graph;
25
+ - compatible with the existing architecture and public contracts unless a migration is explicitly in scope;
26
+ - explicit about trust boundaries, lifetime boundaries, cancellation, persistence, and failure behavior;
27
+ - testable at the narrowest level that proves the requested behavior and at broader levels where integration risk requires it;
28
+ - measurable when latency, throughput, allocation, startup, database, or memory cost is relevant;
29
+ - releasable with evidence from the exact code and configuration that will ship.
30
+
31
+ Prefer repository truth over a generic ASP.NET Core template. Do not introduce a new framework, architecture, persistence model, serializer, hosting model, or ABP abstraction only because it is fashionable.
32
+
33
+ ## 2. Authority and precedence
34
+
35
+ Resolve conflicts in this order:
36
+
37
+ 1. Platform and safety rules.
38
+ 2. The user's latest explicit request.
39
+ 3. Repository-local instructions, including `AGENTS.md`, `PROJECT_PROFILE.md`, and `LOOP_ENGINEERING.md`.
40
+ 4. The actual project files, target frameworks, package graph, tests, CI, deployment manifests, and source code.
41
+ 5. Existing public contracts and established architecture.
42
+ 6. This guide.
43
+ 7. Official documentation and samples for the pinned SDK/runtime.
44
+ 8. Community examples.
45
+
46
+ If the repository targets an older runtime, preserve supported behavior and verify any proposed API against that target. If a migration is needed, make it an explicit deliverable rather than silently changing the target framework.
47
+
48
+ ## 3. Discovery before implementation
49
+
50
+ Inspect the smallest complete set of sources that can explain the change:
51
+
52
+ - all relevant `*.csproj`, `*.fsproj`, and `*.vbproj` files;
53
+ - `Directory.Build.props`, `Directory.Build.targets`, `Directory.Packages.props`, `global.json`, and `NuGet.config`/`nuget.config` in the applicable directory scope;
54
+ - `*.sln`/`*.slnx` membership when a solution is named or changed;
55
+ - `Program.cs`, `Startup.cs`, host builders, worker entry points, and test projects;
56
+ - controllers, minimal API route groups, endpoint classes, Razor/Blazor components, hubs, middleware, filters, and binders;
57
+ - options, configuration providers, secrets references, environment manifests, and deployment files;
58
+ - persistence registrations, `DbContext` types, migrations, repositories, units of work, and transaction boundaries;
59
+ - authentication, authorization, CORS, antiforgery, rate limiting, health checks, telemetry, and exception handling;
60
+ - `appsettings*.json`, launch settings, Dockerfiles, compose/orchestrator manifests, CI workflows, scripts, and release notes;
61
+ - existing unit, integration, contract, architecture, WebApplicationFactory, TestServer, worker, browser, and database tests.
62
+
63
+ Record, when discoverable:
64
+
65
+ - SDK and runtime version, target framework(s), and roll-forward policy;
66
+ - web, worker, Razor, Blazor, library, test, or mixed project topology;
67
+ - hosting model and environment-specific startup behavior;
68
+ - dependency-injection composition root and service lifetimes;
69
+ - public endpoints, event/message contracts, serialization settings, and compatibility constraints;
70
+ - data stores, migration ownership, transaction/unit-of-work strategy, and concurrency model;
71
+ - authentication and authorization scheme, external services, secrets boundary, and observability;
72
+ - the smallest checks that prove the requested behavior.
73
+
74
+ Use structural project evidence for routing, but use source and configuration inspection for implementation decisions. A detector result is discovery input, not proof that an application is healthy.
75
+
76
+ ## 4. Version-sensitive decisions
77
+
78
+ Treat these as version-sensitive:
79
+
80
+ - `global.json`, SDK selection, target frameworks, trimming, Native AOT, single-file publish, and roll-forward;
81
+ - minimal APIs, endpoint filters, route groups, output caching, rate limiting, and hosting defaults;
82
+ - authentication handlers, authorization policies, antiforgery, CORS, and identity packages;
83
+ - JSON source generation, serializer defaults, OpenAPI generation, and contract versioning;
84
+ - EF Core providers, migrations, execution strategies, interceptors, compiled queries, and transaction behavior;
85
+ - HTTP resilience, `IHttpClientFactory`, diagnostics, logging, metrics, tracing, and health checks;
86
+ - Razor, Blazor Server, Blazor WebAssembly, interactive render modes, SignalR, and static assets;
87
+ - ABP modules, dependency injection, unit of work, object mapping, authorization, and distributed events.
88
+
89
+ Determine the pinned versions first. Verify version-sensitive behavior against the official documentation and package source actually used by the repository. Do not copy a current example into an older target without checking API availability and changed defaults.
90
+
91
+ ## 5. Project mental model and topology
92
+
93
+ Model the application before editing it:
94
+
95
+ ```text
96
+ host / composition root
97
+ -> middleware and endpoint pipeline
98
+ -> application use cases
99
+ -> domain rules
100
+ -> persistence and external services
101
+ ```
102
+
103
+ Separate concerns only to the degree the repository's complexity needs. A small service may use feature folders and direct handlers; a larger system may have host, application, domain, infrastructure, contracts, and test projects. Preserve existing dependency direction, naming, namespaces, analyzers, and generated-code boundaries.
104
+
105
+ For multi-project repositories, identify the exact project and solution membership. Do not apply a root-level change to every project just because a shared file exists. Directory-scoped MSBuild and NuGet files affect descendants; verify which projects inherit them. ForgeLoop's detector treats a claimed `global.json` as shared .NET SDK-selection scope for confirmed descendant projects for routing purposes; it does not reproduce the complete MSBuild or .NET SDK resolution algorithm.
106
+
107
+ For monorepos, keep unrelated Flutter, JavaScript, native, and .NET applications isolated. Shared configuration is evidence of scope only when the changed claim is actually in the file's applicable directory boundary.
108
+
109
+ ## 6. Architecture preservation
110
+
111
+ Before introducing layers or abstractions, trace the existing path from transport to use case to persistence/external service. Make the smallest coherent change that preserves:
112
+
113
+ - public route, event, CLI, and serialized contracts;
114
+ - domain invariants and ownership of business decisions;
115
+ - dependency direction and composition-root responsibilities;
116
+ - error, cancellation, transaction, and authorization semantics;
117
+ - deployment shape, health/readiness behavior, and observability;
118
+ - generated code and source-generator configuration.
119
+
120
+ Do not use a repository, service, mediator, CQRS, generic controller, base class, or wrapper as a goal in itself. Add an abstraction when it isolates a real boundary, improves testability, or protects a contract. Remove accidental duplication only when behavior remains explicit.
121
+
122
+ ## 7. Dependency injection and lifetimes
123
+
124
+ Keep registration in the composition root or the repository's established module boundary. Choose lifetimes deliberately:
125
+
126
+ - singleton services must be thread-safe and must not capture scoped services;
127
+ - scoped services are appropriate for request/unit-of-work state;
128
+ - transient services should be cheap and stateless unless the repository documents otherwise.
129
+
130
+ Avoid captive dependencies: a singleton must not retain a scoped `DbContext`, request object, `HttpContext`, or other scoped service. Prefer constructor injection. Use keyed services, factories, or explicit scopes only when the target runtime supports them and the existing design warrants them.
131
+
132
+ Validate registrations early where supported, and test the composition root for required services. Do not hide required dependencies behind service location or `IServiceProvider` calls scattered through business code.
133
+
134
+ ## 8. Hosting and the ASP.NET Core pipeline
135
+
136
+ Understand the actual order of:
137
+
138
+ 1. host construction and configuration;
139
+ 2. service registration;
140
+ 3. exception handling and security headers;
141
+ 4. forwarded headers and HTTPS policy;
142
+ 5. static files, routing, CORS, authentication, authorization, antiforgery, rate limiting, output/response caching, and endpoints;
143
+ 6. health checks, diagnostics, and graceful shutdown.
144
+
145
+ Middleware ordering is behavior. Place authentication before authorization, CORS where the selected policy requires it, and exception handling early enough to cover intended failures. Do not add middleware that bypasses endpoint metadata, hides failures, or changes production behavior without tests.
146
+
147
+ Use environment checks carefully. Development-only diagnostics, detailed exceptions, local certificates, and permissive CORS must not leak into production. Forwarded headers and proxy configuration must match the trusted deployment boundary.
148
+
149
+ ## 9. Endpoints, APIs, and contracts
150
+
151
+ For controllers, minimal APIs, SignalR hubs, Razor endpoints, and endpoint groups:
152
+
153
+ - preserve route templates, verbs, status codes, content types, and documented headers unless change is explicit;
154
+ - bind only the input the endpoint needs; do not over-post domain entities;
155
+ - validate at the boundary, then enforce invariants in the application/domain layer;
156
+ - make response and error shapes stable and serializable;
157
+ - use precise status codes and consistent problem-details handling;
158
+ - define pagination, filtering, sorting, concurrency, idempotency, and retry behavior for collection or mutation endpoints;
159
+ - keep authorization attached to the server-side endpoint/policy, not merely to client visibility;
160
+ - document breaking changes and compatibility strategy.
161
+
162
+ Do not treat generated OpenAPI as proof that runtime behavior is correct. Test the actual route, binding, authorization, serialization, and failure paths.
163
+
164
+ ## 10. Configuration and options
165
+
166
+ Use strongly typed options for cohesive configuration. Validate required values at startup or at the first safe boundary, with errors that name the configuration key but never reveal secret values.
167
+
168
+ Respect provider precedence and environment overrides. Keep defaults safe. Do not commit credentials, tokens, connection strings with passwords, private keys, or production configuration. Use the repository's existing secret provider and deployment mechanism.
169
+
170
+ When changing options, inspect all consumers and environment-specific files. A property rename can be a deployment-breaking change even when compilation succeeds. Test missing, malformed, boundary, and production-like values.
171
+
172
+ ## 11. Authentication, authorization, and trust boundaries
173
+
174
+ Authentication answers who the caller is; authorization answers what the caller may do. Enforce authorization server-side for every protected operation, including background-triggered or direct API calls.
175
+
176
+ Inspect scheme selection, token/cookie validation, issuer/audience, clock skew, claims mapping, policy/role/resource checks, tenant boundaries, impersonation, and denial behavior. Keep authentication credentials out of logs and URLs.
177
+
178
+ For browser flows, evaluate antiforgery, SameSite, secure cookies, CORS, CSRF, redirect validation, clickjacking protection, and content security policy according to the actual deployment. Do not use `AllowAnyOrigin` with credentials. Do not turn off certificate or token validation to make a test pass.
179
+
180
+ Treat every request body, header, query value, uploaded file, URL, webhook, message, and database value as untrusted at the relevant boundary. Validate size, format, encoding, ownership, and authorization before processing.
181
+
182
+ ## 12. Validation and error handling
183
+
184
+ Use layered validation:
185
+
186
+ - transport validation for shape, required fields, limits, and parseability;
187
+ - application validation for use-case rules and authorization context;
188
+ - domain validation for invariants that must hold regardless of transport;
189
+ - persistence constraints for final integrity enforcement.
190
+
191
+ Return safe, actionable errors to callers and detailed structured diagnostics to authorized operators. Do not expose stack traces, SQL, tokens, connection strings, internal paths, or PII in public errors. Map exceptions deliberately; avoid catch-all handlers that convert cancellations or programmer errors into false success.
192
+
193
+ Use a consistent problem-details or repository-specific error contract. Test malformed input, boundary values, unauthorized/forbidden access, not-found behavior, conflict/concurrency behavior, dependency failure, cancellation, and serialization failure.
194
+
195
+ ## 13. Async, cancellation, and request context
196
+
197
+ Use asynchronous APIs for I/O and propagate `CancellationToken` from the request, message, or host lifetime to downstream operations. Do not block async code with `.Result`, `.Wait()`, or `GetAwaiter().GetResult()`. Do not use `async void` except framework-required event handlers.
198
+
199
+ Pass cancellation through EF Core, `HttpClient`, streams, channels, and external SDKs. Decide explicitly whether cancellation is expected control flow or an error to report. Do not swallow `OperationCanceledException` and claim work completed.
200
+
201
+ `HttpContext` is request-scoped and is not thread-safe. Read the required values during the request, copy immutable data into a command/value object, and do not retain `HttpContext`, `HttpRequest`, `HttpResponse`, scoped services, or request streams after the request. Do not access request context from fire-and-forget work.
202
+
203
+ ## 14. HttpClient and external services
204
+
205
+ Use the repository's configured `IHttpClientFactory`/typed or named clients for outbound HTTP. Configure base address, timeouts, headers, resilience, authentication, and diagnostics centrally. Avoid creating a new `HttpClient` per request and avoid an unbounded retry policy.
206
+
207
+ Set explicit cancellation and response-size/time budgets. Treat status codes, malformed payloads, timeouts, partial results, rate limits, and dependency unavailability as designed outcomes. Retry only idempotent or safely repeatable operations, with bounded backoff and observability.
208
+
209
+ Validate external URLs and redirect behavior at trust boundaries. Do not allow user-controlled URLs to reach privileged networks without an explicit SSRF-safe design. Never log authorization headers, cookies, bearer tokens, or sensitive payloads.
210
+
211
+ ## 15. EF Core, data access, and persistence
212
+
213
+ Inspect the provider, `DbContext` lifetime, migrations, conventions, interceptors, query filters, tenant behavior, and transaction ownership before changing data access.
214
+
215
+ - project only required columns for read paths;
216
+ - use `AsNoTracking` for read-only queries when identity tracking is not needed;
217
+ - avoid N+1 queries and unbounded `Include` graphs;
218
+ - paginate deterministically with a stable ordering and a bounded page size;
219
+ - keep database work cancellable and measure generated SQL when query shape changes;
220
+ - use parameterized queries and provider-supported APIs;
221
+ - enforce uniqueness, foreign keys, required fields, and concurrency at the database as well as in code;
222
+ - make migrations explicit, reviewed, ordered, and owned by the delivery process;
223
+ - do not silently create, delete, or rewrite production data.
224
+
225
+ Transactions should match a real consistency boundary. Define isolation, retry, idempotency, and failure behavior. Avoid holding a transaction across remote calls or user interaction. If the repository uses ABP unit of work, follow its established transaction boundary instead of adding an unrelated transaction abstraction.
226
+
227
+ ## 16. Transactions, units of work, and concurrency
228
+
229
+ For each mutation, identify the aggregate/business boundary, transaction owner, commit point, and post-commit effects. Handle optimistic concurrency explicitly and return a stable conflict result. Do not catch a concurrency exception and overwrite another writer without a product decision.
230
+
231
+ Outbox, inbox, idempotency keys, distributed locks, and compensating actions are architectural choices. Add them only when the actual consistency or delivery requirement justifies them, and test duplicate, retry, crash-before-commit, and crash-after-commit paths.
232
+
233
+ ## 17. Background services and workers
234
+
235
+ Use `BackgroundService`, hosted services, queues, or the repository's worker framework with a clear lifetime and shutdown contract. Create an explicit scope for scoped dependencies inside long-running work. Propagate `stoppingToken`, bound concurrency and queue growth, and handle poison messages.
236
+
237
+ Do not start untracked fire-and-forget tasks from a request. Record failures, expose health/readiness signals where appropriate, and make retries bounded and idempotent. Distinguish graceful cancellation from a failed job.
238
+
239
+ ## 18. Caching and state
240
+
241
+ Define cache ownership, key composition, tenant/user boundaries, expiration, invalidation, stampede behavior, and failure fallback before adding a cache. Never cache secrets or data across authorization boundaries. Include contract/version inputs in keys when serialized shapes can change.
242
+
243
+ Use output/response caching only when the response is safe for the cache scope. Do not cache personalized or authorization-sensitive responses publicly. Measure hit rate, memory cost, staleness, and invalidation behavior.
244
+
245
+ ## 19. Logging, metrics, tracing, and health
246
+
247
+ Use structured logs with stable event names and correlation/trace context. Log enough to diagnose the operation, but exclude secrets, tokens, passwords, full sensitive payloads, and unnecessary PII. Choose levels deliberately; a retry loop must not flood production logs.
248
+
249
+ For important paths, define useful counters, latency/error measurements, dependency spans, and health checks that reflect real readiness. Health endpoints must not leak internal configuration or become an expensive dependency fan-out. Preserve OpenTelemetry or repository-specific conventions.
250
+
251
+ ## 20. Serialization, streaming, and uploads
252
+
253
+ Treat serializer settings as public contract. Inspect naming, null/default handling, enum representation, polymorphism, reference handling, date/time, culture, and source-generation configuration before changing them.
254
+
255
+ For large responses, streams, downloads, and uploads:
256
+
257
+ - impose request, file, body, and decompression limits;
258
+ - stream rather than buffering unbounded content;
259
+ - validate content type and file signature where relevant;
260
+ - store outside the web root or in an appropriate object store;
261
+ - generate safe server-side names and prevent path traversal;
262
+ - scan or quarantine content according to the trust model;
263
+ - authorize every download and avoid leaking existence through error differences when sensitive.
264
+
265
+ ## 21. Performance and memory
266
+
267
+ Do not optimize by intuition alone. Establish a baseline, identify the bottleneck, make one bounded change, and compare equivalent measurements. Consider startup, throughput, p50/p95/p99 latency, allocations, GC, database duration, external calls, queue depth, and memory retention.
268
+
269
+ Avoid per-request allocations and serialization/database/network work that do not serve the contract. Bound collection sizes, concurrency, recursion, request bodies, regex complexity, cache size, and queue length. Avoid premature pooling or unsafe low-level code when a clear measurement does not justify it.
270
+
271
+ When performance is the requested risk or a critical path changes, activate the performance guide and preserve reproducible benchmark/load evidence. Mark unavailable production-scale evidence `NOT_VERIFIED`.
272
+
273
+ ## 22. Testing strategy
274
+
275
+ Choose tests from the changed risk:
276
+
277
+ - unit tests for pure domain and application rules;
278
+ - service tests with explicit fakes or test doubles at external boundaries;
279
+ - integration tests for routing, DI, serialization, authentication, persistence, migrations, and real provider behavior;
280
+ - contract tests for public APIs/events and compatibility;
281
+ - worker tests for cancellation, retries, duplicates, poison work, and shutdown;
282
+ - performance or load tests only when a measurable budget or bottleneck is in scope.
283
+
284
+ Every behavior change should have a focused regression. Include negative cases: malformed input, missing configuration, unauthorized and forbidden callers, dependency timeouts, cancellation, duplicate delivery, concurrency conflict, empty/large payloads, and partial failure. Do not weaken production validation to make tests convenient.
285
+
286
+ ## 23. WebApplicationFactory and integration boundaries
287
+
288
+ Use `WebApplicationFactory<TEntryPoint>`/`TestServer` or the repository's established host fixture for end-to-end application behavior. Keep test overrides explicit: database, authentication, clock, external clients, queues, and configuration.
289
+
290
+ Assert actual HTTP behavior, not only internal method calls: route selection, status, headers, content type, JSON shape, auth policy, antiforgery, problem details, database effects, and cancellation. Ensure test services are isolated and disposed. Avoid a test fixture that accidentally uses production credentials, external networks, or a developer's local database.
291
+
292
+ ## 24. Database and migration tests
293
+
294
+ Test schema/migration compatibility and representative queries against the provider that matters. If a faster substitute is used, document which provider-specific behavior it cannot prove. Verify indexes, constraints, transaction behavior, concurrency, query limits, and tenant/soft-delete filters where applicable.
295
+
296
+ Do not run destructive migration or data-reset commands against an unspecified environment. A successful `dotnet build` does not prove migrations apply or queries work.
297
+
298
+ ## 25. Razor, Blazor, and interactive UI
299
+
300
+ For Razor Pages, MVC views, Blazor Server, and Blazor WebAssembly:
301
+
302
+ - keep presentation components focused and preserve the existing render mode;
303
+ - validate and authorize on the server even when a client component hides controls;
304
+ - understand prerendering, interactive lifecycle, reconnection, circuit state, and client/server serialization;
305
+ - avoid blocking lifecycle methods and unbounded rendering work;
306
+ - handle loading, empty, error, offline, reconnecting, and permission states;
307
+ - preserve keyboard, focus, semantics, contrast, reduced motion, and responsive behavior;
308
+ - do not expose server-only configuration or secrets to WebAssembly.
309
+
310
+ Activate design and accessibility when the UI changes. Validate browser-visible behavior with the repository's available tools; do not claim visual or assistive-technology coverage when it was unavailable.
311
+
312
+ ## 26. ABP conditional overlay
313
+
314
+ Apply this overlay only when structural project evidence shows a `Volo.Abp.*` package reference in the selected .NET project. Do not introduce ABP conventions into a plain ASP.NET Core project.
315
+
316
+ Inspect the module dependency graph, `[DependsOn]` declarations, conventional registration, application services, authorization permissions, object mapping, repositories, data filters, tenants, distributed events, and unit-of-work attributes/conventions. Preserve module boundaries and initialization order.
317
+
318
+ Use ABP's established unit-of-work and repository behavior where the application already depends on it. Make transaction ownership, `SaveChanges`, domain events, and post-commit work explicit. Test permission checks, tenant isolation, data filters, validation, localization, serialization, and module startup. When changing a module, verify both the module itself and the host composition that consumes it.
319
+
320
+ ## 27. Legacy target frameworks
321
+
322
+ For .NET Framework or older .NET Core targets, first determine supported SDK, runtime, package, hosting, and deployment constraints. Do not silently modernize APIs, package versions, target frameworks, nullable settings, serializers, or hosting models. Prefer a compatible local fix and record a migration opportunity separately unless modernization is explicitly requested.
323
+
324
+ ## 28. Build, test, publish, and tooling
325
+
326
+ Use repository scripts and pinned SDK behavior first. Typical commands, only when available and authorized, include:
327
+
328
+ ```bash
329
+ dotnet --info
330
+ dotnet restore
331
+ dotnet build --no-restore
332
+ dotnet test --no-restore
333
+ dotnet format --verify-no-changes
334
+ dotnet publish --no-restore
335
+ ```
336
+
337
+ Select the exact solution/project and configuration. Do not imply that `build` proves tests, packaging, migrations, deployment, or runtime health. If restore, SDK selection, workload, analyzer, database, browser, or container prerequisites are unavailable, report the exact check as `NOT_VERIFIED` and retain the failure output.
338
+
339
+ Inspect generated files and build artifacts before committing them. Do not edit generated output instead of its source. Use package lock/central-management conventions already present. Review dependency changes for license, compatibility, transitive behavior, and supply-chain risk; activate the security guide when dependencies or publication are affected.
340
+
341
+ ## 29. Containers, deployment, and CI/CD
342
+
343
+ Inspect the actual Dockerfile, base image, build context, runtime user, ports, certificates, health checks, environment variables, startup command, and artifact provenance. Keep build and runtime images least-privileged and minimal without hiding diagnostics.
344
+
345
+ For deployment changes, verify configuration binding, secret injection, database migration ownership, readiness/liveness, graceful shutdown, forwarded headers, TLS, scaling, rollback, and compatibility with existing clients. A local publish is not a deployment. A green CI job is not proof of production health. Separate local verification, CI evidence, registry publication, deployment, and lifecycle completion in reporting.
346
+
347
+ ## 30. Troubleshooting
348
+
349
+ Diagnose from the first meaningful failure and the exact target:
350
+
351
+ - SDK/restore failures: inspect `global.json`, target framework, feeds, lock/central management, and available SDKs;
352
+ - registration failures: inspect module/host startup, lifetimes, and environment-specific branches;
353
+ - routing/binding failures: inspect endpoint order, metadata, constraints, model shape, and content type;
354
+ - auth failures: inspect scheme, issuer/audience, claims, policy, cookies, CORS, and clock;
355
+ - EF failures: inspect provider, generated SQL, context lifetime, migration state, transaction, and concurrency;
356
+ - production-only failures: compare environment/configuration/proxy/secret/telemetry differences without printing secrets;
357
+ - flaky async/worker tests: inspect cancellation, shared state, time, retries, disposal, and unbounded concurrency.
358
+
359
+ Do not repeat an unchanged command without new evidence. Keep workaround and root cause separate, and add a focused regression when the cause is understood.
360
+
361
+ ## 31. Definition of Done
362
+
363
+ A .NET/ASP.NET Core change is complete only when the applicable items are evidenced:
364
+
365
+ - the actual project, target framework, package graph, and scope were confirmed;
366
+ - architecture and public contracts were preserved or intentionally versioned;
367
+ - DI lifetimes, cancellation, error handling, and trust boundaries are explicit;
368
+ - input, output, auth, data, transaction, concurrency, and external-service behavior are tested;
369
+ - migration and deployment implications are understood;
370
+ - logs, metrics, traces, health, and sensitive-data handling are appropriate;
371
+ - focused tests and proportional build/test checks pass;
372
+ - unavailable checks are reported `NOT_VERIFIED`, not inferred as passing;
373
+ - documentation, changelog, and release evidence are updated when in scope;
374
+ - ForgeLoop evidence and lifecycle state are canonical and validator-backed.
375
+
376
+ ## 32. Deterministic routing evidence
377
+
378
+ The repository router selects this guide when the selected project evidence contains `dotnet` and the scope is `MATCH` or `UNSCOPED` for executable/code work. It may add ASP.NET Core and ABP overlays as reasons on the same `dotnet` specialist guide; these are not separate guide IDs.
379
+
380
+ Accepted structural primary evidence:
381
+
382
+ - `Microsoft.NET.Sdk`, `Microsoft.NET.Sdk.Web`, `Microsoft.NET.Sdk.Worker`, `Microsoft.NET.Sdk.Razor`, `Microsoft.NET.Sdk.BlazorWebAssembly`, `Aspire.AppHost.Sdk`, or `MSTest.Sdk` in an SDK-style project;
383
+ - the equivalent `<Sdk Name="..." />` form;
384
+ - ASP.NET Core confirmation from a supported web/Razor/Blazor SDK or `FrameworkReference Include="Microsoft.AspNetCore.App"`;
385
+ - ABP confirmation from a `PackageReference Include="Volo.Abp..."`.
386
+
387
+ The router must not activate this guide from prose, source snippets, `Dockerfile`, `*.deps.json`, `project.assets.json`, package-lock files, an arbitrary package name, or an unrelated nested project. Documentation-only and UI-copy work does not activate project specialist guides by project evidence alone.
388
+
389
+ Official references for version-sensitive work:
390
+
391
+ - [ASP.NET Core best practices](https://learn.microsoft.com/aspnet/core/fundamentals/best-practices)
392
+ - [.NET SDK overview](https://learn.microsoft.com/dotnet/core/sdk)
393
+ - [`global.json` overview](https://learn.microsoft.com/dotnet/core/tools/global-json)
394
+ - [Customize the build by folder](https://learn.microsoft.com/visualstudio/msbuild/customize-by-directory)
395
+ - [Central Package Management](https://learn.microsoft.com/nuget/consume-packages/central-package-management)
396
+ - [.NET and .NET Core support policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core)
397
+ - [ASP.NET Core documentation](https://learn.microsoft.com/aspnet/core/)
398
+ - [EF Core documentation](https://learn.microsoft.com/ef/core/)
399
+ - [ABP documentation](https://abp.io/docs/latest)
400
+ - [ABP modularity](https://abp.io/docs/latest/framework/architecture/modularity/basics)
401
+ - [ABP unit of work](https://abp.io/docs/latest/framework/architecture/domain-driven-design/unit-of-work)
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: go-development-eng
3
+ language: en
4
+ description: "Specialist guidance for production Go services, workers, CLIs, modules, and concurrent systems."
5
+ version: "2026.09"
6
+ last-reviewed: "2026-09-12"
7
+ guide-id: go
8
+ requires-gates:
9
+ - threat-boundary
10
+ completion-evidence:
11
+ - go-validation
12
+ ---
13
+
14
+ # Go Development Engineering Guide
15
+
16
+ ## Mission and activation
17
+
18
+ Use this guide for confirmed Go modules and workspaces, services, workers,
19
+ libraries, CLIs, and concurrent systems. ForgeLoop recognizes a valid bounded
20
+ `go.mod`, or a `go.work` that connects to already discovered repository-local
21
+ modules. `.go` source, `go.sum`, vendor metadata, a Docker image, a README, a
22
+ toolchain name, or a `setup-go` CI step alone is insufficient.
23
+
24
+ Detection parses structure only. It does not invoke `go`, resolve/download
25
+ modules, evaluate build tags, run generators, or execute project code. Go
26
+ workspace and path metadata never trigger new filesystem traversal.
27
+
28
+ ## Authority and precedence
29
+
30
+ Repository module boundaries, supported Go versions, build tags, target
31
+ matrix, compatibility policy, and release process win over generic advice.
32
+ Use the matching Go specification, standard-library documentation, module and
33
+ workspace documentation, and official Go security guidance after repository
34
+ evidence. The 2026-09 plan snapshot uses Go 1.27/1.27.1 as a current reference;
35
+ that is not permission to upgrade a repository.
36
+
37
+ Keep the `go` language minimum directive distinct from `toolchain`, the build
38
+ tool's Go version, the release binary's runtime expectations, and the target
39
+ OS/architecture. A newer local toolchain does not change the supported module.
40
+
41
+ ## Modules and workspaces
42
+
43
+ Keep `module`, `go`, `toolchain`, `require`, `replace`, `exclude`, `retract`,
44
+ `godebug`, `ignore`, and `use` semantics distinct. The bounded `go.mod`
45
+ recognizer accepts valid single and block `ignore` directives as module
46
+ metadata; they do not establish a module by themselves. `go.work` membership
47
+ is accepted only when `use` paths resolve to known discovered local `go.mod`
48
+ files, and `ignore` is not a workspace directive. `replace` and dependency
49
+ metadata are context; ForgeLoop does not perform registry, VCS, version, or
50
+ feature resolution. Preserve nested modules and independent workspace
51
+ ownership in monorepos.
52
+
53
+ ## Architecture and language semantics
54
+
55
+ Make package ownership, interfaces, zero values, pointer/value choices,
56
+ generics, methods, error wrapping, `panic`/`recover`, `defer`, and resource
57
+ cleanup explicit. Use `errors.Is`/`errors.As` for wrapped errors rather than
58
+ comparing error strings. Keep transport, domain, storage, messaging, and
59
+ subprocess adapters separate where the repository does.
60
+
61
+ Specify goroutine ownership, cancellation, channel direction and closure,
62
+ bounded worker pools, back pressure, lock ordering, atomics, race behavior,
63
+ deadlines, and graceful shutdown. Avoid goroutine leaks, unbounded creation,
64
+ copying synchronization primitives, deadlocks, and ambiguous channel owners.
65
+
66
+ ## I/O, security, and performance
67
+
68
+ Bound request, file, decoding, compression, subprocess, queue, and database
69
+ resources. Treat network input, decoded data, module content, subprocess
70
+ output, environment values, and credentials as hostile. Validate before SQL,
71
+ filesystem, templates, deserialization, shell, or external-service calls.
72
+
73
+ Measure allocation, latency, throughput, queueing, startup, and memory before
74
+ optimizing. Review maps/slices and backing-array retention, pointer lifetimes,
75
+ HTTP timeouts, `net/http` shutdown, `database/sql` pool/transaction policy,
76
+ encoding, and cross-compilation/cgo assumptions.
77
+
78
+ ## Dependencies and build policy
79
+
80
+ Keep `go.mod`, `go.sum`, vendoring, build tags, cgo flags, generated code,
81
+ licenses, and reproducible build commands under review. Do not treat a module
82
+ download, `go generate`, or a generator's output as routing authority. Keep
83
+ public APIs, error behavior, module compatibility, and toolchain policy
84
+ intentional.
85
+
86
+ ## Verification and Definition of Done
87
+
88
+ Run focused package tests, table tests, fuzzing, benchmarks, `go vet`, the race
89
+ detector, and `govulncheck` where applicable, followed by repository checks.
90
+ Record exact Go version, module/workspace scope, tags, target, and commands.
91
+ Race-detector or fuzz success covers only exercised paths. Missing tools are
92
+ `NOT_VERIFIED`. ForgeLoop performs bounded structural Go topology analysis, not
93
+ complete module resolution, version solving, build-tag evaluation, or build
94
+ execution.
95
+
96
+ ## Official sources
97
+
98
+ - [Go language specification](https://go.dev/ref/spec)
99
+ - [Go release history](https://go.dev/doc/devel/release)
100
+ - [Go modules reference](https://go.dev/ref/mod)
101
+ - [Go workspaces](https://go.dev/doc/tutorial/workspaces)
102
+ - [Go standard library](https://pkg.go.dev/std)
103
+ - [Go security policy and tooling](https://go.dev/security/)
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: java-development-eng
3
+ language: en
4
+ description: "Specialist guidance for production Java services, libraries, workers, and JVM build systems."
5
+ version: "2026.09"
6
+ last-reviewed: "2026-09-12"
7
+ guide-id: java
8
+ requires-gates:
9
+ - threat-boundary
10
+ completion-evidence:
11
+ - java-validation
12
+ ---
13
+
14
+ # Java Development Engineering Guide
15
+
16
+ ## Mission and activation
17
+
18
+ Use this guide for Java services, libraries, workers, command-line tools, and
19
+ JVM components. ForgeLoop uses owned `.java` source with structural Maven,
20
+ Gradle, or Bazel evidence, an unambiguous Java compiler/platform declaration,
21
+ or a direct `.java` claim. A `pom.xml`, Gradle wrapper/settings file, JDK
22
+ image, generic aggregator, dependency lock, plugin name, or `setup-java` CI
23
+ step alone is not a delivered Java project.
24
+
25
+ Detection is bounded and static. Maven, Gradle, Bazel, wrappers, plugins,
26
+ annotation processors, tests, Java code, and network resolution are never
27
+ executed. XML DTDs and external entities fail closed.
28
+
29
+ Gradle `settings.gradle` and `settings.gradle.kts` files contribute topology
30
+ only when top-level, unconditional, quoted `include` arguments connect to
31
+ already discovered Gradle builds. Conditional, interpolated, and dynamic
32
+ expressions remain unresolved. `java-gradle-plugin` is Java evidence because
33
+ it applies Gradle's Java Library plugin. `gradle.properties` is a shared
34
+ configuration surface, not an independent Java project; claims are scoped to
35
+ Gradle builds in its directory while nested independent Gradle settings
36
+ boundaries remain isolated.
37
+
38
+ ## Authority and precedence
39
+
40
+ Repository architecture, toolchain/build configuration, source/target policy,
41
+ ABI, and supported runtime win over generic advice. Then use the matching Java
42
+ Language Specification/API, official Maven/Gradle/Bazel documentation, and
43
+ version-matched framework documentation. The 2026-09 plan snapshot identifies
44
+ JDK 26 as the current Java SE release and JDK 25 as the latest Oracle LTS;
45
+ neither is an automatic migration target.
46
+
47
+ Keep separate the JDK running the build tool, Java source level, `--release`,
48
+ bytecode target, compiler toolchain, runtime JRE/JDK, framework minimum,
49
+ vendor distribution, preview features, and target platform.
50
+
51
+ ## Project and build discovery
52
+
53
+ `pom.xml` is parsed structurally. Owned Java source, compiler properties such
54
+ as `maven.compiler.release`/`source`/`target`, or the compiler plugin can
55
+ confirm Java. A `packaging` value of `pom` with modules is retained as
56
+ aggregator/topology context; the aggregator itself is not classified as a Java
57
+ application without Java evidence. A recognized Gradle `java`,
58
+ `java-library`, `java-platform`, `java-gradle-plugin`, `application`, or `war`
59
+ plugin is static Java build evidence. `java-platform` is intentionally
60
+ source-less Java ecosystem evidence. Literal Bazel `java_library`,
61
+ `java_binary`, `java_test`, `java_import`, and `java_plugin` rules are
62
+ supported. Generic wrappers, settings, and dependency metadata alone remain
63
+ insufficient.
64
+
65
+ Resolve only bounded, owned metadata. Do not run convention plugins, evaluate
66
+ profiles, follow arbitrary build logic, or recreate the dependency resolver.
67
+
68
+ ## Architecture and language semantics
69
+
70
+ Keep transport, application, domain, persistence, messaging, and platform
71
+ adapters separate where the repository does. Make thread safety, ownership,
72
+ cancellation, timeouts, resource closure, class loading, reflection, and
73
+ serialization boundaries explicit. Review nullability, generics, variance,
74
+ records, sealed types, pattern matching, immutability, equality/hash contracts,
75
+ exception causes, class initialization, and API/binary compatibility.
76
+
77
+ Use a deliberate error model: preserve causes, distinguish retryable from
78
+ terminal failures, and avoid exposing credentials, SQL, stack traces, or
79
+ internal paths. Do not make checked/unchecked exception changes incidental.
80
+
81
+ ## Concurrency, I/O, and security
82
+
83
+ Specify executor ownership, bounded queues, interruption, cancellation,
84
+ deadlines, back pressure, lock ordering, atomics, and shutdown. Avoid blocking
85
+ unknown work on shared pools. Bound request, file, decompression, serialization,
86
+ and database resources. Validate input before reflection, templates, SQL,
87
+ filesystem, process, deserialization, or network use; keep secrets out of
88
+ logs and error responses.
89
+
90
+ ## Performance and portability
91
+
92
+ Measure allocation, garbage collection, startup, heap, thread, queue, I/O,
93
+ latency, and throughput changes with representative profiles or benchmarks.
94
+ Keep locale, charset, timezone, filesystem, native library, container, CPU, and
95
+ JVM assumptions explicit. Do not use a newer JDK's availability to silently
96
+ change source, bytecode, or runtime requirements.
97
+
98
+ ## Dependencies, frameworks, and interop
99
+
100
+ Keep Maven/Gradle/Bazel files, lock/dependency policy, generated sources, and
101
+ reproducible build metadata under review. Spring, Quarkus, Micronaut, Jakarta,
102
+ Kotlin, SQL, JNI, and deployment platforms are contextual overlays, not public
103
+ ForgeLoop framework IDs. At JNI/FFI boundaries specify ownership, layout,
104
+ encoding, exceptions, thread attachment, and lifetime. Treat generated and
105
+ vendored code as dependency boundaries.
106
+
107
+ ## Verification and Definition of Done
108
+
109
+ Run focused module compilation, unit/integration tests, static analysis,
110
+ dependency/security checks, and packaging for the exact JDK, profile, module,
111
+ and target. Check cancellation, timeout, malformed input, resource cleanup,
112
+ compatibility, and observability. Record unavailable tools as `NOT_VERIFIED`.
113
+ ForgeLoop performs bounded structural JVM project analysis, not complete
114
+ Maven/Gradle/Bazel resolution, profile evaluation, dependency solving, or build
115
+ execution.
116
+
117
+ ## Official sources
118
+
119
+ - [Java SE and JDK documentation](https://docs.oracle.com/en/java/)
120
+ - [Java Language Specification](https://docs.oracle.com/javase/specs/)
121
+ - [Maven POM reference](https://maven.apache.org/pom.html)
122
+ - [Maven compiler plugin](https://maven.apache.org/plugins/maven-compiler-plugin/)
123
+ - [Gradle Java plugin](https://docs.gradle.org/current/userguide/java_plugin.html)
124
+ - [Gradle Java Platform plugin](https://docs.gradle.org/current/userguide/java_platform_plugin.html)
125
+ - [Bazel Java rules](https://bazel.build/reference/be/java)