@mofaggolhoshen/dev-assist-mcp 1.0.4 → 1.0.6
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.
- package/AGENTS.md +72 -0
- package/README.md +204 -52
- package/content/concepts/circuit-breaker.md +25 -0
- package/content/setups/jwt-dotnet9.md +18 -0
- package/content/setups/jwt.md +25 -0
- package/content/templates/clean-architecture.md +25 -0
- package/dist/content/snippetSchema.js +39 -0
- package/dist/index.js +8 -0
- package/dist/schemas/markdownKnowledge.js +30 -0
- package/dist/shared/response.js +12 -0
- package/dist/storage/markdownKnowledgeStore.js +267 -0
- package/dist/tools/knowledge/explainConcept.js +46 -0
- package/dist/tools/knowledge/generateSetup.js +46 -0
- package/dist/tools/knowledge/getSnippet.js +52 -39
- package/dist/tools/knowledge/getTemplate.js +46 -0
- package/dist/tools/knowledge/index.js +4 -0
- package/dist/tools/knowledge/searchSnippet.js +56 -0
- package/examples/basic-search/README.md +13 -0
- package/examples/claude-desktop/README.md +10 -0
- package/examples/claude-desktop/claude_desktop_config.json +8 -0
- package/examples/cursor/README.md +15 -0
- package/examples/explain-mode/expected-response.md +16 -0
- package/examples/jwt-setup/expected-response.json +16 -0
- package/examples/polly-retry/expected-response.json +14 -0
- package/package.json +17 -2
- package/scripts/.gitkeep +0 -0
- package/snippets/architecture/.gitkeep +0 -0
- package/snippets/architecture/clean-architecture-api.md +25 -0
- package/snippets/architecture/cqrs-starter.md +25 -0
- package/snippets/architecture/ddd-aggregate.md +25 -0
- package/snippets/architecture/efcore-repository.md +39 -0
- package/snippets/auth/.gitkeep +0 -0
- package/snippets/auth/jwe-setup.md +28 -0
- package/snippets/auth/jwt-setup-dotnet9.md +27 -0
- package/snippets/auth/jwt-setup.md +44 -0
- package/snippets/auth/refresh-token-rotation.md +27 -0
- package/snippets/auth/role-based-authorization.md +28 -0
- package/snippets/caching/.gitkeep +0 -0
- package/snippets/caching/cache-aside-pattern.md +25 -0
- package/snippets/caching/redis-distributed-cache.md +25 -0
- package/snippets/logging/.gitkeep +0 -0
- package/snippets/logging/opentelemetry-tracing.md +25 -0
- package/snippets/logging/serilog-bootstrap.md +25 -0
- package/snippets/logging/structured-logging-guidelines.md +27 -0
- package/snippets/messaging/.gitkeep +0 -0
- package/snippets/messaging/masstransit-rabbitmq.md +25 -0
- package/snippets/messaging/outbox-pattern.md +25 -0
- package/snippets/messaging/saga-state-machine.md +25 -0
- package/snippets/resilience/.gitkeep +0 -0
- package/snippets/resilience/bulkhead-isolation.md +25 -0
- package/snippets/resilience/circuit-breaker-polly.md +25 -0
- package/snippets/resilience/fallback-policy-polly.md +25 -0
- package/snippets/resilience/polly-retry.md +31 -0
- package/snippets/resilience/timeout-policy-polly.md +25 -0
- package/snippets/efcore-repository.json +0 -7
- package/snippets/jwt-setup.json +0 -7
- package/snippets/polly-retry.json +0 -7
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: timeout-policy-polly
|
|
3
|
+
title: Polly Timeout Policy
|
|
4
|
+
summary: Bound request duration to protect thread and connection pools.
|
|
5
|
+
framework: aspnet
|
|
6
|
+
version: .net8+
|
|
7
|
+
language: csharp
|
|
8
|
+
category: resilience
|
|
9
|
+
tags:
|
|
10
|
+
- polly
|
|
11
|
+
- timeout
|
|
12
|
+
- resilience
|
|
13
|
+
difficulty: beginner
|
|
14
|
+
bestPractices:
|
|
15
|
+
- Use per-operation timeout values from performance baselines
|
|
16
|
+
- Distinguish client timeout from server deadline
|
|
17
|
+
pitfalls:
|
|
18
|
+
- Timeouts that are too short cause self-induced failures
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Implementation
|
|
22
|
+
|
|
23
|
+
```csharp
|
|
24
|
+
// AddTimeoutPolicy(...) with operation-specific thresholds.
|
|
25
|
+
```
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "efcore-repository",
|
|
3
|
-
"title": "EF Core Repository Pattern",
|
|
4
|
-
"language": "csharp",
|
|
5
|
-
"description": "Simple EF Core repository with asynchronous read/write operations.",
|
|
6
|
-
"code": "public sealed class ProductRepository(AppDbContext db)\n{\n public Task<Product?> GetByIdAsync(Guid id, CancellationToken ct = default) =>\n db.Products.FirstOrDefaultAsync(p => p.Id == id, ct);\n\n public async Task AddAsync(Product entity, CancellationToken ct = default)\n {\n await db.Products.AddAsync(entity, ct);\n await db.SaveChangesAsync(ct);\n }\n}"
|
|
7
|
-
}
|
package/snippets/jwt-setup.json
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jwt-setup",
|
|
3
|
-
"title": "JWT Authentication Setup (ASP.NET Core)",
|
|
4
|
-
"language": "csharp",
|
|
5
|
-
"description": "Configures JWT bearer authentication with token validation parameters.",
|
|
6
|
-
"code": "builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)\n .AddJwtBearer(options =>\n {\n options.TokenValidationParameters = new TokenValidationParameters\n {\n ValidateIssuer = true,\n ValidateAudience = true,\n ValidateIssuerSigningKey = true,\n ValidIssuer = config[\"Jwt:Issuer\"],\n ValidAudience = config[\"Jwt:Audience\"],\n IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(config[\"Jwt:Key\"]!))\n };\n });"
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "polly-retry",
|
|
3
|
-
"title": "Polly Retry Policy (.NET)",
|
|
4
|
-
"language": "csharp",
|
|
5
|
-
"description": "Configures an HTTP retry policy with exponential backoff using Polly.",
|
|
6
|
-
"code": "builder.Services.AddHttpClient(\"MyClient\")\n .AddTransientHttpErrorPolicy(p =>\n p.WaitAndRetryAsync(3, attempt => TimeSpan.FromSeconds(Math.Pow(2, attempt))));"
|
|
7
|
-
}
|