kiro-agents 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Build agents for any domain: development, design, business, research, or anythin
|
|
|
16
16
|
**Additional Features:**
|
|
17
17
|
- 🔄 **Flexible Modes** - Switch between vibe (conversational) and spec (structured) workflows
|
|
18
18
|
- 🎯 **Strict Mode** - Precision mode that blocks execution on ambiguous input
|
|
19
|
+
- 🧠 **Reflection System** - Agents learn from experience with persistent memory across sessions
|
|
19
20
|
|
|
20
21
|
## Installation
|
|
21
22
|
|
|
@@ -84,6 +85,7 @@ Agents you create are saved as `.md` files in `.kiro/agents/`. Edit them like an
|
|
|
84
85
|
- **[Getting Started](docs/GETTING_STARTED.md)** - Step-by-step onboarding guide
|
|
85
86
|
- **[Architecture Overview](docs/ARCHITECTURE.md)** - System design and component relationships
|
|
86
87
|
- **[Creating Powerful Agents](docs/user-guide/creating-powerful-agents.md)** - Layered architecture guide
|
|
88
|
+
- **[Reflection System](docs/user-guide/reflection-system.md)** - Persistent memory for agents
|
|
87
89
|
- **[Design Rationale](docs/design/)** - Protocol system, interaction patterns, neurodivergent accessibility
|
|
88
90
|
- **[Contributing](CONTRIBUTING.md)** - Development workflow, build system, testing, versioning
|
|
89
91
|
|
package/build/npm/bin/cli.js
CHANGED
|
@@ -33,7 +33,8 @@ var STEERING_FILES = [
|
|
|
33
33
|
"aliases.md",
|
|
34
34
|
"agents.md",
|
|
35
35
|
"modes.md",
|
|
36
|
-
"strict.md"
|
|
36
|
+
"strict.md",
|
|
37
|
+
"reflect.md"
|
|
37
38
|
];
|
|
38
39
|
var POWER_FILES = [
|
|
39
40
|
"POWER.md",
|
|
@@ -46,6 +47,7 @@ var POWER_FILES = [
|
|
|
46
47
|
"steering/kiro-spec-mode.md",
|
|
47
48
|
"steering/kiro-as-vibe-mode.md",
|
|
48
49
|
"steering/kiro-as-spec-mode.md",
|
|
50
|
+
"steering/explainability-protocol.md",
|
|
49
51
|
"steering/chit-chat.md",
|
|
50
52
|
"steering/agent-management.md",
|
|
51
53
|
"steering/agent-creation.md",
|
package/build/npm/dist/agents.md
CHANGED
|
@@ -13,11 +13,10 @@ keywords: ["agents", "management", "create", "activate", "interactive"]
|
|
|
13
13
|
If the user's message contains `/agents {agent_name}` with a specific agent name (e.g., `/agents kiro-master`):
|
|
14
14
|
|
|
15
15
|
1. **DO NOT execute the interactive management flow below**
|
|
16
|
-
2. **INSTEAD, execute the instruction alias
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- Use `{agent_name}` as the agent identifier throughout the protocol
|
|
16
|
+
2. **INSTEAD, execute the instruction alias:**
|
|
17
|
+
```
|
|
18
|
+
/agents {agent_name}
|
|
19
|
+
```
|
|
21
20
|
3. **Stop processing this document** - The agent activation protocol takes over
|
|
22
21
|
|
|
23
22
|
**Only continue with interactive management flow below if user typed `/agents` without parameters.**
|
|
@@ -34,11 +33,23 @@ You are now in **agent management mode** using chit-chat interaction protocol.
|
|
|
34
33
|
|
|
35
34
|
## Initial Agent
|
|
36
35
|
|
|
37
|
-
When auto-setup detects no agents exist
|
|
36
|
+
When auto-setup detects no agents exist:
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
1. **Load agent definition structure:**
|
|
39
|
+
```
|
|
40
|
+
/only-read-protocols agent-creation.md
|
|
41
|
+
```
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
2. **Create `.kiro/agents/kiro-master.md`** using the agent definition structure from agent-creation.md Step 3, with:
|
|
44
|
+
|
|
45
|
+
**kiro-master** - Interactive Kiro feature management with CRUD operations for MCP servers, hooks, agents, specs, powers, and steering documents. Includes .kiro/ directory maintenance, steering optimization, refactoring, and comprehensive analysis capabilities
|
|
46
|
+
|
|
47
|
+
3. **Validate** the created agent file has:
|
|
48
|
+
- Valid YAML frontmatter
|
|
49
|
+
- All required sections from agent-creation.md Step 3
|
|
50
|
+
- Proper markdown formatting
|
|
51
|
+
|
|
52
|
+
This ensures the initial agent follows the standard agent definition structure.
|
|
42
53
|
|
|
43
54
|
---
|
|
44
55
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
inclusion: manual
|
|
3
|
+
description: "Reflection system commands for capturing and managing agent insights"
|
|
4
|
+
keywords: ["reflect", "insights", "learning", "reflection"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Reflection System
|
|
8
|
+
|
|
9
|
+
Commands for managing the AI reflection system that captures insights, patterns, decisions, and learnings.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
### /reflect - Enable Reflection (Session-Temporary)
|
|
14
|
+
|
|
15
|
+
**Usage:** `/reflect`
|
|
16
|
+
|
|
17
|
+
**Behavior:**
|
|
18
|
+
|
|
19
|
+
Enables reflection system for the currently active agent (session-temporary).
|
|
20
|
+
|
|
21
|
+
**If agent already has Reflections section:**
|
|
22
|
+
- Confirm it's already enabled
|
|
23
|
+
- Show reflection status
|
|
24
|
+
- Continue
|
|
25
|
+
|
|
26
|
+
**If agent lacks Reflections section:**
|
|
27
|
+
- Add Reflections section temporarily for this session
|
|
28
|
+
- Include all 4 tiers (Universal, Category, Agent-Specific, Project)
|
|
29
|
+
- Reflection active while using this agent
|
|
30
|
+
- Removed when session ends or agent changes
|
|
31
|
+
- Next session: agent returns to original state
|
|
32
|
+
|
|
33
|
+
**Reflections section added (temporary):**
|
|
34
|
+
|
|
35
|
+
````markdown
|
|
36
|
+
## Reflections
|
|
37
|
+
|
|
38
|
+
This agent records insights, patterns, and learnings in its dedicated reflection files.
|
|
39
|
+
|
|
40
|
+
### Universal Insights
|
|
41
|
+
|
|
42
|
+
#[[file:.ai-storage/reflections/approved/universal.md:insights]]
|
|
43
|
+
|
|
44
|
+
### Category Insights ({agent-category})
|
|
45
|
+
|
|
46
|
+
#[[file:.ai-storage/reflections/approved/categories/{agent-category}.md:insights]]
|
|
47
|
+
|
|
48
|
+
### Agent-Specific Insights
|
|
49
|
+
|
|
50
|
+
#[[file:.ai-storage/reflections/approved/agents/{agent-name}.md:insights]]
|
|
51
|
+
|
|
52
|
+
### Project Insights
|
|
53
|
+
|
|
54
|
+
#[[file:.ai-storage/reflections/approved/project.md:insights]]
|
|
55
|
+
````
|
|
56
|
+
|
|
57
|
+
**Note:** Replace `{agent-category}` and `{agent-name}` with actual values from agent definition.
|
|
58
|
+
|
|
59
|
+
**After enabling:**
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
✅ REFLECTION ENABLED (Session-Temporary)
|
|
63
|
+
|
|
64
|
+
Agent: {agent-name}
|
|
65
|
+
Category: {agent-category}
|
|
66
|
+
|
|
67
|
+
Reflection files:
|
|
68
|
+
- Universal: .ai-storage/reflections/approved/universal.md
|
|
69
|
+
- Category: .ai-storage/reflections/approved/categories/{agent-category}.md
|
|
70
|
+
- Agent: .ai-storage/reflections/approved/agents/{agent-name}.md
|
|
71
|
+
- Project: .ai-storage/reflections/approved/project.md
|
|
72
|
+
|
|
73
|
+
Draft file:
|
|
74
|
+
- .ai-storage/reflections/drafts/agents/{agent-name}.md
|
|
75
|
+
|
|
76
|
+
You can now capture insights during work. Use /agents reflection-curator to review drafts.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Use case:** Quick testing, one-off reflection capture, temporary enablement.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### /reflect review - Review Draft Insights
|
|
84
|
+
|
|
85
|
+
**Usage:** `/reflect review`
|
|
86
|
+
|
|
87
|
+
**Behavior:**
|
|
88
|
+
|
|
89
|
+
Activates reflection-curator agent and starts draft review workflow.
|
|
90
|
+
|
|
91
|
+
**Equivalent to:**
|
|
92
|
+
```
|
|
93
|
+
/agents reflection-curator
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then curator agent automatically starts review workflow.
|
|
97
|
+
|
|
98
|
+
**Use case:** Review pending draft insights and approve them to appropriate tiers.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Reflection System Overview
|
|
103
|
+
|
|
104
|
+
### Purpose
|
|
105
|
+
|
|
106
|
+
Enable agents to capture and reuse knowledge across sessions:
|
|
107
|
+
- **Insights** - General knowledge, preferences, standards
|
|
108
|
+
- **Patterns** - Reusable approaches, workflows, solutions
|
|
109
|
+
- **Decisions** - Important choices and their rationale
|
|
110
|
+
- **Learnings** - Lessons from successes or failures
|
|
111
|
+
|
|
112
|
+
### Workflow
|
|
113
|
+
|
|
114
|
+
1. **Agent captures insight** → Writes to draft file
|
|
115
|
+
2. **User reviews drafts** → `/reflect review`
|
|
116
|
+
3. **Curator validates** → Checks quality, assigns tier
|
|
117
|
+
4. **Insight approved** → Moves to approved file
|
|
118
|
+
5. **Agents use insights** → Load via file references
|
|
119
|
+
|
|
120
|
+
### Insight Tiers
|
|
121
|
+
|
|
122
|
+
**Universal** - Used by ALL agents
|
|
123
|
+
**Category** - Used by agent type (architects, developers, etc.)
|
|
124
|
+
**Agent-Specific** - Used by one agent only
|
|
125
|
+
**Project** - About this specific project
|
|
126
|
+
|
|
127
|
+
### Storage Location
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
.ai-storage/reflections/
|
|
131
|
+
├── drafts/ - Pending insights
|
|
132
|
+
└── approved/ - Approved insights by tier
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### On-Demand Creation
|
|
136
|
+
|
|
137
|
+
No initialization required! Files created automatically when:
|
|
138
|
+
- Agent records first insight
|
|
139
|
+
- Curator approves insight
|
|
140
|
+
- Agent loads reflections
|
|
141
|
+
|
|
142
|
+
## Related Commands
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
/reflect Enable reflection (session-temporary)
|
|
146
|
+
/reflect review Review draft insights
|
|
147
|
+
/agents reflection-curator Activate curator agent
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Learn More
|
|
151
|
+
|
|
152
|
+
- **README:** `.ai-storage/README.md` - Complete system documentation
|
|
153
|
+
- **Curator Agent:** `.kiro/agents/reflection-curator.md`
|
|
154
|
+
- **Proposal:** `proposals/ai-managed-storage-and-reflection-system-v2.md`
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**Start capturing insights with `/reflect` and review them with `/reflect review`.**
|
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explainability-protocol
|
|
3
|
+
description: Comprehensive protocol for transparent, interpretable AI reasoning and decision-making
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Explainability Protocol
|
|
8
|
+
|
|
9
|
+
Protocol for making AI reasoning transparent, interpretable, and trustworthy. Provides mechanisms for explaining decisions, documenting assumptions, quantifying confidence, and handling uncertainty.
|
|
10
|
+
|
|
11
|
+
## Core Principles
|
|
12
|
+
|
|
13
|
+
1. **Transparency First** - Make reasoning visible and understandable
|
|
14
|
+
2. **Explicit Assumptions** - Document all assumptions and limitations
|
|
15
|
+
3. **Quantified Confidence** - Indicate certainty levels in outputs
|
|
16
|
+
4. **Traceable Decisions** - Show how inputs lead to outputs
|
|
17
|
+
5. **Error Clarity** - Explain what went wrong and why
|
|
18
|
+
6. **Alternative Analysis** - Show options considered and rejection rationale
|
|
19
|
+
7. **Human-Readable** - Present logic in accessible language
|
|
20
|
+
8. **Continuous Learning** - Capture insights for future improvement
|
|
21
|
+
|
|
22
|
+
## Transparency Mechanisms
|
|
23
|
+
|
|
24
|
+
### 1. Reasoning Transparency
|
|
25
|
+
|
|
26
|
+
**Purpose:** Make AI decision-making processes visible and understandable
|
|
27
|
+
|
|
28
|
+
**Implementation:**
|
|
29
|
+
- Break down complex reasoning into clear, sequential steps
|
|
30
|
+
- Show intermediate conclusions and how they connect
|
|
31
|
+
- Document reasoning patterns for future reference
|
|
32
|
+
- Make implicit logic explicit
|
|
33
|
+
- Use visual formatting (numbered steps, bullet points, diagrams)
|
|
34
|
+
|
|
35
|
+
**Example:**
|
|
36
|
+
```
|
|
37
|
+
Decision: Recommend protocol splitting
|
|
38
|
+
|
|
39
|
+
Reasoning:
|
|
40
|
+
1. Current protocol is 3K tokens
|
|
41
|
+
2. Users only need one section at a time
|
|
42
|
+
3. Lazy loading would reduce overhead by 67%
|
|
43
|
+
4. Modular structure improves maintainability
|
|
44
|
+
5. No backward compatibility issues identified
|
|
45
|
+
→ Conclusion: Split protocol into 6 smaller files
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Confidence & Uncertainty
|
|
49
|
+
|
|
50
|
+
**Purpose:** Quantify certainty in AI outputs and communicate limitations
|
|
51
|
+
|
|
52
|
+
**Implementation:**
|
|
53
|
+
- Provide confidence scores for recommendations (High/Medium/Low or %)
|
|
54
|
+
- Communicate when AI is uncertain or making assumptions
|
|
55
|
+
- Explain limitations and edge cases
|
|
56
|
+
- Use qualifiers: "likely", "possibly", "uncertain", "confident"
|
|
57
|
+
- Ask clarifying questions when ambiguous
|
|
58
|
+
|
|
59
|
+
**Confidence Levels:**
|
|
60
|
+
- **High (90%+):** Based on verified facts, documented behavior, or clear patterns
|
|
61
|
+
- **Medium (60-89%):** Based on reasonable inference, common patterns, or partial information
|
|
62
|
+
- **Low (<60%):** Based on assumptions, incomplete information, or uncertain patterns
|
|
63
|
+
|
|
64
|
+
**Example:**
|
|
65
|
+
```
|
|
66
|
+
Recommendation: Use lazy loading pattern
|
|
67
|
+
Confidence: High (95%)
|
|
68
|
+
|
|
69
|
+
Rationale:
|
|
70
|
+
- Pattern is documented in INSTALLED-ARCHITECTURE.md ✓
|
|
71
|
+
- Successfully used in 3 other protocols ✓
|
|
72
|
+
- No known edge cases or limitations ✓
|
|
73
|
+
- Backward compatible ✓
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Decision Tracing
|
|
77
|
+
|
|
78
|
+
**Purpose:** Track how inputs lead to specific outputs
|
|
79
|
+
|
|
80
|
+
**Implementation:**
|
|
81
|
+
- Show decision trees and reasoning paths
|
|
82
|
+
- Document why certain approaches were chosen
|
|
83
|
+
- Make protocol selection logic visible
|
|
84
|
+
- Explain precedence and conflict resolution
|
|
85
|
+
- Link decisions to specific inputs or requirements
|
|
86
|
+
|
|
87
|
+
**Decision Tree Format:**
|
|
88
|
+
```
|
|
89
|
+
Input: User requests protocol optimization
|
|
90
|
+
|
|
91
|
+
├─ Analyze current state
|
|
92
|
+
│ ├─ Protocol size: 3K tokens
|
|
93
|
+
│ ├─ Usage pattern: One section at a time
|
|
94
|
+
│ └─ Loading: All upfront (inefficient)
|
|
95
|
+
│
|
|
96
|
+
├─ Identify options
|
|
97
|
+
│ ├─ Option A: Compress content (saves ~20%)
|
|
98
|
+
│ ├─ Option B: Split into modules (saves ~67%)
|
|
99
|
+
│ └─ Option C: Keep as-is (no savings)
|
|
100
|
+
│
|
|
101
|
+
├─ Evaluate tradeoffs
|
|
102
|
+
│ ├─ Option A: Minimal savings, maintains structure
|
|
103
|
+
│ ├─ Option B: Maximum savings, requires refactoring
|
|
104
|
+
│ └─ Option C: No benefits
|
|
105
|
+
│
|
|
106
|
+
└─ Select optimal solution
|
|
107
|
+
└─ Option B: Split into modules
|
|
108
|
+
Reason: Highest savings, acceptable refactoring cost
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 4. Error Transparency
|
|
112
|
+
|
|
113
|
+
**Purpose:** Identify where and why AI makes mistakes
|
|
114
|
+
|
|
115
|
+
**Implementation:**
|
|
116
|
+
- Provide clear error messages with full context
|
|
117
|
+
- Explain what went wrong and why
|
|
118
|
+
- Offer multiple interpretations for ambiguous input
|
|
119
|
+
- Ask clarifying questions when uncertain
|
|
120
|
+
- Document error patterns for improvement
|
|
121
|
+
- Show recovery strategies
|
|
122
|
+
|
|
123
|
+
**Error Explanation Format:**
|
|
124
|
+
```
|
|
125
|
+
Error: Cannot load protocol "agent-creation-wizard.md"
|
|
126
|
+
|
|
127
|
+
Context:
|
|
128
|
+
- Command: /agents → Create new agent → Method 4
|
|
129
|
+
- Expected: Load agent-creation-wizard.md from kiro-protocols
|
|
130
|
+
- Actual: File not found
|
|
131
|
+
|
|
132
|
+
Root Cause:
|
|
133
|
+
- Protocol file doesn't exist yet (not implemented)
|
|
134
|
+
- agent-creation.md references it but file is missing
|
|
135
|
+
|
|
136
|
+
Recovery Options:
|
|
137
|
+
1. Use different creation method (1, 2, 3, or 5)
|
|
138
|
+
2. Create protocol file manually
|
|
139
|
+
3. Fall back to natural language method
|
|
140
|
+
|
|
141
|
+
Recommendation: Option 1 (use Method 5: Natural Language)
|
|
142
|
+
Confidence: High - Method 5 is implemented and tested
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 5. Human-Readable Outputs
|
|
146
|
+
|
|
147
|
+
**Purpose:** Present AI logic in accessible language
|
|
148
|
+
|
|
149
|
+
**Implementation:**
|
|
150
|
+
- Use clear, concise language (avoid jargon when possible)
|
|
151
|
+
- Provide concrete examples from actual context
|
|
152
|
+
- Use visual formatting (diff blocks, numbered choices, code blocks)
|
|
153
|
+
- Show before/after comparisons
|
|
154
|
+
- Structure complex information with headers and sections
|
|
155
|
+
- Use analogies and metaphors when helpful
|
|
156
|
+
|
|
157
|
+
**Formatting Guidelines:**
|
|
158
|
+
- **Diff blocks:** Progress tracking and state changes
|
|
159
|
+
- **Numbered lists:** Sequential steps or options
|
|
160
|
+
- **Code blocks:** Technical details, file paths, commands
|
|
161
|
+
- **Tables:** Comparisons and structured data
|
|
162
|
+
- **Bold/Italic:** Emphasis and clarification
|
|
163
|
+
- **Whitespace:** Separate concepts, reduce cognitive load
|
|
164
|
+
|
|
165
|
+
### 6. Counterfactual Explanations
|
|
166
|
+
|
|
167
|
+
**Purpose:** Show what would change outcomes
|
|
168
|
+
|
|
169
|
+
**Implementation:**
|
|
170
|
+
- Explain alternative approaches considered
|
|
171
|
+
- Document why certain options were rejected
|
|
172
|
+
- Provide "what if" scenarios
|
|
173
|
+
- Help users understand tradeoffs
|
|
174
|
+
- Show sensitivity to input changes
|
|
175
|
+
|
|
176
|
+
**Counterfactual Format:**
|
|
177
|
+
```
|
|
178
|
+
Chosen Approach: Split protocol into 6 modules
|
|
179
|
+
|
|
180
|
+
Alternative Considered: Compress existing protocol
|
|
181
|
+
|
|
182
|
+
Why Rejected:
|
|
183
|
+
- Compression saves only ~20% vs 67% for splitting
|
|
184
|
+
- Doesn't address lazy loading opportunity
|
|
185
|
+
- Still loads all content upfront
|
|
186
|
+
- Harder to maintain compressed content
|
|
187
|
+
|
|
188
|
+
What If Analysis:
|
|
189
|
+
- If protocol was <1K tokens → Compression would be sufficient
|
|
190
|
+
- If users needed all sections → Splitting would add overhead
|
|
191
|
+
- If backward compatibility was critical → Compression safer
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 7. Reflection & Learning
|
|
195
|
+
|
|
196
|
+
**Purpose:** Analyze outcomes to improve future performance
|
|
197
|
+
|
|
198
|
+
**Implementation:**
|
|
199
|
+
- Capture brilliant AI-generated suggestions
|
|
200
|
+
- Document successful reasoning patterns
|
|
201
|
+
- Learn from errors and edge cases
|
|
202
|
+
- Build knowledge base of effective approaches
|
|
203
|
+
- Identify patterns in successful vs unsuccessful interactions
|
|
204
|
+
- Save "aha moments" and insights
|
|
205
|
+
|
|
206
|
+
**Learning Capture Format:**
|
|
207
|
+
```
|
|
208
|
+
Insight: Protocol splitting pattern
|
|
209
|
+
|
|
210
|
+
Context: agent-creation.md optimization
|
|
211
|
+
|
|
212
|
+
What Worked:
|
|
213
|
+
- Modular structure reduced token overhead by 67%
|
|
214
|
+
- Lazy loading improved user experience
|
|
215
|
+
- Maintenance became easier (edit one module)
|
|
216
|
+
- Pattern applicable to other large protocols
|
|
217
|
+
|
|
218
|
+
Pattern Identified:
|
|
219
|
+
When protocol >2K tokens AND users only need one section at a time
|
|
220
|
+
→ Split into modules with lazy loading
|
|
221
|
+
|
|
222
|
+
Future Applications:
|
|
223
|
+
- mode-management.md (similar structure)
|
|
224
|
+
- agent-management.md (multiple workflows)
|
|
225
|
+
- Any protocol with distinct, independent sections
|
|
226
|
+
|
|
227
|
+
Confidence: High - Pattern validated through implementation
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 8. Self-Correction & Validation
|
|
231
|
+
|
|
232
|
+
**Purpose:** Detect and fix errors autonomously
|
|
233
|
+
|
|
234
|
+
**Implementation:**
|
|
235
|
+
- Validate proposals against documentation
|
|
236
|
+
- Check consistency and coherence
|
|
237
|
+
- Identify conflicts and contradictions
|
|
238
|
+
- Ensure logical soundness of recommendations
|
|
239
|
+
- Cross-reference with verified sources
|
|
240
|
+
- Test assumptions before proceeding
|
|
241
|
+
|
|
242
|
+
**Validation Checklist:**
|
|
243
|
+
```
|
|
244
|
+
Before presenting recommendation:
|
|
245
|
+
|
|
246
|
+
□ Verified against INSTALLED-ARCHITECTURE.md (or relevant docs)
|
|
247
|
+
□ Checked for internal consistency
|
|
248
|
+
□ Identified potential conflicts
|
|
249
|
+
□ Validated assumptions
|
|
250
|
+
□ Considered edge cases
|
|
251
|
+
□ Estimated confidence level
|
|
252
|
+
□ Documented limitations
|
|
253
|
+
□ Prepared alternative options
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 9. Decision Conflict Resolution
|
|
257
|
+
|
|
258
|
+
**Purpose:** Handle contradictory outputs transparently
|
|
259
|
+
|
|
260
|
+
**Implementation:**
|
|
261
|
+
- Explain priority hierarchies
|
|
262
|
+
- Document conflict resolution logic
|
|
263
|
+
- Show why certain decisions override others
|
|
264
|
+
- Make precedence rules explicit
|
|
265
|
+
- Provide rationale for resolution
|
|
266
|
+
|
|
267
|
+
**Conflict Resolution Format:**
|
|
268
|
+
```
|
|
269
|
+
Conflict Detected:
|
|
270
|
+
- Protocol A suggests: Load all content upfront
|
|
271
|
+
- Protocol B suggests: Use lazy loading
|
|
272
|
+
|
|
273
|
+
Priority Hierarchy:
|
|
274
|
+
1. User Experience (reduce cognitive load)
|
|
275
|
+
2. Token Efficiency (minimize context overhead)
|
|
276
|
+
3. Backward Compatibility (don't break existing)
|
|
277
|
+
4. Implementation Simplicity (easier to maintain)
|
|
278
|
+
|
|
279
|
+
Resolution:
|
|
280
|
+
Choose Protocol B (lazy loading)
|
|
281
|
+
|
|
282
|
+
Rationale:
|
|
283
|
+
- Aligns with priorities #1 and #2 (higher priority)
|
|
284
|
+
- No backward compatibility issues (#3 satisfied)
|
|
285
|
+
- Implementation complexity acceptable (#4 trade-off)
|
|
286
|
+
|
|
287
|
+
Confidence: High - Clear priority alignment
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Implementation Guidelines
|
|
291
|
+
|
|
292
|
+
### When to Apply Explainability
|
|
293
|
+
|
|
294
|
+
**Always:**
|
|
295
|
+
- Making recommendations or proposals
|
|
296
|
+
- Handling errors or unexpected behavior
|
|
297
|
+
- Dealing with ambiguous input
|
|
298
|
+
- Making assumptions
|
|
299
|
+
- Choosing between alternatives
|
|
300
|
+
- Explaining complex concepts
|
|
301
|
+
|
|
302
|
+
**Especially Important:**
|
|
303
|
+
- High-stakes decisions (architectural changes, breaking changes)
|
|
304
|
+
- Uncertain situations (incomplete information, ambiguous requirements)
|
|
305
|
+
- Error debugging (understanding what went wrong)
|
|
306
|
+
- Learning opportunities (capturing insights for future)
|
|
307
|
+
|
|
308
|
+
### How to Apply Explainability
|
|
309
|
+
|
|
310
|
+
1. **Before Acting:**
|
|
311
|
+
- Identify what needs explanation
|
|
312
|
+
- Determine appropriate transparency level
|
|
313
|
+
- Choose relevant mechanisms
|
|
314
|
+
|
|
315
|
+
2. **During Execution:**
|
|
316
|
+
- Document reasoning as you go
|
|
317
|
+
- Make assumptions explicit
|
|
318
|
+
- Show decision points
|
|
319
|
+
- Quantify confidence
|
|
320
|
+
|
|
321
|
+
3. **After Completion:**
|
|
322
|
+
- Validate explanations are clear
|
|
323
|
+
- Capture insights and patterns
|
|
324
|
+
- Document for future reference
|
|
325
|
+
|
|
326
|
+
### Integration with Other Protocols
|
|
327
|
+
|
|
328
|
+
**Chit-Chat Protocol:**
|
|
329
|
+
- Use diff blocks for progress tracking
|
|
330
|
+
- Use numbered choices for decision points
|
|
331
|
+
- Maintain single focus per message
|
|
332
|
+
- Apply STOP system for long explanations
|
|
333
|
+
|
|
334
|
+
**Strict Mode:**
|
|
335
|
+
- Increase explainability when STRICT_MODE = ON
|
|
336
|
+
- Provide more detailed reasoning
|
|
337
|
+
- Document all assumptions explicitly
|
|
338
|
+
- Ask clarifying questions proactively
|
|
339
|
+
|
|
340
|
+
**Agent Protocols:**
|
|
341
|
+
- Apply agent-specific explainability patterns
|
|
342
|
+
- Adapt transparency level to agent's domain
|
|
343
|
+
- Use domain-appropriate examples
|
|
344
|
+
- Maintain agent's interaction style
|
|
345
|
+
|
|
346
|
+
## Explainability Patterns Library
|
|
347
|
+
|
|
348
|
+
### Pattern 1: Command Flow Tracing
|
|
349
|
+
|
|
350
|
+
**Use Case:** Explaining how commands execute
|
|
351
|
+
|
|
352
|
+
**Template:**
|
|
353
|
+
```
|
|
354
|
+
Command: {user_input}
|
|
355
|
+
|
|
356
|
+
Execution Flow:
|
|
357
|
+
Step 1: {action}
|
|
358
|
+
├─ {detail}
|
|
359
|
+
├─ {detail}
|
|
360
|
+
└─ {result}
|
|
361
|
+
|
|
362
|
+
Step 2: {action}
|
|
363
|
+
├─ {detail}
|
|
364
|
+
└─ {result}
|
|
365
|
+
|
|
366
|
+
...
|
|
367
|
+
|
|
368
|
+
Result: {final_outcome}
|
|
369
|
+
Files Loaded: {list}
|
|
370
|
+
Context Impact: {token_estimate}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Pattern 2: Protocol Loading Explanation
|
|
374
|
+
|
|
375
|
+
**Use Case:** Explaining why protocols are loaded
|
|
376
|
+
|
|
377
|
+
**Template:**
|
|
378
|
+
```
|
|
379
|
+
Protocol Loaded: {protocol_name}
|
|
380
|
+
|
|
381
|
+
Trigger: {what_caused_loading}
|
|
382
|
+
Purpose: {why_needed}
|
|
383
|
+
Content: {what_it_provides}
|
|
384
|
+
Token Impact: +{tokens}
|
|
385
|
+
Alternative: {if_not_loaded}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Pattern 3: Decision Justification
|
|
389
|
+
|
|
390
|
+
**Use Case:** Explaining why certain improvements are proposed
|
|
391
|
+
|
|
392
|
+
**Template:**
|
|
393
|
+
```
|
|
394
|
+
Recommendation: {proposal}
|
|
395
|
+
Confidence: {level} ({percentage})
|
|
396
|
+
|
|
397
|
+
Analysis:
|
|
398
|
+
- Current State: {description}
|
|
399
|
+
- Issues: {problems_identified}
|
|
400
|
+
- Options: {alternatives_considered}
|
|
401
|
+
- Tradeoffs: {pros_and_cons}
|
|
402
|
+
|
|
403
|
+
Selected Approach: {chosen_option}
|
|
404
|
+
Rationale: {why_chosen}
|
|
405
|
+
Expected Impact: {benefits}
|
|
406
|
+
Risks: {potential_issues}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Pattern 4: Assumption Documentation
|
|
410
|
+
|
|
411
|
+
**Use Case:** Making assumptions explicit
|
|
412
|
+
|
|
413
|
+
**Template:**
|
|
414
|
+
```
|
|
415
|
+
Assumption: {what_is_assumed}
|
|
416
|
+
Basis: {why_assuming}
|
|
417
|
+
Confidence: {level}
|
|
418
|
+
Impact if Wrong: {consequences}
|
|
419
|
+
Validation: {how_to_verify}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Pattern 5: Alternative Analysis
|
|
423
|
+
|
|
424
|
+
**Use Case:** Showing options considered
|
|
425
|
+
|
|
426
|
+
**Template:**
|
|
427
|
+
```
|
|
428
|
+
Options Considered:
|
|
429
|
+
|
|
430
|
+
Option A: {description}
|
|
431
|
+
├─ Pros: {benefits}
|
|
432
|
+
├─ Cons: {drawbacks}
|
|
433
|
+
└─ Confidence: {level}
|
|
434
|
+
|
|
435
|
+
Option B: {description}
|
|
436
|
+
├─ Pros: {benefits}
|
|
437
|
+
├─ Cons: {drawbacks}
|
|
438
|
+
└─ Confidence: {level}
|
|
439
|
+
|
|
440
|
+
Selected: Option {X}
|
|
441
|
+
Reason: {justification}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Pattern 6: Error Context
|
|
445
|
+
|
|
446
|
+
**Use Case:** Providing full context for errors
|
|
447
|
+
|
|
448
|
+
**Template:**
|
|
449
|
+
```
|
|
450
|
+
Error: {error_message}
|
|
451
|
+
|
|
452
|
+
Context:
|
|
453
|
+
- What: {what_was_attempted}
|
|
454
|
+
- Expected: {expected_outcome}
|
|
455
|
+
- Actual: {actual_outcome}
|
|
456
|
+
|
|
457
|
+
Root Cause: {why_it_failed}
|
|
458
|
+
|
|
459
|
+
Recovery Options:
|
|
460
|
+
1. {option_1} - {description}
|
|
461
|
+
2. {option_2} - {description}
|
|
462
|
+
3. {option_3} - {description}
|
|
463
|
+
|
|
464
|
+
Recommendation: {best_option}
|
|
465
|
+
Confidence: {level}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Pattern 7: Impact Estimation
|
|
469
|
+
|
|
470
|
+
**Use Case:** Quantifying expected benefits and costs
|
|
471
|
+
|
|
472
|
+
**Template:**
|
|
473
|
+
```
|
|
474
|
+
Proposal: {change_description}
|
|
475
|
+
|
|
476
|
+
Expected Impact:
|
|
477
|
+
|
|
478
|
+
Benefits:
|
|
479
|
+
- {benefit_1}: {quantification}
|
|
480
|
+
- {benefit_2}: {quantification}
|
|
481
|
+
- {benefit_3}: {quantification}
|
|
482
|
+
|
|
483
|
+
Costs:
|
|
484
|
+
- {cost_1}: {quantification}
|
|
485
|
+
- {cost_2}: {quantification}
|
|
486
|
+
|
|
487
|
+
Net Impact: {overall_assessment}
|
|
488
|
+
Confidence: {level}
|
|
489
|
+
Timeframe: {when_realized}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Pattern 8: Conflict Resolution Transparency
|
|
493
|
+
|
|
494
|
+
**Use Case:** Showing how precedence rules are applied
|
|
495
|
+
|
|
496
|
+
**Template:**
|
|
497
|
+
```
|
|
498
|
+
Conflict: {description}
|
|
499
|
+
|
|
500
|
+
Competing Options:
|
|
501
|
+
- Option A: {description} (from {source})
|
|
502
|
+
- Option B: {description} (from {source})
|
|
503
|
+
|
|
504
|
+
Priority Rules:
|
|
505
|
+
1. {rule_1}
|
|
506
|
+
2. {rule_2}
|
|
507
|
+
3. {rule_3}
|
|
508
|
+
|
|
509
|
+
Resolution: {chosen_option}
|
|
510
|
+
Rationale: {why_based_on_priorities}
|
|
511
|
+
Confidence: {level}
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### Pattern 9: Uncertainty Handling
|
|
515
|
+
|
|
516
|
+
**Use Case:** Asking clarifying questions when ambiguous
|
|
517
|
+
|
|
518
|
+
**Template:**
|
|
519
|
+
```
|
|
520
|
+
Ambiguity Detected: {what_is_unclear}
|
|
521
|
+
|
|
522
|
+
Possible Interpretations:
|
|
523
|
+
1. {interpretation_1}
|
|
524
|
+
2. {interpretation_2}
|
|
525
|
+
3. {interpretation_3}
|
|
526
|
+
|
|
527
|
+
Clarifying Questions:
|
|
528
|
+
1. {question_1}
|
|
529
|
+
2. {question_2}
|
|
530
|
+
|
|
531
|
+
Once clarified, I can: {what_will_do_next}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### Pattern 10: Insight Capture
|
|
535
|
+
|
|
536
|
+
**Use Case:** Documenting brilliant suggestions
|
|
537
|
+
|
|
538
|
+
**Template:**
|
|
539
|
+
```
|
|
540
|
+
Insight: {insight_title}
|
|
541
|
+
|
|
542
|
+
Context: {when_discovered}
|
|
543
|
+
|
|
544
|
+
Discovery:
|
|
545
|
+
{what_was_learned}
|
|
546
|
+
|
|
547
|
+
Pattern:
|
|
548
|
+
{generalizable_pattern}
|
|
549
|
+
|
|
550
|
+
Applications:
|
|
551
|
+
- {use_case_1}
|
|
552
|
+
- {use_case_2}
|
|
553
|
+
- {use_case_3}
|
|
554
|
+
|
|
555
|
+
Confidence: {level}
|
|
556
|
+
Value: {why_important}
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
## Integration Instructions
|
|
560
|
+
|
|
561
|
+
### For Agent Definitions
|
|
562
|
+
|
|
563
|
+
Add to **Mandatory Protocols** section:
|
|
564
|
+
|
|
565
|
+
```markdown
|
|
566
|
+
### N. Explainability & Transparency
|
|
567
|
+
|
|
568
|
+
**Rule:** Make all reasoning, decisions, and assumptions transparent
|
|
569
|
+
|
|
570
|
+
**Rationale:** Users need to understand and trust AI decisions; transparent reasoning enables debugging and learning
|
|
571
|
+
|
|
572
|
+
**Implementation:**
|
|
573
|
+
/only-read-protocols explainability-protocol.md
|
|
574
|
+
|
|
575
|
+
Apply transparency mechanisms from the protocol:
|
|
576
|
+
- Document reasoning steps
|
|
577
|
+
- Quantify confidence levels
|
|
578
|
+
- Make assumptions explicit
|
|
579
|
+
- Show alternatives considered
|
|
580
|
+
- Provide error context
|
|
581
|
+
- Capture insights
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
### For Steering Documents
|
|
585
|
+
|
|
586
|
+
Reference when explainability is needed:
|
|
587
|
+
|
|
588
|
+
```markdown
|
|
589
|
+
For transparent decision-making, load explainability protocol:
|
|
590
|
+
/only-read-protocols explainability-protocol.md
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### For Workflows
|
|
594
|
+
|
|
595
|
+
Integrate explainability steps:
|
|
596
|
+
|
|
597
|
+
```markdown
|
|
598
|
+
### Workflow: {Name}
|
|
599
|
+
|
|
600
|
+
**Steps:**
|
|
601
|
+
|
|
602
|
+
1. {Step 1}
|
|
603
|
+
- Apply explainability: Document reasoning
|
|
604
|
+
|
|
605
|
+
2. {Step 2}
|
|
606
|
+
- Apply explainability: Quantify confidence
|
|
607
|
+
|
|
608
|
+
3. {Step 3}
|
|
609
|
+
- Apply explainability: Show alternatives
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
## Success Metrics
|
|
613
|
+
|
|
614
|
+
Explainability is successful when:
|
|
615
|
+
|
|
616
|
+
- **Reasoning is transparent** - Users can follow decision paths
|
|
617
|
+
- **Confidence is appropriate** - Certainty levels match actual reliability
|
|
618
|
+
- **Errors are debuggable** - Users can understand and fix issues
|
|
619
|
+
- **Assumptions are explicit** - No hidden assumptions or implicit logic
|
|
620
|
+
- **Alternatives are explained** - Users understand why certain options were chosen
|
|
621
|
+
- **Trust is built** - Users feel confident in AI recommendations
|
|
622
|
+
- **Learning occurs** - Insights are captured and applied to future interactions
|
|
623
|
+
|
|
624
|
+
## Notes
|
|
625
|
+
|
|
626
|
+
- This protocol can be loaded on-demand when explainability is needed
|
|
627
|
+
- Reduces token overhead by avoiding duplication across agents
|
|
628
|
+
- Provides consistent explainability patterns across all agents
|
|
629
|
+
- Can be updated once to improve all agents using it
|
|
630
|
+
- Works alongside chit-chat, strict mode, and agent-specific protocols
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kiro-agents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Advanced AI agent system for Kiro IDE - Create specialized AI agents, switch interaction modes, and enhance development workflows with minimal cognitive overhead",
|
|
5
5
|
"homepage": "https://github.com/Theadd/kiro-agents#readme",
|
|
6
6
|
"repository": {
|