fraim-framework 2.0.65 → 2.0.67

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 (254) hide show
  1. package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +101 -0
  2. package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +235 -0
  3. package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +243 -0
  4. package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +206 -0
  5. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +73 -0
  6. package/dist/registry/ai-manager-rules/design-phases/design-design.md +145 -0
  7. package/dist/registry/ai-manager-rules/design-phases/design.md +108 -0
  8. package/dist/registry/ai-manager-rules/design-phases/finalize.md +60 -0
  9. package/dist/registry/ai-manager-rules/design-phases/validate.md +125 -0
  10. package/dist/registry/ai-manager-rules/design.json +97 -0
  11. package/dist/registry/ai-manager-rules/implement-phases/code.md +323 -0
  12. package/dist/registry/ai-manager-rules/implement-phases/completeness-review.md +94 -0
  13. package/dist/registry/ai-manager-rules/implement-phases/finalize.md +177 -0
  14. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +283 -0
  15. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +120 -0
  16. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +173 -0
  17. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +104 -0
  18. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +100 -0
  19. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +237 -0
  20. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +121 -0
  21. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +375 -0
  22. package/dist/registry/ai-manager-rules/implement-phases/quality-review.md +304 -0
  23. package/dist/registry/ai-manager-rules/implement-phases/regression.md +159 -0
  24. package/dist/registry/ai-manager-rules/implement-phases/repro.md +101 -0
  25. package/dist/registry/ai-manager-rules/implement-phases/scoping.md +93 -0
  26. package/dist/registry/ai-manager-rules/implement-phases/smoke.md +225 -0
  27. package/dist/registry/ai-manager-rules/implement-phases/spike.md +118 -0
  28. package/dist/registry/ai-manager-rules/implement-phases/validate.md +347 -0
  29. package/dist/registry/ai-manager-rules/implement.json +153 -0
  30. package/dist/registry/ai-manager-rules/retrospective.md +116 -0
  31. package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +188 -0
  32. package/dist/registry/ai-manager-rules/shared-phases/finalize.md +169 -0
  33. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +202 -0
  34. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +170 -0
  35. package/dist/registry/ai-manager-rules/spec-phases/finalize.md +60 -0
  36. package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +105 -0
  37. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +66 -0
  38. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +139 -0
  39. package/dist/registry/ai-manager-rules/spec-phases/spec.md +102 -0
  40. package/dist/registry/ai-manager-rules/spec-phases/validate.md +118 -0
  41. package/dist/registry/ai-manager-rules/spec.json +112 -0
  42. package/dist/registry/ai-manager-rules/test.json +98 -0
  43. package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +60 -0
  44. package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +23 -0
  45. package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +22 -0
  46. package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +21 -0
  47. package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +19 -0
  48. package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +15 -0
  49. package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +45 -0
  50. package/dist/registry/delivery/address-feedback.md +83 -0
  51. package/dist/registry/delivery/retrospective.md +78 -0
  52. package/dist/registry/delivery/submit.md +79 -0
  53. package/dist/registry/providers/ado.json +19 -0
  54. package/dist/registry/providers/delivery-conversation.json +9 -0
  55. package/dist/registry/providers/delivery-pr.json +9 -0
  56. package/dist/registry/providers/github.json +19 -0
  57. package/dist/registry/rules/agent-success-criteria.md +101 -0
  58. package/dist/registry/rules/agent-testing-guidelines.md +502 -0
  59. package/dist/registry/rules/architecture.md +126 -0
  60. package/dist/registry/rules/communication.md +122 -0
  61. package/dist/registry/rules/continuous-learning.md +55 -0
  62. package/dist/registry/rules/debugging-multitenancy-issues.md +85 -0
  63. package/dist/registry/rules/ephemeral-execution.md +54 -0
  64. package/dist/registry/rules/git-safe-commands.md +34 -0
  65. package/dist/registry/rules/hitl-ppe-record-analysis.md +302 -0
  66. package/dist/registry/rules/integrity-and-test-ethics.md +275 -0
  67. package/dist/registry/rules/local-development.md +275 -0
  68. package/dist/registry/rules/mandatory-pre-completion-reflection.md +193 -0
  69. package/dist/registry/rules/merge-requirements.md +238 -0
  70. package/dist/registry/rules/simplicity.md +118 -0
  71. package/dist/registry/rules/software-development-lifecycle.md +105 -0
  72. package/dist/registry/rules/spike-first-development.md +205 -0
  73. package/dist/registry/rules/successful-debugging-patterns.md +488 -0
  74. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  75. package/dist/registry/scripts/cleanup-branch.js +287 -0
  76. package/dist/registry/scripts/evaluate-code-quality.js +66 -0
  77. package/dist/registry/scripts/exec-with-timeout.js +142 -0
  78. package/dist/registry/scripts/fraim-config.js +61 -0
  79. package/dist/registry/scripts/generate-engagement-emails.js +705 -0
  80. package/dist/registry/scripts/generic-issues-api.js +100 -0
  81. package/dist/registry/scripts/newsletter-helpers.js +671 -0
  82. package/dist/registry/scripts/openapi-generator.js +664 -0
  83. package/dist/registry/scripts/performance/profile-server.js +390 -0
  84. package/dist/registry/scripts/profile-server.js +389 -0
  85. package/dist/registry/scripts/run-thank-you-workflow.js +92 -0
  86. package/dist/registry/scripts/send-newsletter-simple.js +85 -0
  87. package/dist/registry/scripts/send-thank-you-emails.js +54 -0
  88. package/dist/registry/scripts/validate-openapi-limits.js +311 -0
  89. package/dist/registry/scripts/validate-test-coverage.js +262 -0
  90. package/dist/registry/scripts/verify-test-coverage.js +66 -0
  91. package/dist/registry/stubs/workflows/azure/cost-optimization.md +11 -0
  92. package/dist/registry/stubs/workflows/bootstrap/create-architecture.md +11 -0
  93. package/dist/registry/stubs/workflows/bootstrap/detect-broken-windows.md +11 -0
  94. package/dist/registry/stubs/workflows/bootstrap/evaluate-code-quality.md +11 -0
  95. package/dist/registry/stubs/workflows/bootstrap/verify-test-coverage.md +11 -0
  96. package/dist/registry/stubs/workflows/brainstorming/blue-sky-brainstorming.md +11 -0
  97. package/dist/registry/stubs/workflows/brainstorming/codebase-brainstorming.md +11 -0
  98. package/dist/registry/stubs/workflows/business-development/create-business-plan.md +11 -0
  99. package/dist/registry/stubs/workflows/business-development/ideate-business-opportunity.md +11 -0
  100. package/dist/registry/stubs/workflows/business-development/price-product.md +18 -0
  101. package/dist/registry/stubs/workflows/compliance/detect-compliance-requirements.md +11 -0
  102. package/dist/registry/stubs/workflows/compliance/generate-audit-evidence.md +11 -0
  103. package/dist/registry/stubs/workflows/compliance/soc2-evidence-generator.md +11 -0
  104. package/dist/registry/stubs/workflows/customer-development/insight-analysis.md +11 -0
  105. package/dist/registry/stubs/workflows/customer-development/insight-triage.md +11 -0
  106. package/dist/registry/stubs/workflows/customer-development/interview-preparation.md +11 -0
  107. package/dist/registry/stubs/workflows/customer-development/linkedin-outreach.md +11 -0
  108. package/dist/registry/stubs/workflows/customer-development/strategic-brainstorming.md +11 -0
  109. package/dist/registry/stubs/workflows/customer-development/thank-customers.md +11 -0
  110. package/dist/registry/stubs/workflows/customer-development/user-survey-dispatch.md +11 -0
  111. package/dist/registry/stubs/workflows/customer-development/users-to-target.md +11 -0
  112. package/dist/registry/stubs/workflows/customer-development/weekly-newsletter.md +11 -0
  113. package/dist/registry/stubs/workflows/deploy/cloud-deployment.md +11 -0
  114. package/dist/registry/stubs/workflows/improve-fraim/contribute.md +11 -0
  115. package/dist/registry/stubs/workflows/improve-fraim/file-issue.md +11 -0
  116. package/dist/registry/stubs/workflows/learning/build-skillset.md +11 -0
  117. package/dist/registry/stubs/workflows/learning/synthesize-learnings.md +11 -0
  118. package/dist/registry/stubs/workflows/legal/contract-review-analysis.md +11 -0
  119. package/dist/registry/stubs/workflows/legal/nda.md +11 -0
  120. package/dist/registry/stubs/workflows/legal/patent-filing.md +11 -0
  121. package/dist/registry/stubs/workflows/legal/saas-contract-development.md +11 -0
  122. package/dist/registry/stubs/workflows/legal/trademark-filing.md +11 -0
  123. package/dist/registry/stubs/workflows/marketing/content-creation.md +11 -0
  124. package/dist/registry/stubs/workflows/marketing/convert-to-pdf.md +11 -0
  125. package/dist/registry/stubs/workflows/marketing/create-modern-website.md +11 -0
  126. package/dist/registry/stubs/workflows/marketing/domain-registration.md +11 -0
  127. package/dist/registry/stubs/workflows/marketing/evangelize.md +11 -0
  128. package/dist/registry/stubs/workflows/marketing/hbr-article.md +11 -0
  129. package/dist/registry/stubs/workflows/marketing/launch-checklist.md +11 -0
  130. package/dist/registry/stubs/workflows/marketing/marketing-strategy.md +11 -0
  131. package/dist/registry/stubs/workflows/marketing/storytelling.md +11 -0
  132. package/dist/registry/stubs/workflows/performance/analyze-performance.md +11 -0
  133. package/dist/registry/stubs/workflows/product-building/design.md +11 -0
  134. package/dist/registry/stubs/workflows/product-building/implement.md +11 -0
  135. package/dist/registry/stubs/workflows/product-building/iterate-on-pr-comments.md +11 -0
  136. package/dist/registry/stubs/workflows/product-building/prep-issue.md +11 -0
  137. package/dist/registry/stubs/workflows/product-building/prototype.md +11 -0
  138. package/dist/registry/stubs/workflows/product-building/resolve.md +11 -0
  139. package/dist/registry/stubs/workflows/product-building/retrospect.md +11 -0
  140. package/dist/registry/stubs/workflows/product-building/spec.md +11 -0
  141. package/dist/registry/stubs/workflows/product-building/test.md +11 -0
  142. package/dist/registry/stubs/workflows/productivity-report/productivity-report.md +11 -0
  143. package/dist/registry/stubs/workflows/quality-assurance/browser-validation.md +11 -0
  144. package/dist/registry/stubs/workflows/quality-assurance/iterative-improvement-cycle.md +11 -0
  145. package/dist/registry/stubs/workflows/replicate/replicate-discovery.md +11 -0
  146. package/dist/registry/stubs/workflows/replicate/replicate-to-issues.md +11 -0
  147. package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-design-spec.md +11 -0
  148. package/dist/registry/stubs/workflows/reviewer/review-implementation-vs-feature-spec.md +11 -0
  149. package/dist/registry/stubs/workflows/startup-credits/aws-activate-application.md +11 -0
  150. package/dist/registry/stubs/workflows/startup-credits/google-cloud-application.md +11 -0
  151. package/dist/registry/stubs/workflows/startup-credits/microsoft-azure-application.md +11 -0
  152. package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -0
  153. package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +37 -0
  154. package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +35 -0
  155. package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +29 -0
  156. package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +126 -0
  157. package/dist/registry/templates/customer-development/customer-interview-template.md +99 -0
  158. package/dist/registry/templates/customer-development/customer-persona-template.md +69 -0
  159. package/dist/registry/templates/customer-development/follow-up-email-templates.md +132 -0
  160. package/dist/registry/templates/customer-development/insight-analysis-template.md +74 -0
  161. package/dist/registry/templates/customer-development/prospect-inventory-template.csv +3 -0
  162. package/dist/registry/templates/customer-development/search-strategy-template.md +123 -0
  163. package/dist/registry/templates/customer-development/strategic-recommendations-template.md +53 -0
  164. package/dist/registry/templates/customer-development/thank-you-email-template.html +124 -0
  165. package/dist/registry/templates/customer-development/thank-you-note-template.md +16 -0
  166. package/dist/registry/templates/customer-development/triage-log-template.md +278 -0
  167. package/dist/registry/templates/customer-development/weekly-newsletter-template.html +204 -0
  168. package/dist/registry/templates/evidence/Design-Evidence.md +30 -0
  169. package/dist/registry/templates/evidence/Implementation-BugEvidence.md +122 -0
  170. package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +160 -0
  171. package/dist/registry/templates/evidence/Spec-Evidence.md +19 -0
  172. package/dist/registry/templates/help/HelpNeeded.md +14 -0
  173. package/dist/registry/templates/legal/NDA-TEMPLATE.md +170 -0
  174. package/dist/registry/templates/legal/PATENT-TEMPLATE.md +372 -0
  175. package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +339 -0
  176. package/dist/registry/templates/legal/contract-review-checklist.md +193 -0
  177. package/dist/registry/templates/legal/review-report-template.md +198 -0
  178. package/dist/registry/templates/legal/saas-terms-template.md +174 -0
  179. package/dist/registry/templates/legal/sow-template.md +117 -0
  180. package/dist/registry/templates/legal/template-variables.md +131 -0
  181. package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +194 -0
  182. package/dist/registry/templates/marketing/EVANGELIZE-TEMPLATE.md +102 -0
  183. package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +66 -0
  184. package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +130 -0
  185. package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +262 -0
  186. package/dist/registry/templates/marketing/github-pages-workflow.yml +64 -0
  187. package/dist/registry/templates/replicate/implementation-checklist.md +39 -0
  188. package/dist/registry/templates/replicate/use-cases-template.md +88 -0
  189. package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +55 -0
  190. package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +37 -0
  191. package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +66 -0
  192. package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +39 -0
  193. package/dist/registry/workflows/azure/cost-optimization.md +772 -0
  194. package/dist/registry/workflows/bootstrap/create-architecture.md +37 -0
  195. package/dist/registry/workflows/bootstrap/detect-broken-windows.md +300 -0
  196. package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +35 -0
  197. package/dist/registry/workflows/bootstrap/verify-test-coverage.md +36 -0
  198. package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +211 -0
  199. package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +159 -0
  200. package/dist/registry/workflows/business-development/create-business-plan.md +737 -0
  201. package/dist/registry/workflows/business-development/ideate-business-opportunity.md +55 -0
  202. package/dist/registry/workflows/business-development/price-product.md +325 -0
  203. package/dist/registry/workflows/compliance/detect-compliance-requirements.md +80 -0
  204. package/dist/registry/workflows/compliance/generate-audit-evidence.md +80 -0
  205. package/dist/registry/workflows/compliance/soc2-evidence-generator.md +332 -0
  206. package/dist/registry/workflows/customer-development/insight-analysis.md +156 -0
  207. package/dist/registry/workflows/customer-development/insight-triage.md +933 -0
  208. package/dist/registry/workflows/customer-development/interview-preparation.md +452 -0
  209. package/dist/registry/workflows/customer-development/linkedin-outreach.md +599 -0
  210. package/dist/registry/workflows/customer-development/strategic-brainstorming.md +146 -0
  211. package/dist/registry/workflows/customer-development/thank-customers.md +203 -0
  212. package/dist/registry/workflows/customer-development/user-survey-dispatch.md +312 -0
  213. package/dist/registry/workflows/customer-development/users-to-target.md +427 -0
  214. package/dist/registry/workflows/customer-development/weekly-newsletter.md +366 -0
  215. package/dist/registry/workflows/deploy/cloud-deployment.md +310 -0
  216. package/dist/registry/workflows/improve-fraim/contribute.md +32 -0
  217. package/dist/registry/workflows/improve-fraim/file-issue.md +32 -0
  218. package/dist/registry/workflows/learning/build-skillset.md +212 -0
  219. package/dist/registry/workflows/learning/synthesize-learnings.md +369 -0
  220. package/dist/registry/workflows/legal/contract-review-analysis.md +382 -0
  221. package/dist/registry/workflows/legal/nda.md +69 -0
  222. package/dist/registry/workflows/legal/patent-filing.md +76 -0
  223. package/dist/registry/workflows/legal/saas-contract-development.md +204 -0
  224. package/dist/registry/workflows/legal/trademark-filing.md +77 -0
  225. package/dist/registry/workflows/marketing/content-creation.md +40 -0
  226. package/dist/registry/workflows/marketing/convert-to-pdf.md +265 -0
  227. package/dist/registry/workflows/marketing/create-modern-website.md +456 -0
  228. package/dist/registry/workflows/marketing/domain-registration.md +323 -0
  229. package/dist/registry/workflows/marketing/evangelize.md +426 -0
  230. package/dist/registry/workflows/marketing/hbr-article.md +73 -0
  231. package/dist/registry/workflows/marketing/launch-checklist.md +37 -0
  232. package/dist/registry/workflows/marketing/marketing-strategy.md +45 -0
  233. package/dist/registry/workflows/marketing/storytelling.md +65 -0
  234. package/dist/registry/workflows/performance/analyze-performance.md +65 -0
  235. package/dist/registry/workflows/product-building/design.md +263 -0
  236. package/dist/registry/workflows/product-building/implement.md +771 -0
  237. package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +70 -0
  238. package/dist/registry/workflows/product-building/prep-issue.md +41 -0
  239. package/dist/registry/workflows/product-building/prototype.md +60 -0
  240. package/dist/registry/workflows/product-building/resolve.md +175 -0
  241. package/dist/registry/workflows/product-building/retrospect.md +86 -0
  242. package/dist/registry/workflows/product-building/spec.md +303 -0
  243. package/dist/registry/workflows/product-building/test.md +125 -0
  244. package/dist/registry/workflows/productivity-report/productivity-report.md +263 -0
  245. package/dist/registry/workflows/quality-assurance/browser-validation.md +221 -0
  246. package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -0
  247. package/dist/registry/workflows/replicate/replicate-discovery.md +336 -0
  248. package/dist/registry/workflows/replicate/replicate-to-issues.md +319 -0
  249. package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +694 -0
  250. package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +734 -0
  251. package/dist/registry/workflows/startup-credits/aws-activate-application.md +535 -0
  252. package/dist/registry/workflows/startup-credits/google-cloud-application.md +647 -0
  253. package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +538 -0
  254. package/package.json +2 -1
