nestjs-oop-design-patterns
Refactor NestJS Code with Pragmatic Design Patterns
Unclear responsibilities and unnecessary abstractions make NestJS code difficult to change and test. This skill guides evidence-based object design, pattern selection, and behavior-preserving refactoring.
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "nestjs-oop-design-patterns" from https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns.md and its manifest at https://skillstore.io/api/skills/amirtaherkhani-nestjs-oop-design-patterns/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「nestjs-oop-design-patterns」。 A checkout service validates orders, calls a payment SDK, and maps database rows.
預期結果:
- Role: The checkout use case coordinates order placement.
- Evidence: Vendor payment details and persistence mapping change for different reasons.
- Recommendation: Keep coordination in the use case and move vendor translation into an application-owned payment adapter.
- Trade-off: The adapter adds a boundary and requires contract tests.
- Verification: Preserve payment errors, order invariants, and provider wiring with focused tests.
正在使用「nestjs-oop-design-patterns」。 Should a service with one stable pricing rule use Strategy?
預期結果:
- Evidence: Only one pricing algorithm exists, with no accepted requirement for another.
- Recommendation: Keep the direct implementation rather than adding interchangeable policy classes.
- Verification: Test pricing behavior and invariants through the public operation.
正在使用「nestjs-oop-design-patterns」。 Does an in-process event guarantee publication after a database commit?
預期結果:
- Finding: In-process notification does not provide durable delivery across crashes or replicas.
- Recommendation: Consider a transactional outbox when external consumers must reliably observe committed changes.
- Trade-off: A relay requires retries, retention, ordering decisions, and idempotent consumers.
安全審計
安全All 25 static findings are false positives involving ordinary design guidance, Markdown identifiers, or headings. Backticks mark inline code, and the reconnaissance matches contain no system enumeration instructions. No evidence found of prompt injection, credential theft, unauthorized execution, or data exfiltration in the reviewed passages and surrounding files.
風險因素
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/amirtaherkhani-nestjs-oop-design-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/amirtaherkhani-nestjs-oop-design-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
amirtaherkhani. (2026). nestjs-oop-design-patterns security audit report (audit version 1) [Author version 1.0.2]. Skillstore. https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns/audits/1BibTeX 引用
@techreport{amirtaherkhani-amirtaherkhani-nestjs-oop-design-patterns-2026,
author = {amirtaherkhani},
title = {nestjs-oop-design-patterns security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns/audits/1},
note = {Author version 1.0.2}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "nestjs-oop-design-patterns security audit report (audit version 1)"
version: "1.0.2"
type: report
authors:
- name: "amirtaherkhani"
date-released: "2026-10-04"
url: "https://skillstore.io/skills/amirtaherkhani-nestjs-oop-design-patterns/audits/1"
identifiers:
- type: other
value: "skillstore:amirtaherkhani-nestjs-oop-design-patterns:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 中你可以打造什麼
Review an overloaded service
Identify unrelated responsibilities and propose a small refactor that preserves behavior and public contracts.
Choose a provider integration pattern
Compare direct integration, Adapter, and Strategy using vendor coupling, variation, and substitution requirements.
Plan contract-focused verification
Define tests for invariants, adapter substitution, Nest provider wiring, and transport behavior before refactoring.
試試這些提示
Review [class] and its callers. Explain its role, responsibilities, and one concrete design concern without editing files.
Compare a direct solution, Strategy, and Factory for [observed variation]. Recommend one using repository evidence and explain its testing cost.
Refactor [service] to separate [misplaced responsibility]. Preserve public behavior and user changes, add focused tests, and verify Nest provider wiring.
Review [workflow] for adapter substitution, transaction boundaries, and event delivery guarantees. Compare direct coordination with outbox or saga designs and specify contract tests.
最佳實務
- Inspect callers, tests, module wiring, and repository conventions before selecting a pattern.
- State the concrete problem, simpler alternative, and added cost before introducing an abstraction.
- Preserve behavior with focused tests and verify contracts and provider wiring after refactoring.
避免
- Adding interfaces, factories, repositories, or class hierarchies without real variation or a useful boundary.
- Judging design only by line counts or applying fixed size limits as mandatory rules.
- Assuming CQRS dispatch, in-process events, or pattern names provide durability or scalability.
常見問題
Which projects does this skill target?
Does every class need an interface?
Will it always recommend a design pattern?
Are the related NestJS skills required?
Which tests should accompany a refactor?
Does a Nest event bus guarantee durable delivery?
開發者詳細資訊
授權
MIT
作者版本
v1.0.2
Skillstore 修訂
r1
引用
c97a1862d1bc82763903ee068cd15acab35d638c
維護新鮮度
2026/10/5
使用量
0 次下載 · 0 次瀏覽