Search First — Research Before You Code
Search for existing solutions before implementing custom code.
Stack: C#/.NET + Angular/TypeScript
When to Use
- Starting a new feature that likely has existing solutions
- Adding a dependency or integration
- Before creating a new utility, helper, or abstraction
- The user asks "add X functionality" and you're about to write code
Workflow
1. NEED ANALYSIS
Define what functionality is needed
Identify framework constraints (.NET / Angular)
2. PARALLEL SEARCH
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ NuGet / │ │ MCP / │ │ Existing │ │ GitHub / │
│ npm │ │ Skills │ │ Codebase │ │ Web │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
3. EVALUATE
Score candidates (functionality, maintenance,
community, docs, license, dependencies)
4. DECIDE
┌─────────┐ ┌──────────┐ ┌─────────┐
│ Adopt │ │ Extend │ │ Build │
│ as-is │ │ /Wrap │ │ Custom │
└─────────┘ └──────────┘ └─────────┘
5. IMPLEMENT
Install package / Configure / Write minimal custom code
Decision Matrix
| Signal |
Action |
| Exact match, well-maintained, MIT/Apache |
Adopt — install and use directly |
| Partial match, good foundation |
Extend — install + write thin wrapper |
| Multiple weak matches |
Compose — combine small packages |
| Nothing suitable found |
Build — write custom, informed by research |
Search Checklist
Before writing anything, mentally run through:
- Does this already exist in the repo? →
rg through relevant code first
- Is this a common problem? → Search NuGet (C#) or npm (Angular)
- Is there an MCP for this? → Check configured MCP servers
- Is there a skill for this? → Check
.claude/skills/
- Is there an llms.txt? → Check the library/framework docs site for
/llms.txt
- Is there a GitHub implementation? → Search for maintained OSS
Search Shortcuts by Stack
C#/.NET
| Need |
Look for |
| Validation / Result types |
Results (ValidationBuilder, Result<T>) |
| Mapping |
Mapster with Mapster.Tool (compile-time code generation). Manual mapping preferred for simple cases |
| HTTP client |
IHttpClientFactory (built-in), Refit, Flurl |
| Serialization |
System.Text.Json (built-in) |
| Logging |
Serilog, NLog (over raw ILogger) |
| Testing |
xUnit, NSubstitute, Testcontainers |
| Background jobs |
Hangfire, Quartz.NET |
| Caching |
HybridCache (Microsoft.Extensions.Caching.Hybrid), IMemoryCache (built-in), IDistributedCache |
| Auth |
ASP.NET Core Identity, Duende IdentityServer |
| Rate limiting |
Microsoft.AspNetCore.RateLimiting (built-in .NET 7+) |
| Feature flags |
Microsoft.FeatureManagement |
| Health checks |
Microsoft.Extensions.Diagnostics.HealthChecks (built-in) |
| OpenAPI |
Swashbuckle, NSwag |
| Resilience |
Polly, Microsoft.Extensions.Http.Resilience |
| Domain building blocks |
ErikLieben.* NuGet packages (event sourcing, strongly typed IDs, specifications, etc.) |
| ID generation |
Guid.CreateVersion7() (.NET 9+) |
Angular/TypeScript
| Need |
Look for |
| State management |
Signals (built-in, preferred), NgRx only for complex event-driven scenarios |
| Forms |
Template-driven forms with FormsModule (preferred), Reactive Forms for complex cases |
| HTTP |
HttpClient (built-in), interceptors for auth/retry |
| UI components |
Angular Material, PrimeNG |
| Tables |
ag-Grid, ngx-datatable |
| Charts |
ngx-charts, Chart.js wrappers |
| i18n |
@ngx-translate/core, Angular i18n (built-in) |
| Validation |
class-validator, zod |
| Date handling |
date-fns, Luxon (over Moment.js) |
| Feature flags |
@internal/ng-feature-flags (custom internal library) |
| Permissions |
@internal/ng-permissions (custom internal library) |
| Testing |
Vitest, @testing-library/angular, Playwright |
| Linting |
eslint + @angular-eslint |
Shared / Infrastructure
| Need |
Look for |
| CI/CD |
GitHub Actions, Azure DevOps pipelines |
| Containers |
Docker multi-stage builds |
| Database |
EF Core migrations, Flyway |
| Monitoring |
OpenTelemetry, Application Insights |
| Docs site |
VitePress (you have /tool-vitepress) |
Examples
Example 1: "Add retry logic to HTTP calls"
Need: Resilient HTTP calls with retry and circuit breaker
Search: NuGet "resilience http"
Found: Microsoft.Extensions.Http.Resilience (built-in .NET 8+)
Action: ADOPT — already in the framework, zero extra deps
Result: AddStandardResilienceHandler() on HttpClient registration
Example 2: "Add a data table with sorting and filtering"
Need: Feature-rich data table for Angular
Search: npm "angular data table"
Found: ag-Grid Community (score: 9/10), PrimeNG Table (score: 8/10)
Action: ADOPT — ag-Grid for complex needs, PrimeNG if already using PrimeNG
Result: One package, battle-tested, accessible
Example 3: "Add input validation to API"
Need: Request validation in ASP.NET Core
Search: NuGet "validation", check built-in options
Found: Results (in-house), DataAnnotations (built-in)
Action: ADOPT Results for Result-based validation with Railway-Oriented flow
Result: Explicit success/failure flow, TypedResults integration, error accumulation
Example 4: "Persist domain state with full audit trail"
Need: Persist domain state with full audit trail
Search: NuGet "event sourcing", check built-in options
Found: EventSourcing (in-house, Azure Storage backend)
Action: ADOPT — already in-house, battle-tested, includes analyzers + testing helpers
Result: Aggregate + event pattern with blob storage, projections for read models
Anti-Patterns
- Jumping to code: Writing a utility without checking if one exists
- Ignoring built-ins: .NET and Angular have rich built-in capabilities — check the framework first
- Dependency bloat: Installing a massive package for one small feature
- Over-wrapping: Wrapping a library so heavily it loses its benefits
- Outdated packages: Preferring a familiar but unmaintained package over the modern equivalent
1---2name: dev-search-first3description: Research-before-coding workflow. Search for existing tools, packages, and patterns before writing custom code. Checks NuGet, npm, MCP servers, GitHub, and the existing codebase. Use when starting a new feature, adding a dependency, or before creating a new utility.4---5
6# Search First — Research Before You Code
7
8Search for existing solutions before implementing custom code.
9
10> **Stack:** C#/.NET + Angular/TypeScript
11
12## When to Use
13
14- Starting a new feature that likely has existing solutions
15- Adding a dependency or integration
16- Before creating a new utility, helper, or abstraction
17- The user asks "add X functionality" and you're about to write code
18
19## Workflow
20
21```
221. NEED ANALYSIS
23 Define what functionality is needed
24 Identify framework constraints (.NET / Angular)
25
262. PARALLEL SEARCH
27 ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
28 │ NuGet / │ │ MCP / │ │ Existing │ │ GitHub / │
29 │ npm │ │ Skills │ │ Codebase │ │ Web │
30 └──────────┘ └──────────┘ └──────────┘ └──────────┘
31
323. EVALUATE
33 Score candidates (functionality, maintenance,
34 community, docs, license, dependencies)
35
364. DECIDE
37 ┌─────────┐ ┌──────────┐ ┌─────────┐
38 │ Adopt │ │ Extend │ │ Build │
39 │ as-is │ │ /Wrap │ │ Custom │
40 └─────────┘ └──────────┘ └─────────┘
41
425. IMPLEMENT
43 Install package / Configure / Write minimal custom code
44```
45
46## Decision Matrix
47
48| Signal | Action |
49|--------|--------|
50| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
51| Partial match, good foundation | **Extend** — install + write thin wrapper |
52| Multiple weak matches | **Compose** — combine small packages |
53| Nothing suitable found | **Build** — write custom, informed by research |
54
55## Search Checklist
56
57Before writing anything, mentally run through:
58
590. **Does this already exist in the repo?** → `rg` through relevant code first
601. **Is this a common problem?** → Search NuGet (C#) or npm (Angular)
612. **Is there an MCP for this?** → Check configured MCP servers
623. **Is there a skill for this?** → Check `.claude/skills/`
634. **Is there an llms.txt?** → Check the library/framework docs site for `/llms.txt`
645. **Is there a GitHub implementation?** → Search for maintained OSS
65
66## Search Shortcuts by Stack
67
68### C#/.NET
69
70| Need | Look for |
71|------|----------|
72| Validation / Result types | Results (ValidationBuilder, Result\<T\>) |
73| Mapping | Mapster with Mapster.Tool (compile-time code generation). Manual mapping preferred for simple cases |
74| HTTP client | `IHttpClientFactory` (built-in), Refit, Flurl |
75| Serialization | System.Text.Json (built-in) |
76| Logging | Serilog, NLog (over raw `ILogger`) |
77| Testing | xUnit, NSubstitute, Testcontainers |
78| Background jobs | Hangfire, Quartz.NET |
79| Caching | HybridCache (`Microsoft.Extensions.Caching.Hybrid`), `IMemoryCache` (built-in), `IDistributedCache` |
80| Auth | ASP.NET Core Identity, Duende IdentityServer |
81| Rate limiting | `Microsoft.AspNetCore.RateLimiting` (built-in .NET 7+) |
82| Feature flags | Microsoft.FeatureManagement |
83| Health checks | `Microsoft.Extensions.Diagnostics.HealthChecks` (built-in) |
84| OpenAPI | Swashbuckle, NSwag |
85| Resilience | Polly, Microsoft.Extensions.Http.Resilience |
86| Domain building blocks | ErikLieben.* NuGet packages (event sourcing, strongly typed IDs, specifications, etc.) |
87| ID generation | `Guid.CreateVersion7()` (.NET 9+) |
88
89### Angular/TypeScript
90
91| Need | Look for |
92|------|----------|
93| State management | Signals (built-in, preferred), NgRx only for complex event-driven scenarios |
94| Forms | Template-driven forms with FormsModule (preferred), Reactive Forms for complex cases |
95| HTTP | HttpClient (built-in), interceptors for auth/retry |
96| UI components | Angular Material, PrimeNG |
97| Tables | ag-Grid, ngx-datatable |
98| Charts | ngx-charts, Chart.js wrappers |
99| i18n | @ngx-translate/core, Angular i18n (built-in) |
100| Validation | class-validator, zod |
101| Date handling | date-fns, Luxon (over Moment.js) |
102| Feature flags | @internal/ng-feature-flags (custom internal library) |
103| Permissions | @internal/ng-permissions (custom internal library) |
104| Testing | Vitest, @testing-library/angular, Playwright |
105| Linting | eslint + @angular-eslint |
106
107### Shared / Infrastructure
108
109| Need | Look for |
110|------|----------|
111| CI/CD | GitHub Actions, Azure DevOps pipelines |
112| Containers | Docker multi-stage builds |
113| Database | EF Core migrations, Flyway |
114| Monitoring | OpenTelemetry, Application Insights |
115| Docs site | VitePress (you have `/tool-vitepress`) |
116
117## Examples
118
119### Example 1: "Add retry logic to HTTP calls"
120```
121Need: Resilient HTTP calls with retry and circuit breaker
122Search: NuGet "resilience http"
123Found: Microsoft.Extensions.Http.Resilience (built-in .NET 8+)
124Action: ADOPT — already in the framework, zero extra deps
125Result: AddStandardResilienceHandler() on HttpClient registration
126```
127
128### Example 2: "Add a data table with sorting and filtering"
129```
130Need: Feature-rich data table for Angular
131Search: npm "angular data table"
132Found: ag-Grid Community (score: 9/10), PrimeNG Table (score: 8/10)
133Action: ADOPT — ag-Grid for complex needs, PrimeNG if already using PrimeNG
134Result: One package, battle-tested, accessible
135```
136
137### Example 3: "Add input validation to API"
138```
139Need: Request validation in ASP.NET Core
140Search: NuGet "validation", check built-in options
141Found: Results (in-house), DataAnnotations (built-in)
142Action: ADOPT Results for Result-based validation with Railway-Oriented flow
143Result: Explicit success/failure flow, TypedResults integration, error accumulation
144```
145
146### Example 4: "Persist domain state with full audit trail"
147```
148Need: Persist domain state with full audit trail
149Search: NuGet "event sourcing", check built-in options
150Found: EventSourcing (in-house, Azure Storage backend)
151Action: ADOPT — already in-house, battle-tested, includes analyzers + testing helpers
152Result: Aggregate + event pattern with blob storage, projections for read models
153```
154
155## Anti-Patterns
156
157- **Jumping to code**: Writing a utility without checking if one exists
158- **Ignoring built-ins**: .NET and Angular have rich built-in capabilities — check the framework first
159- **Dependency bloat**: Installing a massive package for one small feature
160- **Over-wrapping**: Wrapping a library so heavily it loses its benefits
161- **Outdated packages**: Preferring a familiar but unmaintained package over the modern equivalent