fraim-framework 2.0.56 → 2.0.58

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 (224) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/fraim-mcp.js +14 -0
  3. package/bin/fraim.js +23 -0
  4. package/dist/src/cli/commands/init-project.js +10 -4
  5. package/dist/src/cli/commands/mcp.js +65 -0
  6. package/dist/src/cli/setup/mcp-config-generator.js +19 -16
  7. package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
  8. package/dist/src/fraim/issue-tracking/factory.js +63 -0
  9. package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
  10. package/dist/src/fraim/issue-tracking/types.js +7 -0
  11. package/dist/src/fraim/issue-tracking-config.js +83 -0
  12. package/dist/src/local-mcp-server/stdio-server.js +207 -0
  13. package/dist/src/utils/workflow-parser.js +81 -0
  14. package/package.json +17 -12
  15. package/registry/scripts/pdf-styles.css +172 -0
  16. package/registry/scripts/prep-issue.sh +46 -4
  17. package/registry/scripts/profile-server.ts +131 -130
  18. package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
  19. package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
  20. package/registry/stubs/workflows/product-building/design.md +1 -1
  21. package/registry/stubs/workflows/product-building/implement.md +1 -1
  22. package/Claude.md +0 -1
  23. package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
  24. package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
  25. package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
  26. package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
  27. package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
  28. package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
  29. package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
  30. package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
  31. package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
  32. package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
  33. package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
  34. package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
  35. package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
  36. package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
  37. package/dist/registry/ai-manager-rules/retrospective.md +0 -116
  38. package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
  39. package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
  40. package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
  41. package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
  42. package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
  43. package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
  44. package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
  45. package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
  46. package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
  47. package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
  48. package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
  49. package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
  50. package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
  51. package/dist/registry/providers/ado.json +0 -19
  52. package/dist/registry/providers/github.json +0 -19
  53. package/dist/registry/scripts/cleanup-branch.js +0 -287
  54. package/dist/registry/scripts/evaluate-code-quality.js +0 -66
  55. package/dist/registry/scripts/exec-with-timeout.js +0 -142
  56. package/dist/registry/scripts/generate-engagement-emails.js +0 -705
  57. package/dist/registry/scripts/newsletter-helpers.js +0 -671
  58. package/dist/registry/scripts/profile-server.js +0 -388
  59. package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
  60. package/dist/registry/scripts/send-newsletter-simple.js +0 -85
  61. package/dist/registry/scripts/send-thank-you-emails.js +0 -54
  62. package/dist/registry/scripts/validate-openapi-limits.js +0 -311
  63. package/dist/registry/scripts/validate-test-coverage.js +0 -262
  64. package/dist/registry/scripts/verify-test-coverage.js +0 -66
  65. package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
  66. package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
  67. package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
  68. package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
  69. package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
  70. package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
  71. package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
  72. package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
  73. package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
  74. package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
  75. package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
  76. package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
  77. package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
  78. package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
  79. package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
  80. package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
  81. package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
  82. package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
  83. package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
  84. package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
  85. package/dist/registry/templates/help/HelpNeeded.md +0 -14
  86. package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
  87. package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
  88. package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
  89. package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
  90. package/dist/registry/templates/legal/review-report-template.md +0 -198
  91. package/dist/registry/templates/legal/saas-terms-template.md +0 -174
  92. package/dist/registry/templates/legal/sow-template.md +0 -117
  93. package/dist/registry/templates/legal/template-variables.md +0 -131
  94. package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
  95. package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
  96. package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
  97. package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
  98. package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
  99. package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
  100. package/dist/registry/templates/replicate/use-cases-template.md +0 -88
  101. package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
  102. package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
  103. package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
  104. package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
  105. package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
  106. package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
  107. package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
  108. package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
  109. package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
  110. package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
  111. package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
  112. package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
  113. package/dist/registry/workflows/business-development/price-product.md +0 -325
  114. package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
  115. package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
  116. package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
  117. package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
  118. package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
  119. package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
  120. package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
  121. package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
  122. package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
  123. package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
  124. package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
  125. package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
  126. package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
  127. package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
  128. package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
  129. package/dist/registry/workflows/learning/build-skillset.md +0 -212
  130. package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
  131. package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
  132. package/dist/registry/workflows/legal/nda.md +0 -69
  133. package/dist/registry/workflows/legal/patent-filing.md +0 -76
  134. package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
  135. package/dist/registry/workflows/legal/trademark-filing.md +0 -77
  136. package/dist/registry/workflows/marketing/content-creation.md +0 -37
  137. package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
  138. package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
  139. package/dist/registry/workflows/marketing/domain-registration.md +0 -323
  140. package/dist/registry/workflows/marketing/hbr-article.md +0 -73
  141. package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
  142. package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
  143. package/dist/registry/workflows/marketing/storytelling.md +0 -65
  144. package/dist/registry/workflows/performance/analyze-performance.md +0 -65
  145. package/dist/registry/workflows/product-building/design.md +0 -103
  146. package/dist/registry/workflows/product-building/implement.md +0 -74
  147. package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
  148. package/dist/registry/workflows/product-building/prep-issue.md +0 -41
  149. package/dist/registry/workflows/product-building/prototype.md +0 -65
  150. package/dist/registry/workflows/product-building/resolve.md +0 -168
  151. package/dist/registry/workflows/product-building/retrospect.md +0 -86
  152. package/dist/registry/workflows/product-building/spec.md +0 -181
  153. package/dist/registry/workflows/product-building/test.md +0 -125
  154. package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
  155. package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
  156. package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
  157. package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
  158. package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
  159. package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
  160. package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
  161. package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
  162. package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
  163. package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
  164. package/dist/scripts/build-stub-registry.js +0 -108
  165. package/dist/src/ai-manager/ai-manager.js +0 -480
  166. package/dist/src/ai-manager/phase-flow.js +0 -357
  167. package/dist/src/ai-manager/types.js +0 -5
  168. package/dist/src/fraim-mcp-server.js +0 -1885
  169. package/dist/tests/debug-tools.js +0 -80
  170. package/dist/tests/shared-server-utils.js +0 -57
  171. package/dist/tests/test-add-ide.js +0 -283
  172. package/dist/tests/test-ai-coach-edge-cases.js +0 -420
  173. package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
  174. package/dist/tests/test-ai-coach-performance.js +0 -328
  175. package/dist/tests/test-ai-coach-phase-content.js +0 -264
  176. package/dist/tests/test-ai-coach-workflows.js +0 -514
  177. package/dist/tests/test-cli.js +0 -228
  178. package/dist/tests/test-client-scripts-validation.js +0 -167
  179. package/dist/tests/test-complete-setup-flow.js +0 -110
  180. package/dist/tests/test-config-system.js +0 -279
  181. package/dist/tests/test-debug-session.js +0 -134
  182. package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
  183. package/dist/tests/test-enhanced-session-init.js +0 -188
  184. package/dist/tests/test-first-run-journey.js +0 -368
  185. package/dist/tests/test-fraim-issues.js +0 -59
  186. package/dist/tests/test-genericization.js +0 -44
  187. package/dist/tests/test-hybrid-script-execution.js +0 -340
  188. package/dist/tests/test-ide-detector.js +0 -46
  189. package/dist/tests/test-improved-setup.js +0 -121
  190. package/dist/tests/test-mcp-config-generator.js +0 -99
  191. package/dist/tests/test-mcp-connection.js +0 -107
  192. package/dist/tests/test-mcp-issue-integration.js +0 -156
  193. package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
  194. package/dist/tests/test-mcp-shared-server.js +0 -308
  195. package/dist/tests/test-mcp-template-processing.js +0 -160
  196. package/dist/tests/test-modular-issue-tracking.js +0 -165
  197. package/dist/tests/test-node-compatibility.js +0 -95
  198. package/dist/tests/test-npm-install.js +0 -68
  199. package/dist/tests/test-package-size.js +0 -108
  200. package/dist/tests/test-pr-review-workflow.js +0 -307
  201. package/dist/tests/test-prep-issue.js +0 -129
  202. package/dist/tests/test-productivity-integration.js +0 -157
  203. package/dist/tests/test-script-location-independence.js +0 -198
  204. package/dist/tests/test-script-sync.js +0 -557
  205. package/dist/tests/test-server-utils.js +0 -32
  206. package/dist/tests/test-session-rehydration.js +0 -148
  207. package/dist/tests/test-setup-integration.js +0 -98
  208. package/dist/tests/test-setup-scenarios.js +0 -322
  209. package/dist/tests/test-standalone.js +0 -143
  210. package/dist/tests/test-stub-registry.js +0 -136
  211. package/dist/tests/test-sync-stubs.js +0 -143
  212. package/dist/tests/test-sync-version-update.js +0 -93
  213. package/dist/tests/test-telemetry.js +0 -193
  214. package/dist/tests/test-token-validator.js +0 -30
  215. package/dist/tests/test-user-journey.js +0 -236
  216. package/dist/tests/test-users-to-target-workflow.js +0 -253
  217. package/dist/tests/test-utils.js +0 -109
  218. package/dist/tests/test-wizard.js +0 -71
  219. package/dist/tests/test-workflow-discovery.js +0 -242
  220. package/labels.json +0 -52
  221. package/registry/agent-guardrails.md +0 -63
  222. package/registry/fraim.md +0 -48
  223. package/setup.js +0 -171
  224. package/tsconfig.json +0 -23
@@ -1,181 +0,0 @@
1
- # Workflow: spec
2
-
3
- **Path:** `workflows/spec.md`
4
-
5
- ---
6
-
7
- # Specification Phase
8
-
9
- ## INTENT
10
- To create comprehensive, detailed product specifications that clarify the Why, What and User Experiences for new features.
11
-
12
- ## PRINCIPLES
13
- - **Success Criteria**: Optimize for Integrity, Correctness, Completeness, Independence, and Speed - see `rules/agent-success-criteria.md` (fetch via `get_fraim_file`).
14
- - **Start with the User**: Understand the user's needs and experiences before implementing
15
- - **User Experience Matters**: Focus on creating a great user experience right from the beginning
16
- - **Validation Criteria**: Define clear validation criteria to ensure the feature meets user needs
17
- - **Simplicity**: Maintain simplicity in feature definition (read `rules/simplicity.md` via `get_fraim_file`)
18
-
19
- ## SPECIFICATION WORKFLOW
20
-
21
- ### Step 1: Issue Identification
22
- Ask for {issue_number} (and optional {slug}). Get slug details using GitHub MCP.
23
-
24
- **GitHub Repository Context**: Before using GitHub MCP tools, read the local `.fraim/config.json` file to get the repository context:
25
- - Use `git.repoOwner` for the GitHub repository owner
26
- - Use `git.repoName` for the GitHub repository name
27
- - These values are required for GitHub MCP API calls (owner/repo parameters)
28
-
29
- ### Step 2: Phase Initiation
30
- Label the issue 'phase:spec' (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`)
31
-
32
- ### Step 3: Environment Setup
33
- **IMPORTANT**: The user has already run `prep-issue.sh` which has:
34
- - ✅ Created the feature branch
35
- - ✅ Checked out the branch
36
- - ✅ Pushed the empty branch to origin
37
- - ✅ Indexed the codebase with Serena
38
- - ✅ Opened the editor in the prepared workspace
39
-
40
- You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
41
-
42
- ### Step 4: Work Location
43
- You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
44
-
45
- ### Step 5: Pre-Creation Validation
46
- Before creating any specification document, agents MUST:
47
-
48
- 1. **Verify Template Selection**:
49
- - Use Feature Spec template: `get_fraim_file({ path: "templates/specs/FEATURESPEC-TEMPLATE.md" })`
50
-
51
- 2. **Complete Competitive Analysis**:
52
- - Proceed to competitor-analysis phase after spec creation
53
- - Research configured competitors from .fraim/config.json
54
- - Discover additional competitors through web research
55
- - Update configuration with user-approved new competitors
56
- - Develop competitive positioning strategy
57
-
58
- 3. **Mandatory Retrospective**:
59
- - After PR approval, complete retrospective phase before resolve
60
- - Capture learnings while spec context is fresh
61
- - Analyze PR feedback and incorporate lessons learned
62
-
63
- 2. **Validate Naming Convention**:
64
- - Format: `docs/feature specs/{issue_number}-{kebab-title}.md`
65
- - Example: `docs/feature specs/228-improve-token-refresh.md`
66
- - NO other naming patterns allowed
67
-
68
- 3. **Template Compliance Check**:
69
- - Read and understand the template first
70
-
71
- ### Step 6: Specification Document Creation
72
-
73
- #### Core Principle: Focus on WHAT and WHY, Not HOW
74
- **Feature specifications describe the desired outcome and user experience, NOT technical implementation details.**
75
-
76
- #### Compliance Requirements Integration
77
- Before creating the specification, check for compliance requirements:
78
-
79
- 1. **Read Project Configuration**:
80
- - Read `.fraim/config.json` to check for compliance settings
81
- - Look for `compliance.regulations` array and `compliance.compliance_specifications`
82
- - Check `project.industry` for industry-specific requirements
83
-
84
- 2. **Include Compliance Section** (if applicable):
85
- - If `compliance.regulations` contains any entries, add a compliance section to your spec
86
- - For each regulation, reference the corresponding `compliance_specifications` entry
87
- - Tell agents to "ensure implementation abides by requirements specified in [pointer]"
88
-
89
- Example compliance section:
90
- ```markdown
91
- ## Compliance Requirements
92
-
93
- Based on project configuration, this feature must comply with:
94
-
95
- ### FinRA Requirements
96
- Detailed list of FinRA requirements that apply
97
-
98
- ### WCAG 2.1 AA Standards
99
- Detailed list of WCAG requirements that apply
100
- ```
101
-
102
- #### Include:
103
- - **High-Fidelity Mocks**: All UI changes must include clickable or high-fidelity HTML/CSS mocks. Markdown code blocks are NOT sufficient for UI specifications.
104
- - Clear user stories and acceptance criteria.
105
- - Edge cases and error states.
106
- - **Compliance Requirements**: If regulations are configured, include compliance section with references to specification documents.
107
-
108
- #### Exclude:
109
- - **Markdown Mocks**: Do NOT use markdown code blocks (e.g. ` ```html `) to mock UI. Use real HTML/CSS files or screenshots.
110
- - Technical implementation details.
111
- - Database schema changes (these belong in the Design Phase).
112
-
113
- ### Step 7: Specification Creation Checklist
114
- Before committing your work, verify:
115
- - [ ] Correct template used (`FEATURESPEC-TEMPLATE.md`)
116
- - [ ] Proper file naming: `docs/feature specs/{issue_number}-{kebab-title}.md`
117
- - [ ] High-Fidelity mocks included (if UI changes)
118
- - [ ] No Markdown mocks used for UI
119
- - [ ] All template sections completed
120
- - [ ] No placeholder text remaining
121
- - [ ] Issue labeled `phase:spec`
122
- - [ ] Working in correct branch
123
-
124
- ### Step 8: AI Coach Phase System
125
- This workflow uses the AI Coach phase system for guidance and validation. Start the phase system:
126
-
127
- ```javascript
128
- seekCoachingOnNextStep({
129
- workflowType: "spec",
130
- issueNumber: "{issue_number}",
131
- currentPhase: "spec-spec",
132
- status: "starting"
133
- })
134
- ```
135
-
136
- The AI Coach will guide you through:
137
- 1. **Spec Phase**: Create comprehensive specification document
138
- 2. **Spec Completeness Review**: Validate spec quality and HTML mocks
139
- 3. **Submit PR**: Prepare work for review
140
- 4. **Wait for PR Review**: Monitor review status and collect feedback
141
-
142
- Follow the AI Coach instructions for each phase and report back when complete.
143
-
144
- ### Step 9: Submit for Review
145
- - Commit and sync your work
146
- - Label the issue 'status:needs-review' and remove 'status:wip'
147
- - Update the PR with a comment to include evidence - Use Spec Evidence template: `get_fraim_file({ path: "templates/evidence/Spec-Evidence.md" })`
148
- - **Next Step**: Switch to "Iterate on PR Comments" workflow: `get_fraim_file({ path: "workflows/product-building/iterate-on-pr-comments.md" })`
149
-
150
- ### Step 10: Iteration
151
- If workflow actions or reviewer feedback indicates more work is needed:
152
- - Label the issue 'status:wip' and remove 'status:needs-review'
153
- - Go back to Step 6 and iterate until PR is approved
154
-
155
- ## EXAMPLES
156
-
157
- ### Good: Comprehensive Specification Process
158
- ```
159
- Issue #84: "Add calendar sync"
160
- 1. ✅ Identified: Issue #84, slug: "add-calendar-sync"
161
- 2. ✅ Phase: Set phase:spec, PR created
162
- 3. ✅ Environment: User ran prep-issue.sh, ready to work
163
- 4. ✅ Location: Working in prepared workspace with Serena indexing
164
- 5. ✅ Spec: Created docs/feature specs/84-add-calendar-sync.md
165
- 6. ✅ Mocks: Included high-fidelity HTML mocks for the sync settings
166
- 7. ✅ Review: Set status:needs-review
167
- 8. ✅ Iteration: Incorporated feedback, updated spec
168
- Result: Clear, user-focused specification with high-fi mocks
169
- ```
170
-
171
- ### Bad: Incomplete Specification Process
172
- ```
173
- Issue #84: "Add calendar sync"
174
- 1. ✅ Identified: Issue #84
175
- 2. ❌ Skip: Didn't set phase:spec
176
- 3. ❌ Skip: Didn't create branch
177
- 4. ❌ Skip: Started coding without spec
178
- 5. ❌ Skip: No spec document created
179
- 6. ❌ Skip: Used simple markdown mocks for complex UI
180
- Result: Unclear user experience, potential rework
181
- ```
@@ -1,125 +0,0 @@
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
- **GitHub Repository Context**: Before using GitHub MCP tools, read the local `.fraim/config.json` file to get the repository context:
29
- - Use `git.repoOwner` for the GitHub repository owner
30
- - Use `git.repoName` for the GitHub repository name
31
- - These values are required for GitHub MCP API calls (owner/repo parameters)
32
-
33
- ### Step 2: Phase Initiation
34
- 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`)
35
-
36
- ### Step 3: Environment Setup
37
- **IMPORTANT**: The user has already run `prep-issue.sh` which has:
38
- - ✅ Created the feature branch
39
- - ✅ Checked out the branch
40
- - ✅ Pushed the empty branch to origin
41
- - ✅ Indexed the codebase with Serena
42
- - ✅ Opened the editor in the prepared workspace
43
-
44
- You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
45
-
46
- ### Step 4: Work Location
47
- You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
48
-
49
- ### Step 5: Testing Work
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
- ```
@@ -1,263 +0,0 @@
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