2026-02-11 23:48:45 -08:00
|
|
|
---
|
|
|
|
|
paths:
|
|
|
|
|
- "**/*.ts"
|
|
|
|
|
- "**/*.tsx"
|
|
|
|
|
- "**/*.js"
|
|
|
|
|
- "**/*.jsx"
|
|
|
|
|
---
|
2026-02-05 21:58:06 +08:00
|
|
|
# TypeScript/JavaScript Security
|
|
|
|
|
|
|
|
|
|
> This file extends [common/security.md](../common/security.md) with TypeScript/JavaScript specific content.
|
|
|
|
|
|
|
|
|
|
## Secret Management
|
|
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
|
// NEVER: Hardcoded secrets
|
|
|
|
|
const apiKey = "sk-proj-xxxxx"
|
|
|
|
|
|
|
|
|
|
// ALWAYS: Environment variables
|
2026-06-07 08:26:01 +03:00
|
|
|
const apiKey = process.env.API_KEY
|
2026-02-05 21:58:06 +08:00
|
|
|
|
|
|
|
|
if (!apiKey) {
|
2026-06-07 08:26:01 +03:00
|
|
|
throw new Error('API_KEY not configured')
|
2026-02-05 21:58:06 +08:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Agent Support
|
|
|
|
|
|
|
|
|
|
- Use **security-reviewer** skill for comprehensive security audits
|