L76 Core Architecture Skill
This skill demonstrates a complete, production-ready AgentSkills architecture.
When to Use
✅ USE this skill when:
- - Building a new skill from scratch
- Reviewing or auditing existing skill structure
- Learning AgentSkills best practices
- Needing a template for tool integration
Architecture Overview
CODEBLOCK0
Core Components
1. Frontmatter (Required)
CODEBLOCK1
2. Skill Instructions Structure
CODEBLOCK2
Tool Integration Patterns
Pattern 1: Sequential Tool Calls
CODEBLOCK3
Pattern 2: Conditional Execution
CODEBLOCK4
Pattern 3: Error Recovery
CODEBLOCK5
Pattern 4: Batch Operations
CODEBLOCK6
Error Handling Strategy
Error Categories
- 1. Recoverable — Retry with backoff, fallback to alternative
- User Action Required — Prompt user for input/permission
- Fatal — Report clearly, suggest workaround
Error Response Format
CODEBLOCK7
Memory Items
Skills should track state when needed:
CODEBLOCK8
Testing Checklist
- - [ ] Skill triggers correctly
- [ ] All tool calls succeed
- [ ] Error paths tested
- [ ] Output is clear and actionable
- [ ] No sensitive data leaked
- [ ] Idempotent (safe to re-run)
Publishing to ClawHub
CODEBLOCK9
References
L76 核心架构技能
该技能展示了一个完整的、可用于生产环境的 AgentSkills 架构。
使用时机
✅ 在以下情况下使用此技能:
- - 从头开始构建新技能
- 审查或审计现有技能结构
- 学习 AgentSkills 最佳实践
- 需要工具集成模板时
架构概览
l76-core-arch/
├── SKILL.md # 技能清单 + 指令(您当前所在位置)
├── index.js # 主入口(简单技能可选)
├── references/ # 支持文档、示例、模板
│ └── examples.md
└── scripts/ # 辅助脚本(可选)
└── validate.sh
核心组件
1. 前置元数据(必需)
yaml
name: skill-name # 短横线命名法,唯一标识符
description: | # 清晰的触发条件
何时使用此技能。
metadata:
author: your-name
version: 1.0.0
emoji: 🎯 # 可选的可视化标识符
openclaw: # OpenClaw 特定元数据
requires:
bins: [tool1, tool2]
install: # 安装说明
- id: tool1
kind: node
package: package-name
bins: [binary-name]
label: 安装描述
2. 技能指令结构
markdown
技能名称
简要描述(1-2句话)。
使用时机
✅ 在以下情况下使用此技能:
❌ 不要在以下情况下使用此技能:
工作流程
步骤 1 — 前置检查
开始前检查先决条件。
步骤 2 — 主要逻辑
核心技能功能。
步骤 3 — 清理
完成并报告结果。
错误处理
常见错误及恢复步骤。
示例
具体使用示例。
工具集成模式
模式 1:顺序工具调用
javascript
// 读取文件,然后处理,然后写入
const content = await read({ path: input.txt });
const processed = transform(content);
await write({ path: output.txt, content: processed });
模式 2:条件执行
javascript
// 先检查,再执行
const exists = await exec({ command: test -f file.txt });
if (exists.exitCode === 0) {
await edit({ path: file.txt, oldText: ..., newText: ... });
}
模式 3:错误恢复
javascript
try {
await riskyOperation();
} catch (error) {
// 记录错误
await write({ path: error.log, content: error.message });
// 尝试恢复
await recoveryStep();
// 向用户报告
return { status: recovered, error: error.message };
}
模式 4:批量操作
javascript
// 高效处理多个项目
const items = await discoverItems();
const results = await Promise.all(
items.map(item => processItem(item))
);
错误处理策略
错误分类
- 1. 可恢复 — 重试并退避,回退到替代方案
- 需要用户操作 — 提示用户输入/授权
- 致命错误 — 清晰报告,建议解决方法
错误响应格式
javascript
{
status: error | partial | success,
error: 人类可读的错误消息,
recovery: 建议的下一步操作,
details: { / 技术细节 / }
}
记忆项
技能应在需要时跟踪状态:
markdown
技能状态
- - 上次运行:2026-03-22
- 已处理项目:42
- 遇到的错误:3
- 配置:{...}
测试清单
- - [ ] 技能正确触发
- [ ] 所有工具调用成功
- [ ] 错误路径已测试
- [ ] 输出清晰且可操作
- [ ] 无敏感数据泄露
- [ ] 幂等性(可安全重新运行)
发布到 ClawHub
bash
先登录
clawhub login
发布
clawhub publish ./l76-core-arch \
--slug l76-core-arch \
--name L76 核心架构 \
--version 1.0.0 \
--changelog 初始版本
验证
clawhub list
参考