@k2works/claude-code-booster 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/bin/claude-code-booster +24 -4
- package/lib/assets/.claude/README.md +44 -40
- package/lib/assets/.claude/commands/analysis.md +230 -0
- package/lib/assets/.claude/commands/kill.md +109 -0
- package/lib/assets/.claude/commands/next.md +136 -0
- package/lib/assets/.claude/commands/plan.md +141 -91
- package/lib/assets/.claude/commands/progress.md +172 -0
- package/lib/assets/docs/reference/UI/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md +446 -0
- package/lib/assets/docs/reference//343/202/242/343/203/274/343/202/255/343/203/206/343/202/257/343/203/201/343/203/243/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md +1428 -0
- package/lib/assets/docs/reference//343/202/244/343/203/263/343/203/225/343/203/251/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md +1879 -0
- package/lib/assets/docs/reference//343/203/206/343/202/271/343/203/210/346/210/246/347/225/245/343/202/254/343/202/244/343/203/211.md +1310 -0
- package/lib/assets/docs/reference//343/203/207/343/203/274/343/202/277/343/203/242/343/203/207/343/203/253/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md +312 -0
- package/lib/assets/docs/reference//343/203/211/343/203/241/343/202/244/343/203/263/343/203/242/343/203/207/343/203/253/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md +600 -0
- package/lib/assets/docs/reference//343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271/344/275/234/346/210/220/343/202/254/343/202/244/343/203/211.md +672 -0
- package/lib/assets/docs/reference//343/203/252/343/203/252/343/203/274/343/202/271/343/203/273/343/202/244/343/203/206/343/203/254/343/203/274/343/202/267/343/203/247/343/203/263/350/250/210/347/224/273/343/202/254/343/202/244/343/203/211.md +524 -0
- package/lib/assets/docs/reference//351/201/213/347/224/250/350/246/201/344/273/266/345/256/232/347/276/251/343/202/254/343/202/244/343/203/211.md +393 -0
- package/lib/assets/docs/reference//351/226/213/347/231/272/343/202/254/343/202/244/343/203/211.md +18 -173
- package/lib/assets/docs/reference//351/235/236/346/251/237/350/203/275/350/246/201/344/273/266/345/256/232/347/276/251/343/202/254/343/202/244/343/203/211.md +1231 -0
- package/lib/assets/docs/template//345/256/214/345/205/250/345/275/242/345/274/217/343/201/256/343/203/246/343/203/274/343/202/271/343/202/261/343/203/274/343/202/271.md +64 -0
- package/lib/assets/docs/template//350/246/201/344/273/266/345/256/232/347/276/251.md +467 -443
- package/package.json +1 -1
package/lib/assets/docs/reference/UI/350/250/255/350/250/210/343/202/254/343/202/244/343/203/211.md
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
# UI設計ガイド
|
|
2
|
+
|
|
3
|
+
## オブジェクト指向UI設計(OOUX)
|
|
4
|
+
|
|
5
|
+
### 基本理念
|
|
6
|
+
|
|
7
|
+
オブジェクト指向UI設計は、ユーザーが操作する「オブジェクト」を中心にUIを設計することで、より直感的で理解しやすいユーザーエクスペリエンスを提供する設計手法です。
|
|
8
|
+
|
|
9
|
+
### 4つの主要原則
|
|
10
|
+
|
|
11
|
+
#### 1. オブジェクトの特定
|
|
12
|
+
- ユーザーがシステム内で操作する主要な「モノ」を特定
|
|
13
|
+
- 名詞で表現できるもの(例:生徒、教員、部、イベント、文書、商品など)
|
|
14
|
+
- ドメインモデルと密接に関連
|
|
15
|
+
|
|
16
|
+
#### 2. オブジェクト間の関係の定義
|
|
17
|
+
- 特定されたオブジェクトが互いにどのように関連しているかを明確化
|
|
18
|
+
- 関係の種類:
|
|
19
|
+
- 一対一(1:1)
|
|
20
|
+
- 一対多(1:N)
|
|
21
|
+
- 多対多(M:N)
|
|
22
|
+
- 集約・コンポジション
|
|
23
|
+
|
|
24
|
+
#### 3. オブジェクトのアクションの定義
|
|
25
|
+
- 各オブジェクトに対してユーザーがどのような操作を実行できるかを定義
|
|
26
|
+
- 基本的なCRUD操作:
|
|
27
|
+
- Create(作成)
|
|
28
|
+
- Read(読み取り)
|
|
29
|
+
- Update(更新)
|
|
30
|
+
- Delete(削除)
|
|
31
|
+
- ドメイン固有のアクション
|
|
32
|
+
|
|
33
|
+
#### 4. オブジェクトの属性の定義
|
|
34
|
+
- 各オブジェクトがどのような情報(属性)を持っているかを定義
|
|
35
|
+
- 表示すべき属性の優先順位
|
|
36
|
+
- 編集可能な属性の範囲
|
|
37
|
+
|
|
38
|
+
## UI構造パターン
|
|
39
|
+
|
|
40
|
+
### コレクションビュー
|
|
41
|
+
オブジェクトの一覧を表示するビューパターン
|
|
42
|
+
|
|
43
|
+
```plantuml
|
|
44
|
+
@startuml
|
|
45
|
+
package "コレクションビュー" {
|
|
46
|
+
rectangle "検索・フィルタ" as search
|
|
47
|
+
rectangle "新規作成ボタン" as create
|
|
48
|
+
rectangle "アイテムリスト" as list {
|
|
49
|
+
rectangle "アイテム1" as item1
|
|
50
|
+
rectangle "アイテム2" as item2
|
|
51
|
+
rectangle "アイテム3" as item3
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
search --> list : フィルタリング
|
|
56
|
+
create --> "シングルビュー" : 新規作成
|
|
57
|
+
item1 --> "シングルビュー" : 詳細表示
|
|
58
|
+
@enduml
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**特徴**:
|
|
62
|
+
- 複数のオブジェクトを一覧表示
|
|
63
|
+
- 検索・フィルタリング機能
|
|
64
|
+
- 新規作成のエントリーポイント
|
|
65
|
+
- 個別オブジェクトへの navigation
|
|
66
|
+
|
|
67
|
+
### シングルビュー
|
|
68
|
+
個別オブジェクトの詳細を表示するビューパターン
|
|
69
|
+
|
|
70
|
+
```plantuml
|
|
71
|
+
@startuml
|
|
72
|
+
package "シングルビュー" {
|
|
73
|
+
rectangle "ヘッダー" as header {
|
|
74
|
+
rectangle "タイトル" as title
|
|
75
|
+
rectangle "アクションボタン" as actions
|
|
76
|
+
}
|
|
77
|
+
rectangle "メインコンテンツ" as main {
|
|
78
|
+
rectangle "属性表示" as props
|
|
79
|
+
rectangle "関連オブジェクト1" as related1
|
|
80
|
+
rectangle "関連オブジェクト2" as related2
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
actions --> "編集モード" : 編集
|
|
85
|
+
actions --> "削除確認" : 削除
|
|
86
|
+
related1 --> "関連オブジェクトビュー" : 詳細
|
|
87
|
+
@enduml
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**特徴**:
|
|
91
|
+
- 単一オブジェクトの詳細情報表示
|
|
92
|
+
- 編集・削除などのアクション
|
|
93
|
+
- 関連オブジェクトへのナビゲーション
|
|
94
|
+
- モード切り替え(表示⇔編集)
|
|
95
|
+
|
|
96
|
+
## レイアウトパターン
|
|
97
|
+
|
|
98
|
+
### ナビゲーション配置
|
|
99
|
+
|
|
100
|
+
#### 左サイドナビゲーション
|
|
101
|
+
```plantuml
|
|
102
|
+
@startuml
|
|
103
|
+
rectangle "アプリケーション" {
|
|
104
|
+
rectangle "サイドナビ" as nav {
|
|
105
|
+
rectangle "生徒"
|
|
106
|
+
rectangle "教員"
|
|
107
|
+
rectangle "組"
|
|
108
|
+
rectangle "部"
|
|
109
|
+
rectangle "イベント"
|
|
110
|
+
}
|
|
111
|
+
rectangle "メインコンテンツ" as content {
|
|
112
|
+
rectangle "コレクション/シングルビュー"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
nav -right-> content : オブジェクト選択
|
|
117
|
+
@enduml
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### トップナビゲーション
|
|
121
|
+
```plantuml
|
|
122
|
+
@startuml
|
|
123
|
+
rectangle "アプリケーション" {
|
|
124
|
+
rectangle "トップナビ" as nav {
|
|
125
|
+
rectangle "生徒 | 教員 | 組 | 部 | イベント"
|
|
126
|
+
}
|
|
127
|
+
rectangle "メインコンテンツ" as content {
|
|
128
|
+
rectangle "コレクション/シングルビュー"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
nav -down-> content : オブジェクト選択
|
|
133
|
+
@enduml
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### ビュー配置パターン
|
|
137
|
+
|
|
138
|
+
#### 単一メインオブジェクト
|
|
139
|
+
- 画面を2つのペインに分割
|
|
140
|
+
- 左:コレクションビュー、右:シングルビュー
|
|
141
|
+
|
|
142
|
+
#### タブ式切り替え
|
|
143
|
+
- タブでコレクションビューとシングルビューを切り替え
|
|
144
|
+
|
|
145
|
+
#### モーダル式
|
|
146
|
+
- コレクションビューをベースに、シングルビューをモーダルで表示
|
|
147
|
+
|
|
148
|
+
## アクションパターン
|
|
149
|
+
|
|
150
|
+
### Create(作成)アクション
|
|
151
|
+
|
|
152
|
+
#### ブランクパターン
|
|
153
|
+
```javascript
|
|
154
|
+
// 空のフォームを表示して新規作成
|
|
155
|
+
const createStudent = () => {
|
|
156
|
+
return {
|
|
157
|
+
id: null,
|
|
158
|
+
name: '',
|
|
159
|
+
class: '',
|
|
160
|
+
clubs: [],
|
|
161
|
+
relatedStudents: []
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### テンプレートパターン
|
|
167
|
+
```javascript
|
|
168
|
+
// デフォルト値を持つテンプレートから作成
|
|
169
|
+
const createStudentFromTemplate = (template) => {
|
|
170
|
+
return {
|
|
171
|
+
...template,
|
|
172
|
+
id: generateNewId(),
|
|
173
|
+
name: '',
|
|
174
|
+
createdAt: new Date()
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Update(更新)アクション
|
|
180
|
+
|
|
181
|
+
#### モードレスエディットパターン
|
|
182
|
+
```javascript
|
|
183
|
+
// 同一画面で表示と編集を切り替え
|
|
184
|
+
const toggleEditMode = (student, isEditing) => {
|
|
185
|
+
if (isEditing) {
|
|
186
|
+
return renderEditForm(student);
|
|
187
|
+
} else {
|
|
188
|
+
return renderDisplayView(student);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### インラインエディットパターン
|
|
194
|
+
```javascript
|
|
195
|
+
// 項目ごとに直接編集可能
|
|
196
|
+
const renderInlineEdit = (property, value) => {
|
|
197
|
+
return `
|
|
198
|
+
<div class="inline-edit" data-property="${property}">
|
|
199
|
+
<span class="display">${value}</span>
|
|
200
|
+
<input class="edit" value="${value}" style="display:none">
|
|
201
|
+
</div>
|
|
202
|
+
`;
|
|
203
|
+
};
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Delete(削除)アクション
|
|
207
|
+
|
|
208
|
+
#### モーダル確認パターン
|
|
209
|
+
```javascript
|
|
210
|
+
const deleteWithConfirmation = (student) => {
|
|
211
|
+
const confirmed = confirm(`${student.name}を削除しますか?`);
|
|
212
|
+
if (confirmed) {
|
|
213
|
+
deleteStudent(student.id);
|
|
214
|
+
refreshView();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### ソフトデリートパターン
|
|
220
|
+
```javascript
|
|
221
|
+
const softDelete = (student) => {
|
|
222
|
+
student.deletedAt = new Date();
|
|
223
|
+
student.isActive = false;
|
|
224
|
+
updateStudent(student);
|
|
225
|
+
};
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## 実装ガイドライン
|
|
229
|
+
|
|
230
|
+
### コンポーネント設計
|
|
231
|
+
|
|
232
|
+
#### 責任の分離
|
|
233
|
+
```javascript
|
|
234
|
+
// ❌ 悪い例:すべてが混在
|
|
235
|
+
const StudentComponent = () => {
|
|
236
|
+
// データ取得、状態管理、UI描画がすべて混在
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// ✅ 良い例:責任を分離
|
|
240
|
+
const StudentContainer = () => {
|
|
241
|
+
// データ取得と状態管理
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
const StudentView = ({ students, onAction }) => {
|
|
245
|
+
// UI描画のみ
|
|
246
|
+
};
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### 状態管理パターン
|
|
250
|
+
```javascript
|
|
251
|
+
// 状態の構造化
|
|
252
|
+
const studentState = {
|
|
253
|
+
collection: {
|
|
254
|
+
items: [],
|
|
255
|
+
loading: false,
|
|
256
|
+
filter: '',
|
|
257
|
+
sortBy: 'name'
|
|
258
|
+
},
|
|
259
|
+
selected: {
|
|
260
|
+
item: null,
|
|
261
|
+
mode: 'READ' // READ, EDIT, CREATE
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### アクセシビリティ考慮事項
|
|
267
|
+
|
|
268
|
+
#### キーボードナビゲーション
|
|
269
|
+
```javascript
|
|
270
|
+
// フォーカス管理
|
|
271
|
+
const handleKeyDown = (event) => {
|
|
272
|
+
switch (event.key) {
|
|
273
|
+
case 'Enter':
|
|
274
|
+
selectItem();
|
|
275
|
+
break;
|
|
276
|
+
case 'Escape':
|
|
277
|
+
cancelEdit();
|
|
278
|
+
break;
|
|
279
|
+
case 'ArrowDown':
|
|
280
|
+
moveToNextItem();
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
#### スクリーンリーダー対応
|
|
287
|
+
```html
|
|
288
|
+
<!-- セマンティックなHTML構造 -->
|
|
289
|
+
<main role="main">
|
|
290
|
+
<section aria-label="学生一覧">
|
|
291
|
+
<h1>学生</h1>
|
|
292
|
+
<ul role="list">
|
|
293
|
+
<li role="listitem" tabindex="0">
|
|
294
|
+
<span aria-label="学生名">田中太郎</span>
|
|
295
|
+
</li>
|
|
296
|
+
</ul>
|
|
297
|
+
</section>
|
|
298
|
+
</main>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### パフォーマンス最適化
|
|
302
|
+
|
|
303
|
+
#### 仮想化
|
|
304
|
+
```javascript
|
|
305
|
+
// 大量データの表示最適化
|
|
306
|
+
const VirtualizedList = ({ items, itemHeight = 50 }) => {
|
|
307
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
308
|
+
const containerHeight = 400;
|
|
309
|
+
|
|
310
|
+
const visibleStart = Math.floor(scrollTop / itemHeight);
|
|
311
|
+
const visibleEnd = Math.min(
|
|
312
|
+
visibleStart + Math.ceil(containerHeight / itemHeight),
|
|
313
|
+
items.length
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<div style={{ height: containerHeight, overflow: 'auto' }}>
|
|
318
|
+
{items.slice(visibleStart, visibleEnd).map(renderItem)}
|
|
319
|
+
</div>
|
|
320
|
+
);
|
|
321
|
+
};
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
#### 遅延読み込み
|
|
325
|
+
```javascript
|
|
326
|
+
// 関連データの段階的読み込み
|
|
327
|
+
const loadStudentDetails = async (studentId) => {
|
|
328
|
+
const student = await fetchStudent(studentId);
|
|
329
|
+
// 基本情報をまず表示
|
|
330
|
+
|
|
331
|
+
const [clubs, relatedStudents] = await Promise.all([
|
|
332
|
+
fetchStudentClubs(studentId),
|
|
333
|
+
fetchRelatedStudents(studentId)
|
|
334
|
+
]);
|
|
335
|
+
// 関連情報を後から追加
|
|
336
|
+
};
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## 品質保証
|
|
340
|
+
|
|
341
|
+
### テスト戦略
|
|
342
|
+
|
|
343
|
+
#### ユニットテスト
|
|
344
|
+
```javascript
|
|
345
|
+
describe('StudentComponent', () => {
|
|
346
|
+
test('should display student list', () => {
|
|
347
|
+
const students = [{ id: 1, name: '田中太郎' }];
|
|
348
|
+
render(<StudentComponent students={students} />);
|
|
349
|
+
expect(screen.getByText('田中太郎')).toBeInTheDocument();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
test('should handle create action', () => {
|
|
353
|
+
const onCreateMock = jest.fn();
|
|
354
|
+
render(<StudentComponent onCreate={onCreateMock} />);
|
|
355
|
+
fireEvent.click(screen.getByText('新規'));
|
|
356
|
+
expect(onCreateMock).toHaveBeenCalled();
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### 統合テスト
|
|
362
|
+
```javascript
|
|
363
|
+
describe('Student CRUD flow', () => {
|
|
364
|
+
test('should complete full CRUD cycle', async () => {
|
|
365
|
+
// Create
|
|
366
|
+
await createStudent({ name: '田中太郎' });
|
|
367
|
+
expect(await findByText('田中太郎')).toBeInTheDocument();
|
|
368
|
+
|
|
369
|
+
// Read
|
|
370
|
+
fireEvent.click(await findByText('田中太郎'));
|
|
371
|
+
expect(await findByText('詳細情報')).toBeInTheDocument();
|
|
372
|
+
|
|
373
|
+
// Update
|
|
374
|
+
fireEvent.click(await findByText('編集'));
|
|
375
|
+
fireEvent.change(getByDisplayValue('田中太郎'), {
|
|
376
|
+
target: { value: '田中次郎' }
|
|
377
|
+
});
|
|
378
|
+
fireEvent.click(await findByText('保存'));
|
|
379
|
+
expect(await findByText('田中次郎')).toBeInTheDocument();
|
|
380
|
+
|
|
381
|
+
// Delete
|
|
382
|
+
fireEvent.click(await findByText('削除'));
|
|
383
|
+
fireEvent.click(await findByText('確認'));
|
|
384
|
+
expect(queryByText('田中次郎')).not.toBeInTheDocument();
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### エラーハンドリング
|
|
390
|
+
|
|
391
|
+
#### ユーザーフレンドリーなエラー表示
|
|
392
|
+
```javascript
|
|
393
|
+
const ErrorBoundary = ({ children }) => {
|
|
394
|
+
const [hasError, setHasError] = useState(false);
|
|
395
|
+
const [error, setError] = useState(null);
|
|
396
|
+
|
|
397
|
+
if (hasError) {
|
|
398
|
+
return (
|
|
399
|
+
<div className="error-container">
|
|
400
|
+
<h2>申し訳ございません</h2>
|
|
401
|
+
<p>予期しないエラーが発生しました。</p>
|
|
402
|
+
<button onClick={() => window.location.reload()}>
|
|
403
|
+
ページを再読み込み
|
|
404
|
+
</button>
|
|
405
|
+
</div>
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return children;
|
|
410
|
+
};
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### バリデーション
|
|
414
|
+
```javascript
|
|
415
|
+
const validateStudent = (student) => {
|
|
416
|
+
const errors = {};
|
|
417
|
+
|
|
418
|
+
if (!student.name?.trim()) {
|
|
419
|
+
errors.name = '名前は必須です';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (student.name?.length > 100) {
|
|
423
|
+
errors.name = '名前は100文字以内で入力してください';
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!student.class) {
|
|
427
|
+
errors.class = '組を選択してください';
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return {
|
|
431
|
+
isValid: Object.keys(errors).length === 0,
|
|
432
|
+
errors
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## まとめ
|
|
438
|
+
|
|
439
|
+
オブジェクト指向UI設計は、ユーザーにとって直感的で理解しやすいインターフェースを構築するための強力な手法です。4つの主要原則に従って設計することで、一貫性があり、保守性の高いUIを実現できます。
|
|
440
|
+
|
|
441
|
+
重要なポイント:
|
|
442
|
+
- オブジェクト中心の設計思考
|
|
443
|
+
- コレクション・シングルビューの適切な使い分け
|
|
444
|
+
- アクションパターンの統一
|
|
445
|
+
- アクセシビリティとパフォーマンスの考慮
|
|
446
|
+
- 包括的なテスト戦略
|