yodogawa 1.0.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.
Files changed (61) hide show
  1. package/.windsurf/templates/documentation-rules.md +143 -0
  2. package/.windsurf/templates/project/01-requirements/01-system-overview.md +49 -0
  3. package/.windsurf/templates/project/01-requirements/02-features-implemented.md +73 -0
  4. package/.windsurf/templates/project/01-requirements/03-features-planned.md +75 -0
  5. package/.windsurf/templates/project/01-requirements/04-non-functional-requirements.md +115 -0
  6. package/.windsurf/templates/project/01-requirements/05-user-stories.md +124 -0
  7. package/.windsurf/templates/project/02-behavior/01-scenarios.md +406 -0
  8. package/.windsurf/templates/project/03-domain/01-domain-model.md +338 -0
  9. package/.windsurf/templates/project/03-domain/02-ubiquitous-language.md +153 -0
  10. package/.windsurf/templates/project/04-design/01-tech-stack.md +360 -0
  11. package/.windsurf/templates/project/04-design/02-repository-structure.md +390 -0
  12. package/.windsurf/templates/project/04-design/03-screen-design.md +586 -0
  13. package/.windsurf/templates/project/04-design/04-data-model.md +211 -0
  14. package/.windsurf/templates/project/04-design/05-api-spec.md +221 -0
  15. package/.windsurf/templates/project/04-design/06-architecture.md +183 -0
  16. package/.windsurf/templates/project/04-design/07-infrastructure.md +180 -0
  17. package/.windsurf/templates/tasks/task-template/a-definition.md +143 -0
  18. package/.windsurf/templates/tasks/task-template/b-research.md +185 -0
  19. package/.windsurf/templates/tasks/task-template/c-implementation.md +197 -0
  20. package/.windsurf/workflows/a-001-SetupDocStructure.md +165 -0
  21. package/.windsurf/workflows/a-002-InitializeProject.md +229 -0
  22. package/.windsurf/workflows/a-003-CreateScenarios.md +130 -0
  23. package/.windsurf/workflows/a-004-DefineDomainModel.md +133 -0
  24. package/.windsurf/workflows/a-005-CreateDomainDiagram.md +114 -0
  25. package/.windsurf/workflows/a-006-ReviewRequirementsDomain.md +132 -0
  26. package/.windsurf/workflows/a-007-DefineTechStack.md +121 -0
  27. package/.windsurf/workflows/a-008-DefineRepositoryStructure.md +118 -0
  28. package/.windsurf/workflows/a-009-DefineScreenDesign.md +121 -0
  29. package/.windsurf/workflows/a-010-DefineDataModel.md +125 -0
  30. package/.windsurf/workflows/a-011-DefineAPISpec.md +123 -0
  31. package/.windsurf/workflows/a-012-DefineArchitecture.md +119 -0
  32. package/.windsurf/workflows/a-013-DefineInfrastructure.md +120 -0
  33. package/.windsurf/workflows/a-014-ReviewDesign.md +122 -0
  34. package/.windsurf/workflows/b-001-CreateTaskDirectory.md +71 -0
  35. package/.windsurf/workflows/b-002-CreateTaskDefinition.md +165 -0
  36. package/.windsurf/workflows/b-003-CreateTaskResearch.md +412 -0
  37. package/.windsurf/workflows/b-004-CreateTaskImplementation.md +97 -0
  38. package/.windsurf/workflows/b-005-ReviewTask.md +312 -0
  39. package/.windsurf/workflows/c-001-ImplementTask.md +493 -0
  40. package/.windsurf/workflows/c-002-UpdateDocumentation.md +797 -0
  41. package/.windsurf/workflows/x-Accessibility-Check.md +469 -0
  42. package/.windsurf/workflows/x-Bundle-Optimize.md +386 -0
  43. package/.windsurf/workflows/x-CI-FixFailure.md +636 -0
  44. package/.windsurf/workflows/x-CI-Setup.md +641 -0
  45. package/.windsurf/workflows/x-Code-Refactor.md +71 -0
  46. package/.windsurf/workflows/x-Code-ResearchAndReview.md +78 -0
  47. package/.windsurf/workflows/x-Component-Create.md +359 -0
  48. package/.windsurf/workflows/x-Context-CatchUp.md +63 -0
  49. package/.windsurf/workflows/x-Database-Seed.md +300 -0
  50. package/.windsurf/workflows/x-Dependencies-Update.md +315 -0
  51. package/.windsurf/workflows/x-DevEnvironment-Setup.md +437 -0
  52. package/.windsurf/workflows/x-Logging-Add.md +682 -0
  53. package/.windsurf/workflows/x-Migration-Create.md +354 -0
  54. package/.windsurf/workflows/x-Problem-RootCauseAnalysis.md +65 -0
  55. package/.windsurf/workflows/x-Repository-Push.md +375 -0
  56. package/.windsurf/workflows/x-Repository-PushToGithub.md +72 -0
  57. package/.windsurf/workflows/x-Requirements-Clarify.md +61 -0
  58. package/.windsurf/workflows/z-CreateWorkflow.md +77 -0
  59. package/README.md +280 -0
  60. package/bin/cli.js +74 -0
  61. package/package.json +28 -0
