技能验证

其他 社区

技能解读

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

何时使用

创建或编辑技能之后 提交技能更改之前 审核所有技能的一致性时

必填

[ ] Frontmatter:具有 name: 和 description: 字段 [ ] 冒号命名:name: 使用冒号表示法(例如,tdd:ci 不是 tdd-ci) [ ] 目录匹配:目录名称与 frontmatter name: 字段匹配 [ ] 标题:将 # Skill Name 作为第一个标题 [ ]何时使用:有“何时使用”或“概述”部分

命令格式(必填)

[ ] 沙盒分类:技能被分类为沙盒或管理(见下文) [ ] 单命令:沙盒技能每个代码块使用一个命令(无 && 链接) [ ] 自动批准覆盖范围:沙盒技能中的所有命令都与 .claude/settings.json 中的模式匹配 [ ] 无多行 bash:沙盒技能避免命令中的heredocs、多行管道或 for 循环

推荐

[ ] TOC:如果技能 > 50 行,则显示目录 [ ] 占位符:所有命令均可复制粘贴(没有未解释的占位符) [ ] 任务跟踪:TDD/RCA 技能有“任务跟踪”部分 [ ] 父参考:父类别 SKILL.md 引用此技能 [ ] 命令式语音:使用“运行 X”而不是“你应该运行 X”

沙箱与管理分类

技能在沙箱(安全)或管理(需要批准)目标上运行:类型·目标·自动批准? · 命令格式 沙箱 · 本地类集群、自定义 HyperShift 托管集群 · 是 · 单个命令,每步一个 管理 · 管理集群、AWS 资源、git 推送、破坏性操作 · 否 · 可以链接命令(无论如何都要经过用户批准)

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

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

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

# Validate Skill

## When to Use

- After creating or editing a skill
- Before committing skill changes
- When auditing all skills for consistency

## Validation Checks

### Required

- [ ] **Frontmatter**: Has `name:` and `description:` fields
- [ ] **Colon naming**: `name:` uses colon notation (e.g., `tdd:ci` not `tdd-ci`)
- [ ] **Directory match**: Directory name matches frontmatter `name:` field
- [ ] **Title**: Has `# Skill Name` as first heading
- [ ] **When to Use**: Has "When to Use" or "Overview" section
- [ ] **Related Skills**: Has "Related Skills" section at the end
- [ ] **Mermaid diagram**: Workflow/router skills have an embedded mermaid diagram
- [ ] **Diagram colors**: classDef colors match README color legend

### Command Format (Required)

- [ ] **Sandbox classification**: Skill is classified as sandbox or management (see below)
- [ ] **Single commands**: Sandbox skills use one command per code block (no `&&` chaining)
- [ ] **Auto-approve coverage**: All commands in sandbox skills match a pattern in `.claude/settings.json`
- [ ] **No multiline bash**: Sandbox skills avoid heredocs, multiline pipes, or `for` loops in commands

### Recommended

- [ ] **TOC**: Table of Contents present if skill > 50 lines
- [ ] **Placeholders**: All commands are copy-pasteable (no unexplained placeholders)
- [ ] **Task tracking**: TDD/RCA skills have "Task Tracking" section
- [ ] **Parent ref**: Parent category `SKILL.md` references this skill
- [ ] **Imperative voice**: Uses "Run X" not "You should run X"
- [ ] **Length**: Leaf skills are 80-200 lines (300 max)
- [ ] **Diagram-text match**: Diagram nodes correspond to textual flow steps

## Sandbox vs Management Classification

Skills operate on either **sandbox** (safe) or **management** (requires approval) targets:

| Type | Target | Auto-approve? | Command format |
|------|--------|---------------|----------------|
| **Sandbox** | Local Kind cluster, custom HyperShift hosted cluster | YES | Single commands, one per step |
| **Management** | Management cluster, AWS resources, git push, destructive ops | NO | Can chain commands (user approves anyway) |

### Sandbox skills (auto-approved)
Commands target `localtest.me`, `KUBECONFIG=~/clusters/hcp/kagenti-hypershift-custom-*`, or Kind clusters.

**IMPORTANT**: Run each command separately — not chained with `&&`. Chained or multiline commands break Claude Code's auto-approve pattern matching.

```markdown
## GOOD (each command runs separately, matches auto-approve patterns)

Check pod status:
```bash
kubectl get pods -n kagenti-system
```

Check logs:
```bash
kubectl logs -n kagenti-system deployment/mlflow
```

## BAD (chained commands won't match auto-approve patterns)

```bash
kubectl get pods -n kagenti-system && kubectl logs -n kagenti-system deployment/mlflow
```
```

### Management skills (require approval)
Commands target management clusters, AWS APIs, or perform destructive operations. These can use any command format since the user must approve each one.

## How to Validate

### Single Skill

```bash
# Check frontmatter
head -5 .claude/skills/<skill>/SKILL.md

# Check name matches directory
DIR_NAME=$(basename $(dirname .claude/skills/<skill>/SKILL.md))
SKILL_NAME=$(grep '^name:' .claude/skills/<skill>/SKILL.md | sed 's/name: //')
[ "$DIR_NAME" = "$SKILL_NAME" ] && echo "OK" || echo "MISMATCH: dir=$DIR_NAME name=$SKILL_NAME"
```

### All Skills

```bash
# Check all frontmatter name-vs-directory
for f in .claude/skills/*/SKILL.md; do
  dir=$(basename $(dirname "$f"))
  name=$(grep '^name:' "$f" | sed 's/name: //' | tr -d ' ')
  [ "$dir" = "$name" ] || echo "MISMATCH: $dir != $name"
done
```

### Check Command Format (sandbox skills)

```bash
# Find chained commands in sandbox skills (potential auto-approve issues)
grep -n ' && ' .claude/skills/k8s:*/SKILL.md .claude/skills/kagenti:*/SKILL.md .claude/skills/kind:*/SKILL.md .claude/skills/local:*/SKILL.md .claude/skills/tdd:*/SKILL.md .claude/skills/rca:*/SKILL.md
```

### Check Mermaid Diagram Presence

```bash
for f in .claude/skills/*/SKILL.md; do
  dir=$(basename $(dirname "$f"))
  case "$dir" in git|k8s|auth|openshift|local|kind|helm|meta|genai|repo|testing) continue ;; esac
  if ! grep -q '```mermaid' "$f"; then
    echo "MISSING DIAGRAM: $dir"
  fi
done
```

### Verify settings.json Coverage

For each command in a sandbox skill, verify it matches a pattern in `.claude/settings.json`:

| Command prefix | settings.json pattern |
|----------------|----------------------|
| `kubectl get` | `Bash(kubectl get:*)` |
| `kubectl describe` | `Bash(kubectl describe:*)` |
| `kubectl logs` | `Bash(kubectl logs:*)` |
| `helm list` | `Bash(helm list:*)` |
| `KUBECONFIG=~/clusters/hcp/... kubectl` | `Bash(KUBECONFIG=*/clusters/hcp/kagenti-hypershift-custom-*/auth/kubeconfig kubectl:*)` |
| `uv run pytest` | `Bash(uv run pytest:*)` |

If a command is NOT covered, add the pattern to `.claude/settings.json` in the `allow` array.

## Task Tracking

When validating multiple skills:

```
TaskCreate: "kagenti | skills | <category> | Verify | Validate <skill-name>"
```

## Related Skills

- `skills:write` - Create new skills following the standard
- `skills:retrospective` - Review session to identify skill improvements

讨论

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