spotiarr-architecture

Guide Spotiarr contributors to place new code in correct backend, frontend, and shared layers.

41|6|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/mralexsaavedra/spotiarr --skill spotiarr-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spotiarr-architecture
Source: https://github.com/mralexsaavedra/spotiarr/tree/main/skills/spotiarr-architecture
Command: npx skills add https://github.com/mralexsaavedra/spotiarr --skill spotiarr-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Spotiarr contributors need a reliable rulebook for deciding where new code belongs (backend, frontend, or shared) so the codebase stays consistent, testable, and maintainable.

Core Features & Use Cases

  • Backend DDD-lite layering: Enforces a direction of dependencies so presentation → application → domain, with infrastructure implementing contracts only.
  • Frontend state and real-time boundaries: Uses TanStack Query for server state, Zustand slices for client state, and a dedicated useServerEvents hook for SSE sync.
  • External integration safety: Requires all Spotify HTTP calls to go through CircuitBreaker.execute() in infrastructure/external/circuit-breaker.ts to prevent unsafe direct calls and to preserve circuit state across restarts.
  • Repository placement guidance: Clarifies where use-cases/services register (apps/backend/src/container.ts) and where shared types/utilities live (packages/shared/).

Quick Start

Ask: “Given this Spotiarr feature request and the files it will touch, where should the new backend and frontend code be placed according to the spotiarr architecture rules?”

Frequently Asked Questions about spotiarr-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage frontend state and SSE boundaries in a React monorepo?

Frontend state management requires separating server state using TanStack Query, client state using Zustand slices, and real-time SSE sync using a dedicated useServerEvents hook to maintain clear boundaries.

What's the best way to register use-cases and locate shared code in a monorepo?

Safely integrate external Spotify HTTP calls by wrapping them through CircuitBreaker.execute() in the infrastructure layer. This prevents unsafe direct calls and preserves circuit state across application restarts.

What's the best way to register use-cases and locate shared code in a monorepo?

To place new code in a DDD-lite monorepo, enforce dependency direction so presentation calls application, which calls domain, while infrastructure only implements contracts. This keeps backend layers consistent and testable.

How do I safely integrate external Spotify HTTP calls in a backend service?

Frontend state management requires separating server state using TanStack Query, client state using Zustand slices, and real-time SSE sync using a dedicated useServerEvents hook to maintain clear boundaries.

What's the best way to register use-cases and locate shared code in a monorepo?

Safely integrate external Spotify HTTP calls by wrapping them through CircuitBreaker.execute() in the infrastructure layer. This prevents unsafe direct calls and preserves circuit state across application restarts.