文档写作
- 作者仓库星标 216
- 作者更新于 实时读取
- 作者仓库 kagenti
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @kagenti · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skills:write
description: Create or edit skills with proper structure, task tracking, and naming conventions Create new sk…
category: 工程开发
runtime: 无特殊运行时
---
# skills:write 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Worktree Gate / Table of Contents / New vs Edit”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Worktree Gate / Table of Contents / New vs Edit”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/tmp` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Worktree Gate / Table of Contents / New vs Edit”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skills:write
description: Create or edit skills with proper structure, task tracking, and naming conventions Create new sk…
category: 工程开发
source: kagenti/kagenti
---
# skills:write
## 什么时候使用
- 用于创建、审计和维护 Agent Skill / SKILL 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Worktree Gate / Table of Contents / New vs Edit」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skills:write" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Worktree Gate / Table of Contents / New vs Edit
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Write / Edit Skill
Create new skills or edit existing ones. Both follow the same checklist and conventions.
Worktree Gate
All skill work MUST happen in a worktree. Before proceeding, verify you are in a worktree:
git worktree list
If not in a worktree, create one first:
git fetch upstream main
git worktree add .worktrees/skills-<topic> -b docs/skills-<topic> upstream/main
Table of Contents
New vs Edit
| Action | Steps |
|---|---|
| New skill | Create directory + SKILL.md from template, fill in content, validate |
| Edit skill | Read existing file first, apply changes, re-validate, ensure diagram still matches text |
For edits: always read the skill FIRST, then edit. Never overwrite without reading.
Skill Structure
.claude/skills/<category>:<skill-name>/
└── SKILL.md
IMPORTANT: Use colon notation in directory names (e.g., auth:my-skill/). Required for Claude Code skill discovery.
Categories: auth, ci, genai, git, hypershift, istio, k8s, kagenti, kind, local, openshift, rca, skills, tdd, testing
Frontmatter
---
name: category:skill-name
description: One-line description (what it does, not how)
---
Use colon notation in name: field. Directory name must match.
Content Guidelines
- Title:
# Skill Name - TOC: Include for skills over 50 lines
- Length: Target 80-200 lines (300 max). Split longer skills.
- Sections:
- When to Use
- Steps/Workflow
- Workflow Diagram (required for workflow/router skills)
- Task Tracking (required for workflow skills)
- Troubleshooting
- Related Skills
- Style:
- Imperative voice ("Run X", not "You should run X")
- Real, copy-pasteable commands
- Include expected output where helpful
Command Format and Auto-Approve
Skills must classify as sandbox or management to determine command format:
| Type | Target | Auto-approve? |
|---|---|---|
| Sandbox | Kind cluster, custom HyperShift hosted cluster | YES |
| Management | Management cluster, AWS resources, git push, destructive ops | NO |
Sandbox skills: One command per code block
Claude Code auto-approves commands by matching the first token against .claude/settings.json patterns. Chained commands (&&), multiline scripts, heredocs, and for loops break pattern matching.
IMPORTANT: Write each command as a separate code block:
Check pod status:
```bash
kubectl get pods -n kagenti-system
Check logs:
kubectl logs -n kagenti-system deployment/mlflow
Do NOT chain: `kubectl get pods && kubectl logs ...`
For HyperShift, prefix each command individually:
```markdown
```bash
KUBECONFIG=~/clusters/hcp/kagenti-hypershift-custom-$CLUSTER/auth/kubeconfig kubectl get pods -n kagenti-system
### Management skills: Any format
Commands targeting management clusters or AWS need user approval anyway, so multiline/chained format is acceptable.
### Temporary Files
Skills that download logs, artifacts, or save analysis output should use `/tmp/kagenti/<skill-category>/` as the working directory:
```bash
mkdir -p /tmp/kagenti/rca
This path is auto-approved for read/write in .claude/settings.json.
Update settings.json
After writing a skill, verify all sandbox commands are covered by .claude/settings.json patterns. If a new command prefix is used, add it:
{
"permissions": {
"allow": [
"Bash(new-command:*)"
]
}
}
See skills:validate for the full pattern reference table.
Workflow Diagrams
Workflow skills (skills with phases, decision trees, or routing logic) MUST include:
- Embedded mermaid diagram in the SKILL.md
- Companion
.mmdtemplate file in the skill directory (for debug mode, TDD skills only) - Diagram MUST match textual flow exactly
- Use README color scheme:
| Category | classDef |
|---|---|
| TDD | classDef tdd fill:#4CAF50,stroke:#333,color:white |
| RCA | classDef rca fill:#FF5722,stroke:#333,color:white |
| CI | classDef ci fill:#2196F3,stroke:#333,color:white |
| Test | classDef test fill:#9C27B0,stroke:#333,color:white |
| Git | classDef git fill:#FF9800,stroke:#333,color:white |
| K8s | classDef k8s fill:#00BCD4,stroke:#333,color:white |
| Deploy | classDef deploy fill:#795548,stroke:#333,color:white |
| Skills | classDef skills fill:#607D8B,stroke:#333,color:white |
| GitHub | classDef github fill:#E91E63,stroke:#333,color:white |
| HyperShift | classDef hypershift fill:#3F51B5,stroke:#333,color:white |
| Playwright | classDef pw fill:#8BC34A,stroke:#333,color:white |
Exempt from diagram requirement: pure index parents that only list sub-skills with no routing logic (e.g., git/, k8s/, auth/)
Task Tracking Standard
Every workflow skill (tdd, rca, ci, etc.) MUST include a Task Tracking section. This is the canonical reference for how Claude Code task lists work across all skills.
Task Naming Convention
<worktree> | <PR> | <plan-doc> | <topic> | <phase> | <task description>
- worktree: git worktree name (e.g.,
mlflow-ci) orkagentifor main repo - PR: PR reference (e.g.,
PR#569) ornone - plan-doc: plan filename (e.g.,
calm-toast.md) orad-hocif no plan - topic: area of work (e.g.,
Kind CI,MLflow init,CodeQL) - phase: from planning doc section/step, or blank if ad-hoc
- task: brief description
Examples:
mlflow-ci | PR#569 | calm-toast.md | MLflow init | Phase 2: Fix | Use parameterized SQLmlflow-ci | PR#569 | ad-hoc | Kind CI | | Bind Ollama to 0.0.0.0kagenti | none | calm-toast.md | skills | Step 1 | Create ci:status skill
Task Lifecycle
1. On skill invocation:
- TaskList → check existing tasks for this worktree/PR
- Update completed items
- Create new items for discovered work
2. Task metadata:
- plan: path to plan doc or "ad-hoc" if none
- runner: main-session | subagent | background
3. Dependencies:
- Use addBlockedBy for sequential tasks
- Parallel tasks have no blockers
4. Status reporting - always show plan doc in task name:
| # | Status | Task (includes plan doc) |
|---|--------|-------------------------|
| #26 | in_progress | kagenti \| none \| calm-toast.md \| skills \| Create \| ci:status |
| #32 | completed | mlflow-ci \| PR#569 \| ad-hoc \| Kind CI \| Fix \| Ollama bind |
Plan Doc Reference
Every task should reference its parent planning document:
- Tasks from a plan:
metadata.plan = "<plan-file-path>" - Ad-hoc tasks:
metadata.plan = "ad-hoc" - Tasks without a plan doc indicate work that needs retroactive documentation
Checklist
Before committing a new skill:
- Frontmatter has
nameanddescription - Directory uses colon notation
- Name in frontmatter matches directory name
- TOC included if over 50 lines
- Commands are copy-pasteable
- Task Tracking section present (for workflow skills)
- Troubleshooting section exists
- Related Skills section exists
- Mermaid diagram present (for workflow/router skills)
- Diagram matches textual workflow exactly
- Diagram uses classDef colors from README color legend
- Parent category SKILL.md updated with reference
Template
---
name: category:skill-name
description: Brief description of what this skill does
---
# Skill Name
## When to Use
- Condition 1
- Condition 2
## Workflow
1. Step one
2. Step two
## Workflow Diagram
```mermaid
flowchart TD
START(["/category:skill"]) --> STEP1["Step 1"]:::category
STEP1 --> STEP2["Step 2"]:::category
classDef category fill:#COLOR,stroke:#333,color:white
Task Tracking
On invocation:
- TaskList - check existing tasks
- TaskCreate with naming:
<worktree> | <PR> | <topic> | <phase> | <task> - TaskUpdate as work progresses
Troubleshooting
Problem: Description
Symptom: What you see Fix: How to resolve
Related Skills
category:related-skill
## Related Skills
- `skills:validate` - Check skill format compliance
- `skills:retrospective` - Identify skill gaps and improvements
- `meta:write-docs` - Documentation formatting guidelines
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核