@namch/agent-assistant 1.0.0 → 1.0.2
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/README.md +114 -522
- package/agents/backend-engineer.md +0 -8
- package/agents/brainstormer.md +0 -6
- package/agents/business-analyst.md +0 -5
- package/agents/database-architect.md +0 -6
- package/agents/debugger.md +0 -6
- package/agents/designer.md +0 -5
- package/agents/devops-engineer.md +0 -7
- package/agents/docs-manager.md +0 -6
- package/agents/frontend-engineer.md +0 -7
- package/agents/game-engineer.md +0 -7
- package/agents/mobile-engineer.md +0 -7
- package/agents/performance-engineer.md +0 -7
- package/agents/planner.md +0 -6
- package/agents/project-manager.md +0 -6
- package/agents/researcher.md +0 -5
- package/agents/reviewer.md +0 -6
- package/agents/scouter.md +0 -6
- package/agents/security-engineer.md +0 -7
- package/agents/tech-lead.md +0 -7
- package/agents/tester.md +0 -5
- package/cli/README.md +19 -10
- package/documents/business/business-features.md +1 -1
- package/documents/business/business-prd.md +4 -4
- package/documents/knowledge-architecture.md +1 -1
- package/documents/knowledge-domain.md +1 -1
- package/documents/knowledge-overview.md +14 -29
- package/documents/knowledge-source-base.md +14 -14
- package/package.json +1 -1
- package/rules/QUICK-REFERENCE.md +4 -1
- package/rules/SKILL-DISCOVERY.md +37 -14
- package/skills/active-directory-attacks/SKILL.md +383 -0
- package/skills/active-directory-attacks/references/advanced-attacks.md +382 -0
- package/skills/agent-evaluation/SKILL.md +64 -0
- package/skills/agent-memory-mcp/SKILL.md +82 -0
- package/skills/agent-memory-systems/SKILL.md +67 -0
- package/skills/agent-tool-builder/SKILL.md +53 -0
- package/skills/ai-agents-architect/SKILL.md +90 -0
- package/skills/ai-product/SKILL.md +54 -0
- package/skills/ai-wrapper-product/SKILL.md +273 -0
- package/skills/api-documentation-generator/SKILL.md +484 -0
- package/skills/api-fuzzing-bug-bounty/SKILL.md +433 -0
- package/skills/api-security-best-practices/SKILL.md +907 -0
- package/skills/autonomous-agent-patterns/SKILL.md +761 -0
- package/skills/autonomous-agents/SKILL.md +68 -0
- package/skills/aws-penetration-testing/SKILL.md +405 -0
- package/skills/aws-penetration-testing/references/advanced-aws-pentesting.md +469 -0
- package/skills/azure-functions/SKILL.md +42 -0
- package/skills/backend-dev-guidelines/SKILL.md +342 -0
- package/skills/backend-dev-guidelines/resources/architecture-overview.md +451 -0
- package/skills/backend-dev-guidelines/resources/async-and-errors.md +307 -0
- package/skills/backend-dev-guidelines/resources/complete-examples.md +638 -0
- package/skills/backend-dev-guidelines/resources/configuration.md +275 -0
- package/skills/backend-dev-guidelines/resources/database-patterns.md +224 -0
- package/skills/backend-dev-guidelines/resources/middleware-guide.md +213 -0
- package/skills/backend-dev-guidelines/resources/routing-and-controllers.md +756 -0
- package/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md +336 -0
- package/skills/backend-dev-guidelines/resources/services-and-repositories.md +789 -0
- package/skills/backend-dev-guidelines/resources/testing-guide.md +235 -0
- package/skills/backend-dev-guidelines/resources/validation-patterns.md +754 -0
- package/skills/broken-authentication/SKILL.md +476 -0
- package/skills/bullmq-specialist/SKILL.md +57 -0
- package/skills/bun-development/SKILL.md +691 -0
- package/skills/burp-suite-testing/SKILL.md +380 -0
- package/skills/cloud-penetration-testing/SKILL.md +501 -0
- package/skills/cloud-penetration-testing/references/advanced-cloud-scripts.md +318 -0
- package/skills/computer-use-agents/SKILL.md +315 -0
- package/skills/content-creator/SKILL.md +248 -0
- package/skills/content-creator/assets/content_calendar_template.md +99 -0
- package/skills/content-creator/references/brand_guidelines.md +199 -0
- package/skills/content-creator/references/content_frameworks.md +534 -0
- package/skills/content-creator/references/social_media_optimization.md +317 -0
- package/skills/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/skills/content-creator/scripts/seo_optimizer.py +419 -0
- package/skills/context-window-management/SKILL.md +53 -0
- package/skills/conversation-memory/SKILL.md +61 -0
- package/skills/copy-editing/SKILL.md +439 -0
- package/skills/copywriting/SKILL.md +225 -0
- package/skills/crewai/SKILL.md +243 -0
- package/skills/discord-bot-architect/SKILL.md +277 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/email-sequence/SKILL.md +925 -0
- package/skills/email-systems/SKILL.md +54 -0
- package/skills/ethical-hacking-methodology/SKILL.md +466 -0
- package/skills/executing-plans/SKILL.md +76 -0
- package/skills/file-path-traversal/SKILL.md +486 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/frontend-dev-guidelines/SKILL.md +359 -0
- package/skills/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/skills/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/skills/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/skills/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/skills/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/skills/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/skills/frontend-dev-guidelines/resources/performance.md +406 -0
- package/skills/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/skills/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/skills/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/skills/gcp-cloud-run/SKILL.md +288 -0
- package/skills/git-pushing/SKILL.md +33 -0
- package/skills/git-pushing/scripts/smart_commit.sh +19 -0
- package/skills/github-workflow-automation/SKILL.md +846 -0
- package/skills/html-injection-testing/SKILL.md +498 -0
- package/skills/idor-testing/SKILL.md +442 -0
- package/skills/inngest/SKILL.md +55 -0
- package/skills/javascript-mastery/SKILL.md +645 -0
- package/skills/kaizen/SKILL.md +730 -0
- package/skills/langfuse/SKILL.md +238 -0
- package/skills/langgraph/SKILL.md +287 -0
- package/skills/linux-privilege-escalation/SKILL.md +504 -0
- package/skills/llm-app-patterns/SKILL.md +760 -0
- package/skills/metasploit-framework/SKILL.md +478 -0
- package/skills/multi-agent-brainstorming/SKILL.md +256 -0
- package/skills/neon-postgres/SKILL.md +56 -0
- package/skills/nextjs-supabase-auth/SKILL.md +56 -0
- package/skills/nosql-expert/SKILL.md +111 -0
- package/skills/pentest-checklist/SKILL.md +334 -0
- package/skills/pentest-commands/SKILL.md +438 -0
- package/skills/plaid-fintech/SKILL.md +50 -0
- package/skills/planning-with-files/SKILL.md +211 -0
- package/skills/planning-with-files/examples.md +202 -0
- package/skills/planning-with-files/reference.md +218 -0
- package/skills/planning-with-files/scripts/check-complete.sh +44 -0
- package/skills/planning-with-files/scripts/init-session.sh +120 -0
- package/skills/planning-with-files/templates/findings.md +95 -0
- package/skills/planning-with-files/templates/progress.md +114 -0
- package/skills/planning-with-files/templates/task_plan.md +132 -0
- package/skills/privilege-escalation-methods/SKILL.md +333 -0
- package/skills/production-code-audit/SKILL.md +540 -0
- package/skills/prompt-caching/SKILL.md +61 -0
- package/skills/prompt-engineering/SKILL.md +171 -0
- package/skills/prompt-library/SKILL.md +322 -0
- package/skills/rag-engineer/SKILL.md +90 -0
- package/skills/rag-implementation/SKILL.md +63 -0
- package/skills/react-ui-patterns/SKILL.md +289 -0
- package/skills/red-team-tools/SKILL.md +310 -0
- package/skills/scanning-tools/SKILL.md +589 -0
- package/skills/shodan-reconnaissance/SKILL.md +503 -0
- package/skills/slack-bot-builder/SKILL.md +264 -0
- package/skills/smtp-penetration-testing/SKILL.md +500 -0
- package/skills/social-content/SKILL.md +807 -0
- package/skills/software-architecture/SKILL.md +75 -0
- package/skills/sql-injection-testing/SKILL.md +448 -0
- package/skills/sqlmap-database-pentesting/SKILL.md +400 -0
- package/skills/ssh-penetration-testing/SKILL.md +488 -0
- package/skills/stripe-integration/SKILL.md +69 -0
- package/skills/subagent-driven-development/SKILL.md +240 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tavily-web/SKILL.md +36 -0
- package/skills/telegram-bot-builder/SKILL.md +254 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +119 -0
- package/skills/top-web-vulnerabilities/SKILL.md +543 -0
- package/skills/trigger-dev/SKILL.md +67 -0
- package/skills/twilio-communications/SKILL.md +295 -0
- package/skills/upstash-qstash/SKILL.md +68 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/voice-agents/SKILL.md +68 -0
- package/skills/voice-ai-development/SKILL.md +302 -0
- package/skills/windows-privilege-escalation/SKILL.md +496 -0
- package/skills/wireshark-analysis/SKILL.md +497 -0
- package/skills/wordpress-penetration-testing/SKILL.md +485 -0
- package/skills/workflow-automation/SKILL.md +68 -0
- package/skills/xss-html-injection/SKILL.md +499 -0
- package/skills/zapier-make-patterns/SKILL.md +67 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# Sentry Integration and Monitoring
|
|
2
|
+
|
|
3
|
+
Complete guide to error tracking and performance monitoring with Sentry v8.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Core Principles](#core-principles)
|
|
8
|
+
- [Sentry Initialization](#sentry-initialization)
|
|
9
|
+
- [Error Capture Patterns](#error-capture-patterns)
|
|
10
|
+
- [Performance Monitoring](#performance-monitoring)
|
|
11
|
+
- [Cron Job Monitoring](#cron-job-monitoring)
|
|
12
|
+
- [Error Context Best Practices](#error-context-best-practices)
|
|
13
|
+
- [Common Mistakes](#common-mistakes)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Core Principles
|
|
18
|
+
|
|
19
|
+
**MANDATORY**: All errors MUST be captured to Sentry. No exceptions.
|
|
20
|
+
|
|
21
|
+
**ALL ERRORS MUST BE CAPTURED** - Use Sentry v8 with comprehensive error tracking across all services.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Sentry Initialization
|
|
26
|
+
|
|
27
|
+
### instrument.ts Pattern
|
|
28
|
+
|
|
29
|
+
**Location:** `src/instrument.ts` (MUST be first import in server.ts and all cron jobs)
|
|
30
|
+
|
|
31
|
+
**Template for Microservices:**
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import * as Sentry from '@sentry/node';
|
|
35
|
+
import * as fs from 'fs';
|
|
36
|
+
import * as path from 'path';
|
|
37
|
+
import * as ini from 'ini';
|
|
38
|
+
|
|
39
|
+
const sentryConfigPath = path.join(__dirname, '../sentry.ini');
|
|
40
|
+
const sentryConfig = ini.parse(fs.readFileSync(sentryConfigPath, 'utf-8'));
|
|
41
|
+
|
|
42
|
+
Sentry.init({
|
|
43
|
+
dsn: sentryConfig.sentry?.dsn,
|
|
44
|
+
environment: process.env.NODE_ENV || 'development',
|
|
45
|
+
tracesSampleRate: parseFloat(sentryConfig.sentry?.tracesSampleRate || '0.1'),
|
|
46
|
+
profilesSampleRate: parseFloat(sentryConfig.sentry?.profilesSampleRate || '0.1'),
|
|
47
|
+
|
|
48
|
+
integrations: [
|
|
49
|
+
...Sentry.getDefaultIntegrations({}),
|
|
50
|
+
Sentry.extraErrorDataIntegration({ depth: 5 }),
|
|
51
|
+
Sentry.localVariablesIntegration(),
|
|
52
|
+
Sentry.requestDataIntegration({
|
|
53
|
+
include: {
|
|
54
|
+
cookies: false,
|
|
55
|
+
data: true,
|
|
56
|
+
headers: true,
|
|
57
|
+
ip: true,
|
|
58
|
+
query_string: true,
|
|
59
|
+
url: true,
|
|
60
|
+
user: { id: true, email: true, username: true },
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
Sentry.consoleIntegration(),
|
|
64
|
+
Sentry.contextLinesIntegration(),
|
|
65
|
+
Sentry.prismaIntegration(),
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
beforeSend(event, hint) {
|
|
69
|
+
// Filter health checks
|
|
70
|
+
if (event.request?.url?.includes('/healthcheck')) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Scrub sensitive headers
|
|
75
|
+
if (event.request?.headers) {
|
|
76
|
+
delete event.request.headers['authorization'];
|
|
77
|
+
delete event.request.headers['cookie'];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Mask emails for PII
|
|
81
|
+
if (event.user?.email) {
|
|
82
|
+
event.user.email = event.user.email.replace(/^(.{2}).*(@.*)$/, '$1***$2');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return event;
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
ignoreErrors: [
|
|
89
|
+
/^Invalid JWT/,
|
|
90
|
+
/^JWT expired/,
|
|
91
|
+
'NetworkError',
|
|
92
|
+
],
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Set service context
|
|
96
|
+
Sentry.setTags({
|
|
97
|
+
service: 'form',
|
|
98
|
+
version: '1.0.1',
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
Sentry.setContext('runtime', {
|
|
102
|
+
node_version: process.version,
|
|
103
|
+
platform: process.platform,
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Critical Points:**
|
|
108
|
+
- PII protection built-in (beforeSend)
|
|
109
|
+
- Filter non-critical errors
|
|
110
|
+
- Comprehensive integrations
|
|
111
|
+
- Prisma instrumentation
|
|
112
|
+
- Service-specific tagging
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Error Capture Patterns
|
|
117
|
+
|
|
118
|
+
### 1. BaseController Pattern
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
// Use BaseController.handleError
|
|
122
|
+
protected handleError(error: unknown, res: Response, context: string, statusCode = 500): void {
|
|
123
|
+
Sentry.withScope((scope) => {
|
|
124
|
+
scope.setTag('controller', this.constructor.name);
|
|
125
|
+
scope.setTag('operation', context);
|
|
126
|
+
scope.setUser({ id: res.locals?.claims?.userId });
|
|
127
|
+
Sentry.captureException(error);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
res.status(statusCode).json({
|
|
131
|
+
success: false,
|
|
132
|
+
error: { message: error instanceof Error ? error.message : 'Error occurred' }
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 2. Workflow Error Handling
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { SentryHelper } from '../utils/sentryHelper';
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
await businessOperation();
|
|
144
|
+
} catch (error) {
|
|
145
|
+
SentryHelper.captureOperationError(error, {
|
|
146
|
+
operationType: 'POST_CREATION',
|
|
147
|
+
entityId: 123,
|
|
148
|
+
userId: 'user-123',
|
|
149
|
+
operation: 'createPost',
|
|
150
|
+
});
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 3. Service Layer Error Handling
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
try {
|
|
159
|
+
await someOperation();
|
|
160
|
+
} catch (error) {
|
|
161
|
+
Sentry.captureException(error, {
|
|
162
|
+
tags: {
|
|
163
|
+
service: 'form',
|
|
164
|
+
operation: 'someOperation'
|
|
165
|
+
},
|
|
166
|
+
extra: {
|
|
167
|
+
userId: currentUser.id,
|
|
168
|
+
entityId: 123
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Performance Monitoring
|
|
178
|
+
|
|
179
|
+
### Database Performance Tracking
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { DatabasePerformanceMonitor } from '../utils/databasePerformance';
|
|
183
|
+
|
|
184
|
+
const result = await DatabasePerformanceMonitor.withPerformanceTracking(
|
|
185
|
+
'findMany',
|
|
186
|
+
'UserProfile',
|
|
187
|
+
async () => {
|
|
188
|
+
return await PrismaService.main.userProfile.findMany({ take: 5 });
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### API Endpoint Spans
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
router.post('/operation', async (req, res) => {
|
|
197
|
+
return await Sentry.startSpan({
|
|
198
|
+
name: 'operation.execute',
|
|
199
|
+
op: 'http.server',
|
|
200
|
+
attributes: {
|
|
201
|
+
'http.method': 'POST',
|
|
202
|
+
'http.route': '/operation'
|
|
203
|
+
}
|
|
204
|
+
}, async () => {
|
|
205
|
+
const result = await performOperation();
|
|
206
|
+
res.json(result);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Cron Job Monitoring
|
|
214
|
+
|
|
215
|
+
### Mandatory Pattern
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
#!/usr/bin/env node
|
|
219
|
+
import '../instrument'; // FIRST LINE after shebang
|
|
220
|
+
import * as Sentry from '@sentry/node';
|
|
221
|
+
|
|
222
|
+
async function main() {
|
|
223
|
+
return await Sentry.startSpan({
|
|
224
|
+
name: 'cron.job-name',
|
|
225
|
+
op: 'cron',
|
|
226
|
+
attributes: {
|
|
227
|
+
'cron.job': 'job-name',
|
|
228
|
+
'cron.startTime': new Date().toISOString(),
|
|
229
|
+
}
|
|
230
|
+
}, async () => {
|
|
231
|
+
try {
|
|
232
|
+
// Cron job logic here
|
|
233
|
+
} catch (error) {
|
|
234
|
+
Sentry.captureException(error, {
|
|
235
|
+
tags: {
|
|
236
|
+
'cron.job': 'job-name',
|
|
237
|
+
'error.type': 'execution_error'
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
console.error('[Cron] Error:', error);
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
main().then(() => {
|
|
247
|
+
console.log('[Cron] Completed successfully');
|
|
248
|
+
process.exit(0);
|
|
249
|
+
}).catch((error) => {
|
|
250
|
+
console.error('[Cron] Fatal error:', error);
|
|
251
|
+
process.exit(1);
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Error Context Best Practices
|
|
258
|
+
|
|
259
|
+
### Rich Context Example
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
Sentry.withScope((scope) => {
|
|
263
|
+
// User context
|
|
264
|
+
scope.setUser({
|
|
265
|
+
id: user.id,
|
|
266
|
+
email: user.email,
|
|
267
|
+
username: user.username
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// Tags for filtering
|
|
271
|
+
scope.setTag('service', 'form');
|
|
272
|
+
scope.setTag('endpoint', req.path);
|
|
273
|
+
scope.setTag('method', req.method);
|
|
274
|
+
|
|
275
|
+
// Structured context
|
|
276
|
+
scope.setContext('operation', {
|
|
277
|
+
type: 'workflow.complete',
|
|
278
|
+
workflowId: 123,
|
|
279
|
+
stepId: 456
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// Breadcrumbs for timeline
|
|
283
|
+
scope.addBreadcrumb({
|
|
284
|
+
category: 'workflow',
|
|
285
|
+
message: 'Starting step completion',
|
|
286
|
+
level: 'info',
|
|
287
|
+
data: { stepId: 456 }
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
Sentry.captureException(error);
|
|
291
|
+
});
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Common Mistakes
|
|
297
|
+
|
|
298
|
+
```typescript
|
|
299
|
+
// ❌ Swallowing errors
|
|
300
|
+
try {
|
|
301
|
+
await riskyOperation();
|
|
302
|
+
} catch (error) {
|
|
303
|
+
// Silent failure
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// ❌ Generic error messages
|
|
307
|
+
throw new Error('Error occurred');
|
|
308
|
+
|
|
309
|
+
// ❌ Exposing sensitive data
|
|
310
|
+
Sentry.captureException(error, {
|
|
311
|
+
extra: { password: user.password } // NEVER
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// ❌ Missing async error handling
|
|
315
|
+
async function bad() {
|
|
316
|
+
fetchData().then(data => processResult(data)); // Unhandled
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// ✅ Proper async handling
|
|
320
|
+
async function good() {
|
|
321
|
+
try {
|
|
322
|
+
const data = await fetchData();
|
|
323
|
+
processResult(data);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
Sentry.captureException(error);
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
**Related Files:**
|
|
334
|
+
- [SKILL.md](SKILL.md)
|
|
335
|
+
- [routing-and-controllers.md](routing-and-controllers.md)
|
|
336
|
+
- [async-and-errors.md](async-and-errors.md)
|