メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://factory-docs-auto-sync-jp-docs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

このチェックリストは、基本的なDroidインストールを完全に最適化された開発環境に変換します。各セクションは前のセクションをベースに構築されているため、最良の結果を得るためには順番通りに完了してください。
分けて進めたい場合は、各セクションを個別に実行できます。
Factory Appを使用していますか? このガイドの大部分はCLIとFactory Appの両方に適用されます。体験が異なる箇所では、App固有の方法を記載しています。

レベル1:基本セットアップ

これらの基盤となる項目は、最大の即時効果をもたらします。
1

Factory IDEプラグインをインストール

IDEプラグインは、開いているファイル、エラー、選択範囲などのリアルタイムコンテキストを提供し、Droidがあなたと同じものを見られるようにします。VSCode/Cursor:
  1. Extensionsを開きます(Cmd+Shift+X
  2. Search “Factory”
  3. インストールして再読み込みします
確認: droidを実行し、ステータスバーに”IDE connected”が表示されることを確認します。
2

AGENTS.mdを作成

リポジトリルートに基本的なAGENTS.mdを作成します:
# Project Guidelines

## Build & Test
- Build: `npm run build`
- Test: `npm test`
- Lint: `npm run lint`

## Code Style
- Use TypeScript strict mode
- Prefer functional components in React
- Write tests for new features
最小構成から始め、作業しながら拡張します。その他の例はAGENTS.mdガイドを参照してください。
3

デフォルトモデルを設定

設定で使用するモデルを設定します:CLI:
droid
> /settings
# Navigate to Model and select your default
Factory App: チャットインターフェースのモデルセレクタードロップダウンを使用します。推奨: 複雑な作業ではClaude Opus 4.5(デフォルト)から始め、定型作業ではHaiku 4.5またはGPT-5.1-Codexに切り替えます。
チェックポイント: これでIDE連携、基本的なプロジェクトコンテキスト、使用するモデルが設定されました。

レベル2:メモリ&コンテキスト

永続的なメモリを構築し、Droidがセッション間であなたの設定を記憶できるようにします。
1

memoriesファイルを作成

個人の好み用に~/.factory/memories.mdを作成します:
# My Development Preferences

## Code Style
- I prefer arrow functions over function declarations
- I like early returns over nested conditionals
- I use 2-space indentation

## Testing
- I use React Testing Library, not Enzyme
- I prefer integration tests over unit tests for components
- Mock external APIs, not internal modules

## Past Decisions
- [2024-01] Chose Zustand over Redux for state management
- [2024-02] Using Tailwind CSS for styling
Droidに同じ指示を繰り返していると気づいたら、このファイルを更新してください。
2

AGENTS.mdでmemoriesを参照

AGENTS.mdに追加します:
## Personal Preferences
Refer to `~/.factory/memories.md` for my coding preferences and past decisions.
3

プロジェクト固有のmemoriesを作成(任意)

チームプロジェクトでは.factory/memories.mdを作成します:
# Project Memories

## Architecture Decisions
- We use the repository pattern for data access
- All API routes go through the /api/v1 prefix
- Feature flags are managed via LaunchDarkly

## Known Issues
- The auth service has a 5-second timeout issue (#123)
- Legacy users table uses snake_case columns
チェックポイント: Droidは、あなたが繰り返さなくても好みとプロジェクト履歴にアクセスできるようになりました。
メモリ記録を自動化したいですか? “remember this:“と言ったときにメモリを自動保存するフックを設定します。セットアップ手順はメモリ管理を参照してください。

レベル3:ルール&規約

コーディング標準を整理し、Droidが一貫してそれらに従うようにします。
1

ルールディレクトリを作成

プロジェクトに.factory/rules/を作成します:
.factory/
└── rules/
    ├── typescript.md
    ├── testing.md
    └── security.md
2

TypeScriptルールを追加

.factory/rules/typescript.mdを作成します:
# TypeScript Conventions

## General
- Use `interface` for object types, `type` for unions/intersections
- Avoid `any` - use `unknown` with type guards instead
- Export types alongside their implementations

## React Components
- Use functional components with TypeScript FC type
- Props interfaces should be named `{ComponentName}Props`
- Use `React.ReactNode` for children, not `React.ReactChild`

## Imports
- Group imports: React, external libs, internal modules, types
- Use absolute imports from `@/` prefix
- Avoid barrel files (index.ts re-exports) for performance
3

テストルールを追加

.factory/rules/testing.mdを作成します:
# Testing Conventions

## File Organization
- Test files live next to source: `Component.tsx``Component.test.tsx`
- Integration tests go in `__tests__/integration/`
- E2E tests go in `e2e/`

## Test Structure
- Use descriptive test names: "should [action] when [condition]"
- One assertion per test when possible
- Use `beforeEach` for common setup, not `beforeAll`

## Mocking
- Mock at the boundary (API calls, not internal functions)
- Use MSW for API mocking in integration tests
- Reset mocks in `afterEach`
4

AGENTS.mdでルールを参照

AGENTS.mdを更新します:
## Coding Standards
Follow the conventions documented in:
- `.factory/rules/typescript.md` - TypeScript and React patterns
- `.factory/rules/testing.md` - Testing conventions
- `.factory/rules/security.md` - Security requirements
チェックポイント: コーディング標準が文書化され、Droidが一貫して従うようになりました。
ルールを自動適用: 編集後にリンターを実行するにはPostToolUseフックを使用します。例はフックリファレンスを参照してください。

レベル4:スキル&自動化

再利用可能なスキルと自動化フックを追加します。
自動化する3つの方法:
1

プロンプト改善スキルを作成

~/.factory/skills/prompt-refiner/SKILL.mdを作成します:
---
name: prompt-refiner
description: Improve prompts before sending them to get better results. Use when you want to refine a task description.
---

# Prompt Refiner

## Instructions

When the user wants to refine a prompt:

1. Ask for their draft prompt or task description
2. Analyze it for:
   - Clarity: Is the goal specific and measurable?
   - Context: Does it include relevant background?
   - Constraints: Are requirements and limitations stated?
   - 例: Would examples help clarify expectations?
3. Suggest an improved version with explanations
4. Offer to iterate if needed

## Good Prompt Patterns

- Start with the outcome: "Create a..." not "I want you to..."
- Include acceptance criteria: "The result should..."
- Specify format: "Return as JSON/markdown/code"
- Mention constraints: "Must be compatible with...", "Should not modify..."
2

自動整形フックを追加

/hooksを実行し、自動整形用のPostToolUseフックを追加します:
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Create|Edit|ApplyPatch",
        "hooks": [
          {
            "type": "command",
            "command": "cd \"$FACTORY_PROJECT_DIR\" && npx prettier --write \"$(jq -r '.tool_input.file_path' 2>/dev/null || echo '')\" 2>/dev/null || true"
          }
        ]
      }
    ]
  }
}
これにより、Droidが編集した後にファイルが自動整形されます。
3

