Agent诊断
- 作者仓库星标 225
- 许可证 MIT
- 作者更新于 实时读取
- 作者仓库 agent-bank
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @different-ai · MIT
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-reinforcement
description: Always and Automatically improve skills after each use by capturing learnings and anti-patterns…
category: 工程开发
runtime: 无特殊运行时
---
# skill-reinforcement 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“What I Do / When to Trigger / Reinforcement Process”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“What I Do / When to Trigger / Reinforcement Process”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“What I Do / When to Trigger / Reinforcement Process”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-reinforcement
description: Always and Automatically improve skills after each use by capturing learnings and anti-patterns…
category: 工程开发
source: different-ai/agent-bank
---
# skill-reinforcement
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「What I Do / When to Trigger / Reinforcement Process」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-reinforcement" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> What I Do / When to Trigger / Reinforcement Process
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} What I Do
After ANY skill is used, this meta-skill triggers to:
- Analyze what worked and what didn't
- Identify new patterns or shortcuts discovered
- Update the skill file with learnings
- Prevent knowledge loss between sessions
Relationship with self-improve:
- This skill (
skill-reinforcement) = WHEN to update (post-use triggers) - The
self-improveskill = HOW to update (templates, structures, decision trees)
When to Trigger
Invoke this skill automatically when:
- Any skill from
.opencode/skill/*/SKILL.mdcompletes - 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:
- What took longer than expected? → Document the fix
- What failed unexpectedly? → Add to "Common Issues"
- What shortcut was discovered? → Add to "Token Saving Tips"
- What assumption was wrong? → Correct in documentation
- 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
# 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
### [Shortcut Name]
**Discovery**: [How it was found]
**Before**: [Old approach]
**After**: [New approach]
**Savings**: [Token/time reduction]
For Failure Modes
| Issue | Symptom | Fix |
| ------ | -------------- | ---------------- |
| [Name] | [What you see] | [How to resolve] |
For Anti-Patterns
### Don't: [Bad Pattern Name]
```javascript
// BAD - [explanation]
[bad code]
```
Do: [Good Pattern Name]
// 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):
## 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:
- "Did anything unexpected happen?"
- "Was there a faster way to do this?"
- "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:
- API format is wrong (like
-dvs-Ffor curl) - Commands fail and I find the fix
- User confirms something works
- I discover a better/faster way
- 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 originfirst, delete with a loop that tolerates missing refs, then prune again to verify onlyorigin/mainremains. - 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.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核