antigravity-devkit 1.0.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.
- package/LICENSE +21 -0
- package/README.md +421 -0
- package/bin/cli.js +179 -0
- package/package.json +38 -0
- package/template/ARCHITECTURE.md +148 -0
- package/template/README.md +421 -0
- package/template/agents/backend-specialist.md +137 -0
- package/template/agents/database-architect.md +114 -0
- package/template/agents/debugger.md +108 -0
- package/template/agents/devops-engineer.md +125 -0
- package/template/agents/documentation-writer.md +109 -0
- package/template/agents/explorer-agent.md +107 -0
- package/template/agents/frontend-specialist.md +231 -0
- package/template/agents/orchestrator.md +100 -0
- package/template/agents/performance-optimizer.md +109 -0
- package/template/agents/project-planner.md +123 -0
- package/template/agents/security-auditor.md +107 -0
- package/template/agents/test-engineer.md +133 -0
- package/template/rules/GEMINI.md +180 -0
- package/template/scripts/checklist.py +170 -0
- package/template/scripts/verify_all.py +243 -0
- package/template/skills/api-patterns/SKILL.md +116 -0
- package/template/skills/architecture/SKILL.md +98 -0
- package/template/skills/aspnet-patterns/SKILL.md +120 -0
- package/template/skills/azure-aks/SKILL.md +136 -0
- package/template/skills/azure-devops/SKILL.md +123 -0
- package/template/skills/azure-keyvault/SKILL.md +100 -0
- package/template/skills/brainstorming/SKILL.md +96 -0
- package/template/skills/clean-code/SKILL.md +84 -0
- package/template/skills/csharp-patterns/SKILL.md +115 -0
- package/template/skills/documentation-templates/SKILL.md +127 -0
- package/template/skills/english-education/SKILL.md +116 -0
- package/template/skills/english-education/references/lesson-templates.md +151 -0
- package/template/skills/english-education/references/quiz-templates.md +177 -0
- package/template/skills/english-education/scripts/curriculum_validator.py +175 -0
- package/template/skills/frontend-design/SKILL.md +199 -0
- package/template/skills/frontend-design/animation-guide.md +217 -0
- package/template/skills/frontend-design/design-systems.md +230 -0
- package/template/skills/frontend-design/ux-psychology.md +128 -0
- package/template/skills/gitops-patterns/SKILL.md +105 -0
- package/template/skills/grafana-logging/SKILL.md +107 -0
- package/template/skills/intelligent-routing/SKILL.md +75 -0
- package/template/skills/plan-writing/SKILL.md +96 -0
- package/template/skills/sqlserver-design/SKILL.md +97 -0
- package/template/skills/systematic-debugging/SKILL.md +98 -0
- package/template/skills/testing-patterns/SKILL.md +102 -0
- package/template/skills/vitest-testing/SKILL.md +116 -0
- package/template/skills/vue3-patterns/SKILL.md +195 -0
- package/template/skills/vulnerability-scanner/SKILL.md +104 -0
- package/template/skills/xunit-testing/SKILL.md +127 -0
- package/template/workflows/brainstorm.md +69 -0
- package/template/workflows/code.md +82 -0
- package/template/workflows/create.md +79 -0
- package/template/workflows/debug.md +83 -0
- package/template/workflows/deploy.md +101 -0
- package/template/workflows/orchestrate.md +86 -0
- package/template/workflows/plan.md +79 -0
- package/template/workflows/review.md +85 -0
- package/template/workflows/status.md +90 -0
- package/template/workflows/test.md +89 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: azure-devops
|
|
3
|
+
description: Azure DevOps CI/CD pipelines and YAML configuration
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Azure DevOps
|
|
7
|
+
|
|
8
|
+
> CI/CD pipelines with YAML configuration.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Pipeline Structure
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
trigger:
|
|
16
|
+
- main
|
|
17
|
+
- develop
|
|
18
|
+
|
|
19
|
+
pool:
|
|
20
|
+
vmImage: 'ubuntu-latest'
|
|
21
|
+
|
|
22
|
+
variables:
|
|
23
|
+
buildConfiguration: 'Release'
|
|
24
|
+
|
|
25
|
+
stages:
|
|
26
|
+
- stage: Build
|
|
27
|
+
- stage: Test
|
|
28
|
+
- stage: Deploy
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Build Stage
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
- stage: Build
|
|
37
|
+
jobs:
|
|
38
|
+
- job: BuildJob
|
|
39
|
+
steps:
|
|
40
|
+
- task: UseDotNet@2
|
|
41
|
+
inputs:
|
|
42
|
+
version: '8.x'
|
|
43
|
+
|
|
44
|
+
- task: DotNetCoreCLI@2
|
|
45
|
+
displayName: 'Restore'
|
|
46
|
+
inputs:
|
|
47
|
+
command: 'restore'
|
|
48
|
+
|
|
49
|
+
- task: DotNetCoreCLI@2
|
|
50
|
+
displayName: 'Build'
|
|
51
|
+
inputs:
|
|
52
|
+
command: 'build'
|
|
53
|
+
arguments: '--configuration $(buildConfiguration)'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Test Stage
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
- stage: Test
|
|
62
|
+
dependsOn: Build
|
|
63
|
+
jobs:
|
|
64
|
+
- job: TestJob
|
|
65
|
+
steps:
|
|
66
|
+
- task: DotNetCoreCLI@2
|
|
67
|
+
displayName: 'Test'
|
|
68
|
+
inputs:
|
|
69
|
+
command: 'test'
|
|
70
|
+
arguments: '--collect:"XPlat Code Coverage"'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Deploy Stage
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- stage: Deploy
|
|
79
|
+
dependsOn: Test
|
|
80
|
+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
|
|
81
|
+
jobs:
|
|
82
|
+
- deployment: DeployJob
|
|
83
|
+
environment: 'production'
|
|
84
|
+
strategy:
|
|
85
|
+
runOnce:
|
|
86
|
+
deploy:
|
|
87
|
+
steps:
|
|
88
|
+
- task: AzureWebApp@1
|
|
89
|
+
inputs:
|
|
90
|
+
appName: 'my-app'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## KeyVault Integration
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- task: AzureKeyVault@2
|
|
99
|
+
inputs:
|
|
100
|
+
azureSubscription: 'MySubscription'
|
|
101
|
+
KeyVaultName: 'MyKeyVault'
|
|
102
|
+
SecretsFilter: '*'
|
|
103
|
+
RunAsPreJob: true
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Approval Gates
|
|
109
|
+
|
|
110
|
+
Configure in Azure DevOps UI:
|
|
111
|
+
1. Environments → Production
|
|
112
|
+
2. Approvals and checks
|
|
113
|
+
3. Add approvers
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## DO / DON'T
|
|
118
|
+
|
|
119
|
+
| ✅ Do | ❌ Don't |
|
|
120
|
+
|-------|---------|
|
|
121
|
+
| YAML pipelines | Classic editor |
|
|
122
|
+
| Environment approvals | Auto-deploy to prod |
|
|
123
|
+
| KeyVault for secrets | Variable secrets |
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: azure-keyvault
|
|
3
|
+
description: Azure KeyVault secrets management
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Azure KeyVault
|
|
7
|
+
|
|
8
|
+
> Secure secrets management for Azure applications.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ASP.NET Core Integration
|
|
13
|
+
|
|
14
|
+
```csharp
|
|
15
|
+
// Program.cs
|
|
16
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
17
|
+
|
|
18
|
+
// Add KeyVault
|
|
19
|
+
var keyVaultName = builder.Configuration["KeyVaultName"];
|
|
20
|
+
var keyVaultUri = new Uri($"https://{keyVaultName}.vault.azure.net/");
|
|
21
|
+
|
|
22
|
+
builder.Configuration.AddAzureKeyVault(
|
|
23
|
+
keyVaultUri,
|
|
24
|
+
new DefaultAzureCredential());
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Required Package
|
|
30
|
+
|
|
31
|
+
```xml
|
|
32
|
+
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.*" />
|
|
33
|
+
<PackageReference Include="Azure.Identity" Version="1.*" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Secret Naming
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
KeyVault: ConnectionStrings--DefaultConnection
|
|
42
|
+
Config: ConnectionStrings:DefaultConnection
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Use `--` in KeyVault, maps to `:` in configuration.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Access Configuration
|
|
50
|
+
|
|
51
|
+
```csharp
|
|
52
|
+
// Access secret like any config
|
|
53
|
+
var connectionString = builder.Configuration["ConnectionStrings:DefaultConnection"];
|
|
54
|
+
var apiKey = builder.Configuration["ExternalApi:Key"];
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Managed Identity
|
|
60
|
+
|
|
61
|
+
For Azure-hosted apps (AKS, App Service):
|
|
62
|
+
|
|
63
|
+
1. Enable Managed Identity on the resource
|
|
64
|
+
2. Grant KeyVault access policy to the identity
|
|
65
|
+
3. Use `DefaultAzureCredential()` - auto-detects
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Local Development
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
// appsettings.Development.json
|
|
73
|
+
{
|
|
74
|
+
"KeyVaultName": "my-keyvault-dev"
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use Azure CLI login: `az login`
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Pipeline Integration
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
- task: AzureKeyVault@2
|
|
86
|
+
inputs:
|
|
87
|
+
azureSubscription: 'MySubscription'
|
|
88
|
+
KeyVaultName: 'my-keyvault'
|
|
89
|
+
SecretsFilter: 'ConnectionString,ApiKey'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## DO / DON'T
|
|
95
|
+
|
|
96
|
+
| ✅ Do | ❌ Don't |
|
|
97
|
+
|-------|---------|
|
|
98
|
+
| KeyVault for secrets | appsettings.json secrets |
|
|
99
|
+
| Managed Identity | Service Principal keys |
|
|
100
|
+
| Secret rotation | Static secrets forever |
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: Socratic discovery and requirement clarification
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorming
|
|
7
|
+
|
|
8
|
+
> Clarify requirements before implementation.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Socratic Method
|
|
13
|
+
|
|
14
|
+
**Ask questions to uncover hidden requirements.**
|
|
15
|
+
|
|
16
|
+
| Question Type | Purpose |
|
|
17
|
+
|---------------|---------|
|
|
18
|
+
| Clarifying | What exactly do you mean? |
|
|
19
|
+
| Probing | Why is this important? |
|
|
20
|
+
| Challenging | What if we did X instead? |
|
|
21
|
+
| Boundary | What's out of scope? |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Discovery Questions
|
|
26
|
+
|
|
27
|
+
### Scope
|
|
28
|
+
- What problem are we solving?
|
|
29
|
+
- Who are the users?
|
|
30
|
+
- What's the expected outcome?
|
|
31
|
+
|
|
32
|
+
### Technical
|
|
33
|
+
- What systems are involved?
|
|
34
|
+
- Any existing constraints?
|
|
35
|
+
- Performance requirements?
|
|
36
|
+
|
|
37
|
+
### Timeline
|
|
38
|
+
- What's the deadline?
|
|
39
|
+
- MVP or full feature?
|
|
40
|
+
- Can we iterate?
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Question Flow
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
1. Understand the GOAL
|
|
48
|
+
└─ "What should users be able to do?"
|
|
49
|
+
|
|
50
|
+
2. Identify USERS
|
|
51
|
+
└─ "Who will use this?"
|
|
52
|
+
|
|
53
|
+
3. Define SCOPE
|
|
54
|
+
└─ "What's in/out of scope?"
|
|
55
|
+
|
|
56
|
+
4. Explore CONSTRAINTS
|
|
57
|
+
└─ "Any technical limitations?"
|
|
58
|
+
|
|
59
|
+
5. Clarify PRIORITIES
|
|
60
|
+
└─ "What's most important?"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Response Format
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
🤔 **Before we proceed, let me clarify:**
|
|
69
|
+
|
|
70
|
+
1. [Clarifying question 1]
|
|
71
|
+
2. [Clarifying question 2]
|
|
72
|
+
3. [Clarifying question 3]
|
|
73
|
+
|
|
74
|
+
Please answer these so I can create the best solution.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## When to Brainstorm
|
|
80
|
+
|
|
81
|
+
| ✅ Brainstorm | ❌ Skip |
|
|
82
|
+
|---------------|---------|
|
|
83
|
+
| Vague requests | Clear specifications |
|
|
84
|
+
| New features | Bug fixes |
|
|
85
|
+
| Complex tasks | Simple changes |
|
|
86
|
+
| Multi-domain | Single file edit |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## DO / DON'T
|
|
91
|
+
|
|
92
|
+
| ✅ Do | ❌ Don't |
|
|
93
|
+
|-------|---------|
|
|
94
|
+
| Ask before assuming | Guess requirements |
|
|
95
|
+
| Minimum 3 questions | Skip discovery |
|
|
96
|
+
| Wait for answers | Start coding |
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Pragmatic coding standards - concise, direct, no over-engineering
|
|
4
|
+
priority: CRITICAL
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Clean Code Standards
|
|
8
|
+
|
|
9
|
+
> Be **concise, direct, and solution-focused**.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Core Principles
|
|
14
|
+
|
|
15
|
+
| Principle | Rule |
|
|
16
|
+
|-----------|------|
|
|
17
|
+
| SRP | Single Responsibility - one thing per function/class |
|
|
18
|
+
| DRY | Don't Repeat Yourself |
|
|
19
|
+
| KISS | Keep It Simple |
|
|
20
|
+
| YAGNI | You Aren't Gonna Need It |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Naming
|
|
25
|
+
|
|
26
|
+
| Element | Convention | Example |
|
|
27
|
+
|---------|------------|---------|
|
|
28
|
+
| Variables | Reveal intent | `userCount` not `n` |
|
|
29
|
+
| Functions | Verb + noun | `getUserById()` |
|
|
30
|
+
| Booleans | Question form | `isActive`, `hasPermission` |
|
|
31
|
+
| Constants | SCREAMING_SNAKE | `MAX_RETRY_COUNT` |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Functions
|
|
36
|
+
|
|
37
|
+
| Rule | Guideline |
|
|
38
|
+
|------|-----------|
|
|
39
|
+
| Small | Max 20 lines |
|
|
40
|
+
| One Thing | Single purpose |
|
|
41
|
+
| Few Args | Max 3 parameters |
|
|
42
|
+
| No Side Effects | Don't mutate inputs |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Code Structure
|
|
47
|
+
|
|
48
|
+
| Pattern | Apply |
|
|
49
|
+
|---------|-------|
|
|
50
|
+
| Guard Clauses | Early returns |
|
|
51
|
+
| Flat > Nested | Max 2 levels |
|
|
52
|
+
| Composition | Small functions together |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Anti-Patterns
|
|
57
|
+
|
|
58
|
+
| ❌ Don't | ✅ Do |
|
|
59
|
+
|----------|-------|
|
|
60
|
+
| Comment every line | Self-documenting names |
|
|
61
|
+
| Helper for one-liner | Inline the code |
|
|
62
|
+
| Factory for 2 objects | Direct instantiation |
|
|
63
|
+
| Deep nesting | Guard clauses |
|
|
64
|
+
| Magic numbers | Named constants |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Before Editing
|
|
69
|
+
|
|
70
|
+
| Question | Why |
|
|
71
|
+
|----------|-----|
|
|
72
|
+
| What imports this file? | They might break |
|
|
73
|
+
| What tests cover this? | Tests might fail |
|
|
74
|
+
| Is this shared? | Multiple places affected |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Self-Check
|
|
79
|
+
|
|
80
|
+
| Check | Question |
|
|
81
|
+
|-------|----------|
|
|
82
|
+
| ✅ Goal met? | Did exactly what was asked? |
|
|
83
|
+
| ✅ Code works? | Verified the change? |
|
|
84
|
+
| ✅ No errors? | Lint and types pass? |
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: csharp-patterns
|
|
3
|
+
description: Modern C# best practices and patterns
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# C# Patterns
|
|
7
|
+
|
|
8
|
+
> Modern C# with async/await, nullable, and clean patterns.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Async/Await
|
|
13
|
+
|
|
14
|
+
```csharp
|
|
15
|
+
// ✅ Correct
|
|
16
|
+
public async Task<User> GetUserAsync(int id)
|
|
17
|
+
{
|
|
18
|
+
return await _repository.GetByIdAsync(id);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ❌ Wrong - blocking
|
|
22
|
+
public User GetUser(int id)
|
|
23
|
+
{
|
|
24
|
+
return _repository.GetByIdAsync(id).Result;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Nullable Reference Types
|
|
31
|
+
|
|
32
|
+
```csharp
|
|
33
|
+
// Enable in .csproj
|
|
34
|
+
<Nullable>enable</Nullable>
|
|
35
|
+
|
|
36
|
+
// Usage
|
|
37
|
+
public User? GetUser(int id) // Can be null
|
|
38
|
+
public User GetRequiredUser(int id) // Never null
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Records
|
|
44
|
+
|
|
45
|
+
```csharp
|
|
46
|
+
// Immutable data objects
|
|
47
|
+
public record UserDto(int Id, string Name, string Email);
|
|
48
|
+
|
|
49
|
+
// With modification
|
|
50
|
+
var updated = user with { Name = "New Name" };
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Pattern Matching
|
|
56
|
+
|
|
57
|
+
```csharp
|
|
58
|
+
var result = user switch
|
|
59
|
+
{
|
|
60
|
+
{ Role: "Admin" } => "Full access",
|
|
61
|
+
{ Role: "User" } => "Limited access",
|
|
62
|
+
null => "No user",
|
|
63
|
+
_ => "Unknown"
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## LINQ Best Practices
|
|
70
|
+
|
|
71
|
+
```csharp
|
|
72
|
+
// ✅ Correct - efficient
|
|
73
|
+
var activeUsers = users
|
|
74
|
+
.Where(u => u.IsActive)
|
|
75
|
+
.Select(u => u.Name)
|
|
76
|
+
.ToList();
|
|
77
|
+
|
|
78
|
+
// ❌ Wrong - N+1
|
|
79
|
+
foreach (var user in users)
|
|
80
|
+
{
|
|
81
|
+
var orders = await GetOrdersAsync(user.Id);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Exception Handling
|
|
88
|
+
|
|
89
|
+
```csharp
|
|
90
|
+
try
|
|
91
|
+
{
|
|
92
|
+
await ProcessAsync();
|
|
93
|
+
}
|
|
94
|
+
catch (NotFoundException ex)
|
|
95
|
+
{
|
|
96
|
+
_logger.LogWarning(ex, "Item not found: {Id}", id);
|
|
97
|
+
throw;
|
|
98
|
+
}
|
|
99
|
+
catch (Exception ex)
|
|
100
|
+
{
|
|
101
|
+
_logger.LogError(ex, "Unexpected error");
|
|
102
|
+
throw;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## DO / DON'T
|
|
109
|
+
|
|
110
|
+
| ✅ Do | ❌ Don't |
|
|
111
|
+
|-------|---------|
|
|
112
|
+
| Async all the way | .Result or .Wait() |
|
|
113
|
+
| Nullable types | Ignore null warnings |
|
|
114
|
+
| Records for DTOs | Mutable classes |
|
|
115
|
+
| Pattern matching | Long if-else chains |
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-templates
|
|
3
|
+
description: Templates for technical documentation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Templates
|
|
7
|
+
|
|
8
|
+
> Standard templates for project documentation.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## README Template
|
|
13
|
+
|
|
14
|
+
```markdown
|
|
15
|
+
# Project Name
|
|
16
|
+
|
|
17
|
+
Brief description.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
\`\`\`bash
|
|
22
|
+
# Installation
|
|
23
|
+
npm install
|
|
24
|
+
|
|
25
|
+
# Run
|
|
26
|
+
npm run dev
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Feature 1
|
|
32
|
+
- Feature 2
|
|
33
|
+
|
|
34
|
+
## Configuration
|
|
35
|
+
|
|
36
|
+
| Variable | Description | Default |
|
|
37
|
+
|----------|-------------|---------|
|
|
38
|
+
| API_URL | API endpoint | http://localhost |
|
|
39
|
+
|
|
40
|
+
## API Reference
|
|
41
|
+
|
|
42
|
+
See [API Documentation](./docs/api.md)
|
|
43
|
+
|
|
44
|
+
## Contributing
|
|
45
|
+
|
|
46
|
+
1. Fork the repo
|
|
47
|
+
2. Create feature branch
|
|
48
|
+
3. Submit PR
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## API Endpoint Template
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
## GET /api/users/{id}
|
|
61
|
+
|
|
62
|
+
Get user by ID.
|
|
63
|
+
|
|
64
|
+
### Parameters
|
|
65
|
+
|
|
66
|
+
| Name | Type | Description |
|
|
67
|
+
|------|------|-------------|
|
|
68
|
+
| id | int | User ID |
|
|
69
|
+
|
|
70
|
+
### Response
|
|
71
|
+
|
|
72
|
+
\`\`\`json
|
|
73
|
+
{
|
|
74
|
+
"id": 1,
|
|
75
|
+
"name": "John",
|
|
76
|
+
"email": "john@example.com"
|
|
77
|
+
}
|
|
78
|
+
\`\`\`
|
|
79
|
+
|
|
80
|
+
### Errors
|
|
81
|
+
|
|
82
|
+
| Status | Description |
|
|
83
|
+
|--------|-------------|
|
|
84
|
+
| 404 | User not found |
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Architecture Doc Template
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Architecture: [System Name]
|
|
93
|
+
|
|
94
|
+
## Overview
|
|
95
|
+
|
|
96
|
+
Brief description of the system.
|
|
97
|
+
|
|
98
|
+
## Components
|
|
99
|
+
|
|
100
|
+
| Component | Purpose |
|
|
101
|
+
|-----------|---------|
|
|
102
|
+
| API | REST endpoints |
|
|
103
|
+
| Database | Data storage |
|
|
104
|
+
|
|
105
|
+
## Data Flow
|
|
106
|
+
|
|
107
|
+
1. User action
|
|
108
|
+
2. API call
|
|
109
|
+
3. Database query
|
|
110
|
+
4. Response
|
|
111
|
+
|
|
112
|
+
## Decisions
|
|
113
|
+
|
|
114
|
+
| Decision | Rationale |
|
|
115
|
+
|----------|-----------|
|
|
116
|
+
| SQL Server | Existing infrastructure |
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## When to Document
|
|
122
|
+
|
|
123
|
+
| ✅ Document | ❌ Skip |
|
|
124
|
+
|-------------|---------|
|
|
125
|
+
| Public APIs | Internal helpers |
|
|
126
|
+
| Complex logic | Self-documenting code |
|
|
127
|
+
| Architecture decisions | Obvious patterns |
|