cc_with_figma_prompt - corollazer0/nhcx2025 GitHub Wiki
Figma ์ปดํฌ๋ํธ โ Vue ์ปดํฌ๋ํธ ๋ณํ ํ ํ๋ฆฟ ํ๋กฌํํธ
ํ์ฌ Figma์์ ์ ํ๋ ์ปดํฌ๋ํธ๋ฅผ ์ ํํ ๋์ผํ ๋์์ธ๊ณผ ๊ธฐ๋ฅ์ ๊ฐ์ง Vue 3 ์ปดํฌ๋ํธ๋ก ๊ตฌํํด์ฃผ์ธ์.
-
REQUIRED: ๋จผ์ ๋ค์ MCP ๋๊ตฌ๋ค์ ์ฌ์ฉํ์ฌ Figma ์ ๋ณด๋ฅผ ์์งํ์ธ์:
-
mcp__figma-dev-mode-mcp-server__get_code
: ํ์ฌ ์ ํ๋ ์ปดํฌ๋ํธ์ ์ฝ๋ ์์ฑ -
mcp__figma-dev-mode-mcp-server__get_image
: ์ปดํฌ๋ํธ ์ด๋ฏธ์ง ํ์ธ -
mcp__figma-dev-mode-mcp-server__get_variable_defs
: ๋์์ธ ํ ํฐ ์ ๋ณด ์์ง
-
- Figma์ Properties, ์์, ํฐํธ, ๊ฐ๊ฒฉ, ๋ณด๋ ๋ฑ์ 100% ์ ํํ๊ฒ ๊ตฌํ
- Figma ์ปดํฌ๋ํธ์ ๋ชจ๋ ์ํ(variants, properties)๋ฅผ Vue props๋ก ๋งคํ
// ์ปดํฌ๋ํธ ๊ตฌ์กฐ ์์
<template>
<div class="component-name" data-testid="component-name">
<!-- Figma ๊ตฌ์กฐ์ ์ ํํ ์ผ์นํ๋ HTML ๊ตฌ์กฐ -->
</div>
</template>
<script setup lang="ts">
// 1. Figma Properties๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ TypeScript ์ธํฐํ์ด์ค
interface ComponentProps {
// Figma์ ๋ชจ๋ Properties๋ฅผ boolean, string, object ๋ฑ์ผ๋ก ๋งคํ
// ์: variant?: 'primary' | 'secondary'
// ์: text?: string
// ์: items?: Array<{title: string, data: string}>
}
// 2. Props ์ ์ (๊ธฐ๋ณธ๊ฐ์ Figma์ ๊ธฐ๋ณธ ์ํ)
const props = withDefaults(defineProps<ComponentProps>(), {
// Figma ๊ธฐ๋ณธ๊ฐ๋ค
})
// 3. ์ด๋ฒคํธ ์ ์
const emit = defineEmits<{
click: [event: MouseEvent]
close: []
// ๊ธฐํ ์ํธ์์ฉ ์ด๋ฒคํธ๋ค
}>()
// 4. ๋์ ๋ฐ์ดํฐ ์ฒ๋ฆฌ ๋ก์ง
</script>
<style scoped>
/* Figma ๋์์ธ ํ ํฐ์ CSS ๋ณ์๋ก ์ ์ */
.component-name {
--token-name: value;
/* Figma์ ์ ํํ ์ผ์นํ๋ ์คํ์ผ */
}
</style>
- ๊ฐ๋ฐ์ ์นํ์ ๊ฐ์ ์ฌํญ
-
๋์ ๋ฐ์ดํฐ: ํ๋์ฝ๋ฉ๋ ํ ์คํธ๋ฅผ props๋ก ๋ฐ๋๋ก ๊ตฌํ
-
์ด๋ฒคํธ ์ฒ๋ฆฌ: ๋ชจ๋ ์ํธ์์ฉ ์์์ ์ด๋ฒคํธ emit ๊ตฌํ
-
์ ๊ทผ์ฑ: ์ ์ ํ ARIA ์์ฑ, ํค๋ณด๋ ๋ด๋น๊ฒ์ด์ , data-testid ์ถ๊ฐ
-
ํ์ ์์ ์ฑ: ๋ชจ๋ props์ emit์ TypeScript ํ์ ์ ์
- ํ ์คํธ ํ์ผ ์์ฑ
Unit Test (ComponentName.spec.ts)
// ๋ค์ ํ ์คํธ ์ผ์ด์ค๋ค์ ํฌํจ: // - ๊ธฐ๋ณธ ๋ ๋๋ง ํ ์คํธ // - ๋ชจ๋ props ์กฐํฉ ํ ์คํธ
// - ์ด๋ฒคํธ emit ํ ์คํธ // - ์ ๊ทผ์ฑ ํ ์คํธ // - ์กฐ๊ฑด๋ถ ๋ ๋๋ง ํ ์คํธStorybook Stories (ComponentName.stories.ts)
// ๋ค์ ์คํ ๋ฆฌ๋ค์ ํฌํจ: // - Playground (๋ชจ๋ controls) // - Default // - ๊ฐ variant/state๋ณ ์คํ ๋ฆฌ // - Edge cases ์คํ ๋ฆฌ // - Interactive ํ ์คํธ๊ฐ ํฌํจ๋ play ํจ์
- ํ๋ก์ ํธ ๊ตฌ์กฐ ์ค์
-
ํ์ฌ ํ๋ก์ ํธ์ ์ฝ๋ฉ ์ปจ๋ฒค์ ๋ฐ๋ฅด๊ธฐ
-
๊ธฐ์กด ์ปดํฌ๋ํธ ๊ตฌ์กฐ์ ์ผ๊ด์ฑ ์ ์ง
-
Vue 3 Composition API + TypeScript ์ฌ์ฉ
-
Scoped CSS ์ฌ์ฉ (Tailwind ๋ฏธ์ฌ์ฉ)
์ ์ฝ์ฌํญ
-
Figma ๋์์ธ์์ ์ ๋ ๋ฒ์ด๋์ง ์๊ธฐ
-
์์๋ก ๊ธฐ๋ฅ ์ถ๊ฐํ๊ฑฐ๋ ๋์์ธ ๋ณ๊ฒฝ ๊ธ์ง
-
๋ชจ๋ Figma Properties๋ Vue props๋ก ์์ ํ ๋งคํ๋์ด์ผ ํจ
-
ํ๋ก์ ํธ์ ๊ธฐ์กด ํจํด๊ณผ ์ถฉ๋ํ์ง ์์์ผ ํจ
๊ฒฐ๊ณผ๋ฌผ
- ComponentName.vue - ๋ฉ์ธ ์ปดํฌ๋ํธ
- ComponentName.spec.ts - ๋จ์ ํ ์คํธ
- ComponentName.stories.ts - ์คํ ๋ฆฌ๋ถ ์คํ ๋ฆฌ
๋ชจ๋ ํ์ผ์ src/components/ ๋๋ ํ ๋ฆฌ์ ์์ฑํ๊ณ , ๊ธฐ์กด ์ปดํฌ๋ํธ๋ค๊ณผ ๋์ผํ ํ์ง๊ณผ ๊ตฌ์กฐ๋ฅผ ์ ์งํด์ฃผ์ธ์.