template-demote

template-demote is a command for coding agents from llamadrive/bengo-toolkit. It costs 30 tokens per session (860 once invoked), scanned A, original, MIT.

A command for copying a shared template into the current case folder so that only this case can use a modified version. A template is a reusable document format.

In plain words
What is it for?
It helps copy templates from shared user or firm storage, optionally replace an existing case copy, and let the case-specific version take priority.
Why use it?
It prevents changes made for one case from affecting the common template used by other cases.

Command

Part of the bengo-toolkit plugin — 15 skills, 25 commands, 3 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/llamadrive/bengo-toolkit/template-demote
Clone the repo
git clone --depth 1 https://github.com/llamadrive/bengo-toolkit

Or install bengo-toolkit, the plugin that ships this one along with the rest of its 15 skills, 25 commands, 3 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for template-demote

README.md
[![agentmods](https://agentmods.dev/badge/commands/llamadrive/bengo-toolkit/template-demote.svg)](https://agentmods.dev/commands/llamadrive/bengo-toolkit/template-demote)
Your own site
<a href="https://agentmods.dev/commands/llamadrive/bengo-toolkit/template-demote"><img src="https://agentmods.dev/badge/commands/llamadrive/bengo-toolkit/template-demote.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.00860
Opus 5 $0.00015 $0.00430
Sonnet 5 $0.00006 $0.00172
Haiku 4.5 $0.00003 $0.00086

Measured 5d ago against content hash 056835ca1312, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

template-demote scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/template-demote.md · 77 lines

What it actually says

「この PC の全案件で共通」または「事務所共有」にあるテンプレートを、現在の案件フォルダの .claude-bengo/templates/コピーする(コピー元は残す)。これにより /template-fill はこの案件では案件側を優先的に使う。他の案件は従来どおり 共通領域のテンプレートを参照する。

$ARGUMENTS:

  • テンプレート ID(必須)
  • --from user — 「この PC の全案件で共通」(~/.claude-bengo/templates/)からコピー(既定)
  • --from firm — 「事務所共有」(要 /template-firm-setup)からコピー
  • --replace で案件側の既存を上書き

典型的なユースケース

PC 全案件で使う標準書式を、この事件に限り一部カスタマイズしたい場合(項目追加・ 文言差し替え等)。共通領域のものを直接いじると全案件に波及してしまうため、案件 フォルダにコピーしてそれを編集する。

ワークフロー

Step 0: 動作環境ガード

Bash: python3 skills/_lib/workspace.py check --require local_fs
  • exit 0 → Step 1 へ
  • exit 2 → stdout の日本語メッセージをそのままユーザーへ表示して停止
  • exit 1 → stderr の error JSON をユーザーに伝えて停止

Step 1: 現状確認

python3 skills/_lib/workspace.py templates

user 配列に対象 ID があるか確認する。無ければ「「この PC の全案件で共通」に {id} はない。/template-install で同梱書式から入れるか、/template-create で 新規登録してほしい」と案内。

Step 2: 降格実行

python3 skills/_lib/template_lib.py demote <id>
# case 側に既存があれば: python3 skills/_lib/template_lib.py demote <id> --replace

戻り値 JSON(抜粋):

{
  "id": "...", "src_scope": "user", "dst_scope": "case",
  "dst_yaml": "<workspace>/.claude-bengo/templates/{id}.yaml",
  "replaced": "False", "kept_original": "True"
}

Step 3: 完了案内

テンプレート '{id}' をこの案件フォルダにコピーした(共通領域はそのまま残す)。
  コピー先: <案件フォルダ>/.claude-bengo/templates/{id}.{yaml,xlsx}
  共通領域: 従来どおり(他案件に影響なし)

この案件では案件側のテンプレートが優先的に使われる。YAML / XLSX を
自由に編集してよい。変更を PC 全体に反映したくなったら /template-promote
で移動(共通領域の既存は上書きされる点に注意)。

エラーハンドリング

  • 案件側に同 ID がある → exit 3--replace 併用を確認
  • 対象 ID が共通領域にない → exit 1
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 77 lines · 30 tokens per session scan A 056835ca1312

Subscribe to this mod's changes

template-demote is a command published in the GitHub repository llamadrive/bengo-toolkit (6 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 860 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.