@@ -0,0 +1,65 @@
1
+ # Performance Analysis Phase
2
+
3
+ ## INTENT
4
+ To diagnose production performance issues (CPU, Memory, Swap) and provide actionable recommendations for stabilization without performing direct application or infrastructure modifications.
5
+
6
+ ## PRINCIPLES
7
+ - **Observational Only**: Do not modify code or infrastructure during this phase.
8
+ - **Data-Driven**: Base all recommendations on metrics collected from the environment.
9
+ - **Non-Invasive**: Use non-destructive commands that do not impact server stability.
10
+ - **Actionable**: Provide clear, prioritized recommendations for remediation.
11
+
12
+ ## ANALYSIS WORKFLOW
13
+
14
+ ### Step 1: Run the Performance Profiler
15
+ Execute the profiling script against the production environment to collect plan-level and process-level metrics.
16
+
17
+ **Note**: `profile-server.ts` has FRAIM dependencies and requires ephemeral execution.
18
+
19
+ ```bash
20
+ # Get the profile-server script ephemerally (has FRAIM dependencies)
21
+ # Use get_fraim_file({ path: "scripts/performance/profile-server.ts" }) and save to tmp/profile-server.ts
22
+ npx tsx tmp/profile-server.ts --prod
23
+ ```
24
+
25
+ ### Step 2: Inspect Automated Diagnosis
26
+ Review the "Step 4: Automated Diagnosis" section of the output.
27
+ It will specifically check for:
28
+ - **Swap Death**: If >95% swap is used, the server is thrashing.
29
+ - **Absent Application**: If `server.js` is missing, the infrastructure is healthy but the app is crashed/not starting.
30
+ - **Infrastructure Hogs**: If Azure agents (Kudu/dotnet) are consuming excessive RAM.
31
+
32
+ ### Step 3: Deep Dive Log Analysis
33
+ If a crash loop or high operation frequency is suspected, collect and analyze application logs using the same script with the `--logs` flag.
34
+
35
+ ```bash
36
+ # Use the same ephemeral script with logs flag
37
+ npx tsx tmp/profile-server.ts --prod --logs
38
+ ```
39
+ Look for:
40
+ - Frequency of initialization logs (e.g., "Ensured unique index").
41
+ - Patterns indicative of OOM events or unhandled exceptions.
42
+ - High volume of specific operations (e.g., decryptions) suggesting an infinite loop.
43
+
44
+ ### Step 4: Formulate Recommendations
45
+ Based on the diagnosis, provide specific recommendations in your response or an implementation plan (if a fix is needed in a subsequent phase).
46
+ Examples:
47
+ - **Restart**: If swap usage is high or rogue processes are detected.
48
+ - **Upgrade Plan**: If physical memory is chronically saturated (B1 to P1v3).
49
+ - **Code Optimization**: If log analysis reveals initialization loops or leaks.
50
+
51
+ ## EXAMPLES
52
+
53
+ ### Good Analysis
54
+ > "The profiler shows 98% CPU usage and 'Swap Death'. The logs show 'Ensured unique index' occurring 100 times per minute. I recommend implementing an initialization guard in `PrismaDatabaseService` to break this loop."
55
+
56
+ ### Bad Analysis (Do not do)
57
+ > "I found a loop, so I've updated `server.ts` to fix it."
58
+ > *Correction: Propose the fix first, do not implement it within the analysis workflow.*
59
+
60
+ ## COMPLETION CHECKLIST
61
+ - [ ] Profiler run successfully on production.
62
+ - [ ] Resource bottlenecks (CPU/Mem/Swap) identified.
63
+ - [ ] Application process stability verified.
64
+ - [ ] Root cause hypothesis formulated based on metrics and logs.
65
+ - [ ] Prioritized recommendations delivered to the user.
@@ -0,0 +1,263 @@
1
+ ---
2
+ {
3
+ "name": "design",
4
+ "initialPhase": "design-design",
5
+ "phases": {
6
+ "design-design": {
7
+ "onSuccess": "design-completeness-review",
8
+ "onFailure": "design-design"
9
+ },
10
+ "design-completeness-review": {
11
+ "onSuccess": "submit",
12
+ "onFailure": "design-design"
13
+ },
14
+ "submit": {
15
+ "onSuccess": "address-feedback",
16
+ "onFailure": "submit"
17
+ },
18
+ "address-feedback": {
19
+ "onSuccess": "retrospective",
20
+ "onFailure": "design-design"
21
+ },
22
+ "retrospective": {
23
+ "onSuccess": null,
24
+ "onFailure": null
25
+ }
26
+ }
27
+ }
28
+ ---
29
+
30
+ # Workflow: design
31
+
32
+ # Design Workflow
33
+
34
+ ## INTENT
35
+ To create comprehensive technical design documents using a phase-based approach guided by the AI Mentor, ensuring proper architecture, clear requirements, and stakeholder alignment.
36
+
37
+ ## Phase: design-design
38
+
39
+ ### INTENT
40
+ To create a comprehensive technical design that translates the feature specification into implementable architecture, APIs, and technical solutions.
41
+
42
+ ### OUTCOME
43
+ A complete technical design document that:
44
+ - Translates spec requirements into technical architecture
45
+ - Defines APIs, data models, and system interactions
46
+ - Identifies technical risks and mitigation strategies
47
+ - Provides clear implementation guidance
48
+ - Includes technical validation criteria
49
+
50
+ ### PRINCIPLES
51
+ - **Spec-Driven**: Design directly addresses specification requirements
52
+ - **Implementation-Ready**: Provides clear technical guidance
53
+ - **Risk-Aware**: Identifies and mitigates technical risks
54
+ - **Validation-Focused**: Includes technical validation criteria
55
+ - **Template-Compliant**: Follows RFC template structure
56
+ - **Spike-First**: Follow usage of spikes for unfamiliar technology (read `rules/spike-first-development.md`)
57
+
58
+ ### WORKFLOW
59
+
60
+ #### Step 1: Get Issue Details
61
+
62
+ **Read Issue Details**: Use {{get_issue}} to get the complete issue information:
63
+ - Read the full issue description, title, and labels
64
+ - Check for linked documents (specs, RFCs, design docs)
65
+ - Review any comments or discussion threads
66
+ - Note acceptance criteria and requirements
67
+ - Identify if there's an existing specification document
68
+
69
+ #### Step 2: Load Template and Specification
70
+ - Call `get_fraim_file({ path: "templates/specs/TECHSPEC-TEMPLATE.md" })` (for features)
71
+ - Call `get_fraim_file({ path: "templates/specs/BUGSPEC-TEMPLATE.md" })` (for bugs)
72
+ - Read the completed specification document from previous phase
73
+ - Call `get_fraim_file({ path: "rules/spike-first-development.md" })`
74
+
75
+ #### Step 3: Check for PR Feedback
76
+
77
+ **CRITICAL**: Before creating design, check for feedback:
78
+ - **PR Review Feedback**: `docs/evidence/{issue_number}-design-feedback.md`
79
+
80
+ **If PR feedback exists:**
81
+ - **MUST address all UNADDRESSED items** before proceeding
82
+ - Update feedback file after addressing each item
83
+ - Change status from UNADDRESSED to ADDRESSED with resolution details
84
+ - Cannot skip or defer feedback items
85
+ - Phase cannot complete until all feedback is addressed
86
+
87
+ **PR Feedback File Format** (if exists):
88
+ ```markdown
89
+ ### Comment X - ADDRESSED
90
+ - **Author**: reviewer_name
91
+ - **Comment**: Original feedback
92
+ - **Status**: ADDRESSED
93
+ - **Resolution**: How you addressed this feedback
94
+ ```
95
+
96
+ #### Step 4: Analyze Specification Requirements
97
+ - Extract all technical requirements from specification
98
+ - Identify system components that need modification
99
+ - Determine API changes or additions needed
100
+ - Note any performance or scalability considerations
101
+ - List integration points with existing systems
102
+
103
+ #### Step 5: Create Technical Design Document
104
+ - Create RFC file at `docs/rfcs/{issue_number}-{kebab-case-title}.md`
105
+ - Follow appropriate template structure (TECHSPEC or BUGSPEC)
106
+ - Include all required sections:
107
+ - Problem statement (from spec)
108
+ - Technical requirements
109
+ - Proposed solution architecture
110
+ - API design and data models
111
+ - Implementation plan
112
+ - Testing strategy
113
+ - Risk assessment and mitigation
114
+ - Alternative approaches considered
115
+
116
+ #### Step 6: Design System Architecture
117
+ - Define component interactions and data flow
118
+ - Specify API endpoints and request/response formats
119
+ - Design database schema changes (if needed)
120
+ - Plan integration with existing systems
121
+ - Consider scalability and performance implications
122
+
123
+ #### Step 7: Identify Technical Risks
124
+ - List unfamiliar technologies or patterns
125
+ - Note complex integrations or dependencies
126
+ - Identify performance bottlenecks
127
+ - Consider security implications
128
+ - Plan risk mitigation strategies
129
+
130
+ #### Step 8: Apply Labels
131
+ - Use {{add_issue_labels}} to label the issue with `phase:design`
132
+ - This will trigger automatic PR creation/update
133
+
134
+ ### VALIDATION
135
+
136
+ #### Phase Complete When:
137
+ - ✅ Technical design document created using appropriate template
138
+ - ✅ All specification requirements addressed technically
139
+ - ✅ System architecture clearly defined
140
+ - ✅ API design and data models specified
141
+ - ✅ Technical risks identified and mitigation planned
142
+ - ✅ Implementation plan provides clear guidance
143
+ - ✅ Testing strategy defined
144
+ - ✅ **PR feedback addressed** (if `docs/evidence/{issue_number}-design-feedback.md` exists)
145
+ - ✅ Issue labeled with `phase:design`
146
+
147
+ #### Phase Incomplete If:
148
+ - ❌ Design document missing or incomplete
149
+ - ❌ Template structure not followed
150
+ - ❌ Specification requirements not addressed
151
+ - ❌ Architecture unclear or missing
152
+ - ❌ Technical risks not identified
153
+ - ❌ Implementation guidance insufficient
154
+ - ❌ **PR feedback not addressed** (UNADDRESSED items remain in feedback file)
155
+
156
+ ### Report Back:
157
+ When you complete this phase, call:
158
+
159
+ ```javascript
160
+ seekMentoring({
161
+ workflowType: "design",
162
+ issueNumber: "{issue_number}",
163
+ currentPhase: "design-design",
164
+ status: "complete",
165
+ evidence: {
166
+ designDocument: "docs/rfcs/{issue_number}-{title}.md",
167
+ templateUsed: "TECHSPEC-TEMPLATE.md",
168
+ architectureComponents: ["API layer", "Database schema", "UI components"],
169
+ technicalRisks: ["Integration with legacy system", "Performance at scale"],
170
+ issueLabeled: "phase:design"
171
+ },
172
+ findings: {
173
+ keyDecisions: ["Use REST API", "PostgreSQL for data storage", "React components"],
174
+ riskMitigation: ["Spike legacy integration", "Load testing plan"]
175
+ }
176
+ })
177
+ ```
178
+
179
+ ## Phase: design-completeness-review
180
+
181
+ ### INTENT
182
+ To verify that the technical design addresses all aspects of the functional specification, including the validation plan and testing strategy.
183
+
184
+ ### OUTCOME
185
+ Confirmation that:
186
+ - Design addresses all functional spec requirements
187
+ - Validation plan from spec is reflected in design
188
+ - Testing strategy covers all specified scenarios
189
+ - Technical approach enables spec validation
190
+ - Design is ready for implementation
191
+
192
+ ### WORKFLOW
193
+
194
+ #### Step 1: Load Functional Specification
195
+ - Read the functional specification document from `docs/feature specs/{issue_number}-*.md`
196
+ - Extract all requirements, user workflows, and validation criteria
197
+ - Note any UI mockups and interaction patterns
198
+
199
+ #### Step 2: Verify Spec Requirements Coverage
200
+ - Check that design addresses each functional requirement
201
+ - Confirm technical approach supports all user workflows from spec
202
+ - Verify API design enables the specified user experience
203
+ - Ensure data models support all spec requirements
204
+
205
+ #### Step 3: Validation Plan Alignment
206
+ **Critical**: The spec's validation plan must be implementable with this design
207
+ - Review validation scenarios from functional spec
208
+ - Confirm design provides necessary APIs/interfaces for validation
209
+ - Check that testing strategy covers all validation scenarios
210
+ - Verify design enables browser testing (if UI changes)
211
+ - Ensure backend validation points are accessible
212
+
213
+ #### Step 4: Technical Feasibility Check
214
+ - Confirm design is technically sound and implementable
215
+ - Check that all spec requirements can be built with this approach
216
+ - Verify integration points are well-defined
217
+ - Assess if design enables the spec's success criteria
218
+
219
+ ### VALIDATION
220
+
221
+ #### Phase Complete When:
222
+ - ✅ All functional spec requirements addressed in design
223
+ - ✅ Validation plan from spec is implementable with this design
224
+ - ✅ Testing strategy covers all spec scenarios
225
+ - ✅ Technical approach is sound and feasible
226
+ - ✅ Design enables spec success criteria
227
+ - ✅ Ready for implementation phase
228
+
229
+ #### Phase Incomplete If:
230
+ - ❌ Functional spec requirements not addressed
231
+ - ❌ Validation plan not implementable with current design
232
+ - ❌ Testing strategy insufficient for spec scenarios
233
+ - ❌ Technical approach infeasible or unclear
234
+ - ❌ Design doesn't enable spec success criteria
235
+
236
+ ### Report Back:
237
+ ```javascript
238
+ seekMentoring({
239
+ workflowType: "design",
240
+ issueNumber: "{issue_number}",
241
+ currentPhase: "design-completeness-review",
242
+ status: "complete",
243
+ evidence: {
244
+ specRequirementsCovered: true,
245
+ validationPlanImplementable: true,
246
+ testingStrategySufficient: true,
247
+ technicallyFeasible: true,
248
+ functionalSpecPath: "docs/feature specs/{issue_number}-*.md"
249
+ }
250
+ })
251
+ ```
252
+
253
+ ## Phase: submit
254
+
255
+ {{include:delivery/submit.md}}
256
+
257
+ ## Phase: address-feedback
258
+
259
+ {{include:delivery/address-feedback.md}}
260
+
261
+ ## Phase: retrospective
262
+
263
+ {{include:delivery/retrospective.md}}