nextjs-data-access-layer
БесплатноБез исполняемых скриптовНе проверенBuild secure, reusable data access patterns with DTOs, taint checks, and colocated authorization in Next.js. Use when centralizing database queries…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
Data Access Layer (DAL)
Priority: P1 (HIGH)
Centralize all data access (Database & External APIs) to ensure consistent security, authorization, and caching.
Workflow
- Create DAL module in
services/orlib/data.tswithimport 'server-only'. - Verify auth inside every DAL function using
await auth(). - Transform raw DB/API data into DTOs before returning to components.
- Wrap with
cache()from React to deduplicate requests within render cycle. - Taint-check sensitive objects to prevent accidental client exposure.
Implementation Guidelines
- DTOs: Always transform raw data into plain objects. Never return ORM model instances.
- Security: Use
taintObjectReferenceortaintUniqueValuefrom experimental taint API to guard sensitive data. - Authorization: Colocate auth checks inside every DAL function. Never rely on UI layer.
- Caching: Wrap DAL functions in
cache()to deduplicate within single render. - Error Handling: Throw standardized errors (
NotFoundError,UnauthorizedError) caught byerror.tsxornotFound().
Limitations
- Client Components cannot import DAL files. Use Server Actions or Route Handlers as bridges.
Anti-Patterns
- No auth checks outside DAL: Auth verification must live inside DAL functions.
- No raw ORM instances returned: Transform to plain DTO objects before returning.
- No
fetch('localhost/api')in Server Components: Call DAL functions directly. - No DAL imports in Client Components: Use Server Actions or Route Handlers as bridges.
Установить nextjs-data-access-layer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nextjs-data-access-layer?
Build secure, reusable data access patterns with DTOs, taint checks, and colocated authorization in Next.js. Use when centralizing database queries, transforming raw data to DTOs, adding server-only guards, or preventing sensitive data from reaching Client Components.
Как установить скилл nextjs-data-access-layer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nextjs-data-access-layer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic