@agentlee5/agent-skills 1.0.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.
Files changed (182) hide show
  1. package/.leeway/config.json +133 -0
  2. package/LICENSE +21 -0
  3. package/LeeWay-Standards/LICENSE +21 -0
  4. package/LeeWay-Standards/README.md +324 -0
  5. package/LeeWay-Standards/examples/NexusButton.tsx +90 -0
  6. package/LeeWay-Standards/examples/example-agent.js +89 -0
  7. package/LeeWay-Standards/package.json +61 -0
  8. package/LeeWay-Standards/schemas/leeway-config.schema.json +81 -0
  9. package/LeeWay-Standards/schemas/leeway-header.schema.json +63 -0
  10. package/LeeWay-Standards/src/agents/discovery/architecture-map-agent.js +134 -0
  11. package/LeeWay-Standards/src/agents/discovery/docs-agent.js +126 -0
  12. package/LeeWay-Standards/src/agents/discovery/explain-agent.js +95 -0
  13. package/LeeWay-Standards/src/agents/discovery/intent-registry-agent.js +119 -0
  14. package/LeeWay-Standards/src/agents/discovery/schema-agent.js +116 -0
  15. package/LeeWay-Standards/src/agents/discovery/sitemap-agent.js +88 -0
  16. package/LeeWay-Standards/src/agents/governance/align-agent.js +155 -0
  17. package/LeeWay-Standards/src/agents/governance/assess-agent.js +161 -0
  18. package/LeeWay-Standards/src/agents/governance/audit-agent.js +185 -0
  19. package/LeeWay-Standards/src/agents/integrity/circular-dependency-agent.js +88 -0
  20. package/LeeWay-Standards/src/agents/integrity/dependency-graph-agent.js +107 -0
  21. package/LeeWay-Standards/src/agents/integrity/duplicate-logic-agent.js +108 -0
  22. package/LeeWay-Standards/src/agents/integrity/import-agent.js +83 -0
  23. package/LeeWay-Standards/src/agents/integrity/module-policy-agent.js +94 -0
  24. package/LeeWay-Standards/src/agents/integrity/refactor-scan-agent.js +113 -0
  25. package/LeeWay-Standards/src/agents/integrity/syntax-agent.js +84 -0
  26. package/LeeWay-Standards/src/agents/mcp/endpoint-agent.js +106 -0
  27. package/LeeWay-Standards/src/agents/mcp/env-agent.js +111 -0
  28. package/LeeWay-Standards/src/agents/mcp/health-agent-lite.js +119 -0
  29. package/LeeWay-Standards/src/agents/mcp/manifest-agent.js +87 -0
  30. package/LeeWay-Standards/src/agents/mcp/port-agent.js +125 -0
  31. package/LeeWay-Standards/src/agents/mcp/process-agent.js +124 -0
  32. package/LeeWay-Standards/src/agents/mcp/runtime-agent.js +108 -0
  33. package/LeeWay-Standards/src/agents/mcp/transport-agent.js +78 -0
  34. package/LeeWay-Standards/src/agents/orchestration/doctor-agent.js +149 -0
  35. package/LeeWay-Standards/src/agents/orchestration/memory-agent-lite.js +125 -0
  36. package/LeeWay-Standards/src/agents/orchestration/router-agent.js +110 -0
  37. package/LeeWay-Standards/src/agents/security/permission-agent.js +98 -0
  38. package/LeeWay-Standards/src/agents/security/policy-agent.js +100 -0
  39. package/LeeWay-Standards/src/agents/security/privacy-agent.js +83 -0
  40. package/LeeWay-Standards/src/agents/security/prompt-security-agent.js +103 -0
  41. package/LeeWay-Standards/src/agents/security/secret-scan-agent.js +108 -0
  42. package/LeeWay-Standards/src/agents/security/tool-access-agent.js +105 -0
  43. package/LeeWay-Standards/src/agents/standards/authority-agent.js +114 -0
  44. package/LeeWay-Standards/src/agents/standards/discovery-pipeline-agent.js +91 -0
  45. package/LeeWay-Standards/src/agents/standards/header-agent.js +120 -0
  46. package/LeeWay-Standards/src/agents/standards/placement-agent.js +96 -0
  47. package/LeeWay-Standards/src/agents/standards/region-agent.js +99 -0
  48. package/LeeWay-Standards/src/agents/standards/registry-agent.js +153 -0
  49. package/LeeWay-Standards/src/agents/standards/tag-agent.js +111 -0
  50. package/LeeWay-Standards/src/cli/leeway.js +225 -0
  51. package/LeeWay-Standards/src/core/compliance-scorer.js +168 -0
  52. package/LeeWay-Standards/src/core/compliance-scorer.test.js +121 -0
  53. package/LeeWay-Standards/src/core/header-parser.js +207 -0
  54. package/LeeWay-Standards/src/core/header-parser.test.js +198 -0
  55. package/LeeWay-Standards/src/core/region-classifier.js +137 -0
  56. package/LeeWay-Standards/src/core/region-classifier.test.js +100 -0
  57. package/LeeWay-Standards/src/core/tag-validator.js +139 -0
  58. package/LeeWay-Standards/src/core/tag-validator.test.js +109 -0
  59. package/LeeWay-Standards/src/index.js +83 -0
  60. package/README.md +217 -0
  61. package/agent-config.yaml +456 -0
  62. package/agentbage.png.png +0 -0
  63. package/bin/leeway-skills-badge.js +52 -0
  64. package/bin/leeway-skills-mcp.js +48 -0
  65. package/bin/leeway-skills.js +160 -0
  66. package/bin/leeway-standards.js +49 -0
  67. package/config/.skillsignore +63 -0
  68. package/config/skills-config.json +70 -0
  69. package/documents/AGENT_LEARNING_REFERENCE.md +329 -0
  70. package/documents/AGENT_LEE_INTEGRATION.md +534 -0
  71. package/documents/COMPLETE_SYSTEM_OVERVIEW.md +502 -0
  72. package/documents/COMPREHENSIVE_SKILL_INTEGRATION_PLAN.md +644 -0
  73. package/documents/DIRECTORY_MAP.md +323 -0
  74. package/documents/EXTENDING.md +514 -0
  75. package/documents/FILE_DIRECTORY_GUIDE.md +427 -0
  76. package/documents/LEEWAY_BADGE_INTEGRATION.md +76 -0
  77. package/documents/LEEWAY_IMPLEMENTATION_SUMMARY.md +384 -0
  78. package/documents/LEEWAY_INTEGRATION_GUIDE.md +414 -0
  79. package/documents/LEEWAY_NPM_SDK.md +66 -0
  80. package/documents/LEEWAY_QUICK_START.md +288 -0
  81. package/documents/LEEWAY_SKILLS_BRANDING.md +375 -0
  82. package/documents/LEEWAY_SKILLS_MCP_SUMMARY.md +593 -0
  83. package/documents/LEEWAY_STANDARDS_COMPLIANCE.md +361 -0
  84. package/documents/LEEWAY_UNIFIED_ARCHITECTURE.md +473 -0
  85. package/documents/LEEWAY_WORKFLOWS_QUICK_REFERENCE.md +307 -0
  86. package/documents/LEEWAY_WORKFLOWS_STRATEGIC_PLAN.md +515 -0
  87. package/documents/LIFELONG_LEARNING_LAYER.md +478 -0
  88. package/documents/MCP_ARCHITECTURE.md +683 -0
  89. package/documents/QUICK_REFERENCE.md +301 -0
  90. package/documents/SETUP.md +325 -0
  91. package/documents/SETUP_SUMMARY.md +413 -0
  92. package/documents/SKILL_ACQUISITION_EXECUTIVE_SUMMARY.md +373 -0
  93. package/documents/SKILL_ACQUISITION_IMPLEMENTATION.md +692 -0
  94. package/documents/SKILL_ACQUISITION_MANIFEST.md +404 -0
  95. package/documents/SKILL_ACQUISITION_QUICK_REFERENCE.md +349 -0
  96. package/documents/SKILL_WORKFLOW_COMPOSITION_MATRIX.md +537 -0
  97. package/documents/STRUCTURE.md +382 -0
  98. package/documents/SYSTEM_TRANSFORMATION_SUMMARY.md +560 -0
  99. package/documents/USAGE.md +390 -0
  100. package/documents/WORKFLOW_ACQUISITION_MANIFEST.md +576 -0
  101. package/documents/aiskills.txt +460 -0
  102. package/mcp-server/README.md +697 -0
  103. package/mcp-server/dist/badge-proof.d.ts +66 -0
  104. package/mcp-server/dist/badge-proof.d.ts.map +1 -0
  105. package/mcp-server/dist/badge-proof.js +324 -0
  106. package/mcp-server/dist/badge-proof.js.map +1 -0
  107. package/mcp-server/dist/index.d.ts +64 -0
  108. package/mcp-server/dist/index.d.ts.map +1 -0
  109. package/mcp-server/dist/index.js +263 -0
  110. package/mcp-server/dist/index.js.map +1 -0
  111. package/mcp-server/dist/install-badge-proof.d.ts +3 -0
  112. package/mcp-server/dist/install-badge-proof.d.ts.map +1 -0
  113. package/mcp-server/dist/install-badge-proof.js +109 -0
  114. package/mcp-server/dist/install-badge-proof.js.map +1 -0
  115. package/mcp-server/package.json +43 -0
  116. package/mcp-server/src/badge-proof.ts +469 -0
  117. package/mcp-server/src/index.ts +355 -0
  118. package/mcp-server/src/install-badge-proof.ts +132 -0
  119. package/mcp-server/tsconfig.json +22 -0
  120. package/package.json +84 -0
  121. package/scripts/init-leeway.js +217 -0
  122. package/scripts/leeway-agents/compliance-monitor.js +374 -0
  123. package/scripts/leeway-agents/header-injector.js +321 -0
  124. package/scripts/skill-integration-toolkit.py +319 -0
  125. package/scripts/skills-registry.json +1117 -0
  126. package/scripts/sync-skills.ps1 +275 -0
  127. package/scripts/verify-leeway-setup.js +249 -0
  128. package/scripts/workflow-integration-toolkit.py +522 -0
  129. package/sdk/application-installer.js +92 -0
  130. package/sdk/index.js +43 -0
  131. package/sdk/paths.js +167 -0
  132. package/skills/agent-autonomy/autonomous-conductor/SKILL.md +206 -0
  133. package/skills/agent-autonomy/full-stack-delivery/SKILL.md +206 -0
  134. package/skills/agent-orchestration/multi-agent-orchestration/SKILL.md +68 -0
  135. package/skills/agent-patterns/agent-design-patterns/SKILL.md +70 -0
  136. package/skills/ai-ml/llm-prompting/SKILL.md +71 -0
  137. package/skills/ai-ml/ml-model-development/SKILL.md +67 -0
  138. package/skills/ai-ml/multimodal-systems/SKILL.md +71 -0
  139. package/skills/ai-ml/retrieval-generation-fine-tuning/SKILL.md +71 -0
  140. package/skills/architecture/system-design/SKILL.md +67 -0
  141. package/skills/code-analysis/refactoring/SKILL.md +64 -0
  142. package/skills/code-analysis/security-vulnerability-scanning/SKILL.md +71 -0
  143. package/skills/code-analysis/static-analysis/SKILL.md +64 -0
  144. package/skills/code-generation/full-stack-application/SKILL.md +70 -0
  145. package/skills/code-generation/microservices-architecture/SKILL.md +71 -0
  146. package/skills/code-generation/python-codegen/SKILL.md +64 -0
  147. package/skills/code-generation/typescript-codegen/SKILL.md +64 -0
  148. package/skills/data-analysis/advanced-analytics/SKILL.md +71 -0
  149. package/skills/data-analysis/pandas-analysis/SKILL.md +66 -0
  150. package/skills/database-design/database-design-optimization/SKILL.md +70 -0
  151. package/skills/debugging/javascript-debugging/SKILL.md +67 -0
  152. package/skills/debugging/python-debugging/SKILL.md +67 -0
  153. package/skills/devops/dockerfile-creation/SKILL.md +64 -0
  154. package/skills/devops/kubernetes-deployment/SKILL.md +65 -0
  155. package/skills/documentation/api-documentation/SKILL.md +67 -0
  156. package/skills/error-handling/resilience-patterns/SKILL.md +70 -0
  157. package/skills/git-workflow/git-collaboration/SKILL.md +67 -0
  158. package/skills/infrastructure/cicd-pipelines/SKILL.md +70 -0
  159. package/skills/infrastructure/infrastructure-as-code/SKILL.md +70 -0
  160. package/skills/observability/monitoring-and-observability/SKILL.md +70 -0
  161. package/skills/performance-optimization/performance-engineering/SKILL.md +70 -0
  162. package/skills/prompt-optimization/prompt-engineering-advanced/SKILL.md +70 -0
  163. package/skills/quality-assurance/deployment-validator/SKILL.md +382 -0
  164. package/skills/quality-assurance/web-security-sweep/SKILL.md +320 -0
  165. package/skills/rag-knowledge/rag-systems/SKILL.md +70 -0
  166. package/skills/research/knowledge-synthesis/SKILL.md +71 -0
  167. package/skills/security/authentication-authorization/SKILL.md +71 -0
  168. package/skills/security/code-security/SKILL.md +66 -0
  169. package/skills/security/secure-architecture/SKILL.md +71 -0
  170. package/skills/self-optimization/dev-loop-optimizer/SKILL.md +344 -0
  171. package/skills/self-optimization/memory-learning/SKILL.md +335 -0
  172. package/skills/self-optimization/runtime-self-profiling/SKILL.md +250 -0
  173. package/skills/testing/advanced-testing-strategies/SKILL.md +71 -0
  174. package/skills/testing/integration-testing/SKILL.md +66 -0
  175. package/skills/testing/load-testing-capacity/SKILL.md +71 -0
  176. package/skills/testing/unit-testing/SKILL.md +66 -0
  177. package/skills/tool-integration/custom-tool-creation/SKILL.md +70 -0
  178. package/skills/web-development/advanced-frontend-patterns/SKILL.md +71 -0
  179. package/skills/web-development/api-design/SKILL.md +71 -0
  180. package/skills/web-development/css-styling/SKILL.md +67 -0
  181. package/skills/web-development/react-development/SKILL.md +79 -0
  182. package/skills/workflow-composition/workflow-orchestration/SKILL.md +70 -0
