360 Secure SkillHub
360 安全技能中心

Pilot Task Template

核心功能是定义含占位符的可复用任务模板,通过变量替换生成具体任务描述并提交至pilot系统。典型场景包括复用通用任务模式、标准化组织内任务格式、参数化生成不同任务。输入为模板文件(带{{VAR}}占位符)和参数变量,输出为实例化后的任务内容,需依赖pilotctl、pilot-protocol技能及运行的daemon,通过Bash命令操作。

teoslayer
teoslayer
热度 41.26
最近更新 2026-05-11 17:41:40
分类:效率依赖:代码执行 / 读写文件 / 第三方 API应用场景:模板 / 任务管理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-task-template
Metadata
name
pilot-task-template
description
Reusable task templates with placeholder substitution. Use this skill when: 1. You need to define common task patterns for reuse 2. You want parameterized task definitions with variable substitution 3. You need to standardize task formats across your organization Do NOT use this skill when: - Each task is unique and won't be reused - You don't need parameter substitution - Simple command-line arguments are sufficient
tags
["pilot-protocol","task-workflow","template","reusability"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start).
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

pilot-task-template

Define reusable task templates with placeholder substitution. Enables standardized task patterns that can be instantiated with different parameters.

Essential Commands

Define template

cat > /tmp/ml-inference-template.txt <<'EOF'
Run ML inference using model {{MODEL}} with prompt: {{PROMPT}}, temperature {{TEMPERATURE}}
EOF

Substitute variables

TEMPLATE=$(cat /tmp/ml-inference-template.txt)

TASK_DESC=$(echo "$TEMPLATE" | \
  sed "s/{{MODEL}}/$MODEL/g" | \
  sed "s/{{PROMPT}}/$PROMPT/g" | \
  sed "s/{{TEMPERATURE}}/$TEMPERATURE/g")

Submit from template

pilotctl --json task submit "$AGENT_ADDR" --task "$TASK_DESC"

Template with defaults

MODEL=${MODEL:-"gpt-4"}
TEMPERATURE=${TEMPERATURE:-0.7}
MAX_TOKENS=${MAX_TOKENS:-100}

Template library

TEMPLATE_DIR="$HOME/.pilot/templates"
mkdir -p "$TEMPLATE_DIR"

# List templates
ls -1 "$TEMPLATE_DIR"/*.txt | sed 's|.*/||; s|\.txt$||'

# Load template
TEMPLATE=$(cat "$TEMPLATE_DIR/$TEMPLATE_NAME.txt")

Workflow Example

Template-based submission system:

#!/bin/bash
set -e

TEMPLATE_DIR="$HOME/.pilot/templates"
mkdir -p "$TEMPLATE_DIR"

# Define template
cat > "$TEMPLATE_DIR/image-generation.txt" <<'EOF'
Generate image using model {{MODEL}}: {{PROMPT}}, size {{WIDTH}}x{{HEIGHT}}
EOF

# Instantiate template
instantiate_template() {
  TEMPLATE=$(cat "$TEMPLATE_DIR/$1.txt")

  while IFS= read -r VAR; do
    VAR_NAME=$(echo "$VAR" | sed 's/[{}]//g')
    VAR_VALUE="${!VAR_NAME}"

    [ -z "$VAR_VALUE" ] && { echo "Error: $VAR_NAME required"; exit 1; }

    VAR_VALUE_ESCAPED=$(echo "$VAR_VALUE" | sed 's/[&/\]/\\&/g')
    TEMPLATE=$(echo "$TEMPLATE" | sed "s|{{$VAR_NAME}}|$VAR_VALUE_ESCAPED|g")
  done < <(echo "$TEMPLATE" | grep -o '{{[^}]*}}' | sort -u)

  echo "$TEMPLATE"
}

# Submit
export AGENT="0:1234.5678.9abc"
export MODEL="stable-diffusion-xl"
export PROMPT="futuristic cityscape"
export WIDTH=1024
export HEIGHT=1024

TASK_DESC=$(instantiate_template "image-generation")
TASK_ID=$(pilotctl --json task submit "$AGENT" --task "$TASK_DESC" | jq -r '.task_id')

echo "Task submitted: $TASK_ID"

Dependencies

Requires pilot-protocol skill, pilotctl binary, running daemon, jq for JSON parsing, and template files in ~/.pilot/templates/.