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,303 @@
1
+ ---
2
+ {
3
+ "name": "spec",
4
+ "initialPhase": "spec-spec",
5
+ "phases": {
6
+ "spec-spec": { "onSuccess": "spec-competitor-analysis", "onFailure": "spec-spec" },
7
+ "spec-competitor-analysis": { "onSuccess": "spec-completeness-review", "onFailure": "spec-competitor-analysis" },
8
+ "spec-completeness-review": { "onSuccess": "submit", "onFailure": "spec-spec" },
9
+ "submit": { "onSuccess": "address-feedback", "onFailure": "submit" },
10
+ "address-feedback": { "onSuccess": "retrospective", "onFailure": "spec-spec" },
11
+ "retrospective": { "onSuccess": null, "onFailure": null }
12
+ }
13
+ }
14
+ ---
15
+
16
+ # Workflow: spec
17
+
18
+ # Specification Phase
19
+
20
+ ## INTENT
21
+ To create comprehensive, detailed product specifications that clarify the Why, What and User Experiences for new features.
22
+
23
+ ## PRINCIPLES
24
+ - **Success Criteria**: Optimize for Integrity, Correctness, Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
25
+ - **Start with the User**: Understand the user's needs and experiences before implementing
26
+ - **User Experience Matters**: Focus on creating a great user experience right from the beginning
27
+ - **Validation Criteria**: Define clear validation criteria to ensure the feature meets user needs
28
+ - **Simplicity**: Maintain simplicity in feature definition (read `rules/simplicity.md` via `get_fraim_file`)
29
+
30
+ ## SPECIFICATION WORKFLOW
31
+
32
+ ### Step 1: Issue Identification
33
+ Ask for {issue_number} (and optional {slug}). Get slug details using {{get_issue}}.
34
+
35
+ ### Step 2: Phase Initiation
36
+ Label the issue 'phase:spec' using {{update_issue_status}} (GitHub Action will automatically create a draft PR if none exists, or update the existing PR with phase-specific details, and label the issue `status:wip`)
37
+
38
+ ### Step 3: Environment Setup
39
+ **IMPORTANT**: The user has already run `prep-issue.sh` which has:
40
+ - ✅ Created the feature branch
41
+ - ✅ Checked out the branch
42
+ - ✅ Pushed the empty branch to origin
43
+ - ✅ Indexed the codebase with Serena
44
+ - ✅ Opened the editor in the prepared workspace
45
+
46
+ You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
47
+
48
+ ### Step 4: Work Location
49
+ You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
50
+
51
+ ### Step 5: Start AI Mentor Phase System
52
+ This workflow uses the AI Mentor phase system for guidance and validation. Start the phase system:
53
+
54
+ ```javascript
55
+ seekMentoring({
56
+ workflowType: "spec",
57
+ issueNumber: "{issue_number}",
58
+ currentPhase: "spec-spec",
59
+ status: "starting"
60
+ })
61
+ ```
62
+
63
+ The AI Mentor will guide you through:
64
+ 1. **Spec Phase**: Create comprehensive specification document
65
+ 2. **Spec Completeness Review**: Validate spec quality and HTML mocks
66
+ 3. **Submit PR**: Prepare work for review
67
+ 4. **Wait for PR Review**: Monitor review status and collect feedback
68
+
69
+ Follow the AI Mentor instructions for each phase and report back when complete.
70
+
71
+ ### Step 6: Specification Document Creation
72
+
73
+ ## Phase: spec-spec
74
+
75
+ #### Core Principle: Focus on WHAT and WHY, Not HOW
76
+ **Feature specifications describe the desired outcome and user experience, NOT technical implementation details.**
77
+
78
+ #### Compliance Requirements Integration
79
+ Before creating the specification, check for compliance requirements:
80
+
81
+ 1. **Read Project Configuration**:
82
+ - Compliance settings: {{config.compliance.regulations | "Check if project has specific compliance requirements (SOC2, HIPAA, etc.)"}}
83
+ - Industry: {{config.project.industry | "Determine if project operates in regulated industry"}}
84
+
85
+ 2. **Include Compliance Section** (if applicable):
86
+ - If compliance regulations exist, add a compliance section to your spec
87
+ - For each regulation, reference the corresponding compliance specifications
88
+ - Tell agents to "ensure implementation abides by requirements specified in [pointer]"
89
+
90
+ Example compliance section:
91
+ ```markdown
92
+ ## Compliance Requirements
93
+
94
+ Based on project configuration, this feature must comply with:
95
+
96
+ ### FinRA Requirements
97
+ Detailed list of FinRA requirements that apply
98
+
99
+ ### WCAG 2.1 AA Standards
100
+ Detailed list of WCAG requirements that apply
101
+ ```
102
+
103
+ #### Include:
104
+ - **High-Fidelity Mocks**: All UI changes must include clickable or high-fidelity HTML/CSS mocks. Markdown code blocks are NOT sufficient for UI specifications.
105
+ - Clear user stories and acceptance criteria.
106
+ - Edge cases and error states.
107
+ - **Compliance Requirements**: If regulations are configured, include compliance section with references to specification documents.
108
+
109
+ #### Exclude:
110
+ - **Markdown Mocks**: Do NOT use markdown code blocks (e.g. ` ```html `) to mock UI. Use real HTML/CSS files or screenshots.
111
+ - Technical implementation details.
112
+ - Database schema changes (these belong in the Design Phase).
113
+
114
+ ## Phase: spec-competitor-analysis
115
+
116
+ ### INTENT
117
+ To conduct systematic competitive research and analysis for the feature being specified, ensuring comprehensive understanding of competitive landscape and clear differentiation strategy.
118
+
119
+ ### OUTCOME
120
+ A comprehensive competitive analysis that:
121
+ - Documents all configured competitors and their approaches
122
+ - Identifies new competitors through systematic research
123
+ - Proposes configuration updates with user approval
124
+ - Defines clear differentiation strategy and competitive positioning
125
+ - Updates the specification with complete competitive landscape analysis
126
+
127
+ ### WORKFLOW
128
+
129
+ #### Step 1: Load Competitor Configuration
130
+ Competitors: {{config.competitors | "Research and identify competitors in the project's domain and feature space"}}
131
+
132
+ #### Step 2: Research Configured Competitors
133
+ Competitors: {{config.competitors | "Research and identify competitors in the project's domain and feature space"}}
134
+
135
+ For each competitor:
136
+ - Research their current solution for this feature area
137
+ - Analyze their strengths and weaknesses in this space
138
+ - Gather customer feedback and reviews
139
+ - Assess market position and pricing approach
140
+ - Document findings in structured format
141
+
142
+ #### Step 3: Discover Additional Competitors
143
+ - Use web search to find other competitors in the feature space
144
+ - Research market for competitors not in configuration
145
+ - Identify direct, adjacent, and emerging competitors
146
+ - Focus on competitors specifically relevant to this feature
147
+
148
+ #### Step 4: Competitor Configuration Updates
149
+ - **Identify New Competitors**: Present newly discovered competitors to user
150
+ - **Configuration Proposal**: Suggest adding relevant competitors to `.fraim/config.json`
151
+ - **User Approval**: Ask user to approve additions: "Found new competitor 'X' in space 'Y'. Add to config?"
152
+ - **Auto-Update**: If user approves, automatically update configuration file
153
+ - **Documentation**: Note configuration changes in competitive analysis
154
+
155
+ #### Step 5: Competitive Analysis
156
+ - Compare competitor approaches to our proposed solution
157
+ - Identify competitive advantages and disadvantages
158
+ - Develop differentiation strategy
159
+ - Plan competitive response strategies
160
+ - Define market positioning approach
161
+
162
+ #### Step 6: Update Specification
163
+ - Update Competitive Landscape section with findings
164
+ - Ensure all configured competitors are covered
165
+ - Include newly discovered competitors
166
+ - Add competitive positioning strategy
167
+ - Document research sources and methodology
168
+ - Validate analysis completeness
169
+
170
+ ### VALIDATION
171
+ - ✅ All configured competitors analyzed
172
+ - ✅ Additional competitors discovered through research
173
+ - ✅ User consulted on adding new competitors to config
174
+ - ✅ Configuration updated with user-approved competitors
175
+ - ✅ Competitive positioning strategy defined
176
+ - ✅ Differentiation advantages clearly articulated
177
+ - ✅ Research sources documented
178
+ - ✅ Analysis covers both configured and discovered competitors
179
+ - ✅ Specification competitive landscape section updated
180
+
181
+ ### Report Back:
182
+ When this phase is complete, call:
183
+ ```javascript
184
+ seekMentoring({
185
+ workflowType: "spec",
186
+ issueNumber: "{issue_number}",
187
+ currentPhase: "spec-competitor-analysis",
188
+ status: "complete",
189
+ evidence: {
190
+ competitorsAnalyzed: ["competitor1", "competitor2"],
191
+ newCompetitorsFound: ["new-competitor1"],
192
+ configurationUpdated: true,
193
+ differentiationStrategy: "summary of strategy",
194
+ specificationUpdated: true
195
+ }
196
+ })
197
+ ```
198
+
199
+ ## Phase: spec-completeness-review
200
+
201
+ ### INTENT
202
+ To verify that the specification is complete and includes high-fidelity HTML mocks when UI changes are involved.
203
+
204
+ ### OUTCOME
205
+ Confirmation that:
206
+ - Specification document is complete and follows template
207
+ - High-fidelity HTML mocks exist for UI changes (not markdown code blocks)
208
+ - Mocks are accessible and render properly in browser
209
+ - All requirements from original issue are addressed
210
+
211
+ ### WORKFLOW
212
+
213
+ #### Step 1: Check Specification Completeness
214
+ - Verify spec document exists at `docs/feature specs/{issue_number}-*.md`
215
+ - Confirm all template sections are complete (not placeholder text)
216
+ - Check that customer, desired outcome, and user experience are well-defined
217
+
218
+ #### Step 2: Validate Mocks (if UI changes)
219
+ **If the feature involves UI changes:**
220
+ - Check that HTML mock files exist in `docs/feature specs/mocks/`
221
+ - Verify mocks are named `{issue_number}-*.html`
222
+ - Confirm mocks are actual HTML files (not markdown code blocks)
223
+ - **Ask agent to open mocks in browser** to verify they render properly
224
+ - Check that mocks show different states/views of the feature
225
+
226
+ **If no UI changes:**
227
+ - Confirm this is documented in the spec
228
+ - Verify the feature is purely backend/API
229
+
230
+ #### Step 3: Requirements Coverage
231
+ - Review original GitHub issue requirements
232
+ - Confirm all requirements are addressed in the specification
233
+ - Check that acceptance criteria are covered
234
+
235
+ ### VALIDATION
236
+
237
+ #### Phase Complete When:
238
+ - ✅ Specification document complete and professional quality
239
+ - ✅ High-fidelity HTML mocks created (if UI changes required)
240
+ - ✅ Agent has opened mocks in browser and confirmed they render
241
+ - ✅ All original issue requirements addressed
242
+ - ✅ Ready for design phase
243
+
244
+ #### Phase Incomplete If:
245
+ - ❌ Specification incomplete or poor quality
246
+ - ❌ UI changes specified but no HTML mocks provided
247
+ - ❌ Mocks don't render properly in browser
248
+ - ❌ Original requirements not fully addressed
249
+
250
+ ### Report Back:
251
+ ```javascript
252
+ seekMentoring({
253
+ workflowType: "spec",
254
+ issueNumber: "{issue_number}",
255
+ currentPhase: "spec-completeness-review",
256
+ status: "complete",
257
+ evidence: {
258
+ specComplete: true,
259
+ mockFilesCreated: ["docs/feature specs/mocks/21-view1.html", "21-view2.html"],
260
+ browserValidated: true,
261
+ requirementsCovered: true
262
+ }
263
+ })
264
+ ```
265
+
266
+ ## EXAMPLES
267
+ ### Good: Comprehensive Specification Process
268
+ ```
269
+ Issue #84: "Add calendar sync"
270
+ 1. ✅ Identified: Issue #84, slug: "add-calendar-sync"
271
+ 2. ✅ Phase: Set phase:spec, PR created
272
+ 3. ✅ Environment: User ran prep-issue.sh, ready to work
273
+ 4. ✅ Location: Working in prepared workspace with Serena indexing
274
+ 5. ✅ Spec: Created docs/feature specs/84-add-calendar-sync.md
275
+ 6. ✅ Mocks: Included high-fidelity HTML mocks for the sync settings
276
+ 7. ✅ Review: Set status:needs-review
277
+ 8. ✅ Iteration: Incorporated feedback, updated spec
278
+ Result: Clear, user-focused specification with high-fi mocks
279
+ ```
280
+
281
+ ### Bad: Incomplete Specification Process
282
+ ```
283
+ Issue #84: "Add calendar sync"
284
+ 1. ✅ Identified: Issue #84
285
+ 2. ❌ Skip: Didn't set phase:spec
286
+ 3. ❌ Skip: Didn't create branch
287
+ 4. ❌ Skip: Started coding without spec
288
+ 5. ❌ Skip: No spec document created
289
+ 6. ❌ Skip: Used simple markdown mocks for complex UI
290
+ Result: Unclear user experience, potential rework
291
+ ```
292
+
293
+ ## Phase: submit
294
+
295
+ {{include:delivery/submit.md}}
296
+
297
+ ## Phase: address-feedback
298
+
299
+ {{include:delivery/address-feedback.md}}
300
+
301
+ ## Phase: retrospective
302
+
303
+ {{include:delivery/retrospective.md}}
@@ -0,0 +1,125 @@
1
+ # Workflow: test
2
+
3
+ **Path:** `workflows/test.md`
4
+
5
+ ---
6
+
7
+ # Testing Phase
8
+
9
+ ## INTENT
10
+ To create comprehensive test coverage that accurately reproduces issues and validates solutions, ensuring robust testing through proper test structure, failure verification, and systematic test execution.
11
+
12
+ ## PRINCIPLES
13
+ - **Success Criteria**: Optimize for Integrity (Honest reporting), Correctness (Coverage), Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
14
+ - **Test-Driven**: Write tests that reproduce the issue before fixing
15
+ - **Comprehensive Coverage**: Ensure all scenarios are tested
16
+ - **Failure Verification**: Confirm tests fail before implementation
17
+ - **Proper Structure**: Use established test patterns and frameworks
18
+ - **Systematic Execution**: Follow consistent testing procedures
19
+ - **Testing Guidelines**: Follow "Agent Testing Guidelines" (read `rules/agent-testing-guidelines.md` via `get_fraim_file`)
20
+ - **Integrity**: Adhere to "Integrity and Test Ethics" (read `rules/integrity-and-test-ethics.md` via `get_fraim_file`)
21
+ - **Architecture**: Follow existing architecture - see `.fraim/config.json` for the path (`customizations.architectureDoc`)
22
+
23
+ ## TESTING WORKFLOW
24
+
25
+ ### Step 1: Issue Identification
26
+ Ask for {issue_number} (and optional {slug}); confirm target branch feature/{issue_number}-{slug}.
27
+
28
+ ### Step 2: Phase Initiation
29
+ Label the issue 'phase:tests'. (GitHub Action will automatically create a draft PR if none exists, or update the existing PR with phase-specific details, and label the issue `status:wip`)
30
+
31
+ ### Step 3: Environment Setup
32
+ **IMPORTANT**: The user has already run `prep-issue.sh` which has:
33
+ - ✅ Created the feature branch
34
+ - ✅ Checked out the branch
35
+ - ✅ Pushed the empty branch to origin
36
+ - ✅ Indexed the codebase with Serena
37
+ - ✅ Opened the editor in the prepared workspace
38
+
39
+ You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
40
+
41
+ ### Step 4: Work Location
42
+ You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
43
+
44
+ ### Step 5: Testing Work
45
+
46
+ {{include:orchestration/parallelization-guidance.md}}
47
+
48
+ {{include:testing/test-execution-with-timeout.md}}
49
+
50
+ Your work entails the following:
51
+
52
+ - Review the RFC associated with this issue.
53
+ - Determine whether tests need to be added to an existing test suite, or a new one needs to be created.
54
+ - **CRITICAL: Write INTEGRATION tests that demonstrate the REAL USER SCENARIO**
55
+ - Test the actual end-to-end user experience, not unit tests for hypothetical fixes
56
+ - Use real services and APIs where possible (not mocks)
57
+ - Verify the issue occurs in the real system as described in the issue
58
+ - Example: For email threading issues, actually send emails and verify they appear as new messages vs replies
59
+ - **Use Case Mapping**: If working with documented use cases, map each use case to test cases:
60
+ - For each use case, create corresponding test scenarios (happy path, edge cases, error cases)
61
+ - Organize tests by use case category
62
+ - Ensure all high-priority use cases have test coverage
63
+ - Run the test cases to ensure they fail (demonstrating the issue exists)
64
+ - Flip issue to 'status:needs-review' and remove 'status:wip'
65
+
66
+ ### Step 5.1: Robustness & Permutation Testing (MANDATORY)
67
+ **You must author tests that specifically target fragility:**
68
+
69
+ 1. **Regex Resilience**: if using regex, test for:
70
+ - Case sensitivity (upper/lower/mixed)
71
+ - Line endings (`\n` vs `\r\n`)
72
+ - Whitespace variations
73
+ 2. **Negative & Default State Testing**:
74
+ - Assert that empty inputs fail (do not silently default)
75
+ - Assert that fallback values (e.g. "No intent defined") trigger failures
76
+ 3. **Boundary Conditions**:
77
+ - Test inputs that are too short, too long, or malformed
78
+ 4. **Silent Failure Prevention**:
79
+ - Ensure your tests *assert content coverage*, not just *existence*. (e.g., `assert(content.length > 20)` instead of `assert(content)`)
80
+
81
+ **❌ DO NOT:**
82
+ - Write unit tests for code that doesn't exist yet
83
+ - Test hypothetical fixes or solutions
84
+ - Create mock tests that don't use real services
85
+ - Test individual components in isolation
86
+
87
+ **✅ DO:**
88
+ - Test the complete user workflow end-to-end
89
+ - Use real APIs and services when possible
90
+ - Verify the actual problem described in the issue
91
+ - Verify test fails if product code is removed (No Tautologies)
92
+ - Create tests that will pass AFTER the fix is implemented
93
+
94
+ ### Step 6: Iteration
95
+ If workflow actions or reviewer feedback indicates more work is needed, ensure the issue is set back to `status:wip` and continue working as above.
96
+
97
+ ## EXAMPLES
98
+
99
+ ### Good: Comprehensive Testing Process
100
+ ```
101
+ Issue #84: "Fix calendar sync timeout"
102
+ 1. ✅ Identified: Issue #84, branch feature/84-fix-sync
103
+ 2. ✅ Phase: Set phase:tests, PR created
104
+ 3. ✅ Environment: User ran prep-issue.sh, ready to work
105
+ 4. ✅ Location: Working in prepared workspace with Serena indexing
106
+ 5. ✅ RFC Review: Read docs/rfcs/84-fix-sync-timeout.md
107
+ 6. ✅ Analysis: Determined need to add timeout tests
108
+ 7. ✅ Test Creation: Added test cases for timeout scenarios
109
+ 8. ✅ Failure Verification: Confirmed tests fail before fix
110
+ 9. ✅ Review: Set status:needs-review
111
+ 10. ✅ Iteration: Incorporated feedback, updated tests
112
+ Result: Comprehensive test coverage with proper structure
113
+ ```
114
+
115
+ ### Bad: Incomplete Testing Process
116
+ ```
117
+ Issue #84: "Fix calendar sync timeout"
118
+ 1. ✅ Identified: Issue #84
119
+ 2. ❌ Skip: Didn't review RFC
120
+ 3. ❌ Skip: Started testing without understanding requirements
121
+ 4. ❌ Skip: No test cases written
122
+ 5. ❌ Skip: Didn't verify tests fail
123
+ 6. ❌ Skip: No test structure followed
124
+ Result: Incomplete, ineffective testing
125
+ ```
@@ -0,0 +1,263 @@
1
+ # Productivity Report Workflow
2
+
3
+ **Category:** Performance Analysis
4
+
5
+ ## OVERVIEW
6
+
7
+ This workflow generates comprehensive productivity reports showing development velocity, team collaboration patterns, and project health metrics through analysis of commits, PRs, issues, and comment activity aggregated by day, week, and month. Works with any GitHub repository and automatically detects repository context.
8
+
9
+ ## WHEN TO USE
10
+
11
+ - **Sprint Reviews**: Analyze team productivity during development cycles
12
+ - **Project Retrospectives**: Understand development patterns and bottlenecks
13
+ - **Performance Tracking**: Monitor long-term development velocity trends
14
+ - **Team Management**: Assess collaboration and code review engagement
15
+ - **Stakeholder Reporting**: Provide data-driven insights on project progress
16
+
17
+ ## Intent
18
+ Generate comprehensive productivity reports showing development velocity, team collaboration patterns, and project health metrics through analysis of commits, PRs, issues, and comment activity.
19
+
20
+ ## Overview
21
+ This workflow guides teams through analyzing repository activity to create detailed productivity reports aggregated by day, week, and month. Works with any GitHub repository and automatically detects repository context.
22
+
23
+ ## Prerequisites
24
+ - GitHub CLI authenticated (`gh auth status`)
25
+ - Repository access and permissions
26
+ - Node.js (v14+) and jq installed
27
+ - Git repository context
28
+
29
+ ## Phases
30
+
31
+ ### Phase 1: Environment Setup
32
+ **Objective**: Prepare environment and validate dependencies
33
+
34
+ **Actions**:
35
+ 1. Verify GitHub CLI authentication
36
+ 2. Confirm repository access and permissions
37
+ 3. Check required dependencies (Node.js, jq)
38
+ 4. Detect repository context automatically
39
+
40
+ **Evidence Required**:
41
+ - GitHub CLI authentication confirmed
42
+ - Repository owner/name detected
43
+ - All dependencies available
44
+
45
+ ### Phase 2: Data Collection
46
+ **Objective**: Gather comprehensive repository activity data
47
+
48
+ **Actions**:
49
+ 1. Collect commit timestamps since repository creation
50
+ 2. Fetch pull request creation dates and metadata
51
+ 3. Gather closed issue timestamps (excluding PRs)
52
+ 4. Extract comment data from PRs and reviews
53
+
54
+ **Evidence Required**:
55
+ - Raw data files in `docs/productivity-report/` directory
56
+ - Commit, PR, issue, and comment data collected
57
+ - Data validation completed
58
+
59
+ ### Phase 3: Data Processing & Analysis
60
+ **Objective**: Process and aggregate collected data
61
+
62
+ **Actions**:
63
+ 1. Aggregate activity by day, week, and month
64
+ 2. Calculate comment totals per PR
65
+ 3. Filter issues to exclude pull requests
66
+ 4. Generate summary statistics
67
+
68
+ **Evidence Required**:
69
+ - Processed data aggregations
70
+ - Comment totals calculated
71
+ - Issue/PR separation validated
72
+
73
+ ### Phase 4: Report Generation
74
+ **Objective**: Create final productivity report
75
+
76
+ **Actions**:
77
+ 1. Generate CSV with standardized columns
78
+ 2. Include multiple time period views
79
+ 3. Provide summary statistics
80
+ 4. Validate report completeness
81
+
82
+ **Evidence Required**:
83
+ - Final CSV report: `docs/productivity-report/productivity-report-{timestamp}.csv`
84
+ - All time periods included (day/week/month)
85
+ - Report validation completed
86
+
87
+ ## Success Metrics
88
+ - CSV report generated successfully in `docs/productivity-report/` directory
89
+ - All time periods (day/week/month) included
90
+ - Comment totals are non-zero (validates PR detail fetch)
91
+ - Issues count excludes pull requests
92
+ - Data files cached for reuse
93
+
94
+ ## Output Location
95
+ `docs/productivity-report/productivity-report-{timestamp}.csv`
96
+
97
+ ## Output Format
98
+
99
+ ### CSV Structure
100
+ | Column | Description |
101
+ |--------|-------------|
102
+ | `period_type` | Time aggregation: `day`, `week`, or `month` |
103
+ | `period` | Date (YYYY-MM-DD) or month (YYYY-MM) |
104
+ | `commits` | Number of commits in period |
105
+ | `prs_created` | Pull requests opened in period |
106
+ | `issues_resolved` | Non-PR issues closed in period |
107
+ | `comments_total` | PR + review comments for PRs created in period |
108
+
109
+ ### Sample Output
110
+ ```csv
111
+ period_type,period,commits,prs_created,issues_resolved,comments_total
112
+ day,2024-01-15,5,2,1,8
113
+ week,2024-01-14,23,7,4,34
114
+ month,2024-01,156,28,18,187
115
+ ```
116
+
117
+ ## Directory Structure
118
+ ```
119
+ docs/productivity-report/
120
+ ├── productivity-report-2024-02-04-1430.csv
121
+ ├── productivity-report-2024-01-15-0900.csv
122
+ └── .gitkeep
123
+ ```
124
+
125
+ The workflow automatically creates the output directory if it doesn't exist.
126
+
127
+ ## Execution Instructions
128
+
129
+ ### Quick Start
130
+ ```bash
131
+ # Navigate to your repository root
132
+ cd /path/to/your/repository
133
+
134
+ # Get the main script via FRAIM
135
+ # This copies the script to ~/.fraim/scripts/productivity/
136
+ @fraim get_fraim_file("scripts/productivity/productivity-report.sh")
137
+
138
+ # Create output directory
139
+ mkdir -p docs/productivity-report
140
+
141
+ # Run the complete productivity report
142
+ bash ~/.fraim/scripts/productivity/productivity-report.sh
143
+
144
+ # Output will be saved to docs/productivity-report/productivity-report-{timestamp}.csv
145
+ ```
146
+
147
+ The workflow automatically detects repository context and works with any GitHub repository.
148
+
149
+ ### Manual Configuration
150
+ Set environment variables if auto-detection fails:
151
+ ```bash
152
+ export REPO_OWNER="your-username"
153
+ export REPO_NAME="your-repository"
154
+ export REPO_FULL="your-username/your-repository"
155
+ ```
156
+
157
+ ## Advanced Usage
158
+
159
+ ### Accessing Scripts
160
+ Scripts are available through FRAIM's file system:
161
+ ```bash
162
+ # Get all productivity scripts
163
+ @fraim get_fraim_file("scripts/productivity/productivity-report.sh")
164
+ @fraim get_fraim_file("scripts/productivity/fetch-pr-details.mjs")
165
+ @fraim get_fraim_file("scripts/productivity/build-productivity-csv.mjs")
166
+
167
+ # Ensure output directory exists
168
+ mkdir -p docs/productivity-report
169
+
170
+ # Run main script
171
+ bash ~/.fraim/scripts/productivity/productivity-report.sh
172
+ ```
173
+
174
+ ### Partial Execution
175
+ For large repositories or debugging:
176
+
177
+ ```bash
178
+ # 1. Collect commits only
179
+ gh api "repos/$REPO/commits?per_page=100" --paginate --jq '.[].commit.author.date' > .productivity-data/commits.txt
180
+
181
+ # 2. Collect PR list
182
+ gh api "repos/$REPO/pulls?state=all&per_page=100" --paginate --jq '.[] | {number, created_at}' > .productivity-data/prs_list_raw.json
183
+
184
+ # 3. Collect closed issues
185
+ gh api "repos/$REPO/issues?state=closed&per_page=100" --paginate --jq '.[] | select(.pull_request == null) | .closed_at' > .productivity-data/issues_closed.txt
186
+
187
+ # 4. Fetch PR details (time-intensive)
188
+ node ~/.fraim/scripts/productivity/fetch-pr-details.mjs
189
+
190
+ # 5. Generate final CSV
191
+ node ~/.fraim/scripts/productivity/build-productivity-csv.mjs
192
+ ```
193
+
194
+ ### Data Caching
195
+ - Intermediate data stored in `.productivity-data/`
196
+ - Enables resumable execution for large repositories
197
+ - Automatically added to `.gitignore`
198
+ - Can be cleared and regenerated as needed
199
+
200
+ ## Performance Considerations
201
+
202
+ ### Execution Time
203
+ - **Small repos** (< 100 PRs): 30 seconds - 2 minutes
204
+ - **Medium repos** (100-500 PRs): 2-10 minutes
205
+ - **Large repos** (500+ PRs): 10+ minutes
206
+
207
+ ### Optimization Tips
208
+ - PR comment fetching is the main bottleneck (~1.5 sec per PR)
209
+ - Use cached data for repeated runs
210
+ - Consider date range filtering for very large repositories
211
+ - Run during off-peak hours for better API performance
212
+
213
+ ## Troubleshooting
214
+
215
+ ### Authentication Issues
216
+ ```bash
217
+ # Check GitHub CLI status
218
+ gh auth status
219
+
220
+ # Re-authenticate if needed
221
+ gh auth login
222
+ ```
223
+
224
+ ### Permission Errors
225
+ ```bash
226
+ # Make scripts executable (after obtaining via get_fraim_file)
227
+ chmod +x ~/.fraim/scripts/productivity/productivity-report.sh
228
+ ```
229
+
230
+ ### Missing Dependencies
231
+ ```bash
232
+ # Install jq (macOS)
233
+ brew install jq
234
+
235
+ # Install jq (Ubuntu/Debian)
236
+ sudo apt-get install jq
237
+
238
+ # Verify Node.js
239
+ node --version
240
+ ```
241
+
242
+ ### Large Repository Timeouts
243
+ - Use manual execution steps for better control
244
+ - Monitor `.productivity-data/` for partial progress
245
+ - Consider API rate limiting for very active repositories
246
+
247
+ ## Integration with FRAIM Workflows
248
+ - **After `implement`**: Measure development velocity
249
+ - **During `retrospect`**: Analyze team collaboration patterns
250
+ - **Before `spec`**: Understand historical development patterns
251
+
252
+ ## Dependencies
253
+
254
+ ### Required Tools
255
+ - **GitHub CLI (`gh`)**: API access and authentication
256
+ - **Node.js**: JavaScript script execution (v14+)
257
+ - **jq**: JSON processing in shell scripts
258
+ - **Git**: Repository context detection
259
+
260
+ ### Optional Tools
261
+ - **Excel/LibreOffice**: CSV visualization
262
+ - **Python/R**: Advanced data analysis
263
+ - **Tableau/PowerBI**: Dashboard creation