x-ipe 1.0.23__py3-none-any.whl → 1.0.25__py3-none-any.whl

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.
Files changed (146) hide show
  1. x_ipe/app.py +32 -1
  2. x_ipe/handlers/terminal_handlers.py +6 -0
  3. x_ipe/handlers/voice_handlers.py +5 -0
  4. x_ipe/resources/copilot-instructions.md +19 -6
  5. x_ipe/resources/skills/lesson-learned/SKILL.md +208 -0
  6. x_ipe/resources/skills/lesson-learned/references/examples.md +238 -0
  7. x_ipe/resources/skills/project-quality-board-management/SKILL.md +135 -298
  8. x_ipe/resources/skills/project-quality-board-management/references/evaluation-principles.md +213 -0
  9. x_ipe/resources/skills/project-quality-board-management/references/evaluation-procedures.md +214 -0
  10. x_ipe/resources/skills/project-quality-board-management/templates/quality-report.md +70 -18
  11. x_ipe/resources/skills/task-execution-guideline/SKILL.md +2 -2
  12. x_ipe/resources/skills/task-execution-guideline/templates/task-record.yaml +1 -1
  13. x_ipe/resources/skills/task-type-code-implementation/SKILL.md +72 -270
  14. x_ipe/resources/skills/task-type-code-implementation/references/implementation-guidelines.md +432 -0
  15. x_ipe/resources/skills/task-type-code-refactor-v2/SKILL.md +127 -353
  16. x_ipe/resources/skills/task-type-code-refactor-v2/references/refactoring-techniques.md +373 -0
  17. x_ipe/resources/skills/task-type-feature-breakdown/SKILL.md +31 -243
  18. x_ipe/resources/skills/task-type-feature-breakdown/references/breakdown-guidelines.md +330 -0
  19. x_ipe/resources/skills/task-type-feature-refinement/SKILL.md +27 -180
  20. x_ipe/resources/skills/task-type-feature-refinement/references/specification-writing-guide.md +267 -0
  21. x_ipe/resources/skills/task-type-idea-mockup/SKILL.md +38 -276
  22. x_ipe/resources/skills/task-type-idea-mockup/references/mockup-guidelines.md +299 -0
  23. x_ipe/resources/skills/task-type-idea-to-architecture/SKILL.md +20 -218
  24. x_ipe/resources/skills/task-type-idea-to-architecture/references/architecture-patterns.md +342 -0
  25. x_ipe/resources/skills/task-type-ideation/SKILL.md +10 -266
  26. x_ipe/resources/skills/task-type-ideation/references/folder-naming-guide.md +55 -0
  27. x_ipe/resources/skills/task-type-ideation/references/tool-usage-guide.md +236 -0
  28. x_ipe/resources/skills/task-type-ideation-v2/SKILL.md +488 -0
  29. x_ipe/resources/skills/task-type-ideation-v2/references/examples.md +377 -0
  30. x_ipe/resources/skills/task-type-ideation-v2/references/folder-naming-guide.md +74 -0
  31. x_ipe/resources/skills/task-type-ideation-v2/references/tool-usage-guide.md +145 -0
  32. x_ipe/resources/skills/task-type-ideation-v2/references/visualization-guide.md +160 -0
  33. x_ipe/resources/skills/task-type-ideation-v2/templates/idea-summary.md +86 -0
  34. x_ipe/resources/skills/task-type-refactoring-analysis/SKILL.md +83 -145
  35. x_ipe/resources/skills/task-type-refactoring-analysis/references/output-schema.md +172 -0
  36. x_ipe/resources/skills/task-type-technical-design/SKILL.md +28 -214
  37. x_ipe/resources/skills/task-type-technical-design/references/design-templates.md +422 -0
  38. x_ipe/resources/skills/task-type-test-generation/SKILL.md +47 -332
  39. x_ipe/resources/skills/task-type-test-generation/references/test-patterns.md +368 -0
  40. x_ipe/resources/skills/tool-tracing-creator/SKILL.md +312 -0
  41. x_ipe/resources/skills/tool-tracing-creator/references/examples.md +324 -0
  42. x_ipe/resources/skills/tool-tracing-instrumentation/SKILL.md +373 -0
  43. x_ipe/resources/skills/tool-tracing-instrumentation/references/examples.md +264 -0
  44. x_ipe/resources/skills/x-ipe-skill-creator-v3/SKILL.md +486 -0
  45. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/10. example-gate-conditions.md +73 -0
  46. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/11. reference-quality-standards.md +127 -0
  47. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/2. reference-section-order.md +127 -0
  48. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/3. example-step-based-code-review.md +84 -0
  49. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/4. example-step-based-feature-implementation.md +113 -0
  50. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/5. example-function-based-validation.md +73 -0
  51. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/6. example-function-based-analysis.md +94 -0
  52. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/7. example-task-io-code-implementation.md +36 -0
  53. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/8. example-structured-summary.md +43 -0
  54. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/9. example-dor-dod.md +77 -0
  55. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/examples.md +429 -0
  56. x_ipe/resources/skills/x-ipe-skill-creator-v3/references/skill-general-guidelines-v2.md +611 -0
  57. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-meta.md +153 -0
  58. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-task-based.md +324 -0
  59. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-task-category.md +109 -0
  60. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/skill-meta-x-ipe-tool.md +205 -0
  61. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-meta.md +334 -0
  62. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-task-based.md +279 -0
  63. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-tool.md +175 -0
  64. x_ipe/resources/skills/x-ipe-skill-creator-v3/templates/x-ipe-workflow-orchestration.md +329 -0
  65. x_ipe/resources/skills/x-ipe-task-based-ideation/SKILL.md +487 -0
  66. x_ipe/resources/skills/x-ipe-task-based-ideation/references/examples.md +377 -0
  67. x_ipe/resources/skills/x-ipe-task-based-ideation/references/folder-naming-guide.md +74 -0
  68. x_ipe/resources/skills/x-ipe-task-based-ideation/references/tool-usage-guide.md +145 -0
  69. x_ipe/resources/skills/x-ipe-task-based-ideation/references/visualization-guide.md +160 -0
  70. x_ipe/resources/skills/x-ipe-task-based-ideation/templates/idea-summary.md +86 -0
  71. x_ipe/routes/__init__.py +2 -0
  72. x_ipe/routes/ideas_routes.py +289 -0
  73. x_ipe/routes/kb_routes.py +80 -0
  74. x_ipe/routes/main_routes.py +18 -0
  75. x_ipe/routes/project_routes.py +7 -0
  76. x_ipe/routes/proxy_routes.py +10 -2
  77. x_ipe/routes/quality_evaluation_routes.py +193 -0
  78. x_ipe/routes/settings_routes.py +6 -0
  79. x_ipe/routes/tools_routes.py +6 -0
  80. x_ipe/routes/tracing_routes.py +232 -0
  81. x_ipe/routes/uiux_feedback_routes.py +50 -0
  82. x_ipe/services/__init__.py +5 -0
  83. x_ipe/services/config_service.py +6 -0
  84. x_ipe/services/file_service.py +20 -0
  85. x_ipe/services/homepage_service.py +160 -0
  86. x_ipe/services/ideas_service.py +535 -2
  87. x_ipe/services/kb_service.py +378 -0
  88. x_ipe/services/proxy_service.py +37 -7
  89. x_ipe/services/settings_service.py +13 -0
  90. x_ipe/services/skills_service.py +4 -0
  91. x_ipe/services/terminal_service.py +24 -0
  92. x_ipe/services/themes_service.py +4 -0
  93. x_ipe/services/tools_config_service.py +4 -0
  94. x_ipe/services/tracing_service.py +333 -0
  95. x_ipe/services/uiux_feedback_service.py +148 -1
  96. x_ipe/services/voice_input_service_v2.py +11 -0
  97. x_ipe/static/css/base.css +7 -0
  98. x_ipe/static/css/homepage-infinity.css +330 -0
  99. x_ipe/static/css/kb-core.css +301 -0
  100. x_ipe/static/css/quality-evaluation.css +345 -0
  101. x_ipe/static/css/sidebar.css +14 -4
  102. x_ipe/static/css/terminal.css +23 -0
  103. x_ipe/static/css/tracing-dashboard.css +796 -0
  104. x_ipe/static/css/uiux-feedback.css +7 -1
  105. x_ipe/static/css/workplace.css +636 -0
  106. x_ipe/static/img/homepage-infinity-loop.png +0 -0
  107. x_ipe/static/js/features/confirm-dialog.js +169 -0
  108. x_ipe/static/js/features/folder-view.js +742 -0
  109. x_ipe/static/js/features/homepage-infinity.js +314 -0
  110. x_ipe/static/js/features/kb-core.js +371 -0
  111. x_ipe/static/js/features/quality-evaluation.js +387 -0
  112. x_ipe/static/js/features/sidebar.js +255 -12
  113. x_ipe/static/js/features/tracing-dashboard.js +855 -0
  114. x_ipe/static/js/features/tracing-graph.js +1031 -0
  115. x_ipe/static/js/features/tree-drag.js +227 -0
  116. x_ipe/static/js/features/tree-search.js +228 -0
  117. x_ipe/static/js/features/workplace.js +661 -33
  118. x_ipe/static/js/init.js +76 -0
  119. x_ipe/static/js/terminal-v2.js +45 -14
  120. x_ipe/static/js/terminal.js +50 -49
  121. x_ipe/static/js/uiux-feedback.js +75 -16
  122. x_ipe/templates/base.html +24 -0
  123. x_ipe/templates/index.html +10 -1
  124. x_ipe/templates/knowledge-base.html +110 -0
  125. x_ipe/templates/workplace.html +4 -0
  126. x_ipe/tracing/__init__.py +37 -0
  127. x_ipe/tracing/buffer.py +135 -0
  128. x_ipe/tracing/context.py +125 -0
  129. x_ipe/tracing/decorator.py +288 -0
  130. x_ipe/tracing/middleware.py +197 -0
  131. x_ipe/tracing/parser.py +235 -0
  132. x_ipe/tracing/redactor.py +111 -0
  133. x_ipe/tracing/writer.py +122 -0
  134. {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/METADATA +2 -2
  135. {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/RECORD +138 -65
  136. x_ipe/app.py.bak +0 -1333
  137. x_ipe/resources/skills/x-ipe-skill-creator/SKILL.md +0 -329
  138. x_ipe/resources/skills/x-ipe-skill-creator/references/output-patterns.md +0 -169
  139. x_ipe/resources/skills/x-ipe-skill-creator/references/skill-structure.md +0 -162
  140. x_ipe/resources/skills/x-ipe-skill-creator/references/workflows.md +0 -110
  141. x_ipe/resources/skills/x-ipe-skill-creator/templates/references/examples.md +0 -113
  142. x_ipe/resources/skills/x-ipe-skill-creator/templates/skill-category-skill.md +0 -296
  143. x_ipe/resources/skills/x-ipe-skill-creator/templates/task-type-skill.md +0 -269
  144. {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/WHEEL +0 -0
  145. {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/entry_points.txt +0 -0
  146. {x_ipe-1.0.23.dist-info → x_ipe-1.0.25.dist-info}/licenses/LICENSE +0 -0
x_ipe/app.py CHANGED
@@ -126,12 +126,40 @@ def _init_services(app):
126
126
  if saved_root and saved_root != '.' and not app.config.get('TESTING'):
127
127
  if os.path.exists(saved_root) and os.path.isdir(saved_root):
128
128
  app.config['PROJECT_ROOT'] = saved_root
129
+
130
+ # Cleanup old UIUX feedback on startup (TASK-237)
131
+ if not app.config.get('TESTING'):
132
+ project_root = app.config.get('PROJECT_ROOT', '.')
133
+ from x_ipe.services.uiux_feedback_service import UiuxFeedbackService
134
+
135
+ # Read retention days from tools.json (default 7)
136
+ retention_days = 7
137
+ tools_json_path = Path(project_root) / 'x-ipe-docs' / 'config' / 'tools.json'
138
+ if tools_json_path.exists():
139
+ try:
140
+ import json
141
+ with open(tools_json_path) as f:
142
+ tools_config = json.load(f)
143
+ retention_days = tools_config.get('feedback_retention_days', 7)
144
+ except (json.JSONDecodeError, IOError):
145
+ pass
146
+
147
+ feedback_service = UiuxFeedbackService(project_root)
148
+ deleted = feedback_service.cleanup_old_feedback(days=retention_days)
149
+ if deleted > 0:
150
+ print(f"[X-IPE] Cleaned up {deleted} old feedback entries (retention: {retention_days} days)")
129
151
 
130
152
 
131
153
  def _register_blueprints(app):
132
154
  """Register all Flask Blueprints."""
133
- from x_ipe.routes import main_bp, settings_bp, project_bp, ideas_bp, tools_bp, proxy_bp
155
+ from x_ipe.routes import main_bp, settings_bp, project_bp, ideas_bp, tools_bp, proxy_bp, kb_bp
134
156
  from x_ipe.routes.uiux_feedback_routes import uiux_feedback_bp
157
+ from x_ipe.routes.tracing_routes import tracing_bp
158
+ from x_ipe.routes.quality_evaluation_routes import quality_evaluation_bp
159
+
160
+ # Initialize tracing middleware (FEATURE-023)
161
+ from x_ipe.tracing.middleware import init_tracing_middleware
162
+ init_tracing_middleware(app)
135
163
 
136
164
  app.register_blueprint(main_bp)
137
165
  app.register_blueprint(settings_bp)
@@ -140,6 +168,9 @@ def _register_blueprints(app):
140
168
  app.register_blueprint(tools_bp)
141
169
  app.register_blueprint(proxy_bp)
142
170
  app.register_blueprint(uiux_feedback_bp)
171
+ app.register_blueprint(tracing_bp)
172
+ app.register_blueprint(quality_evaluation_bp)
173
+ app.register_blueprint(kb_bp)
143
174
 
144
175
 
145
176
  def _register_handlers():
@@ -11,6 +11,7 @@ Provides WebSocket handlers for:
11
11
  from flask import request
12
12
 
13
13
  from x_ipe.services import session_manager
14
+ from x_ipe.tracing import x_ipe_tracing
14
15
 
15
16
  # Socket SID to Session ID mapping
16
17
  socket_to_session = {}
@@ -20,12 +21,14 @@ def register_terminal_handlers(socketio):
20
21
  """Register WebSocket event handlers for terminal."""
21
22
 
22
23
  @socketio.on('connect')
24
+ @x_ipe_tracing()
23
25
  def handle_connect():
24
26
  """Handle new WebSocket connection."""
25
27
  sid = request.sid
26
28
  print(f"[Terminal] Client connected: {sid}")
27
29
 
28
30
  @socketio.on('attach')
31
+ @x_ipe_tracing()
29
32
  def handle_attach(data):
30
33
  """
31
34
  Handle session attachment.
@@ -75,6 +78,7 @@ def register_terminal_handlers(socketio):
75
78
  socketio.emit('error', {'message': 'Failed to attach terminal session'}, room=sid)
76
79
 
77
80
  @socketio.on('disconnect')
81
+ @x_ipe_tracing()
78
82
  def handle_disconnect():
79
83
  """Handle WebSocket disconnection - keep session alive."""
80
84
  try:
@@ -91,6 +95,7 @@ def register_terminal_handlers(socketio):
91
95
  print(f"[Terminal] Error in disconnect handler: {e}")
92
96
 
93
97
  @socketio.on('input')
98
+ @x_ipe_tracing()
94
99
  def handle_input(data):
95
100
  """Forward input to PTY."""
96
101
  try:
@@ -105,6 +110,7 @@ def register_terminal_handlers(socketio):
105
110
  print(f"[Terminal] Error in input handler: {e}")
106
111
 
107
112
  @socketio.on('resize')
113
+ @x_ipe_tracing()
108
114
  def handle_resize(data):
109
115
  """Handle terminal resize."""
110
116
  try:
@@ -14,6 +14,7 @@ from flask import request
14
14
  from flask_socketio import emit
15
15
 
16
16
  from x_ipe.services.voice_input_service_v2 import VoiceInputService, is_voice_command
17
+ from x_ipe.tracing import x_ipe_tracing
17
18
 
18
19
  # Global voice service instance
19
20
  voice_service = None
@@ -35,6 +36,7 @@ def register_voice_handlers(socketio):
35
36
  print("[Voice] No ALIBABA_SPEECH_API_KEY found, voice input disabled")
36
37
 
37
38
  @socketio.on('voice_start')
39
+ @x_ipe_tracing()
38
40
  def handle_voice_start(data=None):
39
41
  """Handle voice recording start request."""
40
42
  global voice_service
@@ -77,6 +79,7 @@ def register_voice_handlers(socketio):
77
79
  emit('voice_error', {'message': str(e)})
78
80
 
79
81
  @socketio.on('voice_audio')
82
+ @x_ipe_tracing()
80
83
  def handle_voice_audio(data):
81
84
  """Handle incoming audio chunk from client."""
82
85
  global voice_service
@@ -103,6 +106,7 @@ def register_voice_handlers(socketio):
103
106
  emit('voice_error', {'message': f'Audio error: {e}'})
104
107
 
105
108
  @socketio.on('voice_stop')
109
+ @x_ipe_tracing()
106
110
  def handle_voice_stop(data=None):
107
111
  """Handle voice recording stop request - finalize and get transcription."""
108
112
  global voice_service
@@ -151,6 +155,7 @@ def register_voice_handlers(socketio):
151
155
  emit('voice_error', {'message': str(e)})
152
156
 
153
157
  @socketio.on('voice_cancel')
158
+ @x_ipe_tracing()
154
159
  def handle_voice_cancel(data=None):
155
160
  """Handle voice recording cancel request - abort without transcription."""
156
161
  global voice_service
@@ -65,7 +65,7 @@
65
65
 
66
66
  | Task Type | Skill | Category | Next Task | Human Review (default) |
67
67
  |-----------|-------|----------|-----------|------------------------|
68
- | Ideation | `task-type-ideation` | ideation-stage | Idea Mockup OR Idea to Architecture | No |
68
+ | Ideation | `x-ipe-task-based-ideation` | ideation-stage | Idea Mockup OR Idea to Architecture | No |
69
69
  | Idea Mockup | `task-type-idea-mockup` | ideation-stage | Requirement Gathering | No |
70
70
  | Idea to Architecture | `task-type-idea-to-architecture` | ideation-stage | Requirement Gathering | No |
71
71
  | Share Idea | `task-type-share-idea` | Standalone | - | Yes |
@@ -151,15 +151,28 @@ Always follow:
151
151
  ### Creating, Updating, or Validating X-IPE Skills
152
152
 
153
153
  **When:** Creating a new skill, updating an existing skill, or validating skill structure
154
- **Then:** Always use the `x-ipe-skill-creator` skill
154
+ **Then:** Always use the `x-ipe-skill-creator-v3` skill
155
155
 
156
156
  ```
157
- 1. Load skill: `x-ipe-skill-creator`
157
+ 1. Load skill: `x-ipe-skill-creator-v3`
158
158
  2. Follow the skill creation process defined in the skill
159
159
  3. Use appropriate template based on skill type:
160
- - Task Type → templates/task-type-skill.md
161
- - Skill Category → templates/skill-category-skill.md
162
- - Tool SkillTBD
160
+ - Task Type → templates/x-ipe-task-based.md
161
+ - Tool Skill → templates/x-ipe-tool.md
162
+ - Workflow Orchestrationtemplates/x-ipe-workflow-orchestration.md
163
+ - Meta Skill → templates/x-ipe-meta.md
163
164
  4. Validate against skill-creator checklist before completing
164
165
  ```
165
166
 
167
+ ### Capturing Lessons for Skill Improvement
168
+
169
+ **When:** A skill execution has problems, human provides feedback, or agent observes suboptimal behavior
170
+ **Then:** Use the `lesson-learned` skill
171
+
172
+ ```
173
+ 1. Load skill: `lesson-learned`
174
+ 2. Follow the lesson capture process
175
+ 3. Lessons are stored in x-ipe-docs/skill-meta/{skill}/lesson-learned.md
176
+ 4. Next time skill is updated, lessons will be incorporated
177
+ ```
178
+
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: lesson-learned
3
+ description: Capture issues and feedback for skill improvement. Use when a skill execution had problems, human provides feedback, or agent observes suboptimal behavior. Triggers on requests like "capture lesson", "record issue", "this skill failed", "improve this skill". Records lessons in x-ipe-docs/skill-meta/{skill}/lesson-learned.md for future skill updates.
4
+ ---
5
+
6
+ # Lesson Learned
7
+
8
+ Capture issues and feedback to improve skills over time.
9
+
10
+ ## Purpose
11
+
12
+ This skill captures issues, errors, and feedback for specific skills by:
13
+ 1. Identifying which skill had the issue
14
+ 2. Analyzing what went wrong
15
+ 3. Documenting the correct behavior (ground truth)
16
+ 4. Recording a structured lesson for future skill updates
17
+
18
+ ---
19
+
20
+ ## Important Notes
21
+
22
+ - **Manual trigger only** (for now) - human must say "capture lesson" or similar
23
+ - Lessons are stored per-skill in `x-ipe-docs/skill-meta/{skill-name}/lesson-learned.md`
24
+ - Lessons are consumed by `x-ipe-skill-creator` when updating skills
25
+ - Ground truth is critical - always capture what the correct output should be
26
+
27
+ ---
28
+
29
+ ## Execution Flow
30
+
31
+ | Step | Action | Output |
32
+ |------|--------|--------|
33
+ | 1 | Identify skill | Skill name that had the issue |
34
+ | 2 | Gather context | Task ID, scenario, inputs |
35
+ | 3 | Document issue | Observed vs expected behavior |
36
+ | 4 | Capture ground truth | Correct output (after manual fix) |
37
+ | 5 | Propose improvement | Suggested AC or instruction change |
38
+ | 6 | Save lesson | lesson-learned.md updated |
39
+
40
+ ---
41
+
42
+ ## Execution Procedure
43
+
44
+ ### Step 1: Identify Skill
45
+
46
+ Determine which skill had the issue:
47
+
48
+ ```
49
+ 1. Ask: "Which skill had the issue?"
50
+ - If context clear: extract skill name
51
+ - If unclear: ask user to specify
52
+
53
+ 2. Verify skill exists:
54
+ - Check .github/skills/{skill-name}/
55
+ - If not exists: abort with error
56
+
57
+ 3. Check/create skill-meta folder:
58
+ - If x-ipe-docs/skill-meta/{skill-name}/ not exists: create it
59
+ ```
60
+
61
+ ### Step 2: Gather Context
62
+
63
+ Collect information about when the issue occurred:
64
+
65
+ ```yaml
66
+ context:
67
+ task_id: "{TASK-ID if available}"
68
+ scenario: "{What was being done}"
69
+ inputs: "{What inputs were provided to the skill}"
70
+ skill_version: "{Current skill version if known}"
71
+ ```
72
+
73
+ ### Step 3: Document Issue
74
+
75
+ Record what went wrong:
76
+
77
+ ```yaml
78
+ observed_behavior: |
79
+ {What the skill actually did}
80
+ - Include actual output if available
81
+ - Include error messages if any
82
+
83
+ expected_behavior: |
84
+ {What the skill should have done}
85
+ - Be specific about correct behavior
86
+ ```
87
+
88
+ ### Step 4: Capture Ground Truth
89
+
90
+ **Critical step** - This becomes the test case for validation:
91
+
92
+ ```
93
+ 1. Ask: "What should the correct output look like?"
94
+
95
+ 2. If human provides correction:
96
+ - Record exactly as provided
97
+
98
+ 3. If human fixed output manually:
99
+ - Reference the fixed file path
100
+ - Record the key differences
101
+
102
+ 4. If unclear:
103
+ - Ask clarifying questions
104
+ - Do NOT proceed without ground truth
105
+ ```
106
+
107
+ ### Step 5: Propose Improvement
108
+
109
+ Suggest how to improve the skill:
110
+
111
+ | Improvement Type | When to Use | Target |
112
+ |------------------|-------------|--------|
113
+ | `new_ac` | Issue reveals missing requirement | Add to skill-meta acceptance_criteria |
114
+ | `update_ac` | Existing AC is incomplete | Modify specific AC |
115
+ | `update_instruction` | Skill procedure unclear | SKILL.md section |
116
+ | `add_example` | Edge case not covered | references/examples.md |
117
+
118
+ ### Step 6: Save Lesson
119
+
120
+ Append to or create lesson-learned.md:
121
+
122
+ ```
123
+ 1. Read template: x-ipe-docs/skill-meta/templates/lesson-learned.md
124
+ 2. Generate unique lesson ID: LL-{NNN}
125
+ 3. Create lesson entry with:
126
+ - status: raw
127
+ - All gathered information
128
+ 4. Append to x-ipe-docs/skill-meta/{skill-name}/lesson-learned.md
129
+ 5. If file didn't exist: create with YAML frontmatter
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Definition of Done
135
+
136
+ | Checkpoint | Required |
137
+ |------------|----------|
138
+ | Skill identified and verified | Yes |
139
+ | Context documented | Yes |
140
+ | Issue described (observed vs expected) | Yes |
141
+ | Ground truth captured | Yes |
142
+ | Improvement proposed | Yes |
143
+ | Lesson saved to lesson-learned.md | Yes |
144
+
145
+ ---
146
+
147
+ ## Patterns
148
+
149
+ ### Pattern: Error During Execution
150
+
151
+ **When:** Skill threw an error or failed
152
+ **Then:**
153
+ ```
154
+ 1. Capture error message/stack trace
155
+ 2. Document what operation caused the error
156
+ 3. Record expected behavior: "Should complete without error"
157
+ 4. Propose: update_instruction to handle edge case
158
+ ```
159
+
160
+ ### Pattern: Wrong Output Format
161
+
162
+ **When:** Skill produced output but format was wrong
163
+ **Then:**
164
+ ```
165
+ 1. Save actual output (or screenshot/snippet)
166
+ 2. Show expected format
167
+ 3. Record ground truth with correct format
168
+ 4. Propose: new_ac for format validation
169
+ ```
170
+
171
+ ### Pattern: Missing Content
172
+
173
+ **When:** Skill output was incomplete
174
+ **Then:**
175
+ ```
176
+ 1. List what was missing
177
+ 2. Provide complete expected content
178
+ 3. Record ground truth with all content
179
+ 4. Propose: update_ac to require missing content
180
+ ```
181
+
182
+ ### Pattern: Human Feedback
183
+
184
+ **When:** Human says "this is wrong" or provides feedback
185
+ **Then:**
186
+ ```
187
+ 1. Ask: "What specifically is wrong?"
188
+ 2. Ask: "What should it be instead?"
189
+ 3. Record feedback as ground truth
190
+ 4. Propose improvement based on feedback
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Anti-Patterns
196
+
197
+ | Anti-Pattern | Why Bad | Do Instead |
198
+ |--------------|---------|------------|
199
+ | Recording without ground truth | Can't generate valid tests | Always capture correct output |
200
+ | Vague issue description | Hard to fix skill | Be specific about observed vs expected |
201
+ | Not linking to task ID | Lose context | Always include TASK-ID if available |
202
+ | Skipping severity | Can't prioritize | Always assign critical/major/minor/enhancement |
203
+
204
+ ---
205
+
206
+ ## Example
207
+
208
+ See [references/examples.md](references/examples.md) for execution examples.
@@ -0,0 +1,238 @@
1
+ # Lesson Learned Examples
2
+
3
+ ## Example 1: Skill Error During Execution
4
+
5
+ **Trigger:** "The technical design skill failed with an error"
6
+
7
+ ```
8
+ Step 1: Identify Skill
9
+ → skill_name: task-type-technical-design
10
+ → Verified: .github/skills/task-type-technical-design/ exists
11
+ → Created: x-ipe-docs/skill-meta/task-type-technical-design/
12
+
13
+ Step 2: Gather Context
14
+ → context:
15
+ task_id: TASK-150
16
+ scenario: Creating technical design for FEATURE-025
17
+ inputs: feature_id=FEATURE-025
18
+
19
+ Step 3: Document Issue
20
+ → observed_behavior: |
21
+ Skill threw error at step 3:
22
+ "KeyError: 'acceptance_criteria' not found in specification.md"
23
+
24
+ → expected_behavior: |
25
+ Skill should handle missing acceptance_criteria gracefully
26
+ or use feature requirements as fallback.
27
+
28
+ Step 4: Capture Ground Truth
29
+ → ground_truth: |
30
+ When specification.md lacks acceptance_criteria section:
31
+ 1. Log warning: "No acceptance_criteria found"
32
+ 2. Fall back to requirements from feature-board
33
+ 3. Continue with design using requirements as criteria
34
+
35
+ Step 5: Propose Improvement
36
+ → proposed_improvement:
37
+ type: update_instruction
38
+ target: "Execution Procedure Step 3"
39
+ description: "Add fallback handling for missing acceptance_criteria"
40
+
41
+ → proposed_ac:
42
+ should:
43
+ - id: AC-NEW
44
+ description: "Handles missing specification sections gracefully"
45
+ test_method: error_handling
46
+ expected: "Falls back to feature requirements without error"
47
+
48
+ Step 6: Save Lesson
49
+ → Created: x-ipe-docs/skill-meta/task-type-technical-design/lesson-learned.md
50
+ → Added lesson: LL-001
51
+ → status: raw
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Example 2: Wrong Output Format
57
+
58
+ **Trigger:** "The requirement gathering output doesn't follow the template"
59
+
60
+ ```
61
+ Step 1: Identify Skill
62
+ → skill_name: task-type-requirement-gathering
63
+ → Verified exists
64
+
65
+ Step 2: Gather Context
66
+ → context:
67
+ task_id: TASK-155
68
+ scenario: Gathering requirements for new feature request
69
+ inputs: User request about "add dark mode support"
70
+
71
+ Step 3: Document Issue
72
+ → observed_behavior: |
73
+ Output file requirement-details.md:
74
+ - Missing "Constraints" section
75
+ - "Success Criteria" section has wrong format (bullets instead of checkboxes)
76
+ - No version header
77
+
78
+ → expected_behavior: |
79
+ Output should match template exactly:
80
+ - All sections present
81
+ - Checkboxes for success criteria (- [ ] format)
82
+ - Version header at top
83
+
84
+ Step 4: Capture Ground Truth
85
+ → ground_truth: |
86
+ Correct requirement-details.md structure:
87
+
88
+ # Requirement: {title}
89
+ > Version: 1.0.0
90
+ > Status: Draft
91
+
92
+ ## Overview
93
+ {description}
94
+
95
+ ## Success Criteria
96
+ - [ ] Criterion 1
97
+ - [ ] Criterion 2
98
+
99
+ ## Constraints
100
+ - Constraint 1
101
+ - Constraint 2
102
+
103
+ Step 5: Propose Improvement
104
+ → proposed_improvement:
105
+ type: new_ac
106
+ target: acceptance_criteria.must
107
+ description: "Require template structure validation"
108
+
109
+ → proposed_ac:
110
+ must:
111
+ - id: AC-NEW
112
+ description: "Output follows requirement-details.md template structure"
113
+ test_method: structure_validation
114
+ expected: "All sections present, correct formatting"
115
+
116
+ Step 6: Save Lesson
117
+ → Updated: lesson-learned.md
118
+ → Added lesson: LL-002
119
+ → severity: major
120
+ → status: raw
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Example 3: Human Feedback
126
+
127
+ **Trigger:** "This technical design is missing error handling - please capture that as a lesson"
128
+
129
+ ```
130
+ Step 1: Identify Skill
131
+ → Inferred from context: task-type-technical-design
132
+ → Confirmed with user
133
+
134
+ Step 2: Gather Context
135
+ → context:
136
+ task_id: TASK-160
137
+ scenario: Technical design for API integration feature
138
+ inputs: FEATURE-030
139
+
140
+ Step 3: Document Issue
141
+ → observed_behavior: |
142
+ Technical design document has no Error Handling section.
143
+
144
+ → expected_behavior: |
145
+ Technical design should include Error Handling section
146
+ documenting expected exceptions and recovery strategies.
147
+
148
+ Step 4: Capture Ground Truth
149
+ → Asked: "What should the Error Handling section contain?"
150
+ → Human response: "List of expected exceptions, recovery strategies, fallback behaviors"
151
+
152
+ → ground_truth: |
153
+ Technical design must include ## Error Handling section with:
154
+ - Table of expected exceptions
155
+ - Recovery strategy for each
156
+ - Fallback behaviors
157
+ - Logging requirements
158
+
159
+ Example:
160
+ | Exception | Recovery | Fallback |
161
+ |-----------|----------|----------|
162
+ | ConnectionError | Retry 3x | Use cached data |
163
+ | TimeoutError | Retry with backoff | Return partial result |
164
+
165
+ Step 5: Propose Improvement
166
+ → proposed_improvement:
167
+ type: new_ac
168
+ target: acceptance_criteria.should
169
+ description: "Require Error Handling section in technical design"
170
+
171
+ → proposed_ac:
172
+ should:
173
+ - id: AC-NEW
174
+ description: "Includes Error Handling section with exception table"
175
+ test_method: section_exists
176
+ expected: "Error Handling section with exception/recovery/fallback table"
177
+
178
+ Step 6: Save Lesson
179
+ → Updated: lesson-learned.md
180
+ → Added lesson: LL-003
181
+ → severity: major
182
+ → source: human_feedback
183
+ → status: raw
184
+ ```
185
+
186
+ ---
187
+
188
+ ## Example 4: Edge Case Not Covered
189
+
190
+ **Trigger:** "The feature breakdown skill didn't handle a feature with no acceptance criteria"
191
+
192
+ ```
193
+ Step 1: Identify Skill
194
+ → skill_name: task-type-feature-breakdown
195
+
196
+ Step 2: Gather Context
197
+ → context:
198
+ task_id: TASK-165
199
+ scenario: Breaking down requirement into features
200
+ inputs: requirement-details.md with 3 user stories but no AC
201
+
202
+ Step 3: Document Issue
203
+ → observed_behavior: |
204
+ Skill assumed acceptance criteria existed.
205
+ Created features with empty AC section.
206
+
207
+ → expected_behavior: |
208
+ Skill should derive AC from user stories when none provided.
209
+ Or flag to user that AC are missing and need to be defined.
210
+
211
+ Step 4: Capture Ground Truth
212
+ → ground_truth: |
213
+ When requirement has no explicit acceptance criteria:
214
+ 1. Check for user stories
215
+ 2. If user stories exist: derive AC from "Given/When/Then" if present
216
+ 3. If no derivable AC: ask user "No acceptance criteria found.
217
+ Please provide AC for: {feature_name}"
218
+ 4. Do not proceed with empty AC
219
+
220
+ Step 5: Propose Improvement
221
+ → proposed_improvement:
222
+ type: add_example
223
+ target: references/examples.md
224
+ description: "Add example for handling missing acceptance criteria"
225
+
226
+ → proposed_ac:
227
+ must:
228
+ - id: AC-NEW
229
+ description: "Handles missing acceptance criteria appropriately"
230
+ test_method: edge_case_handling
231
+ expected: "Derives from user stories OR prompts user"
232
+
233
+ Step 6: Save Lesson
234
+ → Created: lesson-learned.md for task-type-feature-breakdown
235
+ → Added lesson: LL-001
236
+ → severity: major
237
+ → status: raw
238
+ ```