← 返回 Skills 市场
sylvanxiao

Iflow Template Toolkit

作者 SylvanXiao · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
106
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install iflow-template-toolkit
功能描述
Dependency-free template engine with variable substitution, conditionals, loops, and multi-language support for iFlow skills.
使用说明 (SKILL.md)

iFlow Template Toolkit

Description

A simple, dependency-free template and internationalization toolkit for iFlow skills. Provides template rendering with variable substitution, conditionals, and loops, plus multi-language support.

Installation

# Clone or copy to your skills directory
openclaw skills install iflow-template-toolkit

Usage

Template Engine

from iflow_template_toolkit import TemplateEngine, render_template

# Quick render from string
result = render_template("Hello {{name}}!", {"name": "World"})
# Output: "Hello World!"

# Using TemplateEngine class
engine = TemplateEngine("./templates")
result = engine.render_file("config.md", {
    "project_name": "my-project",
    "team_size": 5
})

Template Syntax

Variables:

Hello {{name}}!
Project: {{project_name}}

Conditionals:

{% if status == "active" %}
Status is active
{% elif status == "pending" %}
Status is pending
{% else %}
Status unknown
{% endif %}

Loops:

{% for item in items %}
- {{item}} ({{index1}})
{% endfor %}

Internationalization

from iflow_template_toolkit import Translator, t, init_translator

# Initialize with translations
init_translator({
    'en': {'greeting': 'Hello', 'farewell': 'Goodbye'},
    'zh': {'greeting': '你好', 'farewell': '再见'}
}, default_lang='en')

# Translate
t('greeting')           # "Hello"
t('greeting', lang='zh')  # "你好"

# With interpolation
t('welcome', name='John')  # "Welcome, John!" (if translation is "Welcome, {name}!")

Features

Feature Description
Variable Substitution {{variable}} syntax
Conditionals {% if %}...{% elif %}...{% else %}...{% endif %}
Loops {% for item in items %}...{% endfor %}
Comparison ==, !=, in, not in operators
Loop Variables index, index1, first, last
Multi-language JSON-based translation files
Fallback Falls back to default language

Requirements

  • Python 3.6+
  • No external dependencies

File Structure

iflow-template-toolkit/
├── src/
│   ├── __init__.py
│   ├── template_engine.py
│   ├── i18n/
│   │   ├── __init__.py
│   │   ├── translator.py
│   │   └── langs/
│   │       ├── en.json
│   │       └── zh.json
│   └── templates/
├── tests/
├── SKILL.md
└── README.md

Version

1.0.0

安全使用建议
This skill appears to implement exactly what it claims: a small dependency-free template engine and translator. Before installing, consider: (1) avoid rendering untrusted templates or passing absolute/system file paths as template names, since the engine will open files the runtime user can access; (2) translation loading (from_dir) reads JSON files from disk—only load trusted translations; (3) although the engine does not use eval or network calls, review the code if you plan to run it in sensitive environments. If you want to reduce risk, run the included tests locally and restrict what template paths the agent is allowed to access. If you are concerned about autonomous invocation, you can disable the skill or restrict its permissions in your agent settings.
功能分析
Type: OpenClaw Skill Name: iflow-template-toolkit Version: 1.0.0 The toolkit provides template rendering and internationalization features but contains significant security vulnerabilities. Specifically, in `src/template_engine.py`, the `load_template` and `render_template` functions allow for arbitrary file reading/path traversal because they do not validate if the requested template path is restricted to a safe directory. Additionally, the `_get_value` method uses `getattr` to access object attributes based on template keys without sanitization, which could lead to Server-Side Template Injection (SSTI) and information disclosure if an attacker provides a malicious template.
能力评估
Purpose & Capability
Name and description match the included code: template_engine.py and translator.py implement rendering, conditionals, loops, and JSON-backed translations. No unrelated binaries, env vars, or services are requested.
Instruction Scope
SKILL.md usage is scoped to rendering templates and initializing translations. The engine reads template files from disk (TemplateEngine.load_template) and translation JSONs (Translator.from_dir), which is expected for a template/i18n tool; however, rendering arbitrary user-supplied template names or giving absolute file paths could cause the engine to open any file the agent/user permits. The engine does not execute code or call eval(), and conditional parsing is limited to simple operators (==, !=, in, truthiness).
Install Mechanism
There is no install spec (instruction-only); the package contains source files but nothing is downloaded or executed automatically during install. This is low-risk from installation mechanics.
Credentials
No environment variables, credentials, or config paths are required. Declared requirements (Python 3.6+) are proportionate to the functionality.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills. disable-model-invocation is default (agent may invoke autonomously), which is normal and not by itself a red flag.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install iflow-template-toolkit
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /iflow-template-toolkit 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Template engine + i18n support
元数据
Slug iflow-template-toolkit
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Iflow Template Toolkit 是什么?

Dependency-free template engine with variable substitution, conditionals, loops, and multi-language support for iFlow skills. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 106 次。

如何安装 Iflow Template Toolkit?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install iflow-template-toolkit」即可一键安装,无需额外配置。

Iflow Template Toolkit 是免费的吗?

是的,Iflow Template Toolkit 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Iflow Template Toolkit 支持哪些平台?

Iflow Template Toolkit 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Iflow Template Toolkit?

由 SylvanXiao(@sylvanxiao)开发并维护,当前版本 v1.0.0。

💬 留言讨论