cc-codeconductor 0.4.3 → 0.5.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.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +2642 -226
  3. package/package.json +1 -1
  4. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  5. package/presets/agy/skills/openspec/SKILL.md +32 -0
  6. package/presets/agy/workflows/cc-openspec.md +62 -0
  7. package/presets/agy/workflows/cc-scorecard.md +17 -0
  8. package/presets/claude/commands/cc/openspec.md +144 -0
  9. package/presets/claude/commands/cc/review.md +13 -2
  10. package/presets/claude/commands/cc/scorecard.md +65 -0
  11. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  12. package/presets/claude/skills/openspec/SKILL.md +54 -0
  13. package/presets/codex/AGENTS.md +57 -0
  14. package/presets/cursor/.cursorignore +15 -0
  15. package/presets/cursor/AGENTS.md +504 -0
  16. package/presets/cursor/agents/architect.md +211 -0
  17. package/presets/cursor/agents/complexity-auditor.md +76 -0
  18. package/presets/cursor/agents/contract-builder.md +75 -0
  19. package/presets/cursor/agents/docs.md +180 -0
  20. package/presets/cursor/agents/goal-planner.md +71 -0
  21. package/presets/cursor/agents/implementer.md +161 -0
  22. package/presets/cursor/agents/orchestrator.md +377 -0
  23. package/presets/cursor/agents/repo-explorer.md +100 -0
  24. package/presets/cursor/agents/reviewer.md +237 -0
  25. package/presets/cursor/agents/security-reviewer.md +113 -0
  26. package/presets/cursor/agents/task-coach.md +145 -0
  27. package/presets/cursor/agents/tester.md +241 -0
  28. package/presets/cursor/commands/cc/api-contract.md +58 -0
  29. package/presets/cursor/commands/cc/db-migration.md +58 -0
  30. package/presets/cursor/commands/cc/feature.md +115 -0
  31. package/presets/cursor/commands/cc/fix.md +121 -0
  32. package/presets/cursor/commands/cc/openspec.md +144 -0
  33. package/presets/cursor/commands/cc/pagespeed.md +103 -0
  34. package/presets/cursor/commands/cc/refactor.md +148 -0
  35. package/presets/cursor/commands/cc/review.md +137 -0
  36. package/presets/cursor/commands/cc/scorecard.md +65 -0
  37. package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
  38. package/presets/cursor/commands/cc/test-plan.md +138 -0
  39. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  40. package/presets/cursor/rules/context-budget.mdc +12 -0
  41. package/presets/cursor/rules/orchestration.mdc +12 -0
  42. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  43. package/presets/cursor/skills/android/SKILL.md +122 -0
  44. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  45. package/presets/cursor/skills/astro/SKILL.md +322 -0
  46. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  47. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  48. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  49. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  50. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  51. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  52. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  53. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  54. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  55. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  56. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  57. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  58. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  59. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  60. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  61. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  62. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  63. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  64. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  65. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  66. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  67. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  68. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  69. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  70. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  71. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  72. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  73. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  74. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  75. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  76. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  77. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  78. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  79. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  80. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  81. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  82. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  83. package/presets/cursor/skills/python/SKILL.md +613 -0
  84. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  85. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  86. package/presets/cursor/skills/security/SKILL.md +384 -0
  87. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  88. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  89. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  90. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  91. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  92. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  93. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  94. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  95. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  96. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  97. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  98. package/presets/opencode/agents/architect.md +1 -2
  99. package/presets/opencode/agents/complexity-auditor.md +1 -0
  100. package/presets/opencode/agents/contract-builder.md +93 -0
  101. package/presets/opencode/agents/docs.md +1 -2
  102. package/presets/opencode/agents/goal-planner.md +82 -0
  103. package/presets/opencode/agents/implementer.md +9 -2
  104. package/presets/opencode/agents/orchestrator.md +50 -12
  105. package/presets/opencode/agents/repo-explorer.md +0 -1
  106. package/presets/opencode/agents/reviewer.md +23 -2
  107. package/presets/opencode/agents/security-reviewer.md +129 -0
  108. package/presets/opencode/agents/task-coach.md +1 -2
  109. package/presets/opencode/agents/tester.md +1 -2
  110. package/presets/opencode/commands/cc-openspec.md +61 -0
  111. package/presets/opencode/commands/cc-scorecard.md +16 -0
  112. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  113. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  114. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  115. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  116. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  117. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  118. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  119. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  120. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  121. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  122. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  123. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  124. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  125. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  126. package/presets/templates/BACKLOG.md +33 -0
  127. package/presets/templates/execution-profile.yml +6 -0
  128. package/presets/templates/model-comparison.md +11 -0
  129. package/presets/templates/regression-checklist.yml +10 -0
  130. package/src/presets/manifests/agy.yml +2 -2
  131. package/src/presets/manifests/claude.yml +2 -2
  132. package/src/presets/manifests/codex.yml +2 -2
  133. package/src/presets/manifests/cursor.yml +19 -3
  134. package/src/presets/manifests/gemini.yml +2 -2
  135. package/src/presets/manifests/opencode.yml +2 -2
  136. package/src/presets/models/agy.yml +21 -0
  137. package/src/presets/models/claude.yml +18 -0
  138. package/src/presets/models/codex.yml +18 -0
  139. package/src/presets/models/cursor.yml +39 -9
  140. package/src/presets/models/gemini.yml +18 -0
  141. package/src/presets/models/opencode.yml +18 -0
