对话经验沉淀与学习
reflect
学习捕获系统,从对话中提取高/中/低置信度的模式,以避免重复犯错。在用户纠正("no"、"wrong")、表扬("perfect"、"exactly")或发现边缘情况时使用。作为 .squad/agents/{agent}/history.md 和 .squad/decisions.md 的补充。
- License 许可
- MIT
- 最近更新
- 2026-10-27
- Stars
- ★ 0
- Forks
- 3
01 前言 Front Matter
- name
- reflect
- domain
- team-memory, learning
- license
- MIT
- version
- 1.0.0-squad
- confidence
- high
- description
- Learning capture system that extracts HIGH/MED/LOW confidence patterns from conversations to prevent repeating mistakes. Use after user corrections ("no", "wrong"), praise ("perfect", "exactly"), or when discovering edge cases. Complements .squad/agents/{agent}/history.md and .squad/decisions.md.
03 SKILL.md 正文
Reflect Skill
Critical learning capture system for Squad. Prevents repeating mistakes and preserves successful patterns across sessions.
Analyze conversations and propose improvements to squad knowledge based on what worked, what didn't, and edge cases discovered. Every correction is a learning opportunity.
Integration with Squad Architecture
Reflect complements existing Squad knowledge systems:
.squad/agents/{agent}/history.md— Permanent learnings from completed work (append-only; each agent updates their own file; Scribe propagates cross-agent updates).squad/decisions.md— Team-wide decisions that all agents respectreflectskill — Captures in-flight learnings from conversations that may graduate to history.md or decisions.md
Workflow:
- Use
reflectduring work to capture learnings - At session end, review captured learnings
- Promote HIGH confidence patterns → lead agent for decision.md review
- Promote agent-specific patterns →
{agent}/history.mdupdates
Triggers
? HIGH Priority (Invoke Immediately)
| Trigger | Example | Why Critical |
|---|---|---|
| User correction | "no", "wrong", "not like that", "never do" | Captures mistakes to prevent repetition |
| Architectural insight | "you removed that without understanding why" | Documents design decisions (Chesterton's Fence) |
| Immediate fixes | "debug", "root cause", "fix all" | Learns from errors in real-time |
? MEDIUM Priority (Invoke After Multiple)
| Trigger | Example | Why Important |
|---|---|---|
| User praise | "perfect", "exactly", "great" | Reinforces successful patterns |
| Tool preferences | "use X instead of Y", "prefer" | Builds workflow preferences |
| Edge cases | "what if X happens?", "don't forget", "ensure" | Captures scenarios to handle |
? LOW Priority (Invoke at Session End)
| Trigger | Example | Why Useful |
|---|---|---|
| Repeated patterns | Frequent use of specific commands/tools | Identifies workflow preferences |
| Session end | After complex work | Consolidates all session learnings |
Process
Phase 1: Identify Learning Target
Determine what knowledge system should be updated:
- Agent-specific learning →
.squad/agents/{agent}/history.md - Team-wide decision →
.squad/decisions/inbox/{agent}-{topic}.md - Skill-specific improvement → Document in session, recommend to skill owner
Phase 2: Analyze Conversation
Scan for learning signals with confidence levels:
HIGH Confidence: Corrections
User actively steered or corrected output.
Detection patterns:
- Explicit rejection: "no", "not like that", "that's wrong"
- Strong directives: "never do", "always do", "don't ever"
- User provided alternative implementation
Example:
User: "No, use the azure-devops MCP tool instead of raw API calls"
→ [HIGH] + Add constraint: "Prefer azure-devops MCP tools over REST API"
MEDIUM Confidence: Success Patterns
Output was accepted or praised.
Detection patterns:
- Explicit praise: "perfect", "great", "yes", "exactly"
- User built on output without modification
- Output was committed without changes
Example:
User: "Perfect, that's exactly what I needed"
→ [MED] + Add preference: "Include usage examples in documentation"
MEDIUM Confidence: Edge Cases
Scenarios not anticipated.
Detection patterns:
- Questions not answered
- Workarounds user had to apply
- Error handling gaps discovered
LOW Confidence: Preferences
Accumulated patterns over time.
Phase 3: Propose Learnings
Present findings:
┌─────────────────────────────────────────────────────────────┐
│ REFLECTION: {target (agent/decision/skill)} │
├─────────────────────────────────────────────────────────────┤
│ │
│ [HIGH] + Add constraint: "{specific constraint}" │
│ Source: "{quoted user correction}" │
│ Target: .squad/decisions/inbox/{agent}-{topic}.md │
│ │
│ [MED] + Add preference: "{specific preference}" │
│ Source: "{evidence from conversation}" │
│ Target: .squad/agents/{agent}/history.md │
│ │
│ [LOW] ~ Note for review: "{observation}" │
│ Source: "{pattern observed}" │
│ Target: Session notes only │
│ │
├─────────────────────────────────────────────────────────────┤
│ Apply changes? [Y/n/edit] │
└─────────────────────────────────────────────────────────────┘
Confidence Threshold:
| Threshold | Action |
|---|---|
| ≥1 HIGH signal | Always propose (user explicitly corrected) |
| ≥2 MED signals | Propose (sufficient pattern) |
| ≥3 LOW signals | Propose (accumulated evidence) |
| 1-2 LOW only | Skip (insufficient evidence) |
Phase 4: Persist Learnings
ALWAYS show changes before applying.
After user approval:
-
For Agent History:
- Append to
.squad/agents/{agent}/history.mdunder## Learningssection - Format: Date, assignment context, key learning
- Append to
-
For Team Decisions:
- Create
.squad/decisions/inbox/{agent}-{topic}.md - Lead agent reviews and merges to
decisions.mdif appropriate
- Create
-
For Skills:
- Document recommendation in session notes
- Squad lead reviews and routes to skill owner
Usage Examples
Example 1: User Correction
Conversation:
Agent: "I'll use grep to search the repository"
User: "No, use the code search tools first, grep is too slow"
Reflection Output:
[HIGH] + Add constraint: "Use code intelligence tools before grep"
Source: "No, use the code search tools first, grep is too slow"
Target: .squad/agents/{agent}/history.md
Example 2: Success Pattern
Conversation:
Agent: [Creates PR with detailed description and test plan]
User: "Perfect! This is exactly the format I want for all PRs"
Reflection Output:
[MED] + Add preference: "Include test plan in PR descriptions"
Source: User praised detailed PR format
Target: .squad/decisions/inbox/pr-format.md (for team adoption)
When to Use
✅ Use reflect when:
- User says "no", "wrong", "not like that" (HIGH priority)
- User says "perfect", "exactly", "great" (MED priority)
- You discover edge cases or gaps
- Complex work session with multiple learnings
- At end of sprint/milestone to consolidate patterns
❌ Don't use reflect when:
- Simple one-off questions with no pattern
- User is just exploring ideas (no concrete decisions)
- Learning is already captured in history.md/decisions.md
See Also
.squad/decisions.md— Team-wide decisions.squad/agents/*/history.md— Agent-specific learnings.squad/routing.md— Work assignment patterns
04 同仓库更多 Skills
{技能名称}
{skill-name}
{本技能教会智能体做什么}
azd 种子钩子
azd-seed-hook
暂无简介
{技能名称}
{skill-name}
{此技能向智能体传授的内容}
智能体分层记忆模型
tiered-memory
三层智能体记忆模型(热/冷/维基),用于减少每次派生(spawn)智能体时的上下文占用。
API 变更同步更新测试
test-discipline
更改 API 时必须同步更新测试——无一例外。
squad 命令目录与交互菜单
squad
Squad 的命令目录与交互式菜单。通过 /squad(斜杠命令)或自然语言(“squad commands”、“what can squad do”、“show me squad options”)调用。以交互式选择器形式呈现分类操作(安装与升级、团队管理、议题与 PR、插件与技能、模型与成本、会话与状态)。路由到相应的 squad CLI 命令或 Squad 协调器智能体。