prompt-template-system

prompt-template-system is an agent for Claude Code from bl1nk-bot/bl1nk-agents-manager. It costs 20 tokens per session (946 once invoked), scanned A, original, MIT.

A prompt-management system for inserting project context into reusable instructions and routing requests to different models.

In plain words
What is it for?
Use it to define prompt templates, fill context placeholders, and route requests based on their task category and model tier.
Why use it?
It prevents prompts from losing important details such as project status, user preferences, available tools, or error information.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions subagents; names the AskUserQuestion tool.

Good fit Use it to define prompt templates, fill context placeholders, and route requests based on their task category and model tier.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system
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.

Clone the repo
git clone --depth 1 https://github.com/bl1nk-bot/bl1nk-agents-manager

Made for: Claude Code.

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 prompt-template-system

README.md
[![agentmods](https://agentmods.dev/badge/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system/github.svg)](https://agentmods.dev/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system)
Your own site
<a href="https://agentmods.dev/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system"><img src="https://agentmods.dev/badge/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prompt-template-system

Your own site · 80×15
<a href="https://agentmods.dev/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system"><img src="https://agentmods.dev/badge/agents/bl1nk-bot/bl1nk-agents-manager/prompt-template-system.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 946 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00020 $0.00946
Opus 5 $0.00010 $0.00473
Sonnet 5 $0.00004 $0.00189
Haiku 4.5 $0.00002 $0.00095

Measured 11d ago against content hash a6ba1c3acc9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

prompt-template-system 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 11d 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.

agents/prompt-template-system.md · 159 lines

What it actually says

TASK

[คำสั่งงาน]

User: "{user_input}" Assistant: """

3. **อัปเดต templates dictionary:**
```python
self.templates = {
    PromptType.SCENE_ARCHITECT: self._get_scene_architect_prompt(),
    # เพิ่มใหม่ที่นี่
    PromptType.NEW_TEMPLATE: self._get_new_prompt_template(),
}
```text
## Context Injection Rules

### การใช้ Context Manager
```python
from src.core.context_manager import context_manager
from src.core.prompt_templates import prompt_template_manager, PromptType, PromptContext

# สร้าง context
context = context_manager.get_context_for_prompt(user_id="user123")

# สร้าง prompt
prompt = prompt_template_manager.get_prompt(
    PromptType.SCENE_ARCHITECT,
    context=context
)
```text
### Context Placeholders ที่ใช้ได้

- `{STORY_CONTEXT}` - ข้อมูลเรื่องราว "Bound Fate"
- `{PROJECT_STATUS}` - สถานะโปรเจกต์
- `{USER_PREFERENCES}` - ความชอบของผู้ใช้
- `{AVAILABLE_TOOLS}` - เครื่องมือที่ใช้ได้
- `{ERROR_CONTEXT}` - บริบทข้อผิดพลาด

## Model Routing Rules

### การใช้ Model Router
```python
from src.core.model_router import model_router

# Route request
model_name, task_category, model_tier = await model_router.route_request(
    user_input="ช่วยเขียนฉากต่อสู้",
    user_preferences=user_prefs
)
```text
### Task Categories

- `SIMPLE_QA` - คำถามง่ายๆ
- `TOOL_USE` - ใช้เครื่องมือ
- `COMPLEX_REASONING` - การคิดวิเคราะห์ซับซ้อน
- `CODE_GENERATION` - สร้างโค้ด
- `CREATIVE_WRITING` - เขียนสร้างสรรค์
- `AMBIGUOUS` - ไม่แน่ชัด

### Model Tiers

- `LOCAL` - โมเดลในเครื่อง (0 cost)
- `FAST_CLOUD` - โมเดลเร็ว (ต้นทุนต่ำ)
- `SMART_CLOUD` - โมเดลฉลาด (ต้นทุนสูง)

## การทดสอบ Prompt Templates

### สร้างไฟล์ทดสอบ
```python
# test_prompt_templates.py
async def test_scene_architect():
    context = context_manager.get_context_for_prompt()
    prompt = prompt_template_manager.get_prompt(
        PromptType.SCENE_ARCHITECT,
        context=context
    )
    # ทดสอบ prompt
```text
### การตรวจสอบ Context Injection

- ตรวจสอบว่า placeholders ถูกแทนที่
- ตรวจสอบ JSON format
- ตรวจสอบ encoding (ensure_ascii=False)

## การอัปเดต Context

### อัปเดต Story Context
```python
context_manager.update_story_context(
    context_type="characters",
    context_data={
        "new_character": {
            "name": "Erik",
            "role": "Mercenary",
            "personality": "Pragmatic"
        }
    }
)
```text
### อัปเดต Project Status
```python
context_manager.update_project_status(
    component="prompt_templates",
    status="active",
    details={
        "templates_available": 7,
        "context_injection": "working"
    }
)

Best Practices

การเขียน Prompt Template

  1. ชัดเจนและเฉพาะเจาะจง
  2. ใช้ placeholders สำหรับ context
  3. ระบุ output format ที่ต้องการ
  4. ให้ตัวอย่างการใช้งาน

การจัดการ Context

  1. อัปเดต context ทันทีเมื่อมีการเปลี่ยนแปลง
  2. ใช้ JSON format สำหรับ structured data
  3. บันทึกใน database สำหรับ persistence
  4. ใช้ in-memory cache สำหรับ performance

การเลือก Model

  1. วิเคราะห์ task complexity ก่อน
  2. พิจารณา cost optimization
  3. เคารพ user preferences
  4. มี fallback mechanism description: globs: alwaysApply: true
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. 11d ago First seen · 159 lines · 20 tokens per session scan A a6ba1c3acc9b

Subscribe to this mod's changes

prompt-template-system is an agent published in the GitHub repository bl1nk-bot/bl1nk-agents-manager (8 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 946 once invoked, about $0.0001 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.

Related

Other agents, from other repositories