技能创作

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

技能.md 格式

接下来是降价正文:

脚本执行模式

工具 · 运行位置 · 何时使用 local_script · AgentBox(本地) · 来自集群外部的 kubectl 命令 — 最常见 node_script · K8s 节点(主机) · 需要主机工具、/proc、/sys、设备、nsenter pod_script · 在 pod 内部 · 正在运行的容器内诊断 node_script + netns · 节点 + pod 的网络 ns · 主机工具 + pod 的网络视图(先调用resolve_pod_netns)

最佳实践

一种技能,一个目的 — 不要制作瑞士军刀 内联命令上的脚本 — 如果过程超过 3 个步骤,则编写一个脚本 幂等且只读 — 技能用于诊断,而不是补救 描述至关重要 — 代理用它来决定是否使用该技能 具体示例 — 至少 2 个具有实际参数的示例

常见错误

原始输出过多——转储 kubectl 描述而不进行过滤。 Grep 查找相关行 缺少工具部分 — 没有它,代理不知道要使用哪个执行工具 错误的执行模式 — 使用 local_script 作为主机级工具(使用 node_script) 硬编码值 — 节点名称、命名空间应该是参数 无严重性指导 — 例如,CRC 错误:0 = 正常,1-100 = 轻微,>1000 = 严重

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@scitix · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux · Windows
运行环境要求
Node.js
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Skill Authoring Guide

Read this guide before creating a new skill or improving an existing one.

## SKILL.md Format

```yaml
---
name: <kebab-case-name>
description: >-
  One-line summary. Mention the execution tool if the skill uses scripts.
---
```

Followed by markdown body:

```markdown
# <Title>

## Purpose
What problem this skill solves and when to use it.

## Tool
<execution tool invocation — required for script-based skills>
Example: local_script: skill="check-pod-oom", script="check.sh", args="<ns> <pod>"

## Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| `<arg1>`  | Yes      | ...         |

## Procedure
Step-by-step actions with concrete commands.

## Examples
Concrete tool invocations with realistic parameters.
```

## Script Execution Modes

| Tool | Runs where | When to use |
|------|-----------|-------------|
| `local_script` | AgentBox (local) | kubectl commands from outside the cluster — **most common** |
| `node_script` | K8s node (host) | Needs host tools, /proc, /sys, devices, nsenter |
| `pod_script` | Inside a pod | Diagnostics inside a running container |
| `node_script` + `netns` | Node + pod's network ns | Host tools + pod's network view (call `resolve_pod_netns` first) |

## Best Practices

- **One skill, one purpose** — don't make Swiss army knives
- **Script over inline commands** — if the procedure has more than 3 steps, write a script
- **Idempotent and read-only** — skills are for diagnosis, not remediation
- **Description is critical** — the agent uses it to decide whether to use this skill
- **Concrete examples** — at least 2 examples with realistic parameters
- **Explain expected output** — describe what normal vs abnormal output looks like
- **Severity thresholds** — when checking error counters, give thresholds so the agent can judge

## Common Mistakes

- **Too much raw output** — dump kubectl describe without filtering. Grep for relevant lines
- **Missing Tool section** — without it, the agent doesn't know which execution tool to use
- **Wrong execution mode** — using `local_script` for host-level tools (use `node_script`)
- **Hardcoded values** — node names, namespaces should be parameters
- **No severity guidance** — e.g., CRC errors: 0 = normal, 1-100 = minor, >1000 = critical

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。