編集時テストフックを追加(任意)

編集後に関連テストを実行します:
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|ApplyPatch",
        "hooks": [
          {
            "type": "command",
            "command": "cd \"$FACTORY_PROJECT_DIR\" && jq -r '.tool_input.file_path' | xargs -I {} npm test -- --findRelatedTests {} --passWithNoTests 2>/dev/null || true"
          }
        ]
      }
    ]
  }
}
チェックポイント: 再利用可能なスキルと自動整形/テストが設定されました。

レベル5:トークン最適化

品質を犠牲にすることなく、コスト効率を微調整します。
1

複雑な作業で仕様モードを有効化

複数ファイルに触れる機能を始める前にShift+Tabまたは/specを使用します。これによりコストの高い手戻りを防げます。
2

モデル切り替えを設定

計画用に仕様モードモデルを設定します:
droid
> /settings
# Set Spec Mode Model to a reasoning-heavy model
計画にはOpus 4.5を使用し、実装にはSonnetまたはCodexを使用します。
3

準備状況レポートを実行

プロジェクトのAI準備状況を確認します:CLI:
droid
> /readiness-report
Factory App: Agent Readinessダッシュボードで準備状況スコアを確認します。影響の大きい項目から対応します。lint、型チェック、高速テストはトークンの無駄を大幅に減らします。

クイックリファレンス:ファイルの場所

目的個人用プロジェクト用
スキル~/.factory/skills/<name>/SKILL.md.factory/skills/<name>/SKILL.md
メモリ~/.factory/memories.md.factory/memories.md
ルール~/.factory/rules/*.md.factory/rules/*.md
設定~/.factory/settings.json.factory/settings.json
フックsettings.json内settings.json内
エージェント指示~/.factory/AGENTS.md./AGENTS.md
カスタムdroid~/.factory/droids/<name>.md.factory/droids/<name>.md

検証チェックリスト

セットアップを検証するために、このチェックリストを実行してください:
  • Droid実行時にIDEプラグインが「接続済み」を表示する
  • AGENTS.mdがbuild/testコマンドと共に存在する
  • あなたの設定を含むメモリファイルが作成されている
  • 少なくとも1つのルールファイルがあるルールディレクトリが存在する
  • 少なくとも1つのカスタムスキルが作成されている
  • 自動フォーマットフックが設定されている
  • 準備状況レポートがレベル2以上を表示する

次のステップ

プロンプト作成

モデル別のプロンプト技法を学ぶ

トークン効率化

トークン使用量を減らす戦略

メモリ管理

高度なメモリとコンテキストのパターン

ルールガイド

チーム規約を効果的に整理する