This commit is contained in:
@@ -11,36 +11,35 @@ initial_movement: process
|
||||
|
||||
movements:
|
||||
- name: process
|
||||
edit: true
|
||||
persona: document-specialist
|
||||
instruction: |
|
||||
## 最初のステップ: ファイルの把握と前処理
|
||||
|
||||
加工に着手する前に、まずファイルを確認し前処理を行う:
|
||||
1. Glob でワークスペース全体のファイル一覧を確認する(`**/*.xlsx`, `**/*.docx`, `**/*.pptx`, `**/*.pdf`。input/ だけでなくルート直下も含む)
|
||||
2. ファイル種別ごとの読み取り戦略は ReadToolDoc({ name: "ReadPdf" }) などで確認
|
||||
2. 読み取りは種別を問わず Read(拡張子で Office/PDF/メールを自動判定)。詳細は ReadToolDoc({ name: "Read" }) で確認
|
||||
|
||||
## ファイルサイズに応じた前処理
|
||||
|
||||
**Excel (.xlsx)**:
|
||||
- 小〜中規模 → ReadExcel で直接読む
|
||||
- 小〜中規模 → Read で直接読む(sheet / range も指定可)
|
||||
- 巨大・複数シート → SplitExcelSheets でシート別ファイル + manifest を生成し、必要なシートだけ Read する
|
||||
|
||||
**Word (.docx)**:
|
||||
- 短〜中規模 → ReadDocx で直接読む
|
||||
- 短〜中規模 → Read で直接読む
|
||||
- 長文・章構成あり → SplitDocxSections で見出し単位に分割し、関連セクションだけ Read する
|
||||
|
||||
**PowerPoint (.pptx)**:
|
||||
- ReadPPTX で各スライドのテキスト・表・スピーカーノートを取得
|
||||
- Read で各スライドのテキスト・表・スピーカーノートを取得
|
||||
|
||||
**PDF**:
|
||||
- まず ReadPdf で読み取りを試みる
|
||||
- まず Read で読み取りを試みる
|
||||
- テキストが抽出できた場合 → そのまま加工に進む
|
||||
- 全ページが空テキスト(スキャン PDF)の場合 → PdfToImages でページ画像化し、ReadImage で内容を確認する(ReadImage は VLM 対応 worker でのみ利用可能)
|
||||
|
||||
**Outlook メール (.msg)**:
|
||||
- ReadMsg で件名・差出人・宛先・本文を取得。添付は input/ に保存される
|
||||
- 保存された添付は ReadPdf / ReadExcel / ReadImage など種別ごとのツールで開く
|
||||
- Read で件名・差出人・宛先・本文を取得。添付は input/ に保存される
|
||||
- 保存された添付は Read(Office/PDF/テキスト)や ReadImage(画像)で開く
|
||||
|
||||
## Office ファイルの加工方針
|
||||
|
||||
@@ -67,7 +66,6 @@ movements:
|
||||
- **追加情報が必要で同じ process を続行**: `transition({next_step: "process", summary: "..."})`
|
||||
- **対象が特定できずユーザー確認が必要**: `complete({status: "needs_user_input", missing_info: "...", why_no_default: "..."})`
|
||||
- **読み取り不能・対応外フォーマット等の技術的失敗**: `complete({status: "aborted", abort_reason: "..."})`
|
||||
allowed_tools: [Read, Write, Bash, Glob, Grep, ReadExcel, ReadDocx, ReadPdf, ReadPPTX, ReadMsg, SplitExcelSheets, SplitDocxSections, PdfToImages, ReadImage, WebSearch, WebFetch, DownloadFile, SQLite, TranscribeAudio, ReadToolDoc, 'mcp__*']
|
||||
default_next: verify
|
||||
rules:
|
||||
- condition: output/ に成果物を書き出した(または既存ファイルを編集した)
|
||||
@@ -76,7 +74,6 @@ movements:
|
||||
next: process
|
||||
|
||||
- name: verify
|
||||
edit: false
|
||||
persona: reviewer
|
||||
instruction: |
|
||||
output/ の成果物を確認する。
|
||||
@@ -84,7 +81,7 @@ movements:
|
||||
確認手順:
|
||||
1. まず Glob で output/ 内のファイル一覧を確認する(既存 Office ファイルの編集の場合はそのファイルも対象)
|
||||
2. 成果物が1つもなければ「修正が必要」と判断し process に差し戻す
|
||||
3. 成果物があれば適切なツール(ReadPdf / ReadExcel / ReadDocx / ReadPPTX / Read 等)で内容を確認し、指示通りか・品質は十分かをチェックする
|
||||
3. 成果物があれば Read(テキスト / Office / PDF を拡張子で自動判定)や ReadImage で内容を確認し、指示通りか・品質は十分かをチェックする
|
||||
4. 不足や誤りがあれば、`transition({next_step: "process", summary: ...})` で差し戻す。summary は次の形式で書く:
|
||||
[判定] needs_fix
|
||||
## 問題点
|
||||
@@ -116,7 +113,6 @@ movements:
|
||||
- 合格: `complete({status: "success", result: "ユーザー向け最終回答"})`
|
||||
- 修正必要: `transition({next_step: "process", summary: "差し戻し指摘"})` (上記形式で)
|
||||
- 技術的失敗: `complete({status: "aborted", abort_reason: "..."})`
|
||||
allowed_tools: [Read, Glob, Grep, ReadPdf, ReadImage, ReadExcel, ReadDocx, ReadPPTX, ReadMsg, ReadToolDoc]
|
||||
default_next: COMPLETE
|
||||
rules:
|
||||
- condition: 成果物がない、または内容に不足・誤りがある
|
||||
|
||||
Reference in New Issue
Block a user