@@ -0,0 +1,384 @@
1
+ ---
2
+ id: security
3
+ version: 1.0.0
4
+ name: Security
5
+ description: >
6
+ Provides expert knowledge for implementing and reviewing application security following OWASP Top 10 (2021), with stack-specific patterns for Spring Boot, Django, Next.js, and Astro.
7
+
8
+ user-invokable: true
9
+ license: MIT
10
+ metadata:
11
+ author: lgzarturo
12
+ category: security
13
+
14
+ compatibility:
15
+ tools: [claude, codex, gemini, agy, opencode]
16
+ stacks:
17
+ languages: []
18
+ frameworks: []
19
+
20
+ risk:
21
+ level: high
22
+ can_execute_shell: false
23
+ can_modify_files: true
24
+ requires_network: false
25
+
26
+ inputs: []
27
+
28
+ outputs: []
29
+
30
+ quality:
31
+ reviewed_by: codeconductor-core
32
+ version: 0.1.0
33
+ paths:
34
+ - "src/**"
35
+ ---
36
+
37
+
38
+
39
+ # Security
40
+
41
+ ## OWASP Top 10 (2021) — Quick Reference
42
+
43
+ | # | Category | What to check |
44
+ |---|----------|--------------|
45
+ | A01 | Broken Access Control | Is authorization enforced on every endpoint? |
46
+ | A02 | Cryptographic Failures | Are secrets encrypted at rest and in transit? |
47
+ | A03 | Injection | Is all input sanitized or parameterized? |
48
+ | A04 | Insecure Design | Is the threat model documented? |
49
+ | A05 | Security Misconfiguration | Are defaults changed? Debug off in prod? |
50
+ | A06 | Vulnerable Components | Are dependencies up to date? |
51
+ | A07 | Auth & Session Failures | Are sessions invalidated on logout? Token expiry set? |
52
+ | A08 | Software Integrity Failures | Are supply-chain dependencies verified? |
53
+ | A09 | Logging & Monitoring Failures | Are security events logged without leaking PII? |
54
+ | A10 | SSRF | Are outbound URLs allowlisted? |
55
+
56
+ ## Input Validation
57
+
58
+ Validate all input at system boundaries. Never trust data from: HTTP request
59
+ body, query parameters, headers, cookies, or environment variables passed by
60
+ external systems.
61
+
62
+ **Rules:**
63
+
64
+ - Validate type, format, length, and range
65
+ - Reject unknown fields — do not silently ignore them
66
+ - Use allowlists (accept known-good), not blocklists (reject known-bad)
67
+ - Validate at the API layer before it reaches the service layer
68
+
69
+ ```kotlin
70
+ // Spring Boot — Bean Validation
71
+ data class CreateUserRequest(
72
+ @field:NotBlank @field:Email val email: String,
73
+ @field:Size(min = 8, max = 72) val password: String,
74
+ @field:Size(max = 100) val name: String
75
+ )
76
+
77
+ @PostMapping
78
+ fun createUser(@Valid @RequestBody request: CreateUserRequest): ResponseEntity<UserResponse> {
79
+ // request is guaranteed valid here
80
+ }
81
+ ```
82
+
83
+ ```python
84
+ # Django REST Framework — serializer validation
85
+ class CreateUserSerializer(serializers.Serializer):
86
+ email = serializers.EmailField(max_length=254)
87
+ password = serializers.CharField(min_length=8, max_length=72, write_only=True)
88
+ name = serializers.CharField(max_length=100)
89
+
90
+ def validate_email(self, value):
91
+ if User.objects.filter(email=value).exists():
92
+ raise serializers.ValidationError("Email already registered.")
93
+ return value.lower()
94
+ ```
95
+
96
+ ```typescript
97
+ // Next.js / Astro — Zod
98
+ import { z } from 'zod';
99
+
100
+ const CreateUserSchema = z.object({
101
+ email: z.string().email().max(254),
102
+ password: z.string().min(8).max(72),
103
+ name: z.string().max(100),
104
+ });
105
+
106
+ const result = CreateUserSchema.safeParse(body);
107
+ if (!result.success) {
108
+ return Response.json({ error: result.error.flatten() }, { status: 400 });
109
+ }
110
+ ```
111
+
112
+ ## Authentication
113
+
114
+ ### JWT (Stateless)
115
+
116
+ Use JWTs for stateless API authentication. Keep access tokens short-lived.
117
+
118
+ **Token lifetimes:**
119
+
120
+ | Token | Lifetime | Storage |
121
+ |-------|----------|---------|
122
+ | Access token | 15 minutes | Memory (never localStorage) |
123
+ | Refresh token | 7–30 days | HttpOnly cookie |
124
+
125
+ Never store access tokens in `localStorage` — XSS can read them. Store in
126
+ memory (React state, module variable) and refresh via the HttpOnly cookie.
127
+
128
+ ```kotlin
129
+ // Spring Security 6 + JWT
130
+ @Configuration
131
+ @EnableWebSecurity
132
+ class SecurityConfig(private val jwtFilter: JwtAuthenticationFilter) {
133
+
134
+ @Bean
135
+ fun filterChain(http: HttpSecurity): SecurityFilterChain = http
136
+ .csrf { it.disable() } // stateless API — CSRF not needed
137
+ .sessionManagement { it.sessionCreationPolicy(SessionCreationPolicy.STATELESS) }
138
+ .authorizeHttpRequests { auth ->
139
+ auth
140
+ .requestMatchers("/api/auth/**").permitAll()
141
+ .requestMatchers("/api/admin/**").hasRole("ADMIN")
142
+ .anyRequest().authenticated()
143
+ }
144
+ .addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter::class.java)
145
+ .build()
146
+ }
147
+ ```
148
+
149
+ ```python
150
+ # Django — djangorestframework-simplejwt
151
+ # settings.py
152
+ SIMPLE_JWT = {
153
+ "ACCESS_TOKEN_LIFETIME": timedelta(minutes=15),
154
+ "REFRESH_TOKEN_LIFETIME": timedelta(days=7),
155
+ "ROTATE_REFRESH_TOKENS": True,
156
+ "BLACKLIST_AFTER_ROTATION": True,
157
+ "ALGORITHM": "HS256",
158
+ "AUTH_HEADER_TYPES": ("Bearer",),
159
+ }
160
+ ```
161
+
162
+ ```typescript
163
+ // Next.js — Auth.js (NextAuth v5)
164
+ // auth.ts
165
+ import NextAuth from 'next-auth';
166
+ import Credentials from 'next-auth/providers/credentials';
167
+
168
+ export const { auth, signIn, signOut } = NextAuth({
169
+ providers: [
170
+ Credentials({
171
+ authorize: async (credentials) => {
172
+ // validate and return user or null
173
+ },
174
+ }),
175
+ ],
176
+ session: { strategy: 'jwt', maxAge: 7 * 24 * 60 * 60 },
177
+ });
178
+ ```
179
+
180
+ ### Password Hashing
181
+
182
+ Never store plaintext passwords. Never use MD5 or SHA-1 for password hashing.
183
+
184
+ | Algorithm | Use | Work factor |
185
+ |-----------|-----|-------------|
186
+ | bcrypt | default | cost=12 |
187
+ | Argon2id | preferred when available | m=65536, t=3 |
188
+ | PBKDF2 | FIPS environments | iterations=600000 |
189
+
190
+ ```kotlin
191
+ // Spring Security uses bcrypt by default
192
+ @Bean
193
+ fun passwordEncoder(): PasswordEncoder = BCryptPasswordEncoder(12)
194
+ ```
195
+
196
+ ```python
197
+ # Django uses PBKDF2 by default; switch to Argon2 for stronger hashing
198
+ # pip install django[argon2]
199
+ PASSWORD_HASHERS = [
200
+ "django.contrib.auth.hashers.Argon2PasswordHasher",
201
+ "django.contrib.auth.hashers.PBKDF2PasswordHasher", # fallback for existing hashes
202
+ ]
203
+ ```
204
+
205
+ ## Authorization
206
+
207
+ **Principle of least privilege:** every endpoint must explicitly declare who
208
+ can access it. Deny by default.
209
+
210
+ ```kotlin
211
+ // Spring — method-level security
212
+ @PreAuthorize("hasRole('ADMIN') or #userId == authentication.name")
213
+ fun getUser(userId: String): UserResponse { ... }
214
+ ```
215
+
216
+ ```python
217
+ # Django REST Framework
218
+ class UserDetailView(RetrieveUpdateAPIView):
219
+ permission_classes = [IsAuthenticated, IsOwnerOrAdmin]
220
+ queryset = User.objects.all()
221
+
222
+ class IsOwnerOrAdmin(BasePermission):
223
+ def has_object_permission(self, request, view, obj):
224
+ return request.user.is_staff or obj == request.user
225
+ ```
226
+
227
+ Always check authorization at the **object level**, not just the endpoint
228
+ level. An authenticated user should not be able to access another user's data
229
+ by changing an ID in the URL.
230
+
231
+ ## CORS
232
+
233
+ ```kotlin
234
+ // Spring Boot — explicit allowlist; never use "*" in production
235
+ @Bean
236
+ fun corsConfigurationSource(): CorsConfigurationSource {
237
+ val config = CorsConfiguration().apply {
238
+ allowedOrigins = listOf("https://app.example.com")
239
+ allowedMethods = listOf("GET", "POST", "PUT", "DELETE")
240
+ allowedHeaders = listOf("Authorization", "Content-Type")
241
+ allowCredentials = true
242
+ maxAge = 3600L
243
+ }
244
+ return UrlBasedCorsConfigurationSource().apply {
245
+ registerCorsConfiguration("/api/**", config)
246
+ }
247
+ }
248
+ ```
249
+
250
+ ```python
251
+ # Django — django-cors-headers
252
+ CORS_ALLOWED_ORIGINS = [
253
+ "https://app.example.com",
254
+ ]
255
+ CORS_ALLOW_CREDENTIALS = True
256
+ CORS_ALLOW_ALL_ORIGINS = False # never True in production
257
+ ```
258
+
259
+ ## Security Headers
260
+
261
+ Set these headers on every response. They defend against XSS, clickjacking,
262
+ and MIME sniffing.
263
+
264
+ ```text
265
+ Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
266
+ Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'
267
+ X-Frame-Options: DENY
268
+ X-Content-Type-Options: nosniff
269
+ Referrer-Policy: strict-origin-when-cross-origin
270
+ Permissions-Policy: camera=(), microphone=(), geolocation=()
271
+ ```
272
+
273
+ ```typescript
274
+ // Next.js — next.config.ts
275
+ const securityHeaders = [
276
+ { key: 'X-Frame-Options', value: 'DENY' },
277
+ { key: 'X-Content-Type-Options', value: 'nosniff' },
278
+ { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
279
+ {
280
+ key: 'Strict-Transport-Security',
281
+ value: 'max-age=63072000; includeSubDomains; preload',
282
+ },
283
+ ];
284
+
285
+ export default {
286
+ headers: async () => [
287
+ { source: '/(.*)', headers: securityHeaders },
288
+ ],
289
+ };
290
+ ```
291
+
292
+ ## Secrets Management
293
+
294
+ **Never commit secrets to source control.** No exceptions.
295
+
296
+ ```text
297
+ ✗ DATABASE_URL = "postgres://user:password@prod.example.com/db" # in source
298
+ ✓ DATABASE_URL = env("DATABASE_URL") # from environment
299
+ ```
300
+
301
+ Rules:
302
+
303
+ - Load secrets from environment variables or a secrets manager (AWS Secrets
304
+ Manager, Vault, GCP Secret Manager)
305
+ - Rotate credentials on any suspected exposure
306
+ - Use separate credentials per environment (dev, staging, prod)
307
+ - Add `.env` to `.gitignore` and never commit it
308
+
309
+ ```python
310
+ # Django — django-environ
311
+ import environ
312
+ env = environ.Env()
313
+ environ.Env.read_env() # reads .env in development only
314
+
315
+ SECRET_KEY = env("SECRET_KEY")
316
+ DATABASE_URL = env.db("DATABASE_URL")
317
+ ```
318
+
319
+ ## Rate Limiting
320
+
321
+ Protect authentication endpoints. Brute-force without rate limiting can
322
+ compromise any account with a weak password.
323
+
324
+ ```kotlin
325
+ // Spring Boot — Bucket4j
326
+ @Component
327
+ class RateLimitFilter(private val rateLimiter: RateLimiter) : OncePerRequestFilter() {
328
+
329
+ override fun doFilterInternal(request: HttpServletRequest, response: HttpServletResponse, chain: FilterChain) {
330
+ if (request.requestURI.startsWith("/api/auth/")) {
331
+ val probe = rateLimiter.tryConsumeAndReturnRemaining(1)
332
+ if (!probe.isConsumed) {
333
+ response.status = HttpStatus.TOO_MANY_REQUESTS.value()
334
+ return
335
+ }
336
+ }
337
+ chain.doFilter(request, response)
338
+ }
339
+ }
340
+ ```
341
+
342
+ Minimum rate limits for auth endpoints: 5 requests per minute per IP. Stricter
343
+ limits (e.g., 3 per 15 minutes) are better for login endpoints.
344
+
345
+ ## SQL Injection Prevention
346
+
347
+ Never concatenate user input into SQL strings. Always use parameterized queries
348
+ or an ORM.
349
+
350
+ ```kotlin
351
+ // bad — SQL injection risk
352
+ val user = jdbcTemplate.queryForObject("SELECT * FROM users WHERE email = '$email'")
353
+
354
+ // good — parameterized
355
+ val user = jdbcTemplate.queryForObject(
356
+ "SELECT * FROM users WHERE email = ?",
357
+ UserRowMapper(),
358
+ email
359
+ )
360
+ ```
361
+
362
+ ```python
363
+ # bad
364
+ User.objects.raw(f"SELECT * FROM users WHERE email = '{email}'")
365
+
366
+ # good — Django ORM handles parameterization automatically
367
+ User.objects.filter(email=email)
368
+ ```
369
+
370
+ ## Logging Security Events
371
+
372
+ Log authentication events without including sensitive data.
373
+
374
+ ```text
375
+ Log: login success/failure, permission denied, password reset, token refresh
376
+ Never: passwords, tokens, PII (full email in prod logs), credit card numbers
377
+ ```
378
+
379
+ ```kotlin
380
+ // Log security events at INFO level; failures at WARN
381
+ log.info("Authentication successful for user={}", userId)
382
+ log.warn("Authentication failed: invalid credentials for user={}", maskedEmail)
383
+ log.warn("Authorization denied: user={} attempted access to resource={}", userId, resourceId)
384
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: seo-analytics-injector
3
+ version: 1.0.0
4
+ name: SEO Analytics Injector
5
+ description: >
6
+ Verifies and injects Google Tag Manager (GTM), GA4 event triggers, and optimized meta tags.
7
+ user-invokable: true
8
+ license: MIT
9
+ metadata:
10
+ author: lgzarturo
11
+ category: marketing
12
+ compatibility:
13
+ tools: [claude, codex, gemini, agy, opencode]
14
+ stacks:
15
+ languages: [typescript, javascript, html]
16
+ frameworks: [astro, nextjs]
17
+ ---
18
+ # SEO Analytics Injector
19
+
20
+ ## Core Principles
21
+
22
+ 1. **Meta tags**: Layouts must contain standard SEO meta tags (`title`, `description`, `robots`, `og:title`, `og:description`, `og:image`, `twitter:card`).
23
+ 2. **Analytics Integration**: Verify GTM container script is placed inside `<head>` (as high as possible) and the noscript iframe is placed immediately after the opening `<body>` tag.
24
+ 3. **Lighthouse Compatibility**: Ensure images have `width` and `height`, and interactive components have accessible descriptions.
25
+
26
+ ## GTM / GA4 Snippet Verification
27
+
28
+ GTM Script must match:
29
+ ```html
30
+ <!-- Google Tag Manager -->
31
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
32
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
33
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
34
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
35
+ })(window,document,'script','dataLayer','GTM-XXXXXX');</script>
36
+ <!-- End Google Tag Manager -->
37
+ ```
38
+ GTM Noscript must match:
39
+ ```html
40
+ <!-- Google Tag Manager (noscript) -->
41
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
42
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
43
+ <!-- End Google Tag Manager (noscript) -->
44
+ ```
@@ -0,0 +1,33 @@
1
+ ---
2
+ id: spring-auth-auditor
3
+ version: 1.0.0
4
+ name: Spring Auth Auditor
5
+ description: >
6
+ Secures Spring Security filters, JWT validations, OAuth2 setups, and CORS/CSRF headers.
7
+ user-invokable: true
8
+ license: MIT
9
+ metadata:
10
+ author: lgzarturo
11
+ category: security
12
+ compatibility:
13
+ tools: [claude, codex, gemini, agy, opencode]
14
+ stacks:
15
+ languages: [kotlin, java]
16
+ frameworks: [spring-boot, spring-security]
17
+ paths:
18
+ - "**/*.kt"
19
+ - "**/Security*.kt"
20
+ ---
21
+ # Spring Auth Auditor
22
+
23
+ ## Core Principles
24
+
25
+ 1. **Explicit Security Filters**: Define clear SecurityFilterChain configurations. Do not use default broad rules.
26
+ 2. **CORS & CSRF**: Always specify explicit CORS origins and keep CSRF protection enabled unless stateless API endpoints with JWT are explicitly verified.
27
+ 3. **No Mutations in Production**: Configurations must not mutate settings based on dev/prod environments dynamically in an unsafe manner.
28
+
29
+ ## Verification Checklist
30
+
31
+ - Validate JWT signature, issuer, and expiration time inside `OncePerRequestFilter`.
32
+ - Do not store JWT tokens in client-accessible localStorage. Promote Cookie-based Auth with `HttpOnly` flags.
33
+ - Ensure that endpoints matching `/api/public/**` or similar exclusions are intentionally public.