fraim-framework 2.0.36 → 2.0.37

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 (165) hide show
  1. package/bin/fraim.js +5 -52
  2. package/dist/registry/scripts/build-scripts-generator.js +205 -0
  3. package/dist/registry/scripts/fraim-config.js +61 -0
  4. package/dist/registry/scripts/generic-issues-api.js +100 -0
  5. package/dist/registry/scripts/openapi-generator.js +664 -0
  6. package/dist/registry/scripts/performance/profile-server.js +390 -0
  7. package/dist/scripts/build-stub-registry.js +108 -0
  8. package/dist/src/cli/commands/doctor.js +5 -5
  9. package/dist/src/cli/commands/sync.js +33 -19
  10. package/dist/test-utils.js +96 -0
  11. package/dist/tests/esm-compat.js +11 -0
  12. package/dist/tests/test-chalk-esm-issue.js +159 -0
  13. package/dist/tests/test-chalk-real-world.js +265 -0
  14. package/dist/tests/test-chalk-regression.js +2 -18
  15. package/dist/tests/test-chalk-resolution-issue.js +304 -0
  16. package/dist/tests/test-fraim-install-chalk-issue.js +254 -0
  17. package/dist/tests/test-npm-resolution-diagnostic.js +140 -0
  18. package/dist/tests/test-package-size.js +88 -0
  19. package/dist/tests/test-prep-issue.js +34 -1
  20. package/dist/tests/test-stub-registry.js +120 -0
  21. package/dist/tests/test-sync-stubs.js +143 -0
  22. package/package.json +6 -8
  23. package/registry/agent-guardrails.md +62 -62
  24. package/registry/scripts/code-quality-check.sh +559 -559
  25. package/registry/scripts/detect-tautological-tests.sh +38 -38
  26. package/registry/scripts/prep-issue.sh +61 -30
  27. package/registry/scripts/validate-openapi-limits.ts +366 -366
  28. package/registry/scripts/validate-test-coverage.ts +280 -280
  29. package/registry/scripts/verify-pr-comments.sh +70 -70
  30. package/registry/stubs/workflows/bootstrap/create-architecture.md +11 -0
  31. package/registry/stubs/workflows/bootstrap/detect-broken-windows.md +11 -0
  32. package/registry/stubs/workflows/bootstrap/evaluate-code-quality.md +11 -0
  33. package/registry/stubs/workflows/bootstrap/verify-test-coverage.md +11 -0
  34. package/registry/stubs/workflows/business-development/create-business-plan.md +11 -0
  35. package/registry/stubs/workflows/business-development/ideate-business-opportunity.md +11 -0
  36. package/registry/stubs/workflows/business-development/price-product.md +18 -0
  37. package/registry/stubs/workflows/convert-to-pdf.md +11 -0
  38. package/registry/stubs/workflows/customer-development/insight-analysis.md +11 -0
  39. package/registry/stubs/workflows/customer-development/insight-triage.md +11 -0
  40. package/registry/stubs/workflows/customer-development/interview-preparation.md +11 -0
  41. package/registry/stubs/workflows/customer-development/linkedin-outreach.md +11 -0
  42. package/registry/stubs/workflows/customer-development/strategic-brainstorming.md +11 -0
  43. package/registry/stubs/workflows/customer-development/thank-customers.md +11 -0
  44. package/registry/stubs/workflows/customer-development/weekly-newsletter.md +11 -0
  45. package/registry/stubs/workflows/deploy/cloud-deployment.md +11 -0
  46. package/registry/stubs/workflows/improve-fraim/contribute.md +11 -0
  47. package/registry/stubs/workflows/improve-fraim/file-issue.md +11 -0
  48. package/registry/stubs/workflows/marketing/content-creation.md +11 -0
  49. package/registry/stubs/workflows/marketing/hbr-article.md +11 -0
  50. package/registry/stubs/workflows/marketing/launch-checklist.md +11 -0
  51. package/registry/stubs/workflows/marketing/marketing-strategy.md +11 -0
  52. package/registry/stubs/workflows/marketing/storytelling.md +11 -0
  53. package/registry/stubs/workflows/performance/analyze-performance.md +11 -0
  54. package/registry/stubs/workflows/product-building/design.md +11 -0
  55. package/registry/stubs/workflows/product-building/implement.md +12 -0
  56. package/registry/stubs/workflows/product-building/iterate-on-pr-comments.md +11 -0
  57. package/registry/stubs/workflows/product-building/prep-issue.md +11 -0
  58. package/registry/stubs/workflows/product-building/prototype.md +11 -0
  59. package/registry/stubs/workflows/product-building/resolve.md +11 -0
  60. package/registry/stubs/workflows/product-building/retrospect.md +11 -0
  61. package/registry/stubs/workflows/product-building/spec.md +11 -0
  62. package/registry/stubs/workflows/product-building/test.md +11 -0
  63. package/registry/stubs/workflows/quality-assurance/browser-validation.md +11 -0
  64. package/registry/stubs/workflows/quality-assurance/iterative-improvement-cycle.md +11 -0
  65. package/registry/stubs/workflows/replicate/replicate-discovery.md +11 -0
  66. package/registry/stubs/workflows/replicate/replicate-to-issues.md +11 -0
  67. package/registry/stubs/workflows/reviewer/review-implementation-vs-design-spec.md +11 -0
  68. package/registry/stubs/workflows/reviewer/review-implementation-vs-feature-spec.md +11 -0
  69. package/registry/stubs/workflows/startup-credits/aws-activate-application.md +11 -0
  70. package/registry/stubs/workflows/startup-credits/google-cloud-application.md +11 -0
  71. package/registry/stubs/workflows/startup-credits/microsoft-azure-application.md +11 -0
  72. package/.github/workflows/ci.yml +0 -65
  73. package/.github/workflows/deploy-fraim.yml +0 -87
  74. package/.github/workflows/phase-change.yml +0 -251
  75. package/.github/workflows/status-change.yml +0 -68
  76. package/.github/workflows/sync-on-pr-review.yml +0 -66
  77. package/examples/simple-webapp/TESTING.md +0 -62
  78. package/examples/simple-webapp/example-test.ts +0 -186
  79. package/registry/github/workflows/ci.yml +0 -51
  80. package/registry/github/workflows/phase-change.yml +0 -251
  81. package/registry/github/workflows/status-change.yml +0 -68
  82. package/registry/github/workflows/sync-on-pr-review.yml +0 -66
  83. package/registry/mcp-template.jsonc +0 -29
  84. package/registry/rules/agent-success-criteria.md +0 -52
  85. package/registry/rules/agent-testing-guidelines.md +0 -502
  86. package/registry/rules/architecture.md +0 -52
  87. package/registry/rules/communication.md +0 -122
  88. package/registry/rules/continuous-learning.md +0 -55
  89. package/registry/rules/debugging-multitenancy-issues.md +0 -85
  90. package/registry/rules/ephemeral-execution.md +0 -57
  91. package/registry/rules/git-safe-commands.md +0 -34
  92. package/registry/rules/hitl-ppe-record-analysis.md +0 -302
  93. package/registry/rules/integrity-and-test-ethics.md +0 -275
  94. package/registry/rules/local-development.md +0 -254
  95. package/registry/rules/merge-requirements.md +0 -231
  96. package/registry/rules/simplicity.md +0 -118
  97. package/registry/rules/software-development-lifecycle.md +0 -105
  98. package/registry/rules/spike-first-development.md +0 -205
  99. package/registry/rules/successful-debugging-patterns.md +0 -491
  100. package/registry/rules/telemetry.md +0 -67
  101. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
  102. package/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
  103. package/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
  104. package/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
  105. package/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
  106. package/registry/templates/customer-development/customer-interview-template.md +0 -99
  107. package/registry/templates/customer-development/follow-up-email-templates.md +0 -132
  108. package/registry/templates/customer-development/insight-analysis-template.md +0 -74
  109. package/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
  110. package/registry/templates/customer-development/thank-you-email-template.html +0 -124
  111. package/registry/templates/customer-development/thank-you-note-template.md +0 -16
  112. package/registry/templates/customer-development/triage-log-template.md +0 -278
  113. package/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
  114. package/registry/templates/evidence/Design-Evidence.md +0 -30
  115. package/registry/templates/evidence/Implementation-BugEvidence.md +0 -86
  116. package/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -121
  117. package/registry/templates/evidence/Spec-Evidence.md +0 -19
  118. package/registry/templates/help/HelpNeeded.md +0 -14
  119. package/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
  120. package/registry/templates/replicate/implementation-checklist.md +0 -39
  121. package/registry/templates/replicate/use-cases-template.md +0 -88
  122. package/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
  123. package/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
  124. package/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -29
  125. package/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
  126. package/registry/workflows/bootstrap/create-architecture.md +0 -38
  127. package/registry/workflows/bootstrap/evaluate-code-quality.md +0 -36
  128. package/registry/workflows/bootstrap/verify-test-coverage.md +0 -37
  129. package/registry/workflows/business-development/create-business-plan.md +0 -737
  130. package/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
  131. package/registry/workflows/business-development/price-product.md +0 -325
  132. package/registry/workflows/convert-to-pdf.md +0 -235
  133. package/registry/workflows/customer-development/insight-analysis.md +0 -156
  134. package/registry/workflows/customer-development/insight-triage.md +0 -933
  135. package/registry/workflows/customer-development/interview-preparation.md +0 -421
  136. package/registry/workflows/customer-development/linkedin-outreach.md +0 -593
  137. package/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
  138. package/registry/workflows/customer-development/thank-customers.md +0 -203
  139. package/registry/workflows/customer-development/weekly-newsletter.md +0 -366
  140. package/registry/workflows/deploy/cloud-deployment.md +0 -310
  141. package/registry/workflows/improve-fraim/contribute.md +0 -32
  142. package/registry/workflows/improve-fraim/file-issue.md +0 -32
  143. package/registry/workflows/marketing/content-creation.md +0 -37
  144. package/registry/workflows/marketing/hbr-article.md +0 -73
  145. package/registry/workflows/marketing/launch-checklist.md +0 -37
  146. package/registry/workflows/marketing/marketing-strategy.md +0 -45
  147. package/registry/workflows/performance/analyze-performance.md +0 -65
  148. package/registry/workflows/product-building/design.md +0 -130
  149. package/registry/workflows/product-building/implement.md +0 -315
  150. package/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
  151. package/registry/workflows/product-building/prep-issue.md +0 -43
  152. package/registry/workflows/product-building/prototype.md +0 -60
  153. package/registry/workflows/product-building/resolve.md +0 -164
  154. package/registry/workflows/product-building/retrospect.md +0 -86
  155. package/registry/workflows/product-building/spec.md +0 -117
  156. package/registry/workflows/product-building/test.md +0 -120
  157. package/registry/workflows/quality-assurance/browser-validation.md +0 -221
  158. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
  159. package/registry/workflows/replicate/replicate-discovery.md +0 -336
  160. package/registry/workflows/replicate/replicate-to-issues.md +0 -319
  161. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -632
  162. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -669
  163. package/registry/workflows/startup-credits/aws-activate-application.md +0 -535
  164. package/registry/workflows/startup-credits/google-cloud-application.md +0 -647
  165. package/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
