Carta報告用の内部スキルです。Carta報告データをブランド対応したExcelファイルにエクスポート(書き出し)します。 以下のいずれかの場合に起動します: - ユーザーがExcel形式での出力をリクエストした時点で、carta-reporting または carta-reporting-markdown スキルが呼び出す - メインスキルが「Generate Carta Excel —」で始まるメッセージを受け取った場合(アーティファクト・プロンプト・バーのペイロード(入力データ)経由)
Internal subskill for carta-reporting. Exports Carta report data to a branded Excel file. Invoked by carta-reporting or carta-reporting-markdown when the user requests Excel output. Also the entry point when the main skill receives a message starting with "Generate Carta Excel —" (the artifact prompt bar payload).
呼び出し元のスキルから必要なコンテキスト(このスキル実行前にセッションに含まれていること):
user_report_pk — キャッシュされたレポートファイルの確認と、ファイルが見つからない場合のダウンロードURL取得に必要corporation_id — call_tool({"name": "reporting__get__download_url", ...}) の実行に必要carta-reporting-markdown のカスタマイズチェックポイント中に確認(Claude Code)as_of_date(報告基準日)、ユーザーフルネーム — excel_exporter.py の --title、--as-of-date、--generated-by 引数として使用ユーザーがアーティファクトプロンプトバーのペイロードを貼り付けると、Generate Carta Excel — で始まる完全な指示として届きます:
Generate Carta Excel —
Corporation: Meetly, Inc. (ID: 7)
Columns:
Equity Grants: columns: Grant ID, Award Type, Exercise Price; sorted by: Grant Date desc
Vesting Schedule: columns: Grant ID, Vest Date, Shares Vested; totals: Shares Vested sum
Corporation: の行から、エクスポートの対象会社を確認してください。Columns: の下の各インデント行が1つのシートタブです。これは常に1つのExcelファイルで、1シートにつき1つのタブです。各シート行を解析し、すべてのシートをシートごとの sheets 辞書形式を使って report_processor.py に1度に渡してください。これ以上の質問は不要です。
アーティファクトからの列リストは確定的なものです。会話の履歴から列情報をマージしたり上書きしたりしないでください。
プロンプトバーのフィールドを report_processor.py の設定に変換:
| プロンプトバーのフィールド | report_processor.py のシート別キー |
|---|---|
columns: A, B, C |
"columns": ["A", "B", "C"] |
sorted by: Col asc |
"sort": [{"column": "Col", "direction": "asc"}] |
totals: Col sum, Col2 avg |
"aggregations": {"type": "summary", "columns": {"Col": "sum", "Col2": "avg"}} |
totals: は必ず aggregations に変換してください — これが、Excel の関数(=SUM(...)、=AVERAGE(...) など)を生成する唯一の方法です。aggregations を省略すると、出力の合計行はAPI から返されたハードコードされた値になり、ライブ関数にはなりません。
ユーザーがペイロードなしで Excel をリクエストした場合は、次のように聞いてください: 「アーティファクトの下部にある Excel export バーをクリックして選択し、コピーしてここに貼り付けてください。指定された列で Excel を生成します。」
このパスではスコープコンテキストがありません。 プロンプトバーから新規で開始する場合、このスキルはアカウントが株式クラス(特定の種類の株式)の範囲に限定されているかどうかを知ることができないため、スコープの割合列にラベルを付けたり、スコープ内のクラスに名前を付けたりすることができません — label_overrides と同じ制限があります。数値は正確でスコープ済みですが、ラベルは一般的なものにとどまります。合計を会社全体のものとして説明しないでください。
カスタマイズチェックポイント中に確認された列リストを使用してください(carta-reporting-markdown で解決)。
/tmp/carta_report_<user_report_pk>.json が利用可能か確認してください(このセッションの user_report_pk を使用):
report_processor.py に "local_file" として渡してください。call_tool({"name": "reporting__get__download_url", "arguments": { user_report_pk, corporation_id }}) を呼び出して新しい署名付きURL を取得し、代わりに "download_url" として渡してください。データサイズや複雑さに関わらず、常に report_processor.py → excel_exporter.py へ経由してください。 openpyxl や他のライブラリを使って直接 Excel ファイルを書き込まないでください — これらのスクリプトは Carta ブランディング(ロゴ、ヘッダー、フォント、数値形式)を処理します。これは自作の実装では失われます。データセットが小さい場合(例: 3行)やシートを結合する必要がある場合でも当てはまります。
シートを1つのタブに結合する場合は、report_processor.py の呼び出しで merge_sheets を使用してください。
sheets 辞書を使ってすべてのシートを1度に渡してください。excel_exporter.py へ経由してください。親セッションが解決済みの場合、キャッシュされた _report_processor_path を再利用してください(新規の Generate Carta Excel — プロンプトバーパスでは未設定かもしれません — find フォールバックが対応します):
UV_PYTHON_DOWNLOADS=never uv run "${_report_processor_path:-$(find ~ -name "report_processor.py" -path "*/carta-reporting/scripts/*" 2>/dev/null | head -1)}" <<'EOF' | \
UV_PYTHON_DOWNLOADS=never uv run "$(find ~ -name "excel_exporter.py" -path "*/carta-reporting-excel/scripts/*" 2>/dev/null | head -1)" \
--title "Securities Ledger Report" \
--as-of-date 2024-01-15 \
--generated-by "Jane Doe" \
--output ./{report-slug}.xlsx
{
"local_file": "<path or use download_url if file not ready>",
"sheets": {
"Equity Grants": {"columns": ["Grant ID", "Award Type", "Exercise Price"],
"aggregations": {"type": "summary", "columns": {"Exercise Price": "sum"}}},
"Vesting Schedule": {"columns": ["Grant ID", "Vest Date", "Shares Vested"],
"sort": [{"column": "Vest Date", "direction": "asc"}]}
}
}
EOF
スクリプトは成功時に絶対パスを出力します。これを クリック可能なリンク(computer://<absolute-path>、例: computer:///Users/jane/meetly-equity-grants.xlsx)として提示してください。ユーザーにファイルが開く準備ができていることを伝え、次のステップを提案してください:
| 要素 | 値 |
|---|---|
| ヘッダーの背景色 | #c6ebf4 |
| ヘッダーのフォント | Arial 12pt 太字、色 #2f3943 |
| ロゴ | <skill_base_dir>/assets/Carta_Logo.png、セルA2、120×50px |
| タイトル | セルB2、Arial 16pt 太字 |
| サブタイトル | セルB3、Arial 10pt、色 #666666 — "As of MMM d, yyyy • Generated with Claude AI by {user} at MMM d, yyyy h:mm:ss AM/PM TZ • Date format: MMM D, YYYY" |
| ヘッダー行 | 行5(オートフィルター付き);行A6 で固定;データは行6 から開始 |
列の型 → 数値形式: money → $#,##0.00 · percentage → 0.00% · integer → #,##0 · date → mmm d, yyyy · decimal → #,##0.0000
列幅: 文字列/日付 → 35、数値型 → 18。
<!-- carta:plugin-version --> <carta-plugin>carta-cap-table:6.93.3</carta-plugin>
Context expected from the calling skill (must be in session before this skill is invoked):
user_report_pk — needed to check for the cached report file and to fetch a fresh download URL if the file is absentcorporation_id — needed for call_tool({"name": "reporting__get__download_url", ...})carta-reporting-markdown (Claude Code)as_of_date, user full name — used as --title, --as-of-date, --generated-by args to excel_exporter.pyWhen the user pastes an artifact prompt bar payload, it arrives as a complete instruction starting with Generate Carta Excel —:
Generate Carta Excel —
Corporation: Meetly, Inc. (ID: 7)
Columns:
Equity Grants: columns: Grant ID, Award Type, Exercise Price; sorted by: Grant Date desc
Vesting Schedule: columns: Grant ID, Vest Date, Shares Vested; totals: Shares Vested sum
Use the Corporation: line to confirm which company the export is for. Each indented line under Columns: is one sheet tab. This is always one Excel file with one tab per sheet. Parse each sheet line and pass all sheets to report_processor.py in a single run using the per-sheet sheets dict format. No further questions needed.
The column list from the artifact is authoritative; do not merge with or override it from the earlier conversation.
Parsing segment fields into report_processor.py config:
| Prompt bar field | report_processor.py per-sheet key |
|---|---|
columns: A, B, C |
"columns": ["A", "B", "C"] |
sorted by: Col asc |
"sort": [{"column": "Col", "direction": "asc"}] |
totals: Col sum, Col2 avg |
"aggregations": {"type": "summary", "columns": {"Col": "sum", "Col2": "avg"}} |
totals: must become aggregations — this is the only way Excel formulas (=SUM(...), =AVERAGE(...)) are generated. If aggregations is omitted, any total rows in the output are hardcoded API values, not live formulas.
If the user asks for Excel without pasting a payload, ask: "Click the Excel export bar at the bottom of the artifact to select it, copy and paste it here — I'll generate the Excel with exactly those columns."
No scope context on this path. Entering fresh from the prompt bar, this skill cannot know
whether the account is share-class-scoped, so it cannot label a percentage column for the scope or
name the in-scope classes — the same limitation as label_overrides. The numbers are correct and
already scoped; only the labelling is generic. Do not describe any total as company-wide.
Use the column list confirmed during the Customization Checkpoint (resolved in carta-reporting-markdown).
Check if /tmp/carta_report_<user_report_pk>.json is available (use user_report_pk from this session):
"local_file" to report_processor.py.call_tool({"name": "reporting__get__download_url", "arguments": { user_report_pk, corporation_id }}) to get a fresh presigned URL and pass it as "download_url" instead.Always pipe through report_processor.py → excel_exporter.py, regardless of data size or complexity. Never write Excel files directly with openpyxl or any other library — the scripts handle Carta branding (logo, header, fonts, number formats) that will be missing from any ad-hoc implementation. This applies even when the dataset is small (e.g. 3 rows) or when sheets need to be combined.
For combining sheets into one tab, use merge_sheets in the report_processor.py call.
Pass all sheets in one run using the sheets dict. Pipe into excel_exporter.py. Reuse the cached _report_processor_path if the parent session resolved it (it may be unset on the fresh Generate Carta Excel — prompt-bar path — the find fallback handles that):
UV_PYTHON_DOWNLOADS=never uv run "${_report_processor_path:-$(find ~ -name "report_processor.py" -path "*/carta-reporting/scripts/*" 2>/dev/null | head -1)}" <<'EOF' | \
UV_PYTHON_DOWNLOADS=never uv run "$(find ~ -name "excel_exporter.py" -path "*/carta-reporting-excel/scripts/*" 2>/dev/null | head -1)" \
--title "Securities Ledger Report" \
--as-of-date 2024-01-15 \
--generated-by "Jane Doe" \
--output ./{report-slug}.xlsx
{
"local_file": "<path or use download_url if file not ready>",
"sheets": {
"Equity Grants": {"columns": ["Grant ID", "Award Type", "Exercise Price"],
"aggregations": {"type": "summary", "columns": {"Exercise Price": "sum"}}},
"Vesting Schedule": {"columns": ["Grant ID", "Vest Date", "Shares Vested"],
"sort": [{"column": "Vest Date", "direction": "asc"}]}
}
}
EOF
The script prints the absolute output path on success. Present it as a clickable link: computer://<absolute-path> (e.g. computer:///Users/jane/meetly-equity-grants.xlsx). Tell the user their file is ready to open, then offer next steps:
| Element | Value |
|---|---|
| Header background | #c6ebf4 |
| Header font | Arial 12pt bold, #2f3943 |
| Logo | <skill_base_dir>/assets/Carta_Logo.png, cell A2, 120×50px |
| Title | Cell B2, Arial 16pt bold |
| Subtitle | Cell B3, Arial 10pt, #666666 — "As of MMM d, yyyy • Generated with Claude AI by {user} at MMM d, yyyy h:mm:ss AM/PM TZ • Date format: MMM D, YYYY" |
| Header row | Row 5 with auto-filter; freeze panes at A6; data starts at row 6 |
Column type → number format: money → $#,##0.00 · percentage → 0.00% · integer → #,##0 · date → mmm d, yyyy · decimal → #,##0.0000
Column widths: string/date → 35, number types → 18.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。