CLI Prompt Management Tool - Guides and Documentation
Climpt で使用する指示書(プロンプトファイル)の作成方法を説明します。
指示書は、AI に対する指示を定義したマークダウンファイルです。 C3L(Climpt 3-word Language)仕様に従って、3つの要素で構成されます:
| 要素 | 役割 | 例 |
|---|---|---|
| c1(ドメイン) | 対象領域 | git, code, meta, test |
| c2(アクション) | 実行する動作 | create, analyze, review |
| c3(ターゲット) | 対象物 | branch, pull-request, instruction |
コマンド形式: climpt-<c1> <c2> <c3> [options]
例: climpt-git decide-branch working-branch、climpt-meta create instruction
meta create instruction —
目的・ドメイン等を入力し、プロンプトファイルの雛形を生成meta build frontmatter — C3L v0.5
準拠のフロントマターを生成し、ファイル先頭に挿入/reg でレジストリ更新 — プロンプトから registry.json
を再生成し、MCP/CLI で利用可能にClaude Code で以下を実行するか、Skill を呼び出します:
climpt-meta create instruction << 'EOF'
Purpose: コードの複雑度を分析
Domain: code
Action: analyze
Target: complexity
Description: サイクロマティック複雑度を計算し改善提案を行う
EOF
Claude Code 内で自然言語で依頼することも可能です:
新しいClimpt指示書を作成してください。
- 目的: コードの複雑度分析
- ドメイン: code
- アクション: analyze
- ターゲット: complexity
meta create instruction を使ってください。
.agent/climpt/prompts/code/analyze/complexity/f_default.mdcode-app.yml, code-user.yml.deno/bin/climpt-code作成したプロンプトファイルに、C3L v0.5 準拠のフロントマターを生成します。
echo "Domain: code
Action: analyze
Target: complexity
Purpose: サイクロマティック複雑度を計算し改善提案を行う" | climpt-meta build frontmatter
---
c1: code
c2: analyze
c3: complexity
title: Analyze Code Complexity
description: Calculate cyclomatic complexity and provide improvement suggestions
usage: climpt-code analyze complexity
c3l_version: "0.5"
options:
edition:
- default
adaptation:
- default
- detailed
file: true
stdin: false
destination: false
---
c3l_version は引用符で囲む: "0.5"title と description は英語で記述生成されたフロントマターをプロンプトファイルの先頭に挿入してください。
プロンプトファイルを作成・更新したら、レジストリを再生成します。
/reg
または deno task generate-registry、JSR 経由:
deno run --allow-read --allow-write --allow-env jsr:@aidevtool/climpt/reg
新しいコマンドが登録されたか確認:
cat .agent/climpt/registry.json | jq '.tools.commands[] | select(.c1 == "code")'
.agent/climpt/prompts/<domain>/<action>/<target>/
├── f_default.md # デフォルト版
├── f_detailed.md # 詳細版(オプション)
└── f_<edition>.md # その他のバリエーション
| ファイル名 | 説明 | 使用条件 |
|---|---|---|
f_default.md |
デフォルト | --edition 未指定時 |
f_<edition>.md |
特定エディション | --edition=<edition> 指定時 |
f_<edition>_<adaptation>.md |
組み合わせ | 両方指定時 |
| 変数 | CLI オプション | 説明 |
|---|---|---|
{input_text} |
STDIN | 標準入力からのテキスト |
{input_text_file} |
-f, --from |
入力ファイルパス |
{destination_path} |
-o, --destination |
出力先パス |
{uv-*} |
--uv-* |
カスタム変数 |
# コード複雑度分析
## 対象ファイル
{input_text_file}
## 分析内容
{input_text}
## 出力先
結果を `{destination_path}` に保存してください。
## オプション
最大行数: {uv-max-lines}
# Step 1: 指示書作成
climpt-meta create instruction << 'EOF'
Purpose: タスク内容に基づいてブランチ戦略を決定
Domain: git
Action: decide-branch
Target: working-branch
Description: 新規ブランチを作成するか、現在のブランチで続行するかを判断
EOF
# Step 2: フロントマター生成
climpt-meta build frontmatter << 'EOF'
Domain: git
Action: decide-branch
Target: working-branch
Purpose: Decide branch strategy based on task content
EOF
# Step 3: レジストリ更新
deno task generate-registry
ユーザー変数が必要な場合は、プロンプト内で {uv-変数名} を使用し、CLI で
--uv-変数名=値 を指定します。フロントマターの uv
フィールドに変数を宣言してください。