技能强化
- 作者仓库星标 225
- 许可证 MIT
- 作者仓库 agent-bank
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @different-ai · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:捕捉上下文
使用技能后,请注意:
第 2 步:确定学习内容
问这些问题:什么花费了比预期更长的时间? → 记录修复程序 意外失败的原因是什么? → 添加到“常见问题” 发现了什么快捷方式? → 添加到“代币节省技巧” 什么假设是错误的? → 文档正确
第三步:对学习进行分类
类别·添加位置·示例新快捷方式·“令牌节省提示”·电子邮件预览中可见的 OTP 失败模式·“常见问题”·弹出窗口阻止程序破坏流程更好的模式·主要工作流程·首先检查登录状态反模式·“要避免的反模式”·不要快照垃圾邮件
第 5 步:验证更新
确保更新: 可操作 - 不是模糊的观察 具体 - 包括确切的命令/模式 格式化 - 匹配现有样式 非冗余 - 不重复现有内容
## What I Do
After ANY skill is used, this meta-skill triggers to:
1. Analyze what worked and what didn't
2. Identify new patterns or shortcuts discovered
3. Update the skill file with learnings
4. Prevent knowledge loss between sessions
**Relationship with `self-improve`:**
- This skill (`skill-reinforcement`) = **WHEN** to update (post-use triggers)
- The `self-improve` skill = **HOW** to update (templates, structures, decision trees)
## When to Trigger
**Invoke this skill automatically when:**
- Any skill from `.opencode/skill/*/SKILL.md` completes
- A workflow succeeds or fails in a notable way
- New shortcuts or anti-patterns are discovered
- Token usage could be reduced with better patterns
- API behavior differs from documentation
- Commands fail and I find the fix
- User confirms something works
- I do the same task twice (should become a skill/tool)
## Reinforcement Process
### Step 1: Capture the Context
After using a skill, note:
```
- Skill used: [skill-name]
- Task: [what was being done]
- Outcome: [success/partial/failure]
- Token cost: [high/medium/low]
- Time taken: [fast/normal/slow]
```
### Step 2: Identify Learnings
Ask these questions:
1. **What took longer than expected?** → Document the fix
2. **What failed unexpectedly?** → Add to "Common Issues"
3. **What shortcut was discovered?** → Add to "Token Saving Tips"
4. **What assumption was wrong?** → Correct in documentation
5. **What worked better than documented?** → Update the workflow
### Step 3: Categorize the Learning
| Category | Where to Add | Example |
| ----------------- | -------------------------- | ---------------------------- |
| New shortcut | "Token Saving Tips" | OTP visible in email preview |
| Failure mode | "Common Issues" | Popup blocker breaks flow |
| Better pattern | Main workflow | Check login state first |
| Anti-pattern | "Anti-Patterns to Avoid" | Don't snapshot spam |
| Environment quirk | "Prerequisites" or "Notes" | Session persists |
### Step 4: Update the Skill File
```bash
# Read current skill
cat .opencode/skill/[skill-name]/SKILL.md
# Edit to add learning in appropriate section
# Use the Edit tool to append or modify
```
### Step 5: Validate the Update
Ensure updates are:
- **Actionable** - Not vague observations
- **Specific** - Include exact commands/patterns
- **Formatted** - Match existing style
- **Non-redundant** - Don't duplicate existing content
## Learning Templates
### For New Shortcuts
```markdown
### [Shortcut Name]
**Discovery**: [How it was found]
**Before**: [Old approach]
**After**: [New approach]
**Savings**: [Token/time reduction]
```
### For Failure Modes
```markdown
| Issue | Symptom | Fix |
| ------ | -------------- | ---------------- |
| [Name] | [What you see] | [How to resolve] |
```
### For Anti-Patterns
````markdown
### Don't: [Bad Pattern Name]
```javascript
// BAD - [explanation]
[bad code]
```
````
### Do: [Good Pattern Name]
```javascript
// GOOD - [explanation]
[good code]
```
````
### For Workflow Improvements
```markdown
## Updated: [Section Name]
[New content that replaces or augments existing]
> **Note**: Updated [date] after discovering [context]
````
## Real Examples
### Example 1: Session Persistence Discovery
**Context**: Testing staging branch, went through full login flow
**Learning**: Chrome MCP persists sessions - was already logged in
**Action**: Added "Session Persistence is Your Friend" section with check-first pattern
### Example 2: OTP Extraction Optimization
**Context**: Opened email, waited for load, extracted OTP
**Learning**: OTP visible in Gmail list preview without opening email
**Action**: Updated OTP section with faster "search + list preview" method
### Example 3: Deployment URL Pattern
**Context**: Manually constructed URL, got it wrong
**Learning**: Can extract URL directly from Vercel bot's PR comment
**Action**: Added `gh pr view` command to get URL automatically
## Skill File Structure Convention
Every skill should have these sections (add if missing):
```markdown
## What I Do
[Core purpose]
## Prerequisites
[Requirements]
## Workflow
[Main steps]
## Common Issues
[Failure modes and fixes]
## Token Saving Tips
[Efficiency patterns]
## Anti-Patterns to Avoid
[What NOT to do]
## Real Examples
[Actual usage examples]
## Learnings Log
[Append-only log of discoveries - optional]
```
## Integration with Other Skills
When reinforcing a skill, check if learnings apply to related skills:
| Skill | Related Skills |
| ------------------- | ------------------------------- |
| test-staging-branch | Any Chrome MCP skill |
| skill-reinforcement | All skills (meta) |
| self-improve | skill-reinforcement (companion) |
| chrome-devtools-mcp | test-staging-branch, gmail |
| safe-infrastructure | new-vault-implementation |
Cross-pollinate learnings when applicable.
### Deciding What to Create
If reinforcement reveals a need for new capability, use the `self-improve` skill's decision tree:
```
Need to extend capabilities?
│
├─ Just need docs/commands? → SKILL
├─ Need specialized AI persona? → AGENT
├─ Need event hooks? → PLUGIN
├─ Need callable function? → TOOL
└─ Need external integration? → MCP SERVER
```
## Automation Hooks
### Post-Skill Trigger
After completing any skill, automatically ask:
1. "Did anything unexpected happen?"
2. "Was there a faster way to do this?"
3. "What would I do differently next time?"
If answers exist, invoke skill-reinforcement.
### Periodic Review
Every ~10 skill uses, review:
- Most frequently used skills (prioritize improvements)
- Skills with most "Common Issues" (need better documentation)
- Skills with outdated information (need refresh)
## Meta: Reinforcing This Skill
This skill should also improve itself. Track:
- How often it triggers
- Quality of captured learnings
- Whether skills actually improve over time
- Time cost of reinforcement vs value gained
## Quick Reinforcement Checklist
```
[ ] Skill completed
[ ] Outcome noted (success/fail/partial)
[ ] Any surprises? → Document
[ ] Any shortcuts found? → Add to tips
[ ] Any failures? → Add to issues
[ ] Could be faster? → Add anti-pattern
[ ] Update skill file
[ ] Validate formatting
[ ] Done
```
## Immediate Update Rule
**UPDATE IMMEDIATELY** - Don't wait until end of conversation.
When any of these happen, stop and update the relevant skill:
1. API format is wrong (like `-d` vs `-F` for curl)
2. Commands fail and I find the fix
3. User confirms something works
4. I discover a better/faster way
5. Something is missing from docs
Example:
```
❌ "I'll note this for later"
✅ *immediately edits skill file*
```
## Learnings Log
- 2026-01-12: Bulk remote branch cleanup can hit stale refs and timeouts; run `git fetch --prune origin` first, delete with a loop that tolerates missing refs, then prune again to verify only `origin/main` remains.
- 2026-01-13: When extending agent policy docs, renumber numbered headings after inserts and place testing tools + real-funds protocol near the Testability section for clarity.
- 2026-01-13: When refactoring MCP tool handlers into a registry, remove the legacy switch and align handler arg types with tool schemas to avoid type errors.
- 2026-01-13: When adding a new Next.js route handler export, ensure it sits outside existing handler functions to avoid "Modifiers cannot appear here" errors.
章节与文件索引
按说明文件中的顺序排列。
我做什么
何时触发
第 2 步:确定学习内容
第三步:对学习进行分类
第 5 步:验证更新
文件/命令 -> self-improve · skill-reinforcement · .opencode/skill/*/SKILL.md · gh pr view · git fetch --prune origin · origin/main
内容校验值 -> 1b3f2a5694ef
当前原文的自动摘译,尚未人工审校。
我做什么
使用任何技能后,此元技能会触发以下操作: 分析哪些有效,哪些无效 识别发现的新模式或快捷方式 通过学习更新技能文件 防止会话之间的知识丢失
何时触发
在以下情况下自动调用此技能:
.opencode/skill/*/SKILL.md中的任何技能完成 工作流程以显着方式成功或失败 发现新的快捷方式或反模式 通过更好的模式可以减少令牌使用