@@ -0,0 +1,469 @@
1
+ ---
2
+ description: Webアクセシビリティを監査し、WCAG準拠とスクリーンリーダー対応を確認するワークフロー
3
+ auto_execution_mode: 1
4
+ ---
5
+
6
+ # Accessibility-Check (x-Accessibility-Check)
7
+
8
+ ## 目的
9
+
10
+ - Web アクセシビリティ(a11y)の問題を検出し、修正する。
11
+ - WCAG 2.1 レベル AA 準拠を確認する。
12
+ - スクリーンリーダーでの使用体験を改善する。
13
+ - キーボードナビゲーションを確保する。
14
+ - 色のコントラスト比を適切に設定する。
15
+
16
+ ## 前提
17
+
18
+ - Web アプリケーションが開発サーバーまたはステージング環境で動作している。
19
+ - Chrome または Firefox ブラウザが利用可能。
20
+ - axe DevTools または Lighthouse が利用可能。
21
+
22
+ ## 手順
23
+
24
+ ### 1. 自動アクセシビリティテストの実行
25
+
26
+ #### 1.1. axe DevTools のインストール
27
+
28
+ **Chrome 拡張機能**:
29
+ - Chrome Web Store で "axe DevTools" を検索してインストール
30
+ - または: https://chrome.google.com/webstore/detail/axe-devtools-web-accessibility-testing/lhdoppojpmngadmnindnejefpokejbdd
31
+
32
+ **Firefox アドオン**:
33
+ - https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/
34
+
35
+ #### 1.2. axe DevTools の実行
36
+
37
+ 1. 開発サーバーを起動: `npm run dev`
38
+ 2. ブラウザで対象ページを開く
39
+ 3. DevTools を開く(F12)
40
+ 4. "axe DevTools" タブを選択
41
+ 5. "Scan ALL of my page" をクリック
42
+
43
+ **質問1: 検出された問題**
44
+ - 「どのような問題が検出されましたか?」
45
+ - 重要度:
46
+ - **Critical**: 即座に修正が必要
47
+ - **Serious**: 優先度高
48
+ - **Moderate**: 優先度中
49
+ - **Minor**: 優先度低
50
+
51
+ #### 1.3. Lighthouse の実行
52
+
53
+ ```bash
54
+ npx lighthouse https://localhost:3000 --view --only-categories=accessibility
55
+ ```
56
+
57
+ **スコア目標**:
58
+ - **90-100**: 優秀
59
+ - **80-89**: 良好
60
+ - **<80**: 改善が必要
61
+
62
+ ### 2. よくあるアクセシビリティ問題と修正方法
63
+
64
+ #### 2.1. 画像の代替テキスト不足
65
+
66
+ **問題**: `<img>` タグに `alt` 属性がない
67
+
68
+ **修正前**:
69
+ ```html
70
+ <img src="/logo.png" />
71
+ ```
72
+
73
+ **修正後**:
74
+ ```html
75
+ <img src="/logo.png" alt="Company Logo" />
76
+
77
+ <!-- 装飾的な画像の場合は空文字列 -->
78
+ <img src="/decoration.png" alt="" />
79
+ ```
80
+
81
+ #### 2.2. フォーム要素のラベル不足
82
+
83
+ **問題**: `<input>` に対応する `<label>` がない
84
+
85
+ **修正前**:
86
+ ```html
87
+ <input type="email" placeholder="Email" />
88
+ ```
89
+
90
+ **修正後**:
91
+ ```html
92
+ <label htmlFor="email">Email</label>
93
+ <input id="email" type="email" placeholder="Enter your email" />
94
+
95
+ <!-- または暗黙的な関連付け -->
96
+ <label>
97
+ Email
98
+ <input type="email" placeholder="Enter your email" />
99
+ </label>
100
+ ```
101
+
102
+ #### 2.3. 色のコントラスト不足
103
+
104
+ **問題**: テキストと背景のコントラスト比が 4.5:1 未満
105
+
106
+ **チェックツール**:
107
+ - https://webaim.org/resources/contrastchecker/
108
+ - Chrome DevTools の Color Picker
109
+
110
+ **修正前**:
111
+ ```css
112
+ .text {
113
+ color: #999; /* グレー */
114
+ background-color: #fff; /* 白 */
115
+ /* コントラスト比: 2.8:1 (不十分) */
116
+ }
117
+ ```
118
+
119
+ **修正後**:
120
+ ```css
121
+ .text {
122
+ color: #666; /* ダークグレー */
123
+ background-color: #fff; /* 白 */
124
+ /* コントラスト比: 5.7:1 (良好) */
125
+ }
126
+ ```
127
+
128
+ #### 2.4. ボタンのアクセシブルな名前不足
129
+
130
+ **問題**: ボタンにテキストやラベルがない
131
+
132
+ **修正前**:
133
+ ```html
134
+ <button><Icon /></button>
135
+ ```
136
+
137
+ **修正後**:
138
+ ```html
139
+ <!-- 方法1: aria-label -->
140
+ <button aria-label="Close dialog"><CloseIcon /></button>
141
+
142
+ <!-- 方法2: スクリーンリーダー専用テキスト -->
143
+ <button>
144
+ <CloseIcon />
145
+ <span className="sr-only">Close dialog</span>
146
+ </button>
147
+ ```
148
+
149
+ **CSS for sr-only**:
150
+ ```css
151
+ .sr-only {
152
+ position: absolute;
153
+ width: 1px;
154
+ height: 1px;
155
+ padding: 0;
156
+ margin: -1px;
157
+ overflow: hidden;
158
+ clip: rect(0, 0, 0, 0);
159
+ white-space: nowrap;
160
+ border-width: 0;
161
+ }
162
+ ```
163
+
164
+ #### 2.5. 見出しレベルのスキップ
165
+
166
+ **問題**: h1 → h3 のように見出しレベルをスキップ
167
+
168
+ **修正前**:
169
+ ```html
170
+ <h1>Page Title</h1>
171
+ <h3>Subsection</h3>
172
+ ```
173
+
174
+ **修正後**:
175
+ ```html
176
+ <h1>Page Title</h1>
177
+ <h2>Section</h2>
178
+ <h3>Subsection</h3>
179
+ ```
180
+
181
+ #### 2.6. リンクのアクセシブルな名前不足
182
+
183
+ **問題**: "Click here" や "Read more" などの曖昧なリンクテキスト
184
+
185
+ **修正前**:
186
+ ```html
187
+ <a href="/article">Read more</a>
188
+ ```
189
+
190
+ **修正後**:
191
+ ```html
192
+ <!-- 方法1: 説明的なリンクテキスト -->
193
+ <a href="/article">Read more about accessibility best practices</a>
194
+
195
+ <!-- 方法2: aria-label -->
196
+ <a href="/article" aria-label="Read more about accessibility best practices">
197
+ Read more
198
+ </a>
199
+
200
+ <!-- 方法3: スクリーンリーダー専用テキスト -->
201
+ <a href="/article">
202
+ Read more
203
+ <span className="sr-only">about accessibility best practices</span>
204
+ </a>
205
+ ```
206
+
207
+ ### 3. キーボードナビゲーションのテスト
208
+
209
+ **質問2: キーボードナビゲーション**
210
+ - 「キーボードのみですべての機能にアクセスできますか?」
211
+
212
+ **テスト手順**:
213
+ 1. Tab キーで全要素を順番に移動できるか
214
+ 2. Shift+Tab で逆順に移動できるか
215
+ 3. Enter または Space キーでボタンを実行できるか
216
+ 4. Esc キーでモーダルを閉じられるか
217
+ 5. 矢印キーでドロップダウンやタブを操作できるか
218
+
219
+ **フォーカスの可視化**:
220
+ ```css
221
+ /* フォーカスリングを明確にする */
222
+ button:focus-visible,
223
+ a:focus-visible,
224
+ input:focus-visible {
225
+ outline: 2px solid #005fcc;
226
+ outline-offset: 2px;
227
+ }
228
+
229
+ /* outline: none は使わない! */
230
+ ```
231
+
232
+ **フォーカストラップ(モーダル)**:
233
+ ```typescript
234
+ import { useEffect, useRef } from 'react';
235
+
236
+ function Modal({ isOpen, onClose, children }) {
237
+ const modalRef = useRef<HTMLDivElement>(null);
238
+
239
+ useEffect(() => {
240
+ if (!isOpen) return;
241
+
242
+ // フォーカス可能な要素を取得
243
+ const focusableElements = modalRef.current?.querySelectorAll(
244
+ 'a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])'
245
+ );
246
+
247
+ const firstElement = focusableElements?.[0] as HTMLElement;
248
+ const lastElement = focusableElements?.[focusableElements.length - 1] as HTMLElement;
249
+
250
+ // 最初の要素にフォーカス
251
+ firstElement?.focus();
252
+
253
+ // Tab キーのトラップ
254
+ const handleTab = (e: KeyboardEvent) => {
255
+ if (e.key !== 'Tab') return;
256
+
257
+ if (e.shiftKey) {
258
+ // Shift+Tab: 最後の要素から最初へ
259
+ if (document.activeElement === firstElement) {
260
+ e.preventDefault();
261
+ lastElement?.focus();
262
+ }
263
+ } else {
264
+ // Tab: 最初の要素から最後へ
265
+ if (document.activeElement === lastElement) {
266
+ e.preventDefault();
267
+ firstElement?.focus();
268
+ }
269
+ }
270
+ };
271
+
272
+ // Esc キーで閉じる
273
+ const handleEsc = (e: KeyboardEvent) => {
274
+ if (e.key === 'Escape') {
275
+ onClose();
276
+ }
277
+ };
278
+
279
+ document.addEventListener('keydown', handleTab);
280
+ document.addEventListener('keydown', handleEsc);
281
+
282
+ return () => {
283
+ document.removeEventListener('keydown', handleTab);
284
+ document.removeEventListener('keydown', handleEsc);
285
+ };
286
+ }, [isOpen, onClose]);
287
+
288
+ if (!isOpen) return null;
289
+
290
+ return (
291
+ <div
292
+ ref={modalRef}
293
+ role="dialog"
294
+ aria-modal="true"
295
+ aria-labelledby="modal-title"
296
+ >
297
+ <h2 id="modal-title">Modal Title</h2>
298
+ {children}
299
+ <button onClick={onClose}>Close</button>
300
+ </div>
301
+ );
302
+ }
303
+ ```
304
+
305
+ ### 4. ARIA 属性の適切な使用
306
+
307
+ #### 4.1. ランドマークロール
308
+
309
+ ```html
310
+ <header role="banner">
311
+ <nav role="navigation" aria-label="Main navigation">
312
+ <!-- ナビゲーション -->
313
+ </nav>
314
+ </header>
315
+
316
+ <main role="main">
317
+ <!-- メインコンテンツ -->
318
+ </main>
319
+
320
+ <aside role="complementary">
321
+ <!-- サイドバー -->
322
+ </aside>
323
+
324
+ <footer role="contentinfo">
325
+ <!-- フッター -->
326
+ </footer>
327
+ ```
328
+
329
+ #### 4.2. ライブリージョン
330
+
331
+ ```html
332
+ <!-- 成功メッセージ(polite: 現在の読み上げが終わってから) -->
333
+ <div role="status" aria-live="polite">
334
+ Changes saved successfully
335
+ </div>
336
+
337
+ <!-- エラーメッセージ(assertive: 即座に割り込んで読み上げ) -->
338
+ <div role="alert" aria-live="assertive">
339
+ Error: Please fix the following issues
340
+ </div>
341
+ ```
342
+
343
+ #### 4.3. 展開可能な要素
344
+
345
+ ```html
346
+ <button
347
+ aria-expanded="false"
348
+ aria-controls="details-panel"
349
+ onClick={() => setExpanded(!expanded)}
350
+ >
351
+ {expanded ? 'Hide' : 'Show'} Details
352
+ </button>
353
+
354
+ <div id="details-panel" hidden={!expanded}>
355
+ <!-- 詳細コンテンツ -->
356
+ </div>
357
+ ```
358
+
359
+ ### 5. スクリーンリーダーでのテスト
360
+
361
+ **質問3: スクリーンリーダーテスト**
362
+ - 「スクリーンリーダーでテストしますか?」
363
+
364
+ **スクリーンリーダー**:
365
+ - **Windows**: NVDA (無料) または JAWS
366
+ - **Mac**: VoiceOver (内蔵)
367
+ - **Linux**: Orca
368
+
369
+ **VoiceOver の起動** (Mac):
370
+ ```
371
+ Cmd + F5
372
+ ```
373
+
374
+ **基本的なテスト**:
375
+ 1. ページ全体を読み上げさせる
376
+ 2. 見出しのみをナビゲート
377
+ 3. リンクのみをナビゲート
378
+ 4. フォームを入力
379
+ 5. ボタンを操作
380
+
381
+ ### 6. 自動テストの追加
382
+
383
+ **Jest + jest-axe**:
384
+ ```bash
385
+ npm install --save-dev jest-axe
386
+ ```
387
+
388
+ ```typescript
389
+ import { render } from '@testing-library/react';
390
+ import { axe, toHaveNoViolations } from 'jest-axe';
391
+ import { Button } from './Button';
392
+
393
+ expect.extend(toHaveNoViolations);
394
+
395
+ describe('Button accessibility', () => {
396
+ it('should have no accessibility violations', async () => {
397
+ const { container } = render(<Button label="Click me" />);
398
+ const results = await axe(container);
399
+ expect(results).toHaveNoViolations();
400
+ });
401
+ });
402
+ ```
403
+
404
+ **Playwright + axe-playwright**:
405
+ ```bash
406
+ npm install --save-dev @axe-core/playwright
407
+ ```
408
+
409
+ ```typescript
410
+ import { test, expect } from '@playwright/test';
411
+ import AxeBuilder from '@axe-core/playwright';
412
+
413
+ test('should not have any automatically detectable accessibility issues', async ({ page }) => {
414
+ await page.goto('http://localhost:3000');
415
+
416
+ const accessibilityScanResults = await new AxeBuilder({ page }).analyze();
417
+
418
+ expect(accessibilityScanResults.violations).toEqual([]);
419
+ });
420
+ ```
421
+
422
+ ### 7. Git コミット
423
+
424
+ ```bash
425
+ git add .
426
+ git commit -m "a11y: improve accessibility
427
+
428
+ - Add alt text to all images
429
+ - Add labels to form inputs
430
+ - Improve color contrast (4.5:1 minimum)
431
+ - Add aria-labels to icon buttons
432
+ - Implement keyboard navigation for modal
433
+ - Add automated accessibility tests
434
+
435
+ Lighthouse accessibility score: 75 → 95
436
+
437
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
438
+
439
+ Co-Authored-By: Claude <noreply@anthropic.com)"
440
+ ```
441
+
442
+ ## 完了条件
443
+
444
+ - axe DevTools でエラーが 0 件
445
+ - Lighthouse アクセシビリティスコアが 90 以上
446
+ - キーボードのみですべての機能にアクセス可能
447
+ - スクリーンリーダーで適切に読み上げられる
448
+ - 色のコントラスト比が 4.5:1 以上
449
+ - 自動テストが追加されている
450
+
451
+ ## エスカレーション
452
+
453
+ - **Critical 問題が多数**:
454
+ - 「Critical 問題を優先的に修正してください。」
455
+ - 画像の alt 属性、フォームラベル、ボタンラベルを確認
456
+
457
+ - **コントラスト比が改善できない**:
458
+ - 「デザインチームと相談してカラーパレットを見直してください。」
459
+
460
+ - **キーボードナビゲーションが複雑**:
461
+ - 「フォーカス管理ライブラリ(react-focus-lock, focus-trap)の使用を検討してください。」
462
+
463
+ ## ベストプラクティス
464
+
465
+ - **セマンティック HTML**: `<div>` の代わりに `<button>`, `<nav>`, `<main>` を使用
466
+ - **ARIA は最後の手段**: HTML だけで解決できる場合は ARIA を使わない
467
+ - **継続的な監視**: CI で自動テストを実行
468
+ - **早期対応**: 設計段階からアクセシビリティを考慮
469
+ - **実際のユーザーテスト**: 障害を持つユーザーにテストしてもらう