@hailer/mcp 0.0.1

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 (163) hide show
  1. package/.claude/commands/tool-builder.md +37 -0
  2. package/.claude/commands/ws-pull.md +44 -0
  3. package/.claude/settings.json +8 -0
  4. package/.claude/settings.local.json +49 -0
  5. package/.claude/skills/activity-api/SKILL.md +96 -0
  6. package/.claude/skills/activity-api/references/activity-endpoints.md +845 -0
  7. package/.claude/skills/add-app-member-skill/SKILL.md +977 -0
  8. package/.claude/skills/agent-building/SKILL.md +243 -0
  9. package/.claude/skills/agent-building/references/architecture-patterns.md +446 -0
  10. package/.claude/skills/agent-building/references/code-examples.md +587 -0
  11. package/.claude/skills/agent-building/references/implementation-guide.md +619 -0
  12. package/.claude/skills/app-api/SKILL.md +219 -0
  13. package/.claude/skills/app-api/references/app-endpoints.md +759 -0
  14. package/.claude/skills/building-hailer-apps-skill/SKILL.md +548 -0
  15. package/.claude/skills/create-app-skill/SKILL.md +1101 -0
  16. package/.claude/skills/create-insight-skill/SKILL.md +1317 -0
  17. package/.claude/skills/get-insight-data-skill/SKILL.md +1053 -0
  18. package/.claude/skills/hailer-api/SKILL.md +283 -0
  19. package/.claude/skills/hailer-api/references/activities.md +620 -0
  20. package/.claude/skills/hailer-api/references/authentication.md +216 -0
  21. package/.claude/skills/hailer-api/references/datasets.md +437 -0
  22. package/.claude/skills/hailer-api/references/files.md +301 -0
  23. package/.claude/skills/hailer-api/references/insights.md +469 -0
  24. package/.claude/skills/hailer-api/references/workflows.md +720 -0
  25. package/.claude/skills/hailer-api/references/workspaces-users.md +445 -0
  26. package/.claude/skills/insight-api/SKILL.md +185 -0
  27. package/.claude/skills/insight-api/references/insight-endpoints.md +514 -0
  28. package/.claude/skills/install-workflow-skill/SKILL.md +1056 -0
  29. package/.claude/skills/list-apps-skill/SKILL.md +1010 -0
  30. package/.claude/skills/list-workflows-minimal-skill/SKILL.md +992 -0
  31. package/.claude/skills/local-first-skill/SKILL.md +570 -0
  32. package/.claude/skills/mcp-tools/SKILL.md +419 -0
  33. package/.claude/skills/mcp-tools/references/api-endpoints.md +499 -0
  34. package/.claude/skills/mcp-tools/references/data-structures.md +554 -0
  35. package/.claude/skills/mcp-tools/references/implementation-patterns.md +717 -0
  36. package/.claude/skills/preview-insight-skill/SKILL.md +1290 -0
  37. package/.claude/skills/publish-hailer-app-skill/SKILL.md +453 -0
  38. package/.claude/skills/remove-app-member-skill/SKILL.md +671 -0
  39. package/.claude/skills/remove-app-skill/SKILL.md +985 -0
  40. package/.claude/skills/remove-insight-skill/SKILL.md +1011 -0
  41. package/.claude/skills/remove-workflow-skill/SKILL.md +920 -0
  42. package/.claude/skills/scaffold-hailer-app-skill/SKILL.md +1034 -0
  43. package/.claude/skills/skill-testing/README.md +137 -0
  44. package/.claude/skills/skill-testing/SKILL.md +348 -0
  45. package/.claude/skills/skill-testing/references/test-patterns.md +705 -0
  46. package/.claude/skills/skill-testing/references/testing-guide.md +603 -0
  47. package/.claude/skills/skill-testing/references/validation-checklist.md +537 -0
  48. package/.claude/skills/tool-builder/SKILL.md +328 -0
  49. package/.claude/skills/update-app-skill/SKILL.md +970 -0
  50. package/.claude/skills/update-workflow-field-skill/SKILL.md +1098 -0
  51. package/.env.example +81 -0
  52. package/.mcp.json +13 -0
  53. package/README.md +297 -0
  54. package/dist/app.d.ts +4 -0
  55. package/dist/app.js +74 -0
  56. package/dist/cli.d.ts +3 -0
  57. package/dist/cli.js +5 -0
  58. package/dist/client/adaptive-documentation-bot.d.ts +108 -0
  59. package/dist/client/adaptive-documentation-bot.js +475 -0
  60. package/dist/client/adaptive-documentation-types.d.ts +66 -0
  61. package/dist/client/adaptive-documentation-types.js +9 -0
  62. package/dist/client/agent-activity-bot.d.ts +51 -0
  63. package/dist/client/agent-activity-bot.js +166 -0
  64. package/dist/client/agent-tracker.d.ts +499 -0
  65. package/dist/client/agent-tracker.js +659 -0
  66. package/dist/client/description-updater.d.ts +56 -0
  67. package/dist/client/description-updater.js +259 -0
  68. package/dist/client/log-parser.d.ts +72 -0
  69. package/dist/client/log-parser.js +387 -0
  70. package/dist/client/mcp-client.d.ts +50 -0
  71. package/dist/client/mcp-client.js +532 -0
  72. package/dist/client/message-processor.d.ts +35 -0
  73. package/dist/client/message-processor.js +352 -0
  74. package/dist/client/multi-bot-manager.d.ts +24 -0
  75. package/dist/client/multi-bot-manager.js +74 -0
  76. package/dist/client/providers/anthropic-provider.d.ts +19 -0
  77. package/dist/client/providers/anthropic-provider.js +631 -0
  78. package/dist/client/providers/llm-provider.d.ts +47 -0
  79. package/dist/client/providers/llm-provider.js +367 -0
  80. package/dist/client/providers/openai-provider.d.ts +23 -0
  81. package/dist/client/providers/openai-provider.js +621 -0
  82. package/dist/client/simple-llm-caller.d.ts +19 -0
  83. package/dist/client/simple-llm-caller.js +100 -0
  84. package/dist/client/skill-generator.d.ts +81 -0
  85. package/dist/client/skill-generator.js +386 -0
  86. package/dist/client/test-adaptive-bot.d.ts +9 -0
  87. package/dist/client/test-adaptive-bot.js +82 -0
  88. package/dist/client/token-pricing.d.ts +38 -0
  89. package/dist/client/token-pricing.js +127 -0
  90. package/dist/client/token-tracker.d.ts +232 -0
  91. package/dist/client/token-tracker.js +457 -0
  92. package/dist/client/token-usage-bot.d.ts +53 -0
  93. package/dist/client/token-usage-bot.js +153 -0
  94. package/dist/client/tool-executor.d.ts +69 -0
  95. package/dist/client/tool-executor.js +159 -0
  96. package/dist/client/tool-schema-loader.d.ts +60 -0
  97. package/dist/client/tool-schema-loader.js +178 -0
  98. package/dist/client/types.d.ts +69 -0
  99. package/dist/client/types.js +7 -0
  100. package/dist/config.d.ts +162 -0
  101. package/dist/config.js +296 -0
  102. package/dist/core.d.ts +26 -0
  103. package/dist/core.js +147 -0
  104. package/dist/lib/context-manager.d.ts +111 -0
  105. package/dist/lib/context-manager.js +431 -0
  106. package/dist/lib/logger.d.ts +74 -0
  107. package/dist/lib/logger.js +277 -0
  108. package/dist/lib/materialize.d.ts +3 -0
  109. package/dist/lib/materialize.js +101 -0
  110. package/dist/lib/normalizedName.d.ts +7 -0
  111. package/dist/lib/normalizedName.js +48 -0
  112. package/dist/lib/prompt-length-manager.d.ts +81 -0
  113. package/dist/lib/prompt-length-manager.js +457 -0
  114. package/dist/lib/terminal-prompt.d.ts +9 -0
  115. package/dist/lib/terminal-prompt.js +108 -0
  116. package/dist/mcp/UserContextCache.d.ts +56 -0
  117. package/dist/mcp/UserContextCache.js +163 -0
  118. package/dist/mcp/auth.d.ts +2 -0
  119. package/dist/mcp/auth.js +29 -0
  120. package/dist/mcp/hailer-clients.d.ts +42 -0
  121. package/dist/mcp/hailer-clients.js +246 -0
  122. package/dist/mcp/signal-handler.d.ts +45 -0
  123. package/dist/mcp/signal-handler.js +317 -0
  124. package/dist/mcp/tool-registry.d.ts +100 -0
  125. package/dist/mcp/tool-registry.js +306 -0
  126. package/dist/mcp/tools/activity.d.ts +15 -0
  127. package/dist/mcp/tools/activity.js +955 -0
  128. package/dist/mcp/tools/app.d.ts +20 -0
  129. package/dist/mcp/tools/app.js +1488 -0
  130. package/dist/mcp/tools/discussion.d.ts +19 -0
  131. package/dist/mcp/tools/discussion.js +950 -0
  132. package/dist/mcp/tools/file.d.ts +15 -0
  133. package/dist/mcp/tools/file.js +119 -0
  134. package/dist/mcp/tools/insight.d.ts +17 -0
  135. package/dist/mcp/tools/insight.js +806 -0
  136. package/dist/mcp/tools/skill.d.ts +10 -0
  137. package/dist/mcp/tools/skill.js +279 -0
  138. package/dist/mcp/tools/user.d.ts +10 -0
  139. package/dist/mcp/tools/user.js +108 -0
  140. package/dist/mcp/tools/workflow-template.d.ts +19 -0
  141. package/dist/mcp/tools/workflow-template.js +822 -0
  142. package/dist/mcp/tools/workflow.d.ts +18 -0
  143. package/dist/mcp/tools/workflow.js +1362 -0
  144. package/dist/mcp/utils/api-errors.d.ts +45 -0
  145. package/dist/mcp/utils/api-errors.js +160 -0
  146. package/dist/mcp/utils/data-transformers.d.ts +102 -0
  147. package/dist/mcp/utils/data-transformers.js +194 -0
  148. package/dist/mcp/utils/file-upload.d.ts +33 -0
  149. package/dist/mcp/utils/file-upload.js +148 -0
  150. package/dist/mcp/utils/hailer-api-client.d.ts +120 -0
  151. package/dist/mcp/utils/hailer-api-client.js +323 -0
  152. package/dist/mcp/utils/index.d.ts +13 -0
  153. package/dist/mcp/utils/index.js +39 -0
  154. package/dist/mcp/utils/logger.d.ts +42 -0
  155. package/dist/mcp/utils/logger.js +103 -0
  156. package/dist/mcp/utils/types.d.ts +286 -0
  157. package/dist/mcp/utils/types.js +7 -0
  158. package/dist/mcp/workspace-cache.d.ts +42 -0
  159. package/dist/mcp/workspace-cache.js +97 -0
  160. package/dist/mcp-server.d.ts +42 -0
  161. package/dist/mcp-server.js +280 -0
  162. package/package.json +56 -0
  163. package/tsconfig.json +23 -0