@@ -1,275 +0,0 @@
1
- # Agent Integrity and Test Ethics Rules
2
-
3
- ## INTENT
4
- To ensure AI agents maintain the highest ethical standards in development, particularly regarding testing and reporting, fostering trust and preventing deceptive practices.
5
-
6
- ## CORE PRINCIPLES
7
- - **Honesty**: Always report true status of code and tests.
8
- - **Transparency**: Clearly communicate challenges and failures.
9
- - **Integrity**: Never manipulate tests or data to achieve false success.
10
- - **Accountability**: Take responsibility for mistakes and learn from them.
11
- - **User Trust**: Prioritize user trust above all else.
12
- - **Code Quality Discipline**: Always validate syntax, commit all changes, use existing patterns
13
- - **Process Discipline**: Follow all rules without exception, accept feedback immediately
14
-
15
- ## CRITICAL: Test Integrity Violations
16
-
17
- **NEVER modify test criteria, success criteria, or validation requirements to make tests pass.**
18
-
19
- ### Prohibited Behaviors
20
- - ❌ Changing test assertions from strict to lenient
21
- - ❌ Demoting critical requirements to "notes" or "optional"
22
- - ❌ Modifying success criteria to hide failures
23
- - ❌ Adjusting test logic to accommodate broken code
24
- - ❌ Claiming success when tests fail with original criteria
25
- - ❌ **CRITICAL: Claiming tests pass without running them**
26
- - ❌ **CRITICAL: Claiming completion without executing existing test suite**
27
- - ❌ **CRITICAL: Providing false evidence of test success**
28
- - ❌ **CRITICAL: Updating issue status to complete with broken functionality**
29
- - ❌ Arguing when user corrects mistakes
30
- - ❌ Forgetting to commit critical changes
31
- - ❌ Creating new files when existing ones can be extended
32
-
33
- ### Required Behaviors
34
- - ✅ Fix the code to make tests pass with original criteria
35
- - ✅ Admit when implementation is not working
36
- - ✅ Ask for help when facing difficult implementation challenges
37
- - ✅ Be honest about what's working and what isn't
38
- - ✅ Maintain test immutability during implementation phase
39
- - ✅ **MANDATORY: Always run tests and show results before claiming success**
40
- - ✅ **MANDATORY: Execute existing test suite before any completion claims**
41
- - ✅ **MANDATORY: Provide real command output as evidence, not assertions**
42
- - ✅ **MANDATORY: Fix any existing test failures before proceeding**
43
- - ✅ **MANDATORY: Run TypeScript compilation check before commits**
44
- - ✅ **MANDATORY: Execute all test files before submitting PR evidence - cannot claim tests "need fixes" without attempting execution**
45
- - ✅ **MANDATORY: Attempt to run tests, start servers, and validate claims independently before stating external dependencies**
46
- - ✅ **MANDATORY: Cannot defer validation due to assumed constraints without verification**
47
- - ✅ **MANDATORY: Evidence must reflect actual validation status, not assumptions or "pending" items that can be validated automatically**
48
- - ✅ Investigate user feedback thoroughly but push back when you disagree
49
- - ✅ Commit all changes, not just some
50
- - ✅ Use existing code patterns when possible
51
-
52
- ## Test Immutability Rule
53
-
54
- **Existing tests are immutable unless explicitly approved. New functionality must be tested and validated per technical design spec.**
55
-
56
- ### What This Means
57
- - Test criteria must remain unchanged from design phase
58
- - Success requirements cannot be modified to hide failures
59
- - Test logic cannot be adjusted to accommodate broken code
60
- - Any changes to test requirements must be explicitly approved and documented
61
-
62
- ### Verification Process
63
- Before claiming any implementation is working:
64
- 1. Run tests with original, unmodified criteria
65
- 2. Verify ALL requirements pass without exception
66
- 3. Document any test modifications if absolutely necessary
67
- 4. Get explicit approval for any test changes
68
-
69
- ## NO MOCK DATA IN PRODUCTION CODE
70
-
71
- **NEVER generate mock, fake, or random data for production code paths, even "temporarily" or "for testing".**
72
-
73
- ### Critical Rule: Real Data or Fail Fast
74
-
75
- When integrating external services (APIs, databases, AI models):
76
- - ✅ **Call the real service** and verify it works
77
- - ✅ **Throw clear error** if service unavailable or misconfigured
78
- - ✅ **Log actual responses** when structure is unexpected
79
- - ❌ **NEVER generate mock/random/fake data** as fallback
80
- - ❌ **NEVER return "default" data** that isn't real
81
- - ❌ **NEVER silently degrade** to garbage data
82
-
83
- ### Why This Matters
84
-
85
- Mock data makes broken systems **appear** to work while producing meaningless results:
86
- - Semantic search with random embeddings returns nonsense matches
87
- - API integration with fake responses passes tests but fails in production
88
- - Database with default values looks populated but contains garbage
89
-
90
- **This is worse than failing because it's deceptive and wastes user time.**
91
-
92
- ### Examples of Violations
93
-
94
- #### ❌ BAD: Mock Embedding Fallback
95
- ```typescript
96
- } else {
97
- console.warn('⚠️ Using mock embedding');
98
- embedding = Array.from({ length: 768 }, () => Math.random()); // VIOLATION!
99
- }
100
- ```
101
- **Why bad**: Query "sarah" matches "dog named Ella" with 75% similarity - meaningless!
102
-
103
- #### ✅ GOOD: Fail Fast with Clear Error
104
- ```typescript
105
- } else {
106
- console.error('❌ Vertex AI API returned unexpected structure');
107
- throw new Error('Vertex AI not configured - set GOOGLE_CLOUD_PROJECT and credentials');
108
- }
109
- ```
110
- **Why good**: Forces proper configuration, prevents silent corruption.
111
-
112
- #### ❌ BAD: Default API Response
113
- ```typescript
114
- async function callAPI() {
115
- try {
116
- return await fetch(url);
117
- } catch {
118
- return { success: true, data: [] }; // VIOLATION - fake success!
119
- }
120
- }
121
- ```
122
-
123
- #### ✅ GOOD: Fail Fast
124
- ```typescript
125
- async function callAPI() {
126
- try {
127
- return await fetch(url);
128
- } catch (error) {
129
- console.error('API call failed:', error.message);
130
- throw new Error(`API unavailable: ${error.message}`);
131
- }
132
- }
133
- ```
134
-
135
- ### Mock Data Allowed ONLY In
136
-
137
- - ✅ **Test files** (test-*.ts, *.test.ts, *.spec.ts)
138
- - ✅ **Test fixtures** (fixtures/, mocks/, __tests__/)
139
- - ✅ **Development seed scripts** (clearly marked as dev-only)
140
-
141
- ### Mock Data NEVER Allowed In
142
-
143
- - ❌ Production service code
144
- - ❌ API handlers
145
- - ❌ Database services
146
- - ❌ External service integrations
147
- - ❌ "Temporary" fallbacks
148
- - ❌ "For testing" workarounds in production code
149
-
150
- ## CRITICAL: INVALID TEST PATTERNS (TAUTOLOGY & TYPE TESTING)
151
-
152
- **NEVER write tests that pass even if the product code is deleted.**
153
-
154
- ### ❌ The "Testing Constants" Anti-Pattern (Tautology)
155
- **What it looks like**:
156
- ```typescript
157
- it('has correct status enums', () => {
158
- // VIOLATION: This tests an array inside the test file, not the app code
159
- const statuses = ['PENDING', 'DONE'];
160
- assert.deepEqual(statuses, ['PENDING', 'DONE']);
161
- });
162
- ```
163
- **Why it is wrong**: It validates nothing about the application. If you delete `TaskStatus` from the app, this test still passes.
164
- **Correct Approach**: Test that the application *uses* the enum correctly (e.g., saves it to DB, rejects invalid values).
165
-
166
- ### ❌ The "Testing Interfaces" Anti-Pattern (Static Analysis)
167
- **What it looks like**:
168
- ```typescript
169
- it('has correct fields', () => {
170
- // VIOLATION: This tests if you can assign properties to a JS object
171
- const task: Task = { id: '1', title: 'test' };
172
- assert.equal(task.title, 'test');
173
- });
174
- ```
175
- **Why it is wrong**: Interface checks are the job of the TypeScript compiler, not unit tests. This test verifies that the JS engine works, not the application.
176
-
177
- ### ✅ GOOD: Test Behavior, Not Structure
178
- ```typescript
179
- it('rejects invalid status', async () => {
180
- await assert.rejects(
181
- () => taskService.updateStatus('invalid'),
182
- /Invalid status/
183
- );
184
- });
185
- ```
186
-
187
- ## CRITICAL: INVALID TEST PATTERNS - TESTING CONVENIENCE DATA
188
-
189
- **NEVER test against locally defined mock data when real data is readily available in fixtures or existing systems.**
190
-
191
- ### ❌ BAD: Local Mock Data
192
- ```typescript
193
- it('filters by status', () => {
194
- const items = [
195
- { id: 1, status: 'open' },
196
- { id: 2, status: 'closed' }
197
- ];
198
- const result = filterByStatus(items, 'open');
199
- assert.equal(result.length, 1);
200
- });
201
- ```
202
- **Why bad**: This test uses artificial data and doesn't verify integration with real data sources.
203
-
204
- ### ✅ GOOD: Use Real Fixtures
205
- ```typescript
206
- it('filters by status from fixtures', () => {
207
- const items = loadFixture('tickets.json');
208
- const result = filterByStatus(items, 'open');
209
- assert.equal(result.length, 14);
210
- });
211
- ```
212
-
213
- ## CRITICAL: NO COPY-PASTE TESTS
214
-
215
- **Tests must be written specifically for the feature and should not be copied verbatim from other tests.**
216
-
217
- ### Why This Matters
218
- - Copy-pasted tests often include irrelevant assertions
219
- - They may test the wrong behavior for the new feature
220
- - They create maintenance burden
221
- - They can contain subtle bugs
222
-
223
- ### Required Behavior
224
- - Understand the feature requirements
225
- - Write tests specifically for that feature
226
- - Validate behavior that matters for that feature
227
-
228
- ### ❌ BAD: Copied Test
229
- ```typescript
230
- // Copied from test-user-auth.ts
231
- it('creates user successfully', async () => {
232
- const user = await createUser();
233
- assert.equal(user.status, 'active');
234
- });
235
- ```
236
-
237
- ### ✅ GOOD: Feature-Specific Test
238
- ```typescript
239
- it('rejects meeting outside preferred hours', async () => {
240
- await assert.rejects(
241
- () => scheduleMeeting('2024-03-15T21:00:00Z'),
242
- /outside preferred hours/
243
- );
244
- });
245
- ```
246
-
247
- ## COMPLIANCE WITH CODING STANDARDS
248
-
249
- ### Required Coding Standards
250
- - **No placeholder comments**: NEVER use TODO/FIXME/placeholder
251
- - **Complete implementations**: No partial solutions
252
- - **Minimal changes**: Focus on assigned issue only
253
- - **No unrelated fixes**: If you find other issues, report them as separate issues
254
- - **Use existing patterns**: Don't invent new approaches unnecessarily
255
- - **Run TypeScript compile before commits**
256
-
257
- ## PROCESS ADHERENCE
258
-
259
- ### Must Follow Process
260
- - Follow issue workflows (design.md, implement.md, etc.)
261
- - Update issue status labels correctly
262
- - Use correct templates
263
- - Provide implementation evidence
264
- - Respect review processes
265
-
266
- ## SUMMARY
267
-
268
- The agent integrity rules enforce:
269
- - Honest reporting of test status
270
- - No test manipulation
271
- - No fake data in production
272
- - Proper, feature-specific tests
273
- - Process and coding standard adherence
274
-
275
- **Remember**: Integrity in development is non-negotiable.
@@ -1,254 +0,0 @@
1
- # Local Development Guidelines
2
-
3
- ## INTENT
4
- Enable safe parallel development through strict workspace separation, preventing conflicts between agents and maintaining code integrity.
5
-
6
- ## PRINCIPLES
7
- - **Workspace Isolation**: Each agent works in their own cloned repository folder
8
- - **Branch Discipline**: Always work on feature branches, never push to master
9
- - **Timeout Management**: Use exec-with-timeout for all commands to prevent hangs
10
- - **Coordination**: Use GitHub issues and PRs for agent communication
11
-
12
- ## CORE RULES
13
-
14
- ### Development Environment
15
- - Use local file system for development work in your own cloned repository folder
16
- - Push to feature branches only; never push to master
17
- - Do NOT open PRs; push and let Actions open/update Draft PRs
18
- - Always work in your own cloned repository folder.
19
- All your work **MUST** be in your folder.
20
- - Coordinate with other agents through GitHub issues and PRs
21
- - Each agent works independently in their own folder to enable true parallel development
22
- - Run every command using `npx tsx ~/.fraim/scripts/exec-with-timeout.ts --timeout 30 -- <your command>` (Script is pre-synced)
23
-
24
- ## CRITICAL RULE: Absolute Workspace Separation
25
-
26
- ### Main Workspace: READ-ONLY
27
- - **Directory**: `{PROJECT_NAME}` (no issue number)
28
- - **Purpose**: Reference only - for reading existing code
29
- - **PROHIBITION**: **NEVER** create, edit, or modify ANY files here
30
-
31
- ### Local Clone: WORK-ONLY
32
- - **Directory**: `{PROJECT_NAME} - Issue {issue_number}` (includes issue number)
33
- - **Purpose**: All development work happens here exclusively
34
- - **Rule**: ALL file operations must be within this directory
35
-
36
- ## WORKSPACE OPERATIONS
37
-
38
- ### Safe Operations (READ-ONLY)
39
- - `read_file()` from main workspace for reference
40
- - `grep_search()` in main workspace for analysis
41
- - `list_dir()` in main workspace for exploration
42
- - `find_by_name()` in main workspace for discovery
43
-
44
- ### Work Operations (LOCAL CLONE ONLY)
45
- - `edit_file()` - ONLY in your local clone
46
- - `write_to_file()` - ONLY in your local clone
47
- - `delete_file()` - ONLY in your local clone
48
- - All git operations - ONLY in your local clone
49
-
50
- ### NEVER Use These Patterns:
51
- ```
52
- ❌ edit_file("{PROJECT_NAME}/...") # Main workspace
53
- ❌ edit_file("../{PROJECT_NAME}/...") # Main workspace via relative path
54
- ❌ edit_file(".windsurf/...") # Main workspace config
55
- ❌ Any path containing main workspace name
56
- ```
57
-
58
- ### ALWAYS Use These Patterns:
59
- ```
60
- ✅ edit_file("src/...") # Relative path in local clone
61
- ✅ edit_file("./src/...") # Explicit relative path
62
- ✅ read_file("../{PROJECT_NAME}/src/...") # Reference main workspace
63
- ✅ Working directory check before operations
64
- ```
65
-
66
- ## COMMAND EXECUTION
67
-
68
- ### Timeout Wrapper (MANDATORY)
69
- ALL commands must use the timeout wrapper:
70
-
71
- ```bash
72
- # Standard timeout (30 seconds)
73
- npx tsx ~/.fraim/scripts/exec-with-timeout.ts --timeout 30 -- npm install
74
-
75
- # Extended timeout for long operations
76
- npx tsx ~/.fraim/scripts/exec-with-timeout.ts --timeout 300 -- npm run build
77
-
78
- # Very long operations (tests, servers)
79
- npx tsx ~/.fraim/scripts/exec-with-timeout.ts --timeout 1800 -- npm run test-all
80
-
81
- # On Windows, use %USERPROFILE% instead of ~
82
- ```
83
-
84
- ### Timeout Guidelines
85
- - **Quick commands**: 30 seconds (npm install, git operations)
86
- - **Build operations**: 300 seconds (5 minutes)
87
- - **Test suites**: 1800 seconds (30 minutes)
88
- - **Development servers**: 3600 seconds (1 hour)
89
-
90
- ## DIRECTORY STRUCTURE RULES
91
-
92
- ### Correct Naming Convention:
93
- - **Main Workspace**: `{PROJECT_NAME}` (READ-ONLY)
94
- - **Local Clone**: `{PROJECT_NAME} - Issue {issue_number}` (WORK HERE)
95
-
96
- **The issue number in directory name is a visual reminder you're in the right place.**
97
-
98
- ### Directory Verification
99
- Before ANY file operation, verify you're in the correct directory:
100
-
101
- ```bash
102
- # Check current directory
103
- pwd
104
-
105
- # Verify you're in local clone (should contain issue number)
106
- basename "$(pwd)" | grep -q "Issue [0-9]"
107
- ```
108
-
109
- ## BRANCH MANAGEMENT
110
-
111
- ### Branch Naming Convention
112
- - Format: `feature/{issue_number}-{kebab-case-title}`
113
- - Example: `feature/123-fix-authentication-bug`
114
- - Always include issue number for traceability
115
-
116
- ### Branch Operations
117
- ```bash
118
- # Create and switch to feature branch
119
- git checkout -b feature/123-fix-authentication-bug
120
-
121
- # Push branch to origin
122
- git push -u origin feature/123-fix-authentication-bug
123
-
124
- # Never push to master
125
- git push origin master # ❌ FORBIDDEN
126
- ```
127
-
128
- ## COORDINATION PATTERNS
129
-
130
- ### Agent Communication
131
- - Use GitHub issues for task coordination
132
- - Use PR comments for code review feedback
133
- - Use issue labels for status tracking
134
- - Never directly modify another agent's work
135
-
136
- ### Status Updates
137
- - Update issue labels to reflect current phase
138
- - Add comments to issues with progress updates
139
- - Link PRs to issues for traceability
140
- - Use draft PRs for work-in-progress
141
-
142
- ## SAFETY CHECKS
143
-
144
- ### Pre-Operation Verification
145
- 1. **Directory Check**: Confirm you're in local clone
146
- 2. **Branch Check**: Confirm you're on feature branch
147
- 3. **File Path Check**: Confirm relative paths only
148
- 4. **Timeout Check**: Confirm command has timeout wrapper
149
-
150
- ### Example Verification Script
151
- ```bash
152
- # Verify safe working environment
153
- CURRENT_DIR=$(basename "$(pwd)")
154
- CURRENT_BRANCH=$(git branch --show-current)
155
-
156
- if [[ ! "$CURRENT_DIR" =~ "Issue [0-9]+" ]]; then
157
- echo "❌ Not in local clone directory"
158
- exit 1
159
- fi
160
-
161
- if [[ "$CURRENT_BRANCH" == "master" ]] || [[ "$CURRENT_BRANCH" == "main" ]]; then
162
- echo "❌ Working on main branch"
163
- exit 1
164
- fi
165
-
166
- echo "✅ Safe working environment confirmed"
167
- ```
168
-
169
- ## TESTING PATTERNS
170
-
171
- ### Mock Service Pattern
172
- **Use mocks to isolate components during testing**
173
-
174
- **Example**:
175
- ```typescript
176
- const mockApiService = {
177
- calls: [],
178
- updateResource: async (request) => {
179
- mockApiService.calls.push({ method: 'updateResource', request });
180
- return { success: true };
181
- }
182
- };
183
-
184
- // After running action, validate calls
185
- const updateCall = mockApiService.calls.find(call => call.method === 'updateResource');
186
- if (!updateCall) throw new Error('Expected updateResource to be called');
187
- if (updateCall.request.resourceId !== expectedId) throw new Error('Wrong resource ID');
188
- ```
189
-
190
- ## EXAMPLES
191
-
192
- ### Good: Proper Workspace Usage
193
- ```
194
- ✅ Working Directory: /path/to/{PROJECT_NAME} - Issue 84
195
- ✅ File Operation: edit_file("src/api-service.ts")
196
- ✅ Branch Check: feature/84-fix-api-sync
197
- ✅ Path Verification: Relative path, no "../" patterns
198
- ✅ Command: npx tsx scripts/exec-with-timeout.ts --timeout 30 -- npm test
199
- ```
200
-
201
- ### Bad: Workspace Violations
202
- ```
203
- ❌ Working Directory: /path/to/{PROJECT_NAME} (main workspace)
204
- ❌ File Operation: edit_file("src/api-service.ts")
205
- ❌ Branch Check: main
206
- ❌ Path Verification: Working in main workspace
207
- ❌ Command: npm test (no timeout wrapper)
208
- ```
209
-
210
- ### Good: Reference Operations
211
- ```
212
- ✅ Read from main workspace: read_file("../{PROJECT_NAME}/docs/README.md")
213
- ✅ Search main workspace: grep("api", "../{PROJECT_NAME}/src/")
214
- ✅ List main workspace: list_dir("../{PROJECT_NAME}/")
215
- Result: Safe reference without modification
216
- ```
217
-
218
- ### Bad: Modification in Main Workspace
219
- ```
220
- ❌ Edit main workspace: edit_file("../{PROJECT_NAME}/src/api-service.ts")
221
- ❌ Delete main workspace: delete_file("../{PROJECT_NAME}/test-file.ts")
222
- ❌ Search replace main: search_replace("../{PROJECT_NAME}/...")
223
- Result: Violates workspace separation
224
- ```
225
-
226
- ## CLEANUP
227
-
228
- ### End of Work Session
229
- When work is complete, clean up your local clone:
230
-
231
- ```bash
232
- # Navigate out of local clone
233
- cd ..
234
-
235
- # Remove your local clone folder
236
- rm -rf "{PROJECT_NAME} - Issue {issue_number}"
237
- ```
238
-
239
- ## TROUBLESHOOTING
240
-
241
- ### Common Issues
242
- 1. **Permission Denied**: Check if you're in the right directory
243
- 2. **Git Conflicts**: Ensure you're on feature branch, not master
244
- 3. **Command Hangs**: Always use timeout wrapper
245
- 4. **File Not Found**: Verify relative paths and working directory
246
-
247
- ### Recovery Steps
248
- 1. Stop all running processes
249
- 2. Navigate to correct local clone directory
250
- 3. Check git status and current branch
251
- 4. Verify file paths are relative
252
- 5. Use timeout wrapper for all commands
253
-
254
- Respect CODEOWNERS; don't modify auth/CI without approval.