Works everywhere: These prompting techniques apply to both CLI and Factory App.
汎用プロンプト原則
これらの原則は全てのモデルで機能します:Be specific about the outcome
Be specific about the outcome
Weak: “Fix the bug in auth”Strong: “Fix the login timeout bug where users get logged out after 5 minutes of inactivity. The session should persist for 24 hours.”
Provide context before instructions
Provide context before instructions
Weak: “Add error handling”Strong: “This API endpoint handles payment processing. It currently crashes silently on network errors. Add error handling that logs the error, returns a user-friendly message, and triggers an alert.”
Include acceptance criteria
Include acceptance criteria
Weak: “Make it faster”Strong: “Optimize the search query. Success criteria: query time under 100ms for 10k records, no change to result accuracy, passes existing tests.”
Specify constraints explicitly
Specify constraints explicitly
Weak: “Refactor this code”Strong: “Refactor this code to use the repository pattern. Constraints: don’t change the public API, maintain backward compatibility, keep the same test coverage.”
Claudeモデル(Opus、Sonnet、Haiku)
Claudeモデルは構造化された明示的な指示に優れ、特定のフォーマットパターンに特によく応答します。Claudeの主要テクニック
Use XML tags for structure
Claude responds exceptionally well to XML-style tags for organizing complex prompts:
Claudeプロンプト改良スキル
~/.factory/skills/prompt-refiner-claude/SKILL.mdを作成してください:
GPTモデル(GPT-5、GPT-5.1、Codex)
GPTモデルは明確なシステムレベルのコンテキストで優れ、明示的な役割設定から恩恵を受けます。GPTの主要テクニック
GPTプロンプト改良スキル
~/.factory/skills/prompt-refiner-gpt/SKILL.mdを作成してください:
- 全てのエンドポイントで適切な入力検証を確認
- シークレットがハードコードされていない、またはログに記録されていないことを確認
- 認証・認可ロジックをレビュー
- SQLインジェクションとXSS脆弱性を確認
- 機密情報を漏らさない適切なエラーハンドリングを確認
- Critical:デプロイメント前に修正が必要な問題
- High:早急に対処すべき重大なリスク
- Medium:検討すべき改善点
- Recommendations:一般的なセキュリティ強化
- ファイルと行番号
- 脆弱性の説明
- コード例付きの推奨修正
Geminiモデル
Geminiモデルは長いコンテキストをうまく処理し、構造化された推論で効果的に動作します。Geminiの主要テクニック
Leverage long context
Gemini can handle extensive context—don’t be afraid to include more background:
モデル選択戦略
タスクにモデルをマッチさせる:| タスクタイプ | 推奨モデル | 推論レベル |
|---|---|---|
| 複雑なアーキテクチャ | Opus 4.6または Opus 4.5 | High-Max |
| 機能実装 | Sonnet 4.5またはGPT-5.1-Codex | Medium |
| クイック編集、フォーマット | Haiku 4.5 | Off/Low |
| コードレビュー | GPT-5.1-Codex-Max | High |
| バルク自動化 | GLM-4.7 (Droid Core) | None |
| リサーチ/分析 | Gemini 3 Pro | High |
独自プロンプト改良の作成
チーム固有のニーズのために、カスタムプロンプト改良を作成してください:クイックリファレンスカード
Claude(Opus/Sonnet/Haiku)
- ✅ 構造化のためのXMLタグ
- ✅ 指示の前にコンテキスト
- ✅ 専用セクションでの例
- ✅ 推論のための「Think through…」
GPT(GPT-5/Codex)
- ✅ 役割設定(「あなたは…」)
- ✅ 番号付き手順
- ✅ 明示的な出力形式
- ✅ 推論のための「ステップバイステップ」
Gemini
- ✅ 広範囲なコンテキスト包含
- ✅ Low/High推論レベル
- ✅ 構造化された出力リクエスト