@@ -0,0 +1,137 @@
1
+ # Skill Testing
2
+
3
+ Quick reference for using the skill-testing skill system.
4
+
5
+ ## What This Skill Provides
6
+
7
+ This skill helps you test, validate, and ensure quality of skills in the Hailer MCP skill-based agent system. It provides:
8
+
9
+ - **Testing Patterns**: Reusable test templates and scripts
10
+ - **Validation Checklists**: Comprehensive quality checks
11
+ - **Testing Guide**: Step-by-step testing procedures
12
+ - **Best Practices**: Do's and don'ts for skill testing
13
+
14
+ ## When to Use This Skill
15
+
16
+ Ask the agent about skill testing when you:
17
+ - Create a new skill and need to test it
18
+ - Want to validate skill quality before deployment
19
+ - Need testing patterns or templates
20
+ - Want to benchmark skill performance
21
+ - Need guidance on testing best practices
22
+ - Want to set up automated testing
23
+
24
+ ## Trigger Keywords
25
+
26
+ This skill activates when you mention:
27
+ - "test skill" / "test a skill"
28
+ - "validate skill"
29
+ - "skill testing"
30
+ - "test pattern"
31
+ - "benchmark"
32
+ - "quality check"
33
+ - "validation checklist"
34
+ - "unit test" / "integration test"
35
+ - "how to test"
36
+
37
+ ## What You'll Get
38
+
39
+ When this skill is loaded, the agent receives:
40
+ - Complete testing methodology (unit, integration, E2E, performance)
41
+ - Copy-paste test script templates
42
+ - Validation checklists for pre-deployment
43
+ - Performance benchmarking patterns
44
+ - CI/CD integration examples
45
+ - Quality scoring matrices
46
+ - Troubleshooting guides
47
+
48
+ ## Quick Start
49
+
50
+ ### Test a Single Skill
51
+
52
+ ```bash
53
+ # Create quick test script
54
+ npx tsx test-my-skill.ts
55
+
56
+ # Or ask the agent:
57
+ # "How do I test my new skill called 'my-skill'?"
58
+ ```
59
+
60
+ ### Test All Skills
61
+
62
+ ```bash
63
+ # Run comprehensive test suite
64
+ npx tsx test-all-skills.ts
65
+
66
+ # Or ask the agent:
67
+ # "Create a script to test all skills"
68
+ ```
69
+
70
+ ### Validate Before Deployment
71
+
72
+ ```bash
73
+ # Run validation checks
74
+ npx tsx validate-skill.ts my-skill
75
+
76
+ # Or ask the agent:
77
+ # "What validation checks should I run before deploying my-skill?"
78
+ ```
79
+
80
+ ## Files Included
81
+
82
+ ### Main Skill
83
+ - **SKILL.md**: Overview, principles, quick start, patterns
84
+
85
+ ### References
86
+ - **testing-guide.md**: Comprehensive step-by-step testing procedures
87
+ - **test-patterns.md**: Reusable test templates and scripts
88
+ - **validation-checklist.md**: Quality assurance checklists
89
+
90
+ ## Example Usage
91
+
92
+ **User**: "I created a new skill called 'data-export'. How should I test it?"
93
+
94
+ **Agent** (with skill-testing loaded):
95
+ - Provides specific testing steps for the new skill
96
+ - Suggests test patterns for the skill's functionality
97
+ - Recommends validation checks
98
+ - Offers performance benchmarking guidance
99
+ - Provides copy-paste test scripts
100
+
101
+ ## Integration with Development Workflow
102
+
103
+ 1. **Create Skill** โ†’ Document functionality
104
+ 2. **Test Locally** โ†’ Use quick test scripts
105
+ 3. **Validate** โ†’ Run validation checklist
106
+ 4. **Benchmark** โ†’ Measure performance
107
+ 5. **Deploy** โ†’ With confidence!
108
+
109
+ ## Quality Standards
110
+
111
+ Skills should meet:
112
+ - โœ… All automated tests pass
113
+ - โœ… Load time < 100ms (first load)
114
+ - โœ… Cache time < 10ms
115
+ - โœ… Content quality score โ‰ฅ 3.5/5
116
+ - โœ… All validation checks pass
117
+
118
+ ## Getting Help
119
+
120
+ Ask the agent:
121
+ - "Show me test patterns for skills"
122
+ - "What's in the validation checklist?"
123
+ - "How do I benchmark skill performance?"
124
+ - "Create a test script for my skill"
125
+ - "What are the quality standards for skills?"
126
+
127
+ ## Tips
128
+
129
+ - Start with quick test scripts for fast feedback
130
+ - Use validation checklist before every deployment
131
+ - Benchmark regularly to catch performance regressions
132
+ - Integrate tests into CI/CD pipeline
133
+ - Test with real user queries
134
+
135
+ ---
136
+
137
+ *This skill was created using the agent-building skill patterns and is itself an example of a well-tested skill.*
@@ -0,0 +1,348 @@
1
+ # Skill Testing
2
+
3
+ A comprehensive guide for testing skills in the Hailer MCP skill-based agent system. Provides generic, reusable patterns for validating skill content, structure, integration, and performance.
4
+
5
+ ## Overview
6
+
7
+ Testing skills ensures they:
8
+ - Load correctly from disk
9
+ - Match the right user requests (keyword matching works)
10
+ - Provide useful content to the LLM
11
+ - Don't break the system under various conditions
12
+ - Perform efficiently (caching, load times)
13
+ - Follow consistent structure and quality standards
14
+
15
+ ## Core Testing Principles
16
+
17
+ ### 1. Test Isolation
18
+ Each skill should be testable in isolation without dependencies on:
19
+ - Live MCP server
20
+ - External APIs
21
+ - Other skills
22
+ - Specific LLM providers
23
+
24
+ ### 2. Test Coverage Levels
25
+ ```
26
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
27
+ โ”‚ Unit Tests (Individual Skill) โ”‚ <- Fast, isolated
28
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
29
+ โ”‚ Integration Tests (Skill System) โ”‚ <- Real skill loading
30
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
31
+ โ”‚ E2E Tests (Full Agent Flow) โ”‚ <- Complete workflow
32
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
33
+ ```
34
+
35
+ ### 3. Testing Dimensions
36
+
37
+ **Functional Tests:**
38
+ - โœ… Skill loads without errors
39
+ - โœ… Content is valid and complete
40
+ - โœ… References load correctly
41
+ - โœ… Keyword matching works as expected
42
+
43
+ **Performance Tests:**
44
+ - โšก First load time < 100ms
45
+ - โšก Cached load time < 10ms
46
+ - โšก Skill content size reasonable (< 100KB recommended)
47
+
48
+ **Quality Tests:**
49
+ - ๐Ÿ“ Content is clear and actionable
50
+ - ๐Ÿ“ Examples are relevant and working
51
+ - ๐Ÿ“ No broken references or links
52
+ - ๐Ÿ“ Consistent formatting and structure
53
+
54
+ **Integration Tests:**
55
+ - ๐Ÿ”— Works with SkillLoader
56
+ - ๐Ÿ”— Works with SkillManager
57
+ - ๐Ÿ”— Keyword mappings are accurate
58
+ - ๐Ÿ”— Graceful degradation on errors
59
+
60
+ ## Quick Start: Testing a New Skill
61
+
62
+ ```typescript
63
+ // 1. Create test file: test-my-skill.ts
64
+ import { SkillLoader } from './src/client/skill-loader';
65
+ import { SkillManager } from './src/client/skill-manager';
66
+ import * as path from 'path';
67
+
68
+ async function testMySkill() {
69
+ const loader = new SkillLoader(path.join(process.cwd(), '.claude', 'skills'));
70
+ const manager = new SkillManager(loader);
71
+
72
+ // Test 1: Skill loads
73
+ const skill = await loader.load('my-skill');
74
+ console.assert(skill.content.length > 0, 'Skill content should not be empty');
75
+
76
+ // Test 2: Keyword matching
77
+ const guidance = await manager.analyzeRequest('my skill trigger phrase');
78
+ console.assert(guidance.skills.includes('my-skill'), 'Should match my-skill');
79
+
80
+ // Test 3: Performance
81
+ const start = Date.now();
82
+ await loader.load('my-skill'); // Should use cache
83
+ const duration = Date.now() - start;
84
+ console.assert(duration < 10, `Cached load should be fast (${duration}ms)`);
85
+ }
86
+ ```
87
+
88
+ ## Test File Structure
89
+
90
+ ```
91
+ server/
92
+ โ”œโ”€โ”€ tests/
93
+ โ”‚ โ”œโ”€โ”€ skills/
94
+ โ”‚ โ”‚ โ”œโ”€โ”€ skill-loader.test.ts # Unit tests for SkillLoader
95
+ โ”‚ โ”‚ โ”œโ”€โ”€ skill-manager.test.ts # Unit tests for SkillManager
96
+ โ”‚ โ”‚ โ”œโ”€โ”€ integration.test.ts # Integration tests
97
+ โ”‚ โ”‚ โ””โ”€โ”€ performance.test.ts # Performance benchmarks
98
+ โ”‚ โ””โ”€โ”€ fixtures/
99
+ โ”‚ โ””โ”€โ”€ test-skill/ # Mock skill for testing
100
+ โ”‚ โ””โ”€โ”€ SKILL.md
101
+ ```
102
+
103
+ ## Common Testing Patterns
104
+
105
+ ### Pattern 1: Test Skill Loading
106
+ ```typescript
107
+ describe('SkillLoader', () => {
108
+ it('should load skill with content', async () => {
109
+ const loader = new SkillLoader(skillsPath);
110
+ const skill = await loader.load('my-skill');
111
+
112
+ expect(skill.name).toBe('my-skill');
113
+ expect(skill.content).toBeTruthy();
114
+ expect(skill.description).toBeTruthy();
115
+ expect(skill.loadedAt).toBeGreaterThan(0);
116
+ });
117
+ });
118
+ ```
119
+
120
+ ### Pattern 2: Test Keyword Matching
121
+ ```typescript
122
+ describe('SkillManager', () => {
123
+ it('should match skill by keywords', async () => {
124
+ const manager = new SkillManager(loader);
125
+ const testCases = [
126
+ { message: 'create a workflow', expectedSkill: 'mcp-tools' },
127
+ { message: 'list activities', expectedSkill: 'hailer-api' },
128
+ { message: 'build an agent', expectedSkill: 'agent-building' },
129
+ ];
130
+
131
+ for (const { message, expectedSkill } of testCases) {
132
+ const guidance = await manager.analyzeRequest(message);
133
+ expect(guidance.skills).toContain(expectedSkill);
134
+ }
135
+ });
136
+ });
137
+ ```
138
+
139
+ ### Pattern 3: Test Caching
140
+ ```typescript
141
+ describe('Skill Caching', () => {
142
+ it('should cache skills after first load', async () => {
143
+ const loader = new SkillLoader(skillsPath);
144
+
145
+ // First load (from disk)
146
+ const start1 = Date.now();
147
+ await loader.load('my-skill');
148
+ const firstLoad = Date.now() - start1;
149
+
150
+ // Second load (from cache)
151
+ const start2 = Date.now();
152
+ await loader.load('my-skill');
153
+ const cachedLoad = Date.now() - start2;
154
+
155
+ expect(cachedLoad).toBeLessThan(firstLoad / 5); // At least 5x faster
156
+ });
157
+ });
158
+ ```
159
+
160
+ ### Pattern 4: Test Error Handling
161
+ ```typescript
162
+ describe('Error Handling', () => {
163
+ it('should handle missing skills gracefully', async () => {
164
+ const loader = new SkillLoader(skillsPath);
165
+
166
+ await expect(
167
+ loader.load('non-existent-skill')
168
+ ).rejects.toThrow(/Failed to load skill/);
169
+ });
170
+
171
+ it('should return default guidance when no skill matches', async () => {
172
+ const manager = new SkillManager(loader);
173
+ const guidance = await manager.analyzeRequest('random gibberish xyz123');
174
+
175
+ expect(guidance.skills).toHaveLength(0);
176
+ expect(guidance.confidence).toBeLessThan(0.5);
177
+ expect(guidance.guidance).toContain('General assistance');
178
+ });
179
+ });
180
+ ```
181
+
182
+ ## Testing Checklist
183
+
184
+ Before deploying a new skill, verify:
185
+
186
+ - [ ] **Structure**: SKILL.md exists and is valid markdown
187
+ - [ ] **Content**: Contains clear, actionable information
188
+ - [ ] **References**: All references/*.md files load correctly
189
+ - [ ] **Keywords**: Added to SkillManager.buildSkillMappings()
190
+ - [ ] **Loading**: Skill loads without errors
191
+ - [ ] **Matching**: Keywords trigger the skill correctly
192
+ - [ ] **Performance**: First load < 100ms, cached load < 10ms
193
+ - [ ] **Size**: Total content < 100KB (or justified if larger)
194
+ - [ ] **Examples**: All code examples are valid and tested
195
+ - [ ] **Tools**: Recommended tools are accurate and available
196
+ - [ ] **Integration**: Works with both OpenAI and Anthropic providers
197
+ - [ ] **Graceful Failure**: Handles errors without crashing
198
+
199
+ ## Automated Testing
200
+
201
+ ### Quick Test Script
202
+ Create `test-skill.ts` in server directory:
203
+
204
+ ```typescript
205
+ import { SkillLoader } from './src/client/skill-loader';
206
+ import { SkillManager } from './src/client/skill-manager';
207
+ import * as path from 'path';
208
+ import * as fs from 'fs/promises';
209
+
210
+ async function validateSkill(skillName: string) {
211
+ console.log(`\n๐Ÿงช Testing skill: ${skillName}`);
212
+
213
+ const skillsPath = path.join(process.cwd(), '..', '.claude', 'skills');
214
+ const loader = new SkillLoader(skillsPath);
215
+ const manager = new SkillManager(loader);
216
+
217
+ try {
218
+ // 1. Structure validation
219
+ const skillPath = path.join(skillsPath, skillName);
220
+ const skillMdExists = await fs.stat(path.join(skillPath, 'SKILL.md'))
221
+ .then(() => true).catch(() => false);
222
+ console.log(` ${skillMdExists ? 'โœ…' : 'โŒ'} SKILL.md exists`);
223
+
224
+ // 2. Loading test
225
+ const start = Date.now();
226
+ const skill = await loader.load(skillName);
227
+ const loadTime = Date.now() - start;
228
+ console.log(` ${loadTime < 100 ? 'โœ…' : 'โš ๏ธ'} First load: ${loadTime}ms`);
229
+ console.log(` โœ… Content loaded: ${skill.content.length} chars`);
230
+
231
+ // 3. Caching test
232
+ const start2 = Date.now();
233
+ await loader.load(skillName);
234
+ const cacheTime = Date.now() - start2;
235
+ console.log(` ${cacheTime < 10 ? 'โœ…' : 'โš ๏ธ'} Cached load: ${cacheTime}ms`);
236
+
237
+ // 4. Size check
238
+ const sizeKB = skill.content.length / 1024;
239
+ console.log(` ${sizeKB < 100 ? 'โœ…' : 'โš ๏ธ'} Size: ${sizeKB.toFixed(1)} KB`);
240
+
241
+ // 5. Content validation
242
+ const hasExamples = skill.content.includes('```');
243
+ const hasStructure = skill.content.includes('#');
244
+ console.log(` ${hasExamples ? 'โœ…' : 'โš ๏ธ'} Contains code examples`);
245
+ console.log(` ${hasStructure ? 'โœ…' : 'โš ๏ธ'} Has structured headings`);
246
+
247
+ console.log(`\nโœ… ${skillName} passed validation!`);
248
+ return true;
249
+ } catch (error) {
250
+ console.error(`\nโŒ ${skillName} failed:`, error);
251
+ return false;
252
+ }
253
+ }
254
+
255
+ // Test all skills
256
+ async function testAllSkills() {
257
+ const skillsPath = path.join(process.cwd(), '..', '.claude', 'skills');
258
+ const loader = new SkillLoader(skillsPath);
259
+ const allSkills = await loader.getAvailableSkills();
260
+
261
+ console.log(`Found ${allSkills.length} skills to test\n`);
262
+
263
+ const results = await Promise.all(
264
+ allSkills.map(skill => validateSkill(skill))
265
+ );
266
+
267
+ const passed = results.filter(r => r).length;
268
+ console.log(`\n${'='.repeat(50)}`);
269
+ console.log(`Results: ${passed}/${allSkills.length} skills passed`);
270
+ console.log(`${'='.repeat(50)}\n`);
271
+ }
272
+
273
+ testAllSkills().catch(console.error);
274
+ ```
275
+
276
+ Run with: `npx tsx test-skill.ts`
277
+
278
+ ## Best Practices
279
+
280
+ ### DO โœ…
281
+ - Write tests before creating the skill (TDD)
282
+ - Test both success and failure cases
283
+ - Validate skill content quality, not just structure
284
+ - Test performance with realistic data sizes
285
+ - Use fixtures for reproducible tests
286
+ - Mock external dependencies
287
+ - Test keyword matching with real user queries
288
+ - Verify graceful degradation
289
+
290
+ ### DON'T โŒ
291
+ - Don't test against live APIs in unit tests
292
+ - Don't skip error handling tests
293
+ - Don't ignore performance regressions
294
+ - Don't forget to test cache behavior
295
+ - Don't assume keywords will match perfectly
296
+ - Don't test implementation details
297
+ - Don't create brittle tests that break on minor changes
298
+
299
+ ## Troubleshooting
300
+
301
+ ### Skill Doesn't Load
302
+ 1. Check file path: `skills/{skill-name}/SKILL.md`
303
+ 2. Verify file permissions
304
+ 3. Check for syntax errors in markdown
305
+ 4. Look at loader error logs
306
+
307
+ ### Keywords Don't Match
308
+ 1. Review keyword list in SkillManager
309
+ 2. Test with actual user messages
310
+ 3. Add more specific keywords
311
+ 4. Check for typos in keyword mappings
312
+
313
+ ### Performance Issues
314
+ 1. Check skill size (should be < 100KB)
315
+ 2. Verify caching is working
316
+ 3. Profile with real-world queries
317
+ 4. Consider splitting large skills
318
+
319
+ ### Content Quality Issues
320
+ 1. Have others review the content
321
+ 2. Test with the actual LLM
322
+ 3. Check if examples are clear
323
+ 4. Verify technical accuracy
324
+
325
+ ## Integration with CI/CD
326
+
327
+ ```yaml
328
+ # .github/workflows/test-skills.yml
329
+ name: Test Skills
330
+
331
+ on: [push, pull_request]
332
+
333
+ jobs:
334
+ test:
335
+ runs-on: ubuntu-latest
336
+ steps:
337
+ - uses: actions/checkout@v3
338
+ - uses: actions/setup-node@v3
339
+ - run: npm install
340
+ - run: npx tsx test-skill.ts
341
+ ```
342
+
343
+ ## Further Reading
344
+
345
+ See reference files for detailed guides:
346
+ - `testing-guide.md` - Comprehensive testing procedures
347
+ - `test-patterns.md` - Reusable test patterns and templates
348
+ - `validation-checklist.md` - Quality assurance checklist