oh-my-agent-commandcode 0.0.0-stage → 20.38.4
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 +35 -2
- package/filter-test-output.sh +52 -0
- package/mods/oma.ts +347 -0
- package/package.json +30 -4
- package/skills/_shared/conditional/experiment-ledger.md +28 -0
- package/skills/_shared/conditional/exploration-loop.md +22 -0
- package/skills/_shared/conditional/quality-score.md +33 -0
- package/skills/_shared/core/anti-ai-prose.md +191 -0
- package/skills/_shared/core/api-contracts/README.md +28 -0
- package/skills/_shared/core/api-contracts/template.md +90 -0
- package/skills/_shared/core/clarification-protocol.md +23 -0
- package/skills/_shared/core/code-intelligence.md +46 -0
- package/skills/_shared/core/collaboration-policy.md +28 -0
- package/skills/_shared/core/common-checklist.md +28 -0
- package/skills/_shared/core/context-budget.md +22 -0
- package/skills/_shared/core/context-loading.md +34 -0
- package/skills/_shared/core/difficulty-guide.md +26 -0
- package/skills/_shared/core/execution-policy.md +31 -0
- package/skills/_shared/core/lessons-learned.md +33 -0
- package/skills/_shared/core/prompt-structure.md +18 -0
- package/skills/_shared/core/quality-principles.md +11 -0
- package/skills/_shared/core/session-metrics.md +35 -0
- package/skills/_shared/core/skill-routing.md +39 -0
- package/skills/_shared/core/test-approach.md +54 -0
- package/skills/_shared/core/vendor-detection.md +52 -0
- package/skills/_shared/runtime/memory-protocol.md +118 -0
- package/skills/_shared/runtime/result-contract.md +64 -0
- package/skills/_shared/ui-interaction-quality.md +133 -0
- package/skills/oma-academic-writing/SKILL.md +181 -0
- package/skills/oma-academic-writing/resources/abstract-guide.md +51 -0
- package/skills/oma-academic-writing/resources/academic-verb-tiers.md +42 -0
- package/skills/oma-academic-writing/resources/anti-ai-checklist.md +52 -0
- package/skills/oma-academic-writing/resources/hedging-guide.md +132 -0
- package/skills/oma-academic-writing/resources/sentence-structure-reference.md +151 -0
- package/skills/oma-architecture/SKILL.md +203 -0
- package/skills/oma-architecture/resources/api-evolution.md +41 -0
- package/skills/oma-architecture/resources/checklist.md +42 -0
- package/skills/oma-architecture/resources/execution-protocol.md +115 -0
- package/skills/oma-architecture/resources/methodology-selection.md +92 -0
- package/skills/oma-architecture/resources/migration-patterns.md +28 -0
- package/skills/oma-architecture/resources/output-templates.md +111 -0
- package/skills/oma-architecture/resources/stakeholder-synthesis.md +80 -0
- package/skills/oma-backend/SKILL.md +202 -0
- package/skills/oma-backend/resources/checklist.md +45 -0
- package/skills/oma-backend/resources/error-playbook.md +97 -0
- package/skills/oma-backend/resources/execution-protocol.md +39 -0
- package/skills/oma-backend/resources/orm-reference.md +61 -0
- package/skills/oma-backend/variants/node/api-template.ts +315 -0
- package/skills/oma-backend/variants/node/snippets.md +475 -0
- package/skills/oma-backend/variants/node/stack.yaml +21 -0
- package/skills/oma-backend/variants/node/tech-stack.md +33 -0
- package/skills/oma-backend/variants/python/api-template.py +378 -0
- package/skills/oma-backend/variants/python/snippets.md +199 -0
- package/skills/oma-backend/variants/python/stack.yaml +18 -0
- package/skills/oma-backend/variants/python/tech-stack.md +45 -0
- package/skills/oma-backend/variants/rust/api-template.rs +635 -0
- package/skills/oma-backend/variants/rust/snippets.md +471 -0
- package/skills/oma-backend/variants/rust/stack.yaml +20 -0
- package/skills/oma-backend/variants/rust/tech-stack.md +36 -0
- package/skills/oma-backend/variants/stack.schema.json +73 -0
- package/skills/oma-brainstorm/SKILL.md +166 -0
- package/skills/oma-brainstorm/resources/triz-lite.md +117 -0
- package/skills/oma-coordination/SKILL.md +171 -0
- package/skills/oma-db/SKILL.md +201 -0
- package/skills/oma-db/resources/anti-patterns.md +177 -0
- package/skills/oma-db/resources/checklist.md +67 -0
- package/skills/oma-db/resources/document-templates.md +107 -0
- package/skills/oma-db/resources/error-playbook.md +50 -0
- package/skills/oma-db/resources/examples.md +170 -0
- package/skills/oma-db/resources/execution-protocol.md +127 -0
- package/skills/oma-db/resources/iso-controls.md +98 -0
- package/skills/oma-db/resources/migration-playbook.md +93 -0
- package/skills/oma-db/resources/query-tuning.md +57 -0
- package/skills/oma-db/resources/vector-db.md +159 -0
- package/skills/oma-debug/SKILL.md +146 -0
- package/skills/oma-debug/resources/bug-report-template.md +327 -0
- package/skills/oma-debug/resources/checklist.md +31 -0
- package/skills/oma-debug/resources/common-patterns.md +734 -0
- package/skills/oma-debug/resources/debugging-checklist.md +364 -0
- package/skills/oma-debug/resources/error-playbook.md +94 -0
- package/skills/oma-debug/resources/execution-protocol.md +40 -0
- package/skills/oma-design/SKILL.md +135 -0
- package/skills/oma-design/resources/asset-strategy.md +34 -0
- package/skills/oma-design/resources/checklist.md +63 -0
- package/skills/oma-design/resources/data-grid.md +48 -0
- package/skills/oma-design/resources/design-md-spec.md +107 -0
- package/skills/oma-design/resources/design-tokens.md +53 -0
- package/skills/oma-design/resources/error-playbook.md +18 -0
- package/skills/oma-design/resources/execution-protocol.md +95 -0
- package/skills/oma-design/resources/external-design-skills.md +130 -0
- package/skills/oma-design/resources/getdesign-fetcher.md +104 -0
- package/skills/oma-design/resources/product-interface-review.md +59 -0
- package/skills/oma-design/resources/redesign-protocol.md +52 -0
- package/skills/oma-design/resources/stitch-integration.md +244 -0
- package/skills/oma-dev-workflow/SKILL.md +375 -0
- package/skills/oma-dev-workflow/resources/affected-checks.py +58 -0
- package/skills/oma-dev-workflow/resources/api-workflows.md +58 -0
- package/skills/oma-dev-workflow/resources/database-patterns.md +107 -0
- package/skills/oma-dev-workflow/resources/i18n-patterns.md +63 -0
- package/skills/oma-dev-workflow/resources/release-coordination.md +240 -0
- package/skills/oma-dev-workflow/resources/tooling-profiles.md +217 -0
- package/skills/oma-dev-workflow/resources/troubleshooting.md +78 -0
- package/skills/oma-dev-workflow/resources/validation-pipeline.md +246 -0
- package/skills/oma-docs/SKILL.md +77 -0
- package/skills/oma-docs/resources/commands.md +76 -0
- package/skills/oma-explanation/SKILL.md +212 -0
- package/skills/oma-explanation/resources/document-structure.md +115 -0
- package/skills/oma-explanation/resources/draft-format.md +199 -0
- package/skills/oma-explanation/resources/html-contract.md +102 -0
- package/skills/oma-frontend/SKILL.md +227 -0
- package/skills/oma-frontend/resources/angular-rules.md +110 -0
- package/skills/oma-frontend/resources/checklist.md +76 -0
- package/skills/oma-frontend/resources/error-playbook.md +125 -0
- package/skills/oma-frontend/resources/execution-protocol.md +46 -0
- package/skills/oma-frontend/resources/snippets.md +354 -0
- package/skills/oma-frontend/resources/specialized-visual-implementation.md +193 -0
- package/skills/oma-frontend/resources/tailwind-rules.md +83 -0
- package/skills/oma-frontend/resources/tech-stack.md +156 -0
- package/skills/oma-hwp/SKILL.md +166 -0
- package/skills/oma-hwp/config/hwp-config.yaml +35 -0
- package/skills/oma-hwp/resources/balanced-tables.ts +39 -0
- package/skills/oma-hwp/resources/execution-protocol.md +145 -0
- package/skills/oma-hwp/resources/flatten-tables.ts +101 -0
- package/skills/oma-hwp/resources/package.json +13 -0
- package/skills/oma-hwp/resources/troubleshooting.md +70 -0
- package/skills/oma-hwp/resources/tsconfig.json +10 -0
- package/skills/oma-hwp/resources/turndown-plugin-gfm.d.ts +9 -0
- package/skills/oma-image/SKILL.md +142 -0
- package/skills/oma-image/config/image-config.yaml +70 -0
- package/skills/oma-image/resources/checklist.md +18 -0
- package/skills/oma-image/resources/execution-protocol.md +117 -0
- package/skills/oma-image/resources/invocation.md +105 -0
- package/skills/oma-image/resources/prompt-tips.md +71 -0
- package/skills/oma-image/resources/vendor-matrix.md +90 -0
- package/skills/oma-market/SKILL.md +142 -0
- package/skills/oma-market/resources/checklist.md +12 -0
- package/skills/oma-market/resources/error-playbook.md +12 -0
- package/skills/oma-market/resources/execution-protocol.md +60 -0
- package/skills/oma-market/resources/frameworks/pestel.md +101 -0
- package/skills/oma-market/resources/frameworks/porters-5f.md +90 -0
- package/skills/oma-market/resources/frameworks/swot.md +61 -0
- package/skills/oma-market/resources/intent-rules.md +35 -0
- package/skills/oma-market/resources/output-laws.md +53 -0
- package/skills/oma-mobile/SKILL.md +168 -0
- package/skills/oma-mobile/resources/checklist.md +77 -0
- package/skills/oma-mobile/resources/error-playbook.md +198 -0
- package/skills/oma-mobile/resources/execution-protocol.md +47 -0
- package/skills/oma-mobile/resources/screen-template.dart +331 -0
- package/skills/oma-mobile/resources/screen-template.swift +239 -0
- package/skills/oma-mobile/resources/screen-template.tsx +179 -0
- package/skills/oma-mobile/resources/tech-stack.md +69 -0
- package/skills/oma-mobile/variants/README.md +45 -0
- package/skills/oma-mobile/variants/flutter/api-template.dart +461 -0
- package/skills/oma-mobile/variants/flutter/snippets.md +1353 -0
- package/skills/oma-mobile/variants/flutter/stack.yaml +21 -0
- package/skills/oma-mobile/variants/flutter/tech-stack.md +201 -0
- package/skills/oma-mobile/variants/kotlin-android/api-template.kt +182 -0
- package/skills/oma-mobile/variants/kotlin-android/snippets.md +871 -0
- package/skills/oma-mobile/variants/kotlin-android/stack.yaml +32 -0
- package/skills/oma-mobile/variants/kotlin-android/tech-stack.md +159 -0
- package/skills/oma-mobile/variants/react-native/api-template.ts +531 -0
- package/skills/oma-mobile/variants/react-native/snippets.md +1014 -0
- package/skills/oma-mobile/variants/react-native/stack.yaml +22 -0
- package/skills/oma-mobile/variants/react-native/tech-stack.md +192 -0
- package/skills/oma-mobile/variants/stack.schema.json +68 -0
- package/skills/oma-mobile/variants/swift-ios/api-template.swift +165 -0
- package/skills/oma-mobile/variants/swift-ios/snippets.md +1028 -0
- package/skills/oma-mobile/variants/swift-ios/stack.yaml +25 -0
- package/skills/oma-mobile/variants/swift-ios/tech-stack.md +174 -0
- package/skills/oma-observability/SKILL.md +225 -0
- package/skills/oma-observability/resources/anti-patterns.md +555 -0
- package/skills/oma-observability/resources/boundaries/cross-application.md +348 -0
- package/skills/oma-observability/resources/boundaries/multi-tenant.md +290 -0
- package/skills/oma-observability/resources/boundaries/release.md +372 -0
- package/skills/oma-observability/resources/boundaries/slo.md +225 -0
- package/skills/oma-observability/resources/checklist.md +123 -0
- package/skills/oma-observability/resources/examples.md +448 -0
- package/skills/oma-observability/resources/execution-protocol.md +166 -0
- package/skills/oma-observability/resources/incident-forensics.md +348 -0
- package/skills/oma-observability/resources/intent-rules.md +307 -0
- package/skills/oma-observability/resources/layers/L3-network.md +281 -0
- package/skills/oma-observability/resources/layers/L4-transport.md +299 -0
- package/skills/oma-observability/resources/layers/L7-application/crash-analytics.md +359 -0
- package/skills/oma-observability/resources/layers/L7-application/mobile-rum.md +278 -0
- package/skills/oma-observability/resources/layers/L7-application/waf.md +246 -0
- package/skills/oma-observability/resources/layers/L7-application/web-rum.md +350 -0
- package/skills/oma-observability/resources/layers/mesh.md +368 -0
- package/skills/oma-observability/resources/matrix.md +177 -0
- package/skills/oma-observability/resources/meta-observability.md +605 -0
- package/skills/oma-observability/resources/observability-as-code.md +666 -0
- package/skills/oma-observability/resources/signals/audit.md +310 -0
- package/skills/oma-observability/resources/signals/cost.md +303 -0
- package/skills/oma-observability/resources/signals/logs.md +263 -0
- package/skills/oma-observability/resources/signals/metrics.md +478 -0
- package/skills/oma-observability/resources/signals/privacy.md +351 -0
- package/skills/oma-observability/resources/signals/profiles.md +245 -0
- package/skills/oma-observability/resources/signals/traces.md +360 -0
- package/skills/oma-observability/resources/standards.md +214 -0
- package/skills/oma-observability/resources/transport/collector-topology.md +308 -0
- package/skills/oma-observability/resources/transport/otlp-grpc-vs-http.md +256 -0
- package/skills/oma-observability/resources/transport/sampling-recipes.md +297 -0
- package/skills/oma-observability/resources/transport/udp-statsd-mtu.md +167 -0
- package/skills/oma-observability/resources/vendor-categories.md +352 -0
- package/skills/oma-orchestration/SKILL.md +302 -0
- package/skills/oma-orchestration/config/cli-config.yaml +92 -0
- package/skills/oma-orchestration/resources/memory-schema.md +232 -0
- package/skills/oma-orchestration/resources/subagent-prompt-template.md +30 -0
- package/skills/oma-orchestration/scripts/parallel-run.sh +6 -0
- package/skills/oma-orchestration/scripts/spawn-agent.sh +5 -0
- package/skills/oma-orchestration/scripts/verify.sh +20 -0
- package/skills/oma-orchestration/templates/backend-task.md +19 -0
- package/skills/oma-orchestration/templates/debug-task.md +16 -0
- package/skills/oma-orchestration/templates/frontend-task.md +18 -0
- package/skills/oma-orchestration/templates/mobile-task.md +18 -0
- package/skills/oma-orchestration/templates/qa-task.md +16 -0
- package/skills/oma-orchestration/templates/tasks-example.yaml +15 -0
- package/skills/oma-pdf/SKILL.md +162 -0
- package/skills/oma-pdf/config/pdf-config.yaml +27 -0
- package/skills/oma-pdf/resources/execution-protocol.md +127 -0
- package/skills/oma-pm/SKILL.md +157 -0
- package/skills/oma-pm/resources/error-playbook.md +75 -0
- package/skills/oma-pm/resources/examples.md +439 -0
- package/skills/oma-pm/resources/execution-protocol.md +62 -0
- package/skills/oma-pm/resources/iso-planning.md +110 -0
- package/skills/oma-pm/resources/plan-phase-protocol.md +66 -0
- package/skills/oma-pm/resources/task-template.json +86 -0
- package/skills/oma-qa/SKILL.md +141 -0
- package/skills/oma-qa/resources/checklist.md +339 -0
- package/skills/oma-qa/resources/error-playbook.md +98 -0
- package/skills/oma-qa/resources/execution-protocol.md +169 -0
- package/skills/oma-qa/resources/iso-quality.md +82 -0
- package/skills/oma-qa/resources/verify-ship-protocol.md +116 -0
- package/skills/oma-recap/SKILL.md +245 -0
- package/skills/oma-recap/resources/output-formats.md +83 -0
- package/skills/oma-refactor/SKILL.md +184 -0
- package/skills/oma-refactor/resources/definition.md +108 -0
- package/skills/oma-refactor/resources/governance.md +33 -0
- package/skills/oma-refactor/resources/hotspots.py +44 -0
- package/skills/oma-refactor/resources/measurement.md +93 -0
- package/skills/oma-scholar/SKILL.md +276 -0
- package/skills/oma-scholar/config/scholar-config.yaml +79 -0
- package/skills/oma-scholar/resources/api-endpoints.md +174 -0
- package/skills/oma-scholar/resources/checklist.md +92 -0
- package/skills/oma-scholar/resources/execution-protocol.md +224 -0
- package/skills/oma-scholar/resources/fallback-providers.md +143 -0
- package/skills/oma-scholar/resources/setup-openalex.md +85 -0
- package/skills/oma-scholar/resources/sidecar-spec.md +341 -0
- package/skills/oma-scholar/resources/upstream-spec-cache.md +972 -0
- package/skills/oma-scm/SKILL.md +103 -0
- package/skills/oma-scm/resources/cm-operations.md +56 -0
- package/skills/oma-scm/resources/codeowners-playbook.md +45 -0
- package/skills/oma-scm/resources/conventional-commits.md +108 -0
- package/skills/oma-scm/resources/merge-risk.md +76 -0
- package/skills/oma-scm/resources/onboarding-risk-signals.md +71 -0
- package/skills/oma-search/SKILL.md +125 -0
- package/skills/oma-search/resources/checklist.md +36 -0
- package/skills/oma-search/resources/error-playbook.md +66 -0
- package/skills/oma-search/resources/examples.md +80 -0
- package/skills/oma-search/resources/execution-protocol.md +86 -0
- package/skills/oma-search/resources/intent-rules.md +47 -0
- package/skills/oma-search/resources/trust-registry.md +53 -0
- package/skills/oma-security/SKILL.md +172 -0
- package/skills/oma-security/resources/artex.md +108 -0
- package/skills/oma-security/resources/ci.md +134 -0
- package/skills/oma-security/resources/cisco-source.md +108 -0
- package/skills/oma-security/resources/deepsec-config.md +45 -0
- package/skills/oma-security/resources/deepsec-matchers.md +35 -0
- package/skills/oma-security/resources/deepsec-scanning.md +45 -0
- package/skills/oma-security/resources/deepsec-setup.md +41 -0
- package/skills/oma-security/resources/findings-contract.md +408 -0
- package/skills/oma-security/resources/mcp-scanning.md +122 -0
- package/skills/oma-security/resources/skill-scanning.md +106 -0
- package/skills/oma-security/resources/validation.md +71 -0
- package/skills/oma-skill-creation/SKILL.md +84 -0
- package/skills/oma-skill-creation/resources/prompt-evaluation.md +36 -0
- package/skills/oma-skill-creation/resources/ssl-lite-template.md +108 -0
- package/skills/oma-skill-creation/resources/validation-checklist.md +101 -0
- package/skills/oma-slide/SKILL.md +277 -0
- package/skills/oma-slide/resources/animation-patterns.md +245 -0
- package/skills/oma-slide/resources/assets/deck-stage.js +514 -0
- package/skills/oma-slide/resources/assets/viewport-base.css +257 -0
- package/skills/oma-slide/resources/canva-integration.md +203 -0
- package/skills/oma-slide/resources/checklist.md +46 -0
- package/skills/oma-slide/resources/design-doctrine.md +260 -0
- package/skills/oma-slide/resources/fixed-stage.md +232 -0
- package/skills/oma-slide/resources/generation-protocol.md +393 -0
- package/skills/oma-slide/resources/native-pptx.md +84 -0
- package/skills/oma-slide/resources/selection-index.json +461 -0
- package/skills/oma-slide/resources/style-presets.LICENSE +10 -0
- package/skills/oma-slide/resources/style-presets.md +520 -0
- package/skills/oma-tf-infra/SKILL.md +201 -0
- package/skills/oma-tf-infra/resources/checklist.md +53 -0
- package/skills/oma-tf-infra/resources/cost-optimization.md +574 -0
- package/skills/oma-tf-infra/resources/error-playbook.md +68 -0
- package/skills/oma-tf-infra/resources/examples.md +38 -0
- package/skills/oma-tf-infra/resources/execution-protocol.md +129 -0
- package/skills/oma-tf-infra/resources/iso-42001-infra.md +229 -0
- package/skills/oma-tf-infra/resources/multi-cloud-examples.md +241 -0
- package/skills/oma-tf-infra/resources/policy-testing-examples.md +332 -0
- package/skills/oma-translation/SKILL.md +229 -0
- package/skills/oma-translation/resources/anti-ai-patterns.md +104 -0
- package/skills/oma-translation/resources/lang/_template.md +73 -0
- package/skills/oma-translation/resources/lang/en.md +123 -0
- package/skills/oma-translation/resources/lang/ja.md +274 -0
- package/skills/oma-translation/resources/lang/ko.md +228 -0
- package/skills/oma-translation/resources/lang/zh.md +285 -0
- package/skills/oma-translation/resources/style-skills.md +104 -0
- package/skills/oma-translation/resources/translation-rubric.md +126 -0
- package/skills/oma-video/SKILL.md +229 -0
- package/skills/oma-video/config/video-config.yaml +60 -0
- package/skills/oma-video/resources/checklist.md +26 -0
- package/skills/oma-video/resources/execution-protocol.md +122 -0
- package/skills/oma-video/resources/existing-media.md +185 -0
- package/skills/oma-video/resources/hyperframes-authoring/README.md +44 -0
- package/skills/oma-video/resources/hyperframes-authoring/demo.md +31 -0
- package/skills/oma-video/resources/hyperframes-authoring/explainer.md +10 -0
- package/skills/oma-video/resources/hyperframes-authoring/shorts.md +10 -0
- package/skills/oma-video/resources/motion-principles.md +81 -0
- package/skills/oma-video/resources/mpt/driver.py +301 -0
- package/skills/oma-video/resources/prompt-tips.md +75 -0
- package/skills/oma-video/resources/script-schema.md +81 -0
- package/skills/oma-video/resources/sound-design.md +127 -0
- package/skills/oma-video/resources/strudel/package.json +11 -0
- package/skills/oma-video/resources/strudel/page.html +87 -0
- package/skills/oma-video/resources/strudel/render.mjs +295 -0
- package/skills/oma-video/resources/vendor-matrix.md +124 -0
- package/skills/oma-voice/SKILL.md +249 -0
- package/skills/oma-voice/config/voice-config.yaml +30 -0
- package/skills/oma-voice/resources/audio-processing.md +119 -0
- package/skills/oma-voice/resources/checklist.md +47 -0
- package/skills/oma-voice/resources/execution-protocol.md +215 -0
- package/skills/oma-voice/resources/prompt-tips.md +43 -0
- package/skills/oma-voice/resources/voice-matrix.md +51 -0
- package/skills/oma-voice/resources/voicestudio.md +87 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
# Backend Agent - Code Snippets (Node.js / NestJS)
|
|
2
|
+
|
|
3
|
+
Copy-paste ready patterns. Use these as starting points, adapt to the specific task.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. NestJS Controller with Auth Guard
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import {
|
|
11
|
+
Controller,
|
|
12
|
+
Get,
|
|
13
|
+
Post,
|
|
14
|
+
Patch,
|
|
15
|
+
Delete,
|
|
16
|
+
Body,
|
|
17
|
+
Param,
|
|
18
|
+
ParseUUIDPipe,
|
|
19
|
+
HttpCode,
|
|
20
|
+
HttpStatus,
|
|
21
|
+
UseGuards,
|
|
22
|
+
} from '@nestjs/common';
|
|
23
|
+
import { JwtAuthGuard } from '../common/guards/jwt-auth.guard';
|
|
24
|
+
import { CurrentUser } from '../common/decorators/current-user.decorator';
|
|
25
|
+
import { ResourcesService } from './resources.service';
|
|
26
|
+
import { CreateResourceDto, CreateResourceSchema } from './dto/create-resource.dto';
|
|
27
|
+
import { ZodValidationPipe } from '../common/pipes/zod-validation.pipe';
|
|
28
|
+
import { UpdateResourceDto, UpdateResourceSchema } from './dto/update-resource.dto';
|
|
29
|
+
import { User } from '@prisma/client';
|
|
30
|
+
|
|
31
|
+
@Controller('api/resources')
|
|
32
|
+
@UseGuards(JwtAuthGuard)
|
|
33
|
+
export class ResourcesController {
|
|
34
|
+
constructor(private readonly resourcesService: ResourcesService) {}
|
|
35
|
+
|
|
36
|
+
@Get()
|
|
37
|
+
findAll(@CurrentUser() user: User) {
|
|
38
|
+
return this.resourcesService.findAll(user.id);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Get(':id')
|
|
42
|
+
findOne(
|
|
43
|
+
@Param('id', ParseUUIDPipe) id: string,
|
|
44
|
+
@CurrentUser() user: User,
|
|
45
|
+
) {
|
|
46
|
+
return this.resourcesService.findOne(id, user.id);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@Post()
|
|
50
|
+
@HttpCode(HttpStatus.CREATED)
|
|
51
|
+
create(
|
|
52
|
+
@Body(new ZodValidationPipe(CreateResourceSchema)) dto: CreateResourceDto,
|
|
53
|
+
@CurrentUser() user: User,
|
|
54
|
+
) {
|
|
55
|
+
return this.resourcesService.create(dto, user.id);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@Patch(':id')
|
|
59
|
+
update(
|
|
60
|
+
@Param('id', ParseUUIDPipe) id: string,
|
|
61
|
+
@Body(new ZodValidationPipe(UpdateResourceSchema)) dto: UpdateResourceDto,
|
|
62
|
+
@CurrentUser() user: User,
|
|
63
|
+
) {
|
|
64
|
+
return this.resourcesService.update(id, dto, user.id);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Delete(':id')
|
|
68
|
+
@HttpCode(HttpStatus.NO_CONTENT)
|
|
69
|
+
remove(
|
|
70
|
+
@Param('id', ParseUUIDPipe) id: string,
|
|
71
|
+
@CurrentUser() user: User,
|
|
72
|
+
) {
|
|
73
|
+
return this.resourcesService.remove(id, user.id);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 2. Zod Schema Validation
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { z } from 'zod';
|
|
84
|
+
|
|
85
|
+
// Schema definitions
|
|
86
|
+
export const CreateResourceSchema = z.object({
|
|
87
|
+
title: z.string().min(1).max(200),
|
|
88
|
+
description: z.string().max(1000).optional(),
|
|
89
|
+
status: z.enum(['active', 'archived']).default('active'),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const UpdateResourceSchema = CreateResourceSchema.partial();
|
|
93
|
+
|
|
94
|
+
export const PaginationSchema = z.object({
|
|
95
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
96
|
+
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
97
|
+
search: z.string().optional(),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Inferred TypeScript types
|
|
101
|
+
export type CreateResourceDto = z.infer<typeof CreateResourceSchema>;
|
|
102
|
+
export type UpdateResourceDto = z.infer<typeof UpdateResourceSchema>;
|
|
103
|
+
export type PaginationDto = z.infer<typeof PaginationSchema>;
|
|
104
|
+
|
|
105
|
+
// NestJS pipe for Zod validation
|
|
106
|
+
import { PipeTransform, Injectable, BadRequestException } from '@nestjs/common';
|
|
107
|
+
import { ZodSchema } from 'zod';
|
|
108
|
+
|
|
109
|
+
@Injectable()
|
|
110
|
+
export class ZodValidationPipe implements PipeTransform {
|
|
111
|
+
constructor(private readonly schema: ZodSchema) {}
|
|
112
|
+
|
|
113
|
+
transform(value: unknown) {
|
|
114
|
+
const result = this.schema.safeParse(value);
|
|
115
|
+
if (!result.success) {
|
|
116
|
+
throw new BadRequestException(result.error.flatten());
|
|
117
|
+
}
|
|
118
|
+
return result.data;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 3. Prisma Model Example
|
|
126
|
+
|
|
127
|
+
```prisma
|
|
128
|
+
// schema.prisma
|
|
129
|
+
|
|
130
|
+
generator client {
|
|
131
|
+
provider = "prisma-client-js"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
datasource db {
|
|
135
|
+
provider = "postgresql"
|
|
136
|
+
url = env("DATABASE_URL")
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
model User {
|
|
140
|
+
id String @id @default(uuid()) @db.Uuid
|
|
141
|
+
email String @unique
|
|
142
|
+
password String
|
|
143
|
+
resources Resource[]
|
|
144
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
145
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
146
|
+
|
|
147
|
+
@@map("users")
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
model Resource {
|
|
151
|
+
id String @id @default(uuid()) @db.Uuid
|
|
152
|
+
title String @db.VarChar(200)
|
|
153
|
+
description String? @db.Text
|
|
154
|
+
status String @default("active") @db.VarChar(20)
|
|
155
|
+
userId String @map("user_id") @db.Uuid
|
|
156
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
157
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
158
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
159
|
+
deletedAt DateTime? @map("deleted_at")
|
|
160
|
+
|
|
161
|
+
@@index([userId])
|
|
162
|
+
@@map("resources")
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 4. NestJS Module with DI
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
import { Module } from '@nestjs/common';
|
|
172
|
+
import { ResourcesController } from './resources.controller';
|
|
173
|
+
import { ResourcesService } from './resources.service';
|
|
174
|
+
import { ResourcesRepository } from './resources.repository';
|
|
175
|
+
import { PrismaModule } from '../prisma/prisma.module';
|
|
176
|
+
|
|
177
|
+
@Module({
|
|
178
|
+
imports: [PrismaModule],
|
|
179
|
+
controllers: [ResourcesController],
|
|
180
|
+
providers: [ResourcesService, ResourcesRepository],
|
|
181
|
+
exports: [ResourcesService],
|
|
182
|
+
})
|
|
183
|
+
export class ResourcesModule {}
|
|
184
|
+
|
|
185
|
+
// prisma/prisma.module.ts
|
|
186
|
+
import { Global, Module } from '@nestjs/common';
|
|
187
|
+
import { PrismaService } from './prisma.service';
|
|
188
|
+
|
|
189
|
+
@Global()
|
|
190
|
+
@Module({
|
|
191
|
+
providers: [PrismaService],
|
|
192
|
+
exports: [PrismaService],
|
|
193
|
+
})
|
|
194
|
+
export class PrismaModule {}
|
|
195
|
+
|
|
196
|
+
// prisma/prisma.service.ts
|
|
197
|
+
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
|
198
|
+
import { PrismaClient } from '@prisma/client';
|
|
199
|
+
|
|
200
|
+
@Injectable()
|
|
201
|
+
export class PrismaService
|
|
202
|
+
extends PrismaClient
|
|
203
|
+
implements OnModuleInit, OnModuleDestroy
|
|
204
|
+
{
|
|
205
|
+
async onModuleInit() {
|
|
206
|
+
await this.$connect();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
async onModuleDestroy() {
|
|
210
|
+
await this.$disconnect();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 5. Repository/Service Pattern
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
// resources.repository.ts
|
|
221
|
+
import { Injectable } from '@nestjs/common';
|
|
222
|
+
import { PrismaService } from '../prisma/prisma.service';
|
|
223
|
+
import { Prisma, Resource } from '@prisma/client';
|
|
224
|
+
|
|
225
|
+
@Injectable()
|
|
226
|
+
export class ResourcesRepository {
|
|
227
|
+
constructor(private readonly prisma: PrismaService) {}
|
|
228
|
+
|
|
229
|
+
async findMany(
|
|
230
|
+
where: Prisma.ResourceWhereInput,
|
|
231
|
+
options?: { skip?: number; take?: number },
|
|
232
|
+
): Promise<Resource[]> {
|
|
233
|
+
return this.prisma.resource.findMany({
|
|
234
|
+
where,
|
|
235
|
+
skip: options?.skip,
|
|
236
|
+
take: options?.take,
|
|
237
|
+
orderBy: { createdAt: 'desc' },
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
async findOne(id: string, userId: string): Promise<Resource | null> {
|
|
242
|
+
return this.prisma.resource.findFirst({
|
|
243
|
+
where: { id, userId, deletedAt: null },
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async create(data: Prisma.ResourceCreateInput): Promise<Resource> {
|
|
248
|
+
return this.prisma.resource.create({ data });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
async update(id: string, data: Prisma.ResourceUpdateInput): Promise<Resource> {
|
|
252
|
+
return this.prisma.resource.update({ where: { id }, data });
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async softDelete(id: string): Promise<Resource> {
|
|
256
|
+
return this.prisma.resource.update({
|
|
257
|
+
where: { id },
|
|
258
|
+
data: { deletedAt: new Date() },
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// resources.service.ts
|
|
264
|
+
import { Injectable, NotFoundException, ForbiddenException } from '@nestjs/common';
|
|
265
|
+
import { ResourcesRepository } from './resources.repository';
|
|
266
|
+
import { CreateResourceDto, UpdateResourceDto } from './dto/resource.dto';
|
|
267
|
+
import { Resource } from '@prisma/client';
|
|
268
|
+
|
|
269
|
+
@Injectable()
|
|
270
|
+
export class ResourcesService {
|
|
271
|
+
constructor(private readonly resourcesRepo: ResourcesRepository) {}
|
|
272
|
+
|
|
273
|
+
async findAll(userId: string): Promise<Resource[]> {
|
|
274
|
+
return this.resourcesRepo.findMany({ userId, deletedAt: null });
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
async findOne(id: string, userId: string): Promise<Resource> {
|
|
278
|
+
const resource = await this.resourcesRepo.findOne(id, userId);
|
|
279
|
+
if (!resource) throw new NotFoundException(`Resource ${id} not found`);
|
|
280
|
+
if (resource.userId !== userId) throw new ForbiddenException('Access denied');
|
|
281
|
+
return resource;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
async create(dto: CreateResourceDto, userId: string): Promise<Resource> {
|
|
285
|
+
return this.resourcesRepo.create({ ...dto, user: { connect: { id: userId } } });
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async update(id: string, dto: UpdateResourceDto, userId: string): Promise<Resource> {
|
|
289
|
+
await this.findOne(id, userId); // ownership check
|
|
290
|
+
return this.resourcesRepo.update(id, dto);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async remove(id: string, userId: string): Promise<void> {
|
|
294
|
+
await this.findOne(id, userId); // ownership check
|
|
295
|
+
await this.resourcesRepo.softDelete(id);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 6. Paginated Query with Prisma
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
import { Injectable } from '@nestjs/common';
|
|
306
|
+
import { PrismaService } from '../prisma/prisma.service';
|
|
307
|
+
import { Resource } from '@prisma/client';
|
|
308
|
+
|
|
309
|
+
export interface PaginatedResult<T> {
|
|
310
|
+
items: T[];
|
|
311
|
+
total: number;
|
|
312
|
+
page: number;
|
|
313
|
+
limit: number;
|
|
314
|
+
totalPages: number;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@Injectable()
|
|
318
|
+
export class ResourcesRepository {
|
|
319
|
+
constructor(private readonly prisma: PrismaService) {}
|
|
320
|
+
|
|
321
|
+
async findPaginated(
|
|
322
|
+
userId: string,
|
|
323
|
+
page: number = 1,
|
|
324
|
+
limit: number = 20,
|
|
325
|
+
search?: string,
|
|
326
|
+
): Promise<PaginatedResult<Resource>> {
|
|
327
|
+
const where = {
|
|
328
|
+
userId,
|
|
329
|
+
deletedAt: null,
|
|
330
|
+
...(search && {
|
|
331
|
+
title: { contains: search, mode: 'insensitive' as const },
|
|
332
|
+
}),
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
const [items, total] = await this.prisma.$transaction([
|
|
336
|
+
this.prisma.resource.findMany({
|
|
337
|
+
where,
|
|
338
|
+
skip: (page - 1) * limit,
|
|
339
|
+
take: limit,
|
|
340
|
+
orderBy: { createdAt: 'desc' },
|
|
341
|
+
}),
|
|
342
|
+
this.prisma.resource.count({ where }),
|
|
343
|
+
]);
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
items,
|
|
347
|
+
total,
|
|
348
|
+
page,
|
|
349
|
+
limit,
|
|
350
|
+
totalPages: Math.ceil(total / limit),
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 7. Prisma Migration Example
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# Generate and apply a new migration
|
|
362
|
+
npx prisma migrate dev --name add_resources_table
|
|
363
|
+
|
|
364
|
+
# Apply migrations in production
|
|
365
|
+
npx prisma migrate deploy
|
|
366
|
+
|
|
367
|
+
# Reset database (dev only)
|
|
368
|
+
npx prisma migrate reset
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
```sql
|
|
372
|
+
-- Migration file: prisma/migrations/20240101000000_add_resources_table/migration.sql
|
|
373
|
+
|
|
374
|
+
CREATE TABLE "resources" (
|
|
375
|
+
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
|
|
376
|
+
"title" VARCHAR(200) NOT NULL,
|
|
377
|
+
"description" TEXT,
|
|
378
|
+
"status" VARCHAR(20) NOT NULL DEFAULT 'active',
|
|
379
|
+
"user_id" UUID NOT NULL,
|
|
380
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
381
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
382
|
+
"deleted_at" TIMESTAMP(3),
|
|
383
|
+
|
|
384
|
+
CONSTRAINT "resources_pkey" PRIMARY KEY ("id")
|
|
385
|
+
);
|
|
386
|
+
|
|
387
|
+
CREATE INDEX "resources_user_id_idx" ON "resources"("user_id");
|
|
388
|
+
|
|
389
|
+
ALTER TABLE "resources"
|
|
390
|
+
ADD CONSTRAINT "resources_user_id_fkey"
|
|
391
|
+
FOREIGN KEY ("user_id")
|
|
392
|
+
REFERENCES "users"("id")
|
|
393
|
+
ON DELETE CASCADE ON UPDATE CASCADE;
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## 8. Vitest + Supertest Endpoint Test
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
// resources.e2e-spec.ts
|
|
402
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
403
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
404
|
+
import { INestApplication, ValidationPipe } from '@nestjs/common';
|
|
405
|
+
import request from 'supertest';
|
|
406
|
+
import { AppModule } from '../src/app.module';
|
|
407
|
+
import { PrismaService } from '../src/prisma/prisma.service';
|
|
408
|
+
|
|
409
|
+
describe('Resources (e2e)', () => {
|
|
410
|
+
let app: INestApplication;
|
|
411
|
+
let prisma: PrismaService;
|
|
412
|
+
let authToken: string;
|
|
413
|
+
|
|
414
|
+
beforeAll(async () => {
|
|
415
|
+
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
416
|
+
imports: [AppModule],
|
|
417
|
+
}).compile();
|
|
418
|
+
|
|
419
|
+
app = moduleFixture.createNestApplication();
|
|
420
|
+
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
|
|
421
|
+
await app.init();
|
|
422
|
+
|
|
423
|
+
prisma = app.get(PrismaService);
|
|
424
|
+
|
|
425
|
+
// Create a test user and obtain JWT
|
|
426
|
+
const loginRes = await request(app.getHttpServer())
|
|
427
|
+
.post('/api/auth/login')
|
|
428
|
+
.send({ email: 'test@example.com', password: 'password123' });
|
|
429
|
+
|
|
430
|
+
authToken = loginRes.body.accessToken;
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
afterAll(async () => {
|
|
434
|
+
await prisma.resource.deleteMany({ where: { title: { startsWith: 'Test' } } });
|
|
435
|
+
await app.close();
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
it('POST /api/resources - creates a resource', async () => {
|
|
439
|
+
const res = await request(app.getHttpServer())
|
|
440
|
+
.post('/api/resources')
|
|
441
|
+
.set('Authorization', `Bearer ${authToken}`)
|
|
442
|
+
.send({ title: 'Test Resource', description: 'Test description' });
|
|
443
|
+
|
|
444
|
+
expect(res.status).toBe(201);
|
|
445
|
+
expect(res.body).toMatchObject({
|
|
446
|
+
id: expect.any(String),
|
|
447
|
+
title: 'Test Resource',
|
|
448
|
+
description: 'Test description',
|
|
449
|
+
status: 'active',
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it('GET /api/resources - lists resources', async () => {
|
|
454
|
+
const res = await request(app.getHttpServer())
|
|
455
|
+
.get('/api/resources')
|
|
456
|
+
.set('Authorization', `Bearer ${authToken}`);
|
|
457
|
+
|
|
458
|
+
expect(res.status).toBe(200);
|
|
459
|
+
expect(Array.isArray(res.body)).toBe(true);
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
it('GET /api/resources/:id - returns 404 for unknown id', async () => {
|
|
463
|
+
const res = await request(app.getHttpServer())
|
|
464
|
+
.get('/api/resources/00000000-0000-0000-0000-000000000000')
|
|
465
|
+
.set('Authorization', `Bearer ${authToken}`);
|
|
466
|
+
|
|
467
|
+
expect(res.status).toBe(404);
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
it('GET /api/resources - returns 401 without token', async () => {
|
|
471
|
+
const res = await request(app.getHttpServer()).get('/api/resources');
|
|
472
|
+
expect(res.status).toBe(401);
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../stack.schema.json
|
|
2
|
+
language: node
|
|
3
|
+
framework: hono
|
|
4
|
+
orm: prisma
|
|
5
|
+
source: variant
|
|
6
|
+
|
|
7
|
+
verify:
|
|
8
|
+
detect: package.json
|
|
9
|
+
syntax:
|
|
10
|
+
cmd: "bunx tsc --noEmit"
|
|
11
|
+
skip_if_missing: bunx
|
|
12
|
+
tests:
|
|
13
|
+
cmd: "bun test"
|
|
14
|
+
skip_if_missing: bun
|
|
15
|
+
raw_sql:
|
|
16
|
+
patterns:
|
|
17
|
+
- "\\$queryRawUnsafe\\("
|
|
18
|
+
- "\\$executeRawUnsafe\\("
|
|
19
|
+
- "sql\\.raw\\("
|
|
20
|
+
include_glob: "*.ts"
|
|
21
|
+
exclude_dirs: [node_modules, dist, build, coverage]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Backend Agent - Tech Stack Reference (Node.js)
|
|
2
|
+
|
|
3
|
+
## Primary Stack
|
|
4
|
+
- **Runtime**: Node.js 22+ / Bun 1.2+
|
|
5
|
+
- **Language**: TypeScript 5.x (strict mode)
|
|
6
|
+
- **Framework**: NestJS 11+ or Hono 4+
|
|
7
|
+
- **ORM**: Prisma 6+ or Drizzle ORM
|
|
8
|
+
- **Validation**: Zod
|
|
9
|
+
- **Type utilities**: type-fest (`SetRequired`, `Merge`, `JsonValue`, `Promisable`, etc.; prefer over hand-rolled conditional-type gymnastics)
|
|
10
|
+
- **Database**: PostgreSQL 16+, Redis 7+
|
|
11
|
+
- **Auth**: jsonwebtoken, argon2 (node-argon2)
|
|
12
|
+
- **Testing**: Vitest, Supertest
|
|
13
|
+
- **Migrations**: Prisma Migrate or Drizzle Kit
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
```
|
|
17
|
+
src/
|
|
18
|
+
modules/ # Feature modules (NestJS) or routes (Hono)
|
|
19
|
+
common/ # Shared guards, pipes, interceptors
|
|
20
|
+
prisma/ # Prisma client and schema
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Security Requirements
|
|
24
|
+
- Password hashing: Argon2id via `argon2` (bcrypt cost 10-12 acceptable for legacy compatibility)
|
|
25
|
+
- JWT: 15min access tokens, 7 day refresh tokens
|
|
26
|
+
- Rate limiting on auth endpoints
|
|
27
|
+
- Input validation with Zod schemas
|
|
28
|
+
- Parameterized queries via ORM (never raw string interpolation)
|
|
29
|
+
|
|
30
|
+
## Linter/Formatter
|
|
31
|
+
- **ESLint**: with @typescript-eslint
|
|
32
|
+
- **Prettier**: consistent formatting
|
|
33
|
+
- **Biome**: alternative all-in-one (lint + format)
|