Skip to content
feature-scaffolding logo

Feature Scaffolding Skill

feature-scaffolding

BoxLogの新しいFeatureモジュールを作成。stores, hooks, components, types の統一構造を生成。

SKILL.md

Full skill instructions

Feature Scaffolding Skill

BoxLogプロジェクトの新しいFeatureモジュールを規約に沿って作成するスキルです。

このスキルを使用するタイミング

以下のキーワードが含まれる場合に自動的に起動:

  • 「新しい機能を作成」「feature作成」
  • 「〇〇機能を追加」
  • 「モジュールを作成」
  • 「src/​features/​xxx を作って」

Feature構造

src/​features/​{feature-name}/
├── index.ts              # Public API(バレルファイル)
├── types/
│   └── index.ts          # 型定義
├── stores/
│   └── index.ts          # Zustand stores
├── hooks/
│   └── index.ts          # カスタムフック
├── components/
│   └── index.ts          # UIコンポーネント
├── constants/            # (optional)
│   └── index.ts
└── contexts/             # (optional)
    └── {Feature}Context.tsx

作成手順

1. ディレクトリ作成

FEATURE_NAME="your-feature"
mkdir -p src/​features/​${FEATURE_NAME}/​{types,stores,hooks,components}

2. types/​index.ts

// {Feature}の型定義

export interface {Entity} {
  id: string
  user_id: string
  // entity fields
  created_at: Date
  updated_at: Date
}

export interface Create{Entity}Input {
  // required fields for creation
}

export interface Update{Entity}Input {
  // optional fields for update
}

3. stores/​index.ts

export { use{Feature}Store } from './​use{Feature}Store'

4. stores/​use{Feature}Store.ts

import { create } from 'zustand'
import { devtools, persist } from 'zustand/​middleware'

interface {Feature}State {
  // state
  items: {Entity}[]

  // actions
  addItem: (item: Create{Entity}Input) => Promise<boolean>
  updateItem: (id: string, updates: Update{Entity}Input) => Promise<boolean>
  deleteItem: (id: string) => Promise<boolean>
  getItemById: (id: string) => {Entity} | undefined
}

export const use{Feature}Store = create<{Feature}State>()(
  devtools(
    persist(
      (set, get) => ({
        items: [],

        addItem: async (data) => {
          // implementation
        },

        updateItem: async (id, updates) => {
          // implementation
        },

        deleteItem: async (id) => {
          // implementation
        },

        getItemById: (id) => {
          return get().items.find((item) => item.id === id)
        },
      }),
      {
        name: '{feature}-storage',
        partialize: (state) => ({ items: state.items }),
      }
    ),
    { name: '{feature}-store' }
  )
)

5. hooks/​index.ts

export { use{Feature}s } from './​use-{feature}s'
export { use{Feature}Operations } from './​use-{feature}-operations'

6. components/​index.ts

export { {Feature}List } from './​{Feature}List'
export { {Feature}Item } from './​{Feature}Item'

7. index.ts(Public API)

/​**
 * {Feature} Feature - Public API
 *
 * @example
 * ```tsx
 * // ✅ 推奨: バレルファイル経由
 * import { {Feature}List, use{Feature}s, use{Feature}Store } from '@/​features/​{feature}'
 *
 * // ❌ 非推奨: 深いパス指定
 * import { {Feature}List } from '@/​features/​{feature}/​components/​{Feature}List'
 * ```
 */

// Components
export { } from './​components'

// Hooks
export { } from './​hooks'

// Stores
export { use{Feature}Store } from './​stores'

// Types
export type { } from './​types'

命名規則

種類命名規則例
ディレクトリkebab-caseuser-settings
コンポーネントPascalCaseUserSettingsList
フックcamelCase (use prefix)useUserSettings
ストアcamelCase (use prefix)useUserSettingsStore
型PascalCaseUserSettings

チェックリスト

  • 全てのexportは index.ts 経由
  • 型は types/​index.ts に集約
  • ストアは devtools + persist ミドルウェア使用
  • コンポーネントは export function 形式(export default 禁止)
  • セマンティックトークン使用(bg-card, text-foreground 等)

参考: 既存Feature

src/​features/
├── tags/        # 参考実装(最も完成度が高い)
├── plans/       # 複雑なFeatureの例
├── calendar/    # 大規模Featureの例
├── settings/    # シンプルなFeatureの例
└── auth/        # 認証関連

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View