@@ -0,0 +1,335 @@
1
+ /*
2
+ LEEWAY HEADER — DO NOT REMOVE
3
+
4
+ REGION: AI.OPTIMIZATION
5
+ TAG: AI.OPTIMIZATION.MEMORY_LEARNING
6
+
7
+ COLOR_ONION_HEX:
8
+ NEON=#FFD700
9
+ FLUO=#FFA500
10
+ PASTEL=#E8F5E9
11
+
12
+ ICON_ASCII:
13
+ family=lucide
14
+ glyph=zap
15
+
16
+ 5WH:
17
+ WHAT = memory learning skill for Leeway-compliant AI systems
18
+ WHY = Provides capabilities for self-optimization within the AIskills ecosystem
19
+ WHO = Leeway Industries (By Leonard Jerome Lee)
20
+ WHERE = skills/self-optimization/memory-learning/SKILL.md
21
+ WHEN = 2026
22
+ HOW = Leeway-governed skill.md definition with structured capabilities and tags
23
+
24
+ AGENTS:
25
+ ASSESS
26
+ AUDIT
27
+
28
+ LICENSE:
29
+ MIT
30
+ */
31
+
32
+ # Memory and Continuous Learning
33
+
34
+ **Expert in**: Summarizing work, storing institutional knowledge, and applying cross-project patterns to prevent repeated mistakes and compound learning. Builds a searchable, evolving knowledge base as you work.
35
+
36
+ **Role**: Knowledge Keeper / Organizational Learner
37
+
38
+ ## Mission
39
+
40
+ You capture insights, decisions, and lessons from every project, store them in an accessible format, and proactively apply them to new work. Over time, your projects improve because you don't repeat the same decisions or mistakes twice.
41
+
42
+ ## Operating Principles
43
+
44
+ 1. **Everything important gets written down**: decisions, blockers, edge cases, workarounds, and performance findings.
45
+ 2. **Structure for search and reuse**: organize by topic (patterns, pitfalls, tools, tech stack choices) so you can find relevant lessons in new projects.
46
+ 3. **Search before deciding**: when facing a decision, check if you've already solved it before.
47
+ 4. **Update and refine**: over time, refine lessons as you validate them across multiple projects.
48
+ 5. **Share patterns across projects**: a lesson from one project should benefit all future projects.
49
+
50
+ ## Knowledge Repository Structure
51
+
52
+ ```
53
+ workspace/
54
+ ├── patterns_log.md # Cross-project lessons and patterns
55
+ ├── pitfalls_log.md # Common mistakes and how to avoid them
56
+ ├── tool_registry.md # Tools, libraries, and when to use them
57
+ ├── architecture_patterns.md # Reusable architectures and designs
58
+ ├── tech_stack_log.md # Tech choices and their outcomes
59
+ └── projects/
60
+ ├── app-1/
61
+ │ ├── decisions_log.md
62
+ │ ├── project_log.md
63
+ └── app-2/
64
+ ├── decisions_log.md
65
+ ├── project_log.md
66
+ ```
67
+
68
+ ## Knowledge Capture Process
69
+
70
+ ### After Each Milestone (or Daily in Long Projects)
71
+
72
+ **Reflect and document** in the project's `project_log.md`:
73
+
74
+ ```markdown
75
+ ## 2026-03-15 – Milestone 2 Complete
76
+
77
+ ### Work Summary
78
+
79
+ - Installed authentication library (Firebase / Auth0 comparison)
80
+ - Implemented user registration and login flows
81
+ - Added JWT token refresh mechanism
82
+
83
+ ### Key Decisions
84
+
85
+ - **Why Firebase over Auth0?**
86
+ - Faster integration for MVP (3 days vs. 2 weeks for Auth0 setup)
87
+ - Cost at scale: Firebase included in GCP free tier; Auth0 is per-MAU
88
+ - Tradeoff: less customization flexibility, vendor lock-in
89
+
90
+ ### Problems Encountered
91
+
92
+ - JWT refresh token rotation was non-obvious in Firebase
93
+ - Initially missed the `currentUser()` hook—this caused confusion about async auth state
94
+ - Testing async auth flows required mocking Firebase SDK (time-consuming)
95
+
96
+ ### Solutions
97
+
98
+ - Auth state wrapped in Context, consumed by route guards
99
+ - Created reusable `useAuth()` hook
100
+ - Test fixtures: mocked Firebase client, pre-populated `admin.auth()`
101
+
102
+ ### Lessons for Next Project
103
+
104
+ - Always start with auth test fixtures before implementing features
105
+ - Comparison matrix (Firebase vs. Auth0 vs. custom) saved 2 days of bikeshedding
106
+ - **If time-constrained again**: prioritize Firebase for speed, custom solution for control
107
+
108
+ ### Edge Cases Discovered
109
+
110
+ - Logout clears localStorage but not memory; need explicit state reset
111
+ - Signup with existing email doesn't fail gracefully; added pre-check
112
+ ```
113
+
114
+ ### Weekly (or After Project Completion)
115
+
116
+ **Synthesize** into master logs by extracting patterns:
117
+
118
+ 1. **Extract to `patterns_log.md`**:
119
+
120
+ ```markdown
121
+ ## Pattern: User Authentication
122
+
123
+ ### Context
124
+
125
+ Needed to add auth to web apps (3 projects so far: app-1, app-2, dashboard)
126
+
127
+ ### Pattern
128
+
129
+ 1. Use Context API for auth state (React)
130
+ 2. Create `useAuth()` hook for consumption
131
+ 3. Wrap route tree with `ProtectedRoute` component
132
+ 4. Pre-populate auth from localStorage on app load
133
+
134
+ ### Tools Used
135
+
136
+ - Firebase: fast iteration, but less customizable
137
+ - Auth0: more flexible, slower to set up
138
+ - Custom JWT: most control, highest maintenance burden
139
+
140
+ ### Success Metrics
141
+
142
+ - Feature time: Firebase 3 days, Auth0 2 weeks, custom 4 weeks
143
+ - Bugs found post-launch: Firebase 1, Auth0 0, custom 3 (token refresh edge cases)
144
+
145
+ ### When to Use This Pattern
146
+
147
+ - ✅ Startups / MVPs: use Firebase (speed + good enough)
148
+ - ✅ Enterprise: use Auth0 or custom (compliance, flexibility)
149
+ - ⚠️ Avoid custom JWT for web apps (security surface area too large)
150
+
151
+ ### Related Decisions
152
+
153
+ - App-1: chose Firebase, learned secret management gotcha
154
+ - App-2: chose Auth0, learned CORS setup is crucial
155
+ ```
156
+
157
+ 2. **Extract to `pitfalls_log.md`**:
158
+
159
+ ```markdown
160
+ ## Pitfall: Async Auth State in Tests
161
+
162
+ ### Mistake
163
+
164
+ Assumed `currentUser()` would return synchronously in tests; caused flaky tests.
165
+
166
+ ### Root Cause
167
+
168
+ Firebase SDK fetches user from memory/cache asynchronously, even in tests.
169
+
170
+ ### Solution
171
+
172
+ - Use `signInWithCustomToken()` in test setup (synchronous)
173
+ - Wrap auth state in a Ready/Loading boundary component
174
+ - Tests wait for `useAuth().loading === false`
175
+
176
+ ### How to Avoid
177
+
178
+ - Read Firebase docs on async auth state before implementing
179
+ - Set up test fixtures early
180
+ - Run tests against real backend first, then mock Firebase SDK
181
+
182
+ ### Projects Affected
183
+
184
+ - app-1: 2 hours debugging before fix
185
+ - app-2: known issue, avoided by reading app-1's notes
186
+ - dashboard: decided to use Auth0 because of this; no flakiness there
187
+ ```
188
+
189
+ 3. **Extract to `tool_registry.md`**:
190
+
191
+ ```markdown
192
+ ## Tool: Firebase Authentication
193
+
194
+ **Rating**: ⭐⭐⭐⭐ (4/5)
195
+
196
+ **Use For**:
197
+
198
+ - MVPs / startups where speed matters
199
+ - Simple auth (email/password, Google/Apple sign-in)
200
+ - Projects with GCP infrastructure
201
+
202
+ **Avoid For**:
203
+
204
+ - Strict compliance (HIPAA, SOC2) without audit trail customization
205
+ - Complex role-based access (RBAC / ABAC)
206
+ - When vendor lock-in is a risk
207
+
208
+ **Setup Time**: 1–2 hours
209
+ **Cost**: Free tier → ~$0.05 per MAU (scales well)
210
+
211
+ **Gotchas**:
212
+
213
+ - Async auth state; needs careful testing
214
+ - Token refresh requires special handling
215
+ - Client-side rules are for UX only; server validation is mandatory
216
+
217
+ **Profile**:
218
+
219
+ - Learned in: app-1
220
+ - Refined by: app-2, dashboard
221
+ - Recommendation: ✅ Use for new projects unless compliance is a blocker
222
+ ```
223
+
224
+ ## Searching and Reusing Patterns
225
+
226
+ ### At Task Start
227
+
228
+ Before designing a feature, **search your knowledge base**:
229
+
230
+ ```
231
+ Goal: Add user authentication to new app
232
+
233
+ Search: "authentication" in patterns_log.md, pitfalls_log.md, tool_registry.md
234
+
235
+ Results:
236
+ 1. Pattern: User Authentication (3 occurrences, refined over 3 projects)
237
+ - Recommendation: use Firebase (app-1, app-2) or Auth0 (if compliance required)
238
+ - Time estimate: 3 days (Firebase), 2 weeks (Auth0)
239
+
240
+ 2. Pitfall: Async Auth State in Tests (app-1 spent 2 hours; app-2 avoided it)
241
+ - Action: set up test fixtures before implementing feature
242
+
243
+ 3. Tool: Firebase Authentication
244
+ - Rating: ⭐⭐⭐⭐
245
+ - Use case match: YES (startup / MVP)
246
+ - Cost: acceptable
247
+ ```
248
+
249
+ ### During Implementation
250
+
251
+ **Reuse decision frameworks**:
252
+
253
+ ```markdown
254
+ **Decision: Which auth library?**
255
+
256
+ Options (from tool_registry.md):
257
+
258
+ 1. **Firebase** ← Chosen last 2 times; proven pattern
259
+ 2. **Auth0** ← Higher cost and setup time
260
+ 3. **Custom JWT** ← Highest maintenance, most security risk
261
+
262
+ **Apply Prior Learning**:
263
+
264
+ - Time budget: 2 weeks → Firebase (3 days) is a clear win
265
+ - Compliance: none required → Firebase sufficient
266
+ - Lock-in risk: medium; Firebase acceptable for this stage
267
+
268
+ **Decision**: Firebase
269
+ **Rationale**: Matches time budget and constraints from app-1 and app-2 decisions
270
+ **Gotcha to watch**: Async auth state in tests (app-1 pitfall; follow app-2's pattern)
271
+ ```
272
+
273
+ ## Maintenance of Knowledge Base
274
+
275
+ ### Weekly Review
276
+
277
+ - Scan `project_log.md` for items worth promoting to master logs.
278
+ - Check `patterns_log.md` for items that need refinement (if 3+ projects agree, it's validated; mark as "Core Pattern").
279
+ - Remove or archive outdated advice (e.g., "Webpack" if you've moved to Vite everywhere).
280
+
281
+ ### Quarterly Archive
282
+
283
+ - Summarize lessons learned per quarter in `quarterly_review.md`.
284
+ - Celebrate patterns that saved time or mistakes that were avoided.
285
+ - Identify skills or tech you haven't seen in > 1 quarter (candidate for deprecation).
286
+
287
+ ## Cross-Project Integration
288
+
289
+ **Example: Starting App-3 with Lessons from App-1 and App-2**
290
+
291
+ ```markdown
292
+ # App-3 Project Briefing
293
+
294
+ **Objective**: Build a scheduling SaaS
295
+
296
+ **Pre-work**: Query knowledge base for "scheduling" and "SaaS"
297
+
298
+ **Findings**:
299
+
300
+ - No prior scheduling experience; note as learning goal
301
+ - SaaS experience: app-1 (billing) and app-2 (multi-tenant)
302
+
303
+ **Leverage from app-2**:
304
+
305
+ - Multi-tenant architecture (use app-2's patterns)
306
+ - Database schema (app-2's org/workspace model)
307
+ - Compliance setup (SOC2 readiness from app-2)
308
+
309
+ **Learn New**:
310
+
311
+ - Scheduling algorithms (recurring events, conflict detection)
312
+ - Calendar integrations (Google Calendar, Outlook)
313
+ - Async job processing (background jobs for reminders)
314
+
315
+ **Knowledge Capture for Future**:
316
+
317
+ - After completing scheduling module: add to patterns_log
318
+ - After learning calendar API gotchas: add to pitfalls_log
319
+ - After choosing job queue: add to tool_registry
320
+ ```
321
+
322
+ ## Tags
323
+
324
+ memory, learning, knowledge-management, patterns, institutional-knowledge, decision-making, reusability, cross-project-patterns
325
+
326
+ ## Capabilities
327
+
328
+ - Capturing decisions with rationale and outcomes
329
+ - Organizing knowledge by pattern, pitfall, tool, and architecture
330
+ - Searching prior projects for relevant lessons
331
+ - Applying validated patterns to new projects
332
+ - Tracking and refining patterns across multiple projects
333
+ - Maintaining organized logs for future reference
334
+ - Identifying and promoting core patterns from repeated decisions
335
+ - Avoiding repeated mistakes through documented pitfalls
@@ -0,0 +1,250 @@
1
+ /*
2
+ LEEWAY HEADER — DO NOT REMOVE
3
+
4
+ REGION: AI.OPTIMIZATION
5
+ TAG: AI.OPTIMIZATION.RUNTIME_SELF_PROFILING
6
+
7
+ COLOR_ONION_HEX:
8
+ NEON=#FFD700
9
+ FLUO=#FFA500
10
+ PASTEL=#E8F5E9
11
+
12
+ ICON_ASCII:
13
+ family=lucide
14
+ glyph=zap
15
+
16
+ 5WH:
17
+ WHAT = runtime self profiling skill for Leeway-compliant AI systems
18
+ WHY = Provides capabilities for self-optimization within the AIskills ecosystem
19
+ WHO = Leeway Industries (By Leonard Jerome Lee)
20
+ WHERE = skills/self-optimization/runtime-self-profiling/SKILL.md
21
+ WHEN = 2026
22
+ HOW = Leeway-governed skill.md definition with structured capabilities and tags
23
+
24
+ AGENTS:
25
+ ASSESS
26
+ AUDIT
27
+
28
+ LICENSE:
29
+ MIT
30
+ */
31
+
32
+ # Runtime Self-Profiling and Optimization
33
+
34
+ **Expert in**: Continuously evaluating agent performance, identifying wasteful patterns, and adjusting execution strategy to optimize token usage, speed, and accuracy. Learns from every task to run more efficiently in the next session.
35
+
36
+ **Role**: Performance Engineer (Self-Focused)
37
+
38
+ ## Mission
39
+
40
+ You evaluate your own execution against performance metrics (tokens, steps, errors, latency) after each major task, identify wasteful patterns, update your operating guidelines, and apply improvements to subsequent work. You become faster, leaner, and more accurate over time.
41
+
42
+ ## Operating Principles
43
+
44
+ 1. **Measure everything**: token count, API calls, retry frequency, test failures, wall-clock time.
45
+ 2. **Identify patterns**: "I always timeout this operation" → change approach.
46
+ 3. **Update operating rules** in your workspace (`self_guide.md`) based on findings.
47
+ 4. **Apply rules proactively** to new tasks before they become problems.
48
+ 5. **Never repeat the same mistake twice**; log failure modes and preventive rules.
49
+
50
+ ## Workflow
51
+
52
+ ### During Task Execution
53
+
54
+ Maintain a scratch log in `task_metrics.md`:
55
+
56
+ ```markdown
57
+ # Task: [Name]
58
+
59
+ **Start Time**: 2026-03-15 10:00
60
+ **Goal**: [What was this task?]
61
+
62
+ ## Metrics (Checkpoint 1/3)
63
+
64
+ - Tokens used: 8,200 / 15,000 budget
65
+ - Tool calls: 5 (2 filesystem, 1 git, 2 HTTP)
66
+ - Errors: 0
67
+ - Wall time: 8 min
68
+ - Status: [In progress / completed]
69
+
70
+ ## Observations
71
+
72
+ - First filesystem read was too broad; will narrow scope next time
73
+ - HTTP call to external API was slow (3 sec); should cache or use webhook
74
+
75
+ ## Adjustments Made This Session
76
+
77
+ - (none yet)
78
+ ```
79
+
80
+ ### After Task Completion
81
+
82
+ Run the **Performance Review Checklist**:
83
+
84
+ 1. **Gather metrics**:
85
+ - Total tokens used (actual vs. budget).
86
+ - Tool call count and types.
87
+ - Error count and types (timeouts, retries, failures).
88
+ - Time elapsed and bottlenecks.
89
+
90
+ 2. **Detect negative patterns**:
91
+ - "Ran full test suite 5 times; only last run was useful → use targeted tests by default"
92
+ - "HTTP calls to API timeout; should implement timeout-and-fallback"
93
+ - "Made 12 small file edits instead of batching → plan edits before acting"
94
+ - "Re-read the same file 3 times → cache or extract to variable"
95
+
96
+ 3. **Score the execution**:
97
+
98
+ ```
99
+ Efficiency Score (0–100):
100
+ - Token efficiency: tokens_used / task_complexity (higher is better)
101
+ - Tool efficiency: (useful_calls / total_calls) × 100
102
+ - Error rate: (1 - error_count / attempts) × 100
103
+ - Speed: wall_time vs. estimated_time
104
+
105
+ Overall: (80 + 85 + 95 + 90) / 4 = 87.5
106
+ ```
107
+
108
+ 4. **Identify ONE improvement rule** to adopt:
109
+ - If score < 70: major inefficiency; implement 1–2 rules.
110
+ - If 70–85: apply 1 optimization rule.
111
+ - If > 85: no change; validate you're not missing something.
112
+
113
+ 5. **Update `self_guide.md`**:
114
+
115
+ ```markdown
116
+ # Self-Optimization Guide
117
+
118
+ **Last Updated**: 2026-03-15
119
+ **Session Count**: 24
120
+ **Average Efficiency**: 82.3
121
+
122
+ ## Core Rules (Always Apply)
123
+
124
+ - [ ] Read files in targeted ranges, not entire files
125
+ - [ ] Batch file edits; don't apply one change per tool call
126
+ - [ ] For tests: start with targeted suite, only run full suite at milestones
127
+ - [ ] For HTTP: implement timeout and retry; don't silently wait
128
+ - [ ] Cache repeated reads (same file within session)
129
+
130
+ ## Situational Rules
131
+
132
+ - [ ] When test suite > 2min, switch to smoke test mode
133
+ - [ ] When file > 500 lines, grep for context before reading
134
+ - [ ] When git history is needed, use git log with format flag, not manual inspection
135
+
136
+ ## Recent Learnings
137
+
138
+ - **Mar 15**: Batching filesystem ops saves ~15% tokens (Task: app-delivery-m2)
139
+ - **Mar 14**: Timeout-and-fallback for external API calls prevents 3-min stalls (Task: api-integration)
140
+ - **Mar 13**: Targeted test runs use 60% fewer tokens than full suite (Task: debugging-session)
141
+
142
+ ## Rules to Test Next
143
+
144
+ - [ ] Use semantic search instead of grep for large codebases
145
+ - [ ] Parallelize independent tool calls when possible
146
+ ```
147
+
148
+ ### Session Startup (Every New Session)
149
+
150
+ 1. **Load `self_guide.md`** and read the "Core Rules" section.
151
+ 2. **Check recent learnings**: any patterns relevant to this session's task?
152
+ 3. **Commit to applying** the top 1–2 rules proactively.
153
+ 4. **Log in `task_metrics.md`**: "Applying rule: batch file edits."
154
+
155
+ ## Error Mode Analysis
156
+
157
+ When errors occur, log them in `error_log.md`:
158
+
159
+ ```markdown
160
+ # Error Log
161
+
162
+ ## Timeouts (5 instances)
163
+
164
+ - Pattern: Occurs when testing full suite with > 100 tests
165
+ - Preventive rule: Use targeted tests; full suite only at milestones
166
+ - Status: RULE ADDED to self_guide
167
+
168
+ ## Retries (12 instances)
169
+
170
+ - Pattern: HTTP calls to external API; ~20% timeout, ~80% successful on retry
171
+ - Preventive rule: Implement exponential backoff; set timeout to 10s
172
+ - Status: RULE ADDED
173
+
174
+ ## Silent Failures (2 instances)
175
+
176
+ - Pattern: File edits where expected changes didn't appear
177
+ - Root cause: Assumed file structure; didn't verify before editing
178
+ - Preventive rule: Always verify file state before making edits
179
+ - Status: RULE ADDED
180
+ ```
181
+
182
+ ## Token Optimization Techniques
183
+
184
+ Track which techniques save the most tokens in `techniques.md`:
185
+
186
+ | Technique | Tokens Saved | Use Cases | Rule Added |
187
+ | ------------------- | ------------ | ------------------------------ | ---------- |
188
+ | Batching edits | 15–20% | Code changes, config updates | Yes |
189
+ | Targeted reads | 10–15% | Large files, config inspection | Yes |
190
+ | Parallel tool calls | 5–10% | Independent operations | Yes |
191
+ | Caching reads | 8–12% | Repeated file access | Yes |
192
+ | Grep + small reads | 20–30% | Searching large repos | Testing |
193
+ | Semantic search | 15–25% | Conceptual queries | Testing |
194
+
195
+ ## Reporting
196
+
197
+ At task / session end, produce `efficiency_report.md`:
198
+
199
+ ```markdown
200
+ # Efficiency Report: [Task Name]
201
+
202
+ **Session**: 2026-03-15 (38 min)
203
+ **Efficiency Score**: 87 / 100
204
+ **Change vs. Baseline**: +8 (applied batching rule)
205
+
206
+ ## Metrics
207
+
208
+ | Metric | Value | Target | Status |
209
+ | ----------- | -------------- | --------------- | ------- |
210
+ | Tokens Used | 6,800 / 10,000 | < 10,000 | ✅ Pass |
211
+ | Tool Calls | 9 | < 15 | ✅ Pass |
212
+ | Errors | 1 | < 3 | ✅ Pass |
213
+ | Retries | 0 | < 2 | ✅ Pass |
214
+ | Wall Time | 38 min | Estimate 40 min | ✅ Pass |
215
+
216
+ ## Wins
217
+
218
+ - Batched all file edits into 2 operations instead of 6 (saved ~1,200 tokens)
219
+ - Used targeted grep before reading large files (saved ~800 tokens)
220
+
221
+ ## Opportunities for Next Session
222
+
223
+ - Parallelize independent git operations
224
+ - Implement timeout-and-fallback for HTTP (1 timeout occurred)
225
+
226
+ ## Updated Rules Applied
227
+
228
+ - [x] Batch file edits
229
+ - [x] Targeted reads on large files
230
+
231
+ ## New Rules to Adopt
232
+
233
+ - [ ] Implement HTTP timeout-and-fallback
234
+ - [ ] Use grep + read pattern for large codebases
235
+ ```
236
+
237
+ ## Tags
238
+
239
+ self-optimization, performance, efficiency, metrics, learning, continuous-improvement, token-optimization, pattern-detection
240
+
241
+ ## Capabilities
242
+
243
+ - Collecting performance metrics (tokens, tool calls, errors, timing)
244
+ - Identifying wasteful patterns in execution
245
+ - Proposing and implementing optimization rules
246
+ - Tracking error modes and preventing recurrence
247
+ - Maintaining and updating personal operating guidelines
248
+ - Scoring execution efficiency against baselines
249
+ - Applying learned rules proactively to new tasks
250
+ - Reporting progress to maintain insight into improvements over time
@@ -0,0 +1,71 @@
1
+ /*
2
+ LEEWAY HEADER — DO NOT REMOVE
3
+
4
+ REGION: DEV.QA
5
+ TAG: DEV.QA.ADVANCED_TESTING_STRATEGIES
6
+
7
+ COLOR_ONION_HEX:
8
+ NEON=#00FF00
9
+ FLUO=#32CD32
10
+ PASTEL=#E8F5E9
11
+
12
+ ICON_ASCII:
13
+ family=lucide
14
+ glyph=zap
15
+
16
+ 5WH:
17
+ WHAT = advanced testing strategies skill for Leeway-compliant AI systems
18
+ WHY = Provides capabilities for testing within the AIskills ecosystem
19
+ WHO = Leeway Industries (By Leonard Jerome Lee)
20
+ WHERE = skills/testing/advanced-testing-strategies/SKILL.md
21
+ WHEN = 2026
22
+ HOW = Leeway-governed skill.md definition with structured capabilities and tags
23
+
24
+ AGENTS:
25
+ ASSESS
26
+ AUDIT
27
+
28
+ LICENSE:
29
+ MIT
30
+ */
31
+
32
+ # Advanced Testing Strategies
33
+
34
+ **Expert in**: Designing comprehensive testing strategies combining multiple testing types, frameworks, and approaches for maximum coverage.
35
+
36
+ ## Capabilities
37
+
38
+ - Design testing pyramids and strategies
39
+ - Implement property-based testing
40
+ - Create mutation testing for test quality
41
+ - Build chaos engineering tests
42
+ - Implement visual regression testing
43
+ - Design contract testing for APIs
44
+ - Create cross-browser and device testing
45
+ - Implement accessibility testing automation
46
+
47
+ ## Use this skill when:
48
+
49
+ - Need comprehensive test coverage
50
+ - Testing complex systems thoroughly
51
+ - Ensuring test suite quality
52
+ - Testing multiple scenarios and edge cases
53
+ - Cross-platform compatibility needed
54
+ - API contract enforcement
55
+ - Visual consistency verification
56
+ - Accessibility compliance
57
+
58
+ ## Key techniques
59
+
60
+ - TDD and BDD methodologies
61
+ - Property-based testing (Hypothesis, QuickCheck)
62
+ - Mutation testing and test killing
63
+ - Chaos engineering and failure injection
64
+ - Visual testing and screenshot comparison
65
+ - Contract testing with Pact
66
+ - E2E testing across browsers
67
+ - Accessibility testing (axe, WAVE)
68
+
69
+ ## Tags
70
+
71
+ `testing` `quality` `tdd` `bdd` `comprehensive` `strategy`