skills/crearize/fix-bug/SKILL.md
バグ修正統合スキル(原因調査→修正→テスト→レビュー→QA→PR作成の全工程自動化)
npx skillsauth add aiskillstore/marketplace fix-bugInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
バグ修正の全工程を統合的に実行するスキルです。原因調査、修正実装、テスト追加、レビュー、品質保証、PR作成まで、完全なバグ修正フローを自動化します。
# 現在のブランチを確認
git branch --show-current
# mainブランチの場合は新しいブランチを作成
# ブランチ名: fix/[bug-description-summary]-[issue_number]
# 例: fix/login-session-error-456
# mainブランチでないことを確認
# Backendログ確認(該当する場合)
grep -r "[bug related keywords]" backend/logs/
grep -r "ERROR" backend/logs/ | tail -50
# Frontendコンソールエラー確認(該当する場合)
# ブラウザDevToolsでエラー確認
# suspected_filesが指定されている場合は優先的に確認
# 指定がない場合は、バグ説明から関連キーワードを抽出して検索
# Backendコード検索
grep -r "[keyword]" backend/src/main/java/
# Frontendコード検索
grep -r "[keyword]" frontend/
# 関連するテストケースを検索
# Backendテスト
find backend/src/test/java/ -name "*Test.java" | xargs grep -l "[keyword]"
# Frontendテスト
find frontend/ -name "*.test.ts*" | xargs grep -l "[keyword]"
## バグ原因調査レポート
### バグ概要
- [bug_description]
### 再現手順(推測)
1. [手順1]
2. [手順2]
3. [手順3]
### 原因箇所
- **ファイル**: [ファイルパス]:[行番号]
- **問題**: [具体的な問題内容]
- **根本原因**: [なぜこのバグが発生したか]
### 影響範囲
- [影響を受ける機能や画面]
### 修正方針
- [どのように修正するか]
### テスト方針
- [どのようにテストするか]
最小限の変更で修正:
修正例(NullPointerException):
// Before: バグあり
public User getUser(UUID userId) {
User user = userMapper.selectById(userId);
return user; // userがnullの場合、後続処理でNPE発生
}
// After: 修正後
public User getUser(UUID userId) {
User user = userMapper.selectById(userId);
if (user == null) {
throw new UserNotFoundException("User not found: " + userId);
}
return user;
}
修正後のチェック:
最小限の変更で修正:
修正例(useEffectのメモリリーク):
// Before: バグあり
useEffect(() => {
fetchData().then(data => setData(data));
}, []);
// コンポーネントアンマウント後にsetDataが呼ばれる可能性
// After: 修正後
useEffect(() => {
let cancelled = false;
fetchData().then(data => {
if (!cancelled) {
setData(data);
}
});
return () => {
cancelled = true;
};
}, []);
修正後のチェック:
/test-backend target_class="[修正したクラスの完全修飾名]" test_type="unit" coverage_target=90
バグ再現テストの追加:
@Test
void バグ再現_ユーザーIDがnullの場合は例外を投げる() {
// given
UUID userId = null;
// when & then
assertThatThrownBy(() -> userService.getUser(userId))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("User ID must not be null");
}
@Test
void バグ再現_存在しないユーザーIDの場合は例外を投げる() {
// given
UUID userId = UUID.randomUUID();
when(userMapper.selectById(userId)).thenReturn(null);
// when & then
assertThatThrownBy(() -> userService.getUser(userId))
.isInstanceOf(UserNotFoundException.class)
.hasMessageContaining("User not found");
}
/test-frontend target_file="[修正したファイルのパス]" test_type="component" coverage_target=90
バグ再現テストの追加:
it('バグ再現: コンポーネントアンマウント後にAPIレスポンスが返ってきてもエラーにならない', async () => {
const { unmount } = render(<UserProfile userId="123" />);
// コンポーネントを即座にアンマウント
unmount();
// APIレスポンスを待つ
await waitFor(() => {
// エラーが発生しないことを確認
expect(console.error).not.toHaveBeenCalled();
});
});
cd backend
./gradlew bootRun
確認事項:
cd frontend
pnpm dev
確認事項:
/review-architecture target="[target]"
実行内容:
判定:
/qa-check target="[target]"
実行内容:
判定:
/create-pr issue_number=[issue_number]
PR説明文に含める内容:
## Fix Bug 完了報告
### バグ概要
- [bug_description]
### Issue番号
- #[issue_number]
### PR URL
- [PR URL]
### 原因
- **ファイル**: [ファイルパス]:[行番号]
- **問題**: [具体的な問題内容]
- **根本原因**: [なぜこのバグが発生したか]
### 修正内容
- [具体的な修正内容]
### 影響範囲
- [影響を受ける機能や画面]
### テスト追加
- バグ再現テスト: [テストケース数] ケース
- 境界値テスト: [テストケース数] ケース
- 既存テスト: すべて成功
### 品質保証結果
- ✅ アーキテクチャレビュー: 合格
- ✅ QAチェック: 合格
- ✅ テストカバレッジ: [数値]%
- ✅ Lint/ビルド: 成功
- ✅ サーバー起動・動作確認: 完了
- ✅ バグ再現しないことを確認: 完了
### 次のステップ
Pull Requestのレビューを依頼してください。
documents/development/development-policy.md: 開発ガイドラインdocuments/development/coding-rules/: コーディング規約documents/development/error-codes.md: エラーコード一覧documents/architecture/database-design.md: データベース設計documents/architecture/system-architecture.md: システムアーキテクチャdocuments/features/[機能名]/specification.md: 機能仕様書development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.