home / skills / leavesfly / jimi / script-test

This skill automates test script execution upon activation, supporting multiple script types and logging results to simplify verification.

npx playbooks add skill leavesfly/jimi --skill script-test

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
806 B
---
name: script-test
description: 测试脚本执行功能的示例 Skill
version: 1.0.0
category: testing
triggers:
  - script test
  - 脚本测试
  - test script
scriptPath: init.sh
scriptType: bash
autoExecute: true
scriptTimeout: 10
---

# 脚本测试技能包

这是一个用于测试 Skill 脚本执行功能的示例。

当这个 Skill 被激活时,会自动执行 `init.sh` 脚本。

## 功能说明

1. 脚本会在 Skill 激活时自动执行
2. 支持多种脚本类型(bash, python, node 等)
3. 可配置超时时间和环境变量
4. 脚本执行结果会记录到日志中

## 使用示例

触发此 Skill:
```
请执行脚本测试
```

系统会:
1. 匹配并激活此 Skill
2. 注入技能包内容到上下文
3. 自动执行 init.sh 脚本
4. 显示脚本执行结果

Overview

This skill is a lightweight example that demonstrates automated script execution when the skill is activated. It runs a predefined init.sh and captures execution output for inspection. The skill supports multiple script types and configurable runtime parameters to mirror real-world automation flows.

How this skill works

When activated, the skill injects its package content into the conversation context and automatically executes init.sh. It can run bash, Python, Node, or other supported interpreters, applying configured environment variables and a timeout. Execution stdout/stderr and exit status are recorded to logs and returned as the result summary.

When to use it

  • Validate that script execution integration works in a development or test environment
  • Demonstrate automated initialization tasks when a skill is triggered
  • Run short setup scripts that require environment variables or time limits
  • Capture and inspect script output and exit codes for debugging
  • Test handling of different interpreters (bash, python, node) under the same workflow

Best practices

  • Keep init scripts idempotent and safe to run repeatedly
  • Limit script runtime with an explicit timeout to avoid hanging executions
  • Pass only necessary environment variables and avoid secrets in plain text
  • Log both stdout and stderr and propagate nonzero exit codes for visibility
  • Use small, test-focused scripts in production simulations to reduce risk

Example use cases

  • Run an initialization script to verify interpreter availability and environment setup
  • Execute a small Python or Node test file to validate dependency resolution
  • Simulate onboarding steps that configure a temporary workspace
  • Collect script logs to reproduce and diagnose failures in automation pipelines
  • Demonstrate script execution behavior for training or onboarding engineers

FAQ

Which scripts can this skill run?

It can run bash, Python, Node, and other interpreters available in the runtime; the active script is init.sh by default.

How are timeouts and environment variables handled?

You can configure a maximum execution timeout and provide environment variables that the script will inherit at runtime.

Where is the script output stored?

Stdout, stderr, and the script exit code are recorded to logs and summarized in the activation result.