소스 정보
- 저장소
- Dev-Toolbelt/dev-team-agents
- 최근 소스 활동
- 2026년 5월 11일 16:18
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill component-patterns명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | component-patterns |
| description | Component patterns — container/presentational for React/Vue/Angular. |
The core idea: separate what data comes from (container) from how it looks (presentational). Presentational components receive everything via props/inputs — they own no side effects and no data fetching.
| Aspect | Container (Smart) | Presentational (Dumb) |
|---|---|---|
| Responsibility | Fetch data, manage state, handle business logic | Render UI, emit user events |
| Dependencies | API clients, stores, router | None beyond UI primitives |
| Reusability | Low — tied to a specific domain | High — usable anywhere |
| Testability | Test behavior + integration | Test with prop snapshots / storybook |
| State | Owns or subscribes to state | Receives everything via props/inputs |
When to split: as soon as a component both fetches data AND renders UI, extract the rendering into a presentational child. This makes the UI testable without mocking the network.
features/orders must not import directly from features/users; go through a shared layer.// Container — owns data fetching and state
function OrderListContainer() {
const { data, isLoading, error } = useOrders()
if (isLoading) return <Spinner />
if (error) return <ErrorMessage error={error} />
return <OrderList orders={data} />
}
// Presentational — pure render, fully testable with props alone
function OrderList({ orders }: { orders: Order[] }) {
return (
<ul>
{orders.map(o => <OrderItem key={o.id} order={o} />)}
</ul>
)
}
React-specific rules:
useOrders() over class-based containers.ErrorBoundary; presentational components should not catch errors themselves.React.memo on stable presentational components to avoid unnecessary re-renders from parent state changes.<!-- Container -->
<script setup lang="ts">
const { orders, isLoading, error } = useOrders()
</script>
<template>
<Spinner v-if="isLoading" />
<ErrorMessage v-else-if="error" :error="error" />
<OrderList v-else :orders="orders" />
</template>
<!-- Presentational -->
<script setup lang="ts">
defineProps<{ orders: Order[] }>()
</script>
<template>
<ul>
<OrderItem v-for="o in orders" :key="o.id" :order="o" />
</ul>
</template>
Vue-specific rules:
useX) are the Vue equivalent of React hooks — put all fetching and state logic there.defineProps with explicit types; avoid prop drilling beyond two levels — use provide/inject or a store.defineEmits and typed payloads; never mutate a prop directly.// Container — smart component, injects service
@Component({
selector: 'app-order-list-container',
template: `
<app-spinner *ngIf="isLoading" />
<app-error-message *ngIf="error" [error]="error" />
<app-order-list *ngIf="!isLoading && !error" [orders]="orders" />
`
})
export class OrderListContainerComponent implements OnInit {
orders: Order[] = []
isLoading = false
error: Error | null = null
constructor(private orderService: OrderService) {}
ngOnInit() {
this.isLoading = true
this.orderService.getOrders().subscribe({
next: orders => { this.orders = orders; this.isLoading = false },
error: err => { this.error = err; this.isLoading = false }
})
}
}
// Presentational — dumb component, only @Input / @Output
({
: ,
:
})
{
() : [] = []
}
Angular-specific rules:
@Input and @Output.OnPush change detection on presentational components — they receive immutable inputs, so there's no need for the default dirty-check cycle.ErrorHandler and is provided at the root level ({ provide: ErrorHandler, useClass: AppErrorHandler }); do not swallow errors silently.async pipe over manual subscriptions to avoid memory leaks from forgotten unsubscribe() calls.<!-- Container -->
<script lang="ts">
import { onMount } from 'svelte'
let orders: Order[] = []
let isLoading = true
onMount(async () => {
orders = await fetchOrders()
isLoading = false
})
</script>
{#if isLoading}<Spinner />{:else}<OrderList {orders} />{/if}
<!-- Presentational -->
<script lang="ts">
export let orders: Order[]
</script>
<ul>{#each orders as o}<OrderItem order={o} />{/each}</ul>
Svelte-specific rules:
$: reactive declarations that reach outside the component boundary.writable, derived) as the shared-state layer rather than passing deeply nested props.<svelte:boundary> (Svelte 5) for error isolation.| Anti-Pattern | Problem |
|---|---|
| Fetching inside a presentational component | Makes the component untestable without network mocking |
| Business logic in template expressions | Hard to test, hard to read |
| Prop drilling beyond two levels | Use a store, context, or composable instead |
| God component | One component handling routing, fetching, form state, and rendering |
| Direct store mutation in presentational components | Breaks the unidirectional data flow contract |