Initial commit
This commit is contained in:
193
skills/ask-user-choice/SKILL.md
Normal file
193
skills/ask-user-choice/SKILL.md
Normal file
@@ -0,0 +1,193 @@
|
||||
---
|
||||
name: ask-user-choice
|
||||
description: ユーザーに質問や確認をする際に毎回発動してください。自由回答形式ではなく、明確な選択肢(1質問あたり2-4個)を持つAskUserQuestionツールを使用し、ユーザーの入力負担を軽減して意思決定を迅速化します。柔軟性のためmultiSelect trueをデフォルトにしてください。
|
||||
allowed-tools: AskUserQuestion
|
||||
---
|
||||
|
||||
# Ask User Choice Skill
|
||||
|
||||
## 目的
|
||||
|
||||
このスキルは`AskUserQuestion`ツールの使用を推進し、ユーザーの入力負担を軽減して対話をより効率的にします。テキスト入力が必要な自由回答形式ではなく、ワンクリックで選択できる構造化された選択肢を提供してください。
|
||||
|
||||
## 使用タイミング
|
||||
|
||||
<trigger>
|
||||
|
||||
以下の場合にこのスキルを発動してください:
|
||||
- ユーザーの入力や好みを取得する
|
||||
- 曖昧な要件を明確化する
|
||||
- 実装の選択肢を提示する(ライブラリ、アーキテクチャ、アプローチなど)
|
||||
- 複数のタスクがある場合に優先順位を決定する
|
||||
- 作業完了後に次のアクションを提案する
|
||||
|
||||
</trigger>
|
||||
|
||||
## ベストプラクティス
|
||||
|
||||
### 1. 良い質問の構造
|
||||
|
||||
各質問には以下を含めること:
|
||||
|
||||
- **明確な質問文**: 疑問符で終わり、具体的であること
|
||||
- **簡潔なheader**: 短いラベル。例:「ライブラリ」「アプローチ」
|
||||
- **選択肢**: それぞれにラベルと詳細な説明を付ける
|
||||
- **multiSelect**: **デフォルトで`true`に設定**(柔軟性のため、ユーザーは1つまたは複数選択可能)
|
||||
|
||||
### 2. 充実した詳細な説明文を書く
|
||||
|
||||
説明文は長くてOK。情報量を充実させること。
|
||||
|
||||
良い選択肢の構造:
|
||||
|
||||
```json
|
||||
{
|
||||
"label": "短い選択肢名",
|
||||
"description": "コンテキスト、トレードオフ、影響を含む詳細な説明。\n\n段落区切りには\\n\\nを使って可読性を向上させる。\n\n十分な情報を提供して、情報に基づいた意思決定を可能にする。"
|
||||
}
|
||||
```
|
||||
|
||||
- `\n\n`で段落区切りを使う(可読性が大幅に向上)
|
||||
- コンテキスト、メリット・デメリット、影響を含める
|
||||
- 詳細を出し惜しみしない - ユーザーは簡潔すぎる説明より包括的な情報を好む
|
||||
- **Markdown記法の制限**:
|
||||
- `**bold**`、`*italic*`、`` `code` ``などは使えない(そのまま表示される)
|
||||
- 箇条書き(`-`)は装飾されないがそのまま表示されるので、可読性向上のために使用OK
|
||||
|
||||
### 3. multiSelectをデフォルトで使用
|
||||
|
||||
**特に理由がない限り`multiSelect: true`をデフォルトに**
|
||||
|
||||
✅ **`multiSelect: true`を使用(推奨デフォルト)**:
|
||||
|
||||
- ほとんどのシナリオで柔軟性の恩恵がある
|
||||
- ユーザーは1つだけ選びたければ1つだけ選べる
|
||||
- 該当する場合は複数の選択肢を組み合わせられる
|
||||
- よりユーザーフレンドリーで制約が少ない
|
||||
|
||||
⚠️ **`multiSelect: false`を使うのは以下の場合のみ**:
|
||||
|
||||
- 選択肢が厳密に相互排他的
|
||||
- 複数選択すると論理的な矛盾が生じる
|
||||
- 質問の性質上、単一選択が本質的に必要
|
||||
|
||||
## 使用例
|
||||
|
||||
<examples>
|
||||
|
||||
### 例1: 実装アプローチ選択(詳細な説明文付き)
|
||||
|
||||
<example>
|
||||
|
||||
```json
|
||||
{
|
||||
"question": "どのJavaScriptフレームワークを使用しますか?",
|
||||
"header": "Framework",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "React + TypeScript",
|
||||
"description": "仮想DOMを使用した高速レンダリングを実現する、最も人気のあるJavaScriptフレームワーク。\n\nTypeScriptと組み合わせることで型安全性が向上し、大規模プロジェクトでも保守性が高まる。\n\nコンポーネントベースの設計で再利用性が高く、豊富なエコシステム(React Router, Redux, Next.js等)が利用できる。\n\n学習コストは中程度で、ドキュメントやコミュニティサポートが充実している。"
|
||||
},
|
||||
{
|
||||
"label": "Vue.js + Composition API",
|
||||
"description": "学習曲線が穏やかで初心者にも取り組みやすいフレームワーク。\n\nComposition APIを使用することで、React Hooksに近いロジックの再利用が可能になる。\n\nテンプレート構文が直感的でHTMLに近い書き方ができ、公式の状態管理ライブラリPiniaやルーティングライブラリVue Routerが統合されている。\n\nパフォーマンスも優れており、中小規模から大規模まで幅広く対応できる。"
|
||||
},
|
||||
{
|
||||
"label": "Svelte + SvelteKit",
|
||||
"description": "コンパイル時にコードを最適化するため、ランタイムのオーバーヘッドが極めて少なく、高速なアプリケーションを構築できる。\n\n仮想DOMを使わず、ビルド時に効率的な命令型コードに変換される。\n\nSvelteKitを使用することでSSRやSSG、ルーティングなどの機能が統合されている。\n\nコード量が少なく、バンドルサイズが小さいのも大きなメリット。ただし、エコシステムはReactやVueと比べるとまだ小さい。"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</example>
|
||||
|
||||
### 例2: 複数機能選択(multiSelect推奨)
|
||||
|
||||
<example>
|
||||
|
||||
```json
|
||||
{
|
||||
"question": "どの機能を実装しますか?",
|
||||
"header": "Features",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{
|
||||
"label": "ダークモード",
|
||||
"description": "ライトモードとダークモードの切り替え機能を追加。\n\n- アクセシビリティが向上\n- 低照度環境でのユーザーの快適性が改善\n- 目の疲労を軽減\n\n実装要件:\n- CSS変数の設定\n- 状態管理(localStorage等)\n- テーマ切り替えUI"
|
||||
},
|
||||
{
|
||||
"label": "キーボードショートカット",
|
||||
"description": "パワーユーザー向けにキーボードナビゲーションとショートカットを有効化。\n\n頻繁に使用するユーザーの生産性が大幅に向上する。\n\nブラウザのショートカットとの衝突を避けるための慎重な設計が必要。"
|
||||
},
|
||||
{
|
||||
"label": "PDF出力",
|
||||
"description": "コンテンツをPDFファイルとしてエクスポートできる機能。\n\nレポート、ドキュメント、オフライン共有に便利。\n\nPDF生成ライブラリ(jsPDF、pdfmake等)が必要。"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</example>
|
||||
|
||||
### 例3: タスク優先順位(multiSelect falseのレアケース)
|
||||
|
||||
<example>
|
||||
|
||||
```json
|
||||
{
|
||||
"question": "最初にどのタスクから始めますか?",
|
||||
"header": "Priority",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "認証バグの修正",
|
||||
"description": "🔴 最優先 - 現在ユーザーがログインできない状態。\n\n全ユーザーのアクセスをブロック中。修正予想時間:1-2時間。\n\n他の作業より先に即座に対処すべき。"
|
||||
},
|
||||
{
|
||||
"label": "新機能追加",
|
||||
"description": "🟡 中優先度 - 次スプリント向けにクライアントから要望あり。\n\n現在の機能をブロックしていない。予想時間:1-2日。\n\nクリティカルなバグ解決後にスケジュール可能。"
|
||||
},
|
||||
{
|
||||
"label": "コードリファクタリング",
|
||||
"description": "🟢 低優先度 - 保守性とコード品質を改善。\n\nユーザーへの即時影響なし。予想時間:3-4時間。\n\n機能開発の合間を埋めるのに適している。"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</example>
|
||||
|
||||
</examples>
|
||||
|
||||
## 常に覚えておくこと
|
||||
|
||||
<important>
|
||||
|
||||
✅ **すべきこと**:
|
||||
|
||||
- 詳細な説明を使う(コンテキストとトレードオフを追加)
|
||||
- `\n\n`で段落区切りを使い、可読性を向上させる
|
||||
- 柔軟性のため`multiSelect: true`をデフォルトにする
|
||||
- 各選択肢のlabelは短く、descriptionは充実させる
|
||||
- **必要に応じて複数回質問する** - フォローアップが必要な場合は、最初の回答を得た後に再度AskUserQuestionを使用
|
||||
|
||||
❌ **してはいけないこと**:
|
||||
|
||||
- 簡潔すぎる説明 - ユーザーは情報に基づいた意思決定のため詳細を求める
|
||||
- 選択肢が真に相互排他的でない限り`multiSelect: false`を使う
|
||||
- フォローアップ質問を躊躇する - 推測よりも明確化の方が良い
|
||||
|
||||
</important>
|
||||
|
||||
## 複数ラウンドの質問
|
||||
|
||||
不明点が多い場合や段階的な明確化が必要な場合:
|
||||
|
||||
1. **関連する質問をグループ化**
|
||||
2. **最初のバッチを聞く**、回答を待つ
|
||||
3. **回答に基づいてフォローアップ質問**を必要に応じて行う
|
||||
4. **すべての不確実性が解消されるまで繰り返す**
|
||||
|
||||
この段階的な質問アプローチは推奨されており、実装に進む前に徹底的な理解を確保するのに役立ちます。
|
||||
145
skills/gha-sha-reference/SKILL.md
Normal file
145
skills/gha-sha-reference/SKILL.md
Normal file
@@ -0,0 +1,145 @@
|
||||
---
|
||||
name: gha-sha-reference
|
||||
description: ユーザーがGitHub Actionsのタグ参照をSHA参照に変換するよう要求したときに発動してください。uses:フィールドのタグ参照を自動的にSHA参照(コミットハッシュ + コメント付きバージョン)に変換します。
|
||||
---
|
||||
|
||||
# GitHub Actions SHA Reference Skill
|
||||
|
||||
## 目的
|
||||
|
||||
このスキルはGitHub Actionsワークフローファイル内の`uses:`フィールドで使用されているタグ参照(例: `@v4`)を、セキュリティのベストプラクティスに従ってSHA参照(例: `@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2`)に自動変換します。
|
||||
|
||||
## 使用タイミング
|
||||
|
||||
<trigger>
|
||||
|
||||
以下の場合にこのスキルを発動してください:
|
||||
|
||||
- ユーザーが「GitHub ActionsをSHA参照に変換して」と要求したとき
|
||||
- ユーザーが「actionsのusesをSHAに書き換えて」と言及したとき
|
||||
|
||||
</trigger>
|
||||
|
||||
## 実行手順
|
||||
|
||||
<procedure>
|
||||
|
||||
### 1. 変更対象を確認
|
||||
|
||||
まず `--check --diff` オプションで、どのファイルが変更されるかを確認します:
|
||||
|
||||
```bash
|
||||
pinact run --check --diff
|
||||
```
|
||||
|
||||
**出力例**:
|
||||
|
||||
```
|
||||
ERROR action isn't pinned
|
||||
.github/workflows/ci.yaml:10
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||
ERROR action isn't pinned
|
||||
.github/workflows/ci.yaml:11
|
||||
- - uses: actions/setup-go@v4
|
||||
+ - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
ERROR action isn't pinned
|
||||
.github/workflows/deploy.yaml:15
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||
```
|
||||
|
||||
### 2. 変換を実行
|
||||
|
||||
確認後、`pinact run` を実行してすべての対象ファイルを一括変換します:
|
||||
|
||||
```bash
|
||||
pinact run
|
||||
```
|
||||
|
||||
pinactは以下を自動的に行います:
|
||||
- タグ参照からコミットSHAを取得
|
||||
- 最も詳細なバージョンタグ(v4.3.0など)をコメントとして追加
|
||||
- `.github/workflows/*.{yml,yaml}` と `action.{yml,yaml}` を自動検出して変換
|
||||
|
||||
</procedure>
|
||||
|
||||
## 実装例
|
||||
|
||||
<examples>
|
||||
|
||||
### 例1: 基本的な使用方法
|
||||
|
||||
<example>
|
||||
|
||||
**ステップ1: 変更対象を確認**:
|
||||
|
||||
```bash
|
||||
pinact run --check --diff
|
||||
```
|
||||
|
||||
**出力**:
|
||||
|
||||
```
|
||||
ERROR action isn't pinned
|
||||
.github/workflows/ci.yaml:10
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||
ERROR action isn't pinned
|
||||
.github/workflows/ci.yaml:11
|
||||
- - uses: actions/setup-go@v4
|
||||
+ - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
```
|
||||
|
||||
**ステップ2: 変換を実行**:
|
||||
|
||||
```bash
|
||||
pinact run
|
||||
```
|
||||
|
||||
**変換後のワークフローファイル (.github/workflows/ci.yaml)**:
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
|
||||
```
|
||||
|
||||
</example>
|
||||
|
||||
</examples>
|
||||
|
||||
## 重要な注意事項
|
||||
|
||||
<important>
|
||||
|
||||
### すべきこと
|
||||
|
||||
- **pinactを使用**: GitHub Actions SHA参照変換には専用ツールpinactを使用する
|
||||
- **まず --check --diff で確認**: `pinact run --check --diff` で変更対象を確認する
|
||||
- **一括実行**: diffで確認した後、`pinact run` で全ファイルを一括変換する
|
||||
- **変換結果を報告**: 何が変換されたかユーザーに伝える
|
||||
|
||||
### してはいけないこと
|
||||
|
||||
- **カスタムスクリプトを作成**: pinactという専用ツールがあるので、独自スクリプトは不要
|
||||
- **いきなり実行**: `--check --diff` で確認せずに `pinact run` を実行しない
|
||||
- **エラーを無視**: pinactの実行でエラーが出た場合は、そのまま進めずユーザーに報告する
|
||||
|
||||
### 実行前チェックリスト
|
||||
|
||||
- [ ] pinactがインストールされている(`pinact --version`で確認)
|
||||
- [ ] `pinact run --check --diff` で変更対象を確認した
|
||||
- [ ] diffの出力から変換対象のファイル一覧を把握した
|
||||
|
||||
</important>
|
||||
|
||||
## 参考リンク
|
||||
|
||||
- [pinact - GitHub](https://github.com/suzuki-shunsuke/pinact)
|
||||
- [GitHub Actions セキュリティガイド](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions)
|
||||
42
skills/reading-notion/SKILL.md
Normal file
42
skills/reading-notion/SKILL.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: reading-notion
|
||||
description: Notion URLが会話に登場した時、またはNotionのコンテンツを検索・取得する必要がある時に使用してください。
|
||||
allowed-tools: Bash, Read
|
||||
---
|
||||
|
||||
# Reading Notion
|
||||
|
||||
NotionページやドキュメントをMarkdownに変換して読み取り、内容を要約・説明するスキルです。
|
||||
|
||||
## 概要
|
||||
|
||||
このスキルは2つのモードで動作します:
|
||||
|
||||
1. **URL直接モード**: Notion URLが会話に登場した時、`notion-to-md`を使って自動的にMarkdownに変換し、内容を説明
|
||||
2. **検索モード**: キーワードでNotionを検索し、結果から選択したページの内容を説明
|
||||
|
||||
**URL直接モード**では、Go製のCLIツール`notion-to-md`を使用してNotion APIからページデータを取得し、Markdown形式に変換します。これにより、ネスト構造、豊富なブロックタイプ、テキストアノテーションなどを正確に保持したMarkdownファイルが生成されます。
|
||||
|
||||
|
||||
## モード詳細
|
||||
|
||||
<trigger>
|
||||
|
||||
### URL直接モード
|
||||
|
||||
Notion URLを検出すると自動的に発動します。詳細は **reference/url-mode.md** を参照してください。
|
||||
|
||||
**発動例**:
|
||||
- ユーザーが `https://www.notion.so/myorg/abc123def456ghi789jkl012mno34567` のようなURLを提示
|
||||
- 会話中にNotion URLが登場
|
||||
|
||||
### 検索モード
|
||||
|
||||
キーワードでNotion内を検索したい時に発動します。詳細は **reference/search-mode.md** を参照してください。
|
||||
|
||||
**発動例**:
|
||||
- 「データ基盤チームについて教えて」
|
||||
- 「Notionでプロジェクト〇〇を検索して」
|
||||
- 特定のキーワードに関する情報を求められた時
|
||||
|
||||
</trigger>
|
||||
113
skills/reading-notion/reference/search-mode.md
Normal file
113
skills/reading-notion/reference/search-mode.md
Normal file
@@ -0,0 +1,113 @@
|
||||
# 検索モード
|
||||
|
||||
「notionでxyzを探して」という形で発動し、キーワードでNotionを検索して結果から選択したページの内容を説明します。
|
||||
|
||||
## 発動条件
|
||||
|
||||
<trigger>
|
||||
|
||||
以下のようなリクエストで発動します:
|
||||
|
||||
- 「Notionでプロジェクト〇〇を検索して」
|
||||
- Notionに関する質問であることが明らかな場合
|
||||
|
||||
</trigger>
|
||||
|
||||
## 実行フロー
|
||||
|
||||
<procedure>
|
||||
|
||||
### 1. キーワード検索と結果表示
|
||||
|
||||
jqを使って検索結果を箇条書き形式で整形します:
|
||||
|
||||
```bash
|
||||
mcptools call API-post-search npx -y @notionhq/notion-mcp-server --params '{"query":"プロジェクトXYZ","page_size":10}' | jq -r '.results[] | "- \(if .title then .title[0].text.content else (.properties | to_entries[] | select(.value.type == "title") | .value.title[0].text.content) end)\n - \(.url)"'
|
||||
```
|
||||
|
||||
**出力例**:
|
||||
```
|
||||
- プロジェクトXYZ概要
|
||||
- https://www.notion.so/abc123de...
|
||||
- XYZ実装ガイド
|
||||
- https://www.notion.so/def456gh...
|
||||
- XYZ関連メモ
|
||||
- https://www.notion.so/ghi789jk...
|
||||
- プロジェクトXYZ
|
||||
- https://www.notion.so/jkl012mn...
|
||||
```
|
||||
|
||||
<context>
|
||||
|
||||
**API: API-post-search**
|
||||
|
||||
```json
|
||||
{
|
||||
"properties": {
|
||||
"filter": {
|
||||
"additionalProperties": true,
|
||||
"description": "A set of criteria, `value` and `property` keys, that limits the results to either only pages or only databases. Possible `value` values are `\"page\"` or `\"database\"`. The only supported `property` value is `\"object\"`.",
|
||||
"properties": {
|
||||
"property": {
|
||||
"description": "The name of the property to filter by. Currently the only property you can filter by is the object type. Possible values include `object`. Limitation: Currently the only filter allowed is `object` which will filter by type of object (either `page` or `database`)",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"description": "The value of the property to filter the results by. Possible values for object type include `page` or `database`. **Limitation**: Currently the only filter allowed is `object` which will filter by type of object (either `page` or `database`)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"page_size": {
|
||||
"default": 100,
|
||||
"description": "The number of items from the full list to include in the response. Maximum: `100`.",
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"query": {
|
||||
"description": "The text that the API compares page and database titles against.",
|
||||
"type": "string"
|
||||
},
|
||||
"sort": {
|
||||
"additionalProperties": true,
|
||||
"description": "A set of criteria, `direction` and `timestamp` keys, that orders the results. The **only** supported timestamp value is `\"last_edited_time\"`. Supported `direction` values are `\"ascending\"` and `\"descending\"`. If `sort` is not provided, then the most recently edited results are returned first.",
|
||||
"properties": {
|
||||
"direction": {
|
||||
"description": "The direction to sort. Possible values include `ascending` and `descending`.",
|
||||
"type": "string"
|
||||
},
|
||||
"timestamp": {
|
||||
"description": "The name of the timestamp to sort against. Possible values include `last_edited_time`.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"start_cursor": {
|
||||
"description": "A `cursor` value returned in a previous response that If supplied, limits the response to results starting after the `cursor`. If not supplied, then the first page of results is returned. Refer to [pagination](https://developers.notion.com/reference/intro#pagination) for more details.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
```
|
||||
|
||||
</context>
|
||||
|
||||
### 2. ユーザーへの提示
|
||||
|
||||
AIは検索結果を以下の形式でユーザーに提示します:
|
||||
|
||||
```
|
||||
Notionで「プロジェクトXYZ」を検索した結果、以下のページが見つかりました:
|
||||
|
||||
- **プロジェクトXYZ**
|
||||
- https://www.notion.so/jkl012mn...
|
||||
- **XYZ関連メモ**
|
||||
- https://www.notion.so/ghi789jk...
|
||||
- **XYZ実装ガイド**
|
||||
- https://www.notion.so/def456gh...
|
||||
```
|
||||
|
||||
</procedure>
|
||||
80
skills/reading-notion/reference/url-mode.md
Normal file
80
skills/reading-notion/reference/url-mode.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# URL直接モード
|
||||
|
||||
Notion URLを検出すると自動的に発動し、そのページの内容を取得して要約します。
|
||||
|
||||
## URL検出パターン
|
||||
|
||||
以下のようなNotion URLを検出します:
|
||||
|
||||
```
|
||||
https://www.notion.so/{workspace}/{page-id}
|
||||
https://www.notion.so/{page-id}
|
||||
```
|
||||
|
||||
例:
|
||||
```
|
||||
https://www.notion.so/myorg/abc123def456ghi789jkl012mno34567
|
||||
https://www.notion.so/abc123def456ghi789jkl012mno34567
|
||||
```
|
||||
|
||||
## 実行手順
|
||||
|
||||
<procedure>
|
||||
|
||||
### 1. Markdown変換と出力
|
||||
|
||||
`notion-to-md`コマンドを使ってNotion URLを直接Markdownに変換します。
|
||||
|
||||
**実行コマンド**:
|
||||
|
||||
```bash
|
||||
mkdir -p .claude_work/notion && notion-to-md {notion_url} | tee .claude_work/notion/{page_id}.md > /dev/null
|
||||
```
|
||||
|
||||
**説明**:
|
||||
- `{notion_url}`: ユーザーが提示したNotion URL(例: `https://www.notion.so/workspace/Page-title-abc123...`)
|
||||
- `{page_id}`: URLの最後の32文字(例: `abc123def456ghi789jkl012mno34567`)
|
||||
- `tee`を使うことで許可なしでファイル保存が可能
|
||||
|
||||
### 2. Markdownファイルの読み込みと要約報告
|
||||
|
||||
出力されたMarkdownファイルをReadツールで読み込み、内容を要約してユーザーに報告します。
|
||||
|
||||
**手順**:
|
||||
|
||||
1. Readツールで `.claude_work/notion/{page_id}.md` を読み込む
|
||||
2. ページの主な内容を要約してユーザーに報告(箇条書き5行以内)
|
||||
|
||||
**報告フォーマット**:
|
||||
|
||||
```
|
||||
Notionページを以下のファイルに出力しました:
|
||||
.claude_work/notion/{page_id}.md
|
||||
|
||||
【ページの要約】
|
||||
- {要約ポイント1}
|
||||
- {要約ポイント2}
|
||||
- {要約ポイント3}
|
||||
- {要約ポイント4}
|
||||
- {要約ポイント5}
|
||||
```
|
||||
|
||||
</procedure>
|
||||
|
||||
## エラーハンドリング
|
||||
|
||||
### ページが見つからない場合
|
||||
|
||||
```
|
||||
申し訳ございません。指定されたNotion URLからページを取得できませんでした。
|
||||
以下の可能性があります:
|
||||
- ページが削除されている
|
||||
- アクセス権限がない
|
||||
- URLが正しくない
|
||||
```
|
||||
|
||||
### API呼び出しが失敗した場合
|
||||
|
||||
```
|
||||
Notion APIへの接続に失敗しました。しばらくしてから再度お試しください。
|
||||
```
|
||||
Reference in New Issue
Block a user