> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embedder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 一般的なワークフロー

このページでは、日常的によく使う手順をまとめます。プロジェクト作成、ハードウェア連携、開発、デバッグ、セッション管理までをカバーします。

## 新規プロジェクト開始

<Steps>
  <Step title="プロジェクト作成 / 選択">
    ```txt embedder theme={"system"}
    /project
    ```

    <Frame caption="プロジェクト選択画面">
      <img src="https://mintcdn.com/embedder/4y2q1agcuRz3fRND/images/select-project.png?fit=max&auto=format&n=4y2q1agcuRz3fRND&q=85&s=a9be00239cea81ce0616f63c85ec8a36" alt="検索ボックス、新規作成ボタン、既存プロジェクト一覧を表示する画面" width="1992" height="1656" data-path="images/select-project.png" />
    </Frame>
  </Step>

  <Step title="プラットフォーム選択">
    カタログから選択、または独自プラットフォームを追加します。

    <Frame caption="プラットフォーム選択画面">
      <img src="https://mintcdn.com/embedder/ujO4-sDifSwa2qo6/images/select-platform.png?fit=max&auto=format&n=ujO4-sDifSwa2qo6&q=85&s=a6c3fc150ba41632be86d7a8f4b7f876" alt="Nordic の nRF9xxx を表示するプラットフォーム選択ダイアログ" width="1980" height="1636" data-path="images/select-platform.png" />
    </Frame>

    独自追加時は `+ Add "[platform name]"` を使い、必要ドキュメントをアップロードします。
  </Step>

  <Step title="周辺機器追加">
    利用する I2C/SPI/UART などの周辺機器を選択します。

    <Frame caption="周辺機器選択画面">
      <img src="https://mintcdn.com/embedder/ujO4-sDifSwa2qo6/images/select-peripherals.png?fit=max&auto=format&n=ujO4-sDifSwa2qo6&q=85&s=5bf9421145a180e0648c9072b476478c" alt="複数メーカーの部品を表示する周辺機器選択ダイアログ" width="1990" height="1646" data-path="images/select-peripherals.png" />
    </Frame>

    後で `/peripheral` を再実行すれば変更できます。
  </Step>

  <Step title="EMBEDDER.md 生成">
    ```txt embedder theme={"system"}
    /init
    ```

    プロジェクト固有ルールを初期化します。
  </Step>
</Steps>

## ハードウェア連携

### シリアルモニター

```txt Embedder theme={"system"}
/serial
```

または `` Ctrl+` `` で切り替えます。

自動接続を無効化したい場合：

```txt Embedder theme={"system"}
> don't auto-connect to serial after flashing
```

ノイズが多い場合は `[Filter]` で regex フィルタを使います。

<Frame>
  <img src="https://mintcdn.com/embedder/feqpp7Csqgb6FFzf/images/serial_filter.png?fit=max&auto=format&n=feqpp7Csqgb6FFzf&q=85&s=5e518da4c96ca100e44ea8ce95769018" alt="正規表現でログを絞り込むシリアルフィルタ画面" style={{ maxWidth:"200px" }} width="688" height="1254" data-path="images/serial_filter.png" />
</Frame>

## ファームウェア開発

### ドライバ実装

```txt Embedder theme={"system"}
> write an I2C driver for the BME280 sensor on I2C1 (SDA=PB7, SCL=PB6).
> include functions for reading temperature, humidity, and pressure.
```

```txt Embedder theme={"system"}
> create a UART driver for GPS module on UART2 at 9600 baud.
> implement a ring buffer for RX and parse NMEA sentences.
```

```txt Embedder theme={"system"}
> implement SPI driver for the SD card module on SPI1.
> include initialization and single block read/write.
```

### ビルド / 書き込み

<Steps>
  <Step title="依存関係の導入">
    ```txt Embedder theme={"system"}
    > help me install the dependencies for this project
    ```
  </Step>

  <Step title="ビルド">
    ```txt Embedder theme={"system"}
    > build the project
    ```
  </Step>

  <Step title="書き込み">
    ```txt Embedder theme={"system"}
    > flash the firmware to the device
    ```
  </Step>

  <Step title="ビルド + 書き込み + 監視">
    ```txt Embedder theme={"system"}
    > build and flash, then show me the serial output
    ```
  </Step>
</Steps>

## シリアル出力でデバッグ

```txt Embedder theme={"system"}
> what's causing this error in the serial output?
```

```txt Embedder theme={"system"}
> the device keeps resetting, analyze the crash dump
```

```txt Embedder theme={"system"}
> add debug prints to trace the initialization sequence
```

## Plan モードと Act モード

* **Act**: 読み書き・実行可能（実装向け）
* **Plan**: 読み取り中心（調査・設計向け）

切替：`Shift+Tab`、`/plan`、`/act`

## ドキュメント活用

`/console` からデータシートや補足資料を追加アップロードできます。

<Frame caption="ドキュメントアップロード画面">
  <img src="https://mintcdn.com/embedder/4y2q1agcuRz3fRND/images/console-docs.png?fit=max&auto=format&n=4y2q1agcuRz3fRND&q=85&s=3e8e4a0ae841d2d936c8f3a2c5de982a" alt="Web アプリのドキュメントアップロード領域" width="3016" height="2152" data-path="images/console-docs.png" />
</Frame>

例：

```txt Embedder theme={"system"}
> what's the maximum I2C clock speed for this sensor?
```

```txt Embedder theme={"system"}
> show me the register map for the accelerometer
```

## Bash モード

`!` プレフィックスで AI を介さず直接実行できます。

```bash theme={"system"}
!ls -la
!make clean
!git status
```

## シリアル送信モード

`~` プレフィックスで MCU に直接送信します。

```txt embedder theme={"system"}
~help
~reset
~get status
```

## `@` でファイル参照

```txt Embedder theme={"system"}
> explain the logic in @src/main.c
```

```txt Embedder theme={"system"}
> what's in @src/drivers/?
```

## セッション管理

```txt Embedder theme={"system"}
/project
/history
/compress
```

## クイックリファレンス

| 用途       | コマンド / ショートカット                         |
| -------- | -------------------------------------- |
| 新規セットアップ | `/project` -> `/peripheral` -> `/init` |
| シリアル表示   | `/serial` または `` Ctrl+` ``             |
| モード切替    | `Shift+Tab` または `/plan` `/act`         |
| ファイル参照   | プロンプト内で `@filename`                    |
| Bash 直実行 | `!command`                             |
| シリアル送信   | `~message`                             |
| 取り消し     | `/undo` または `Ctrl+Z`                   |
| 巻き戻し     | `/rewind` または `Ctrl+Z (2x)`            |
| ヘルプ      | `/help`                                |
