fraim-framework 2.0.30 → 2.0.34

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 (67) hide show
  1. package/bin/fraim.js +3 -18
  2. package/dist/src/cli/commands/init.js +29 -2
  3. package/dist/src/cli/commands/sync.js +82 -70
  4. package/dist/src/utils/script-sync-utils.js +216 -0
  5. package/dist/tests/debug-tools.js +6 -5
  6. package/dist/tests/test-chalk-regression.js +58 -8
  7. package/dist/tests/test-cli.js +70 -5
  8. package/dist/tests/test-end-to-end-hybrid-validation.js +328 -0
  9. package/dist/tests/test-first-run-journey.js +43 -3
  10. package/dist/tests/test-hybrid-script-execution.js +340 -0
  11. package/dist/tests/test-mcp-connection.js +2 -2
  12. package/dist/tests/test-mcp-issue-integration.js +12 -4
  13. package/dist/tests/test-mcp-lifecycle-methods.js +4 -4
  14. package/dist/tests/test-node-compatibility.js +24 -2
  15. package/dist/tests/test-prep-issue.js +4 -1
  16. package/dist/tests/test-script-location-independence.js +173 -0
  17. package/dist/tests/test-script-sync.js +557 -0
  18. package/dist/tests/test-session-rehydration.js +2 -2
  19. package/dist/tests/test-standalone.js +3 -3
  20. package/dist/tests/test-sync-version-update.js +1 -1
  21. package/dist/tests/test-telemetry.js +2 -2
  22. package/dist/tests/test-user-journey.js +8 -4
  23. package/dist/tests/test-utils.js +13 -0
  24. package/dist/tests/test-wizard.js +2 -2
  25. package/package.json +3 -3
  26. package/registry/rules/agent-testing-guidelines.md +502 -502
  27. package/registry/rules/ephemeral-execution.md +37 -27
  28. package/registry/rules/local-development.md +253 -251
  29. package/registry/rules/successful-debugging-patterns.md +491 -482
  30. package/registry/scripts/prep-issue.sh +468 -468
  31. package/registry/workflows/bootstrap/evaluate-code-quality.md +8 -2
  32. package/registry/workflows/bootstrap/verify-test-coverage.md +8 -2
  33. package/registry/workflows/customer-development/thank-customers.md +203 -193
  34. package/registry/workflows/customer-development/weekly-newsletter.md +366 -362
  35. package/registry/workflows/performance/analyze-performance.md +65 -63
  36. package/registry/workflows/product-building/implement.md +6 -2
  37. package/registry/workflows/product-building/prep-issue.md +11 -24
  38. package/registry/workflows/product-building/resolve.md +5 -1
  39. package/registry/workflows/replicate/replicate-discovery.md +336 -0
  40. package/registry/workflows/replicate/replicate-to-issues.md +319 -0
  41. package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
  42. package/.windsurf/rules/windsurf-rules.md +0 -7
  43. package/.windsurf/workflows/resolve-issue.md +0 -6
  44. package/.windsurf/workflows/retrospect.md +0 -6
  45. package/.windsurf/workflows/start-design.md +0 -6
  46. package/.windsurf/workflows/start-impl.md +0 -6
  47. package/.windsurf/workflows/start-spec.md +0 -6
  48. package/.windsurf/workflows/start-tests.md +0 -6
  49. package/registry/scripts/build-scripts-generator.ts +0 -216
  50. package/registry/scripts/cleanup-branch.ts +0 -303
  51. package/registry/scripts/fraim-config.ts +0 -63
  52. package/registry/scripts/generate-engagement-emails.ts +0 -744
  53. package/registry/scripts/generic-issues-api.ts +0 -110
  54. package/registry/scripts/newsletter-helpers.ts +0 -874
  55. package/registry/scripts/openapi-generator.ts +0 -695
  56. package/registry/scripts/performance/profile-server.ts +0 -370
  57. package/registry/scripts/run-thank-you-workflow.ts +0 -122
  58. package/registry/scripts/send-newsletter-simple.ts +0 -104
  59. package/registry/scripts/send-thank-you-emails.ts +0 -57
  60. package/registry/workflows/replicate/re-implementation-strategy.md +0 -226
  61. package/registry/workflows/replicate/use-case-extraction.md +0 -135
  62. package/registry/workflows/replicate/visual-analysis.md +0 -154
  63. package/registry/workflows/replicate/website-discovery-analysis.md +0 -231
  64. package/sample_package.json +0 -18
  65. /package/registry/scripts/{replicate/comprehensive-explorer.py → comprehensive-explorer.py} +0 -0
  66. /package/registry/scripts/{replicate/interactive-explorer.py → interactive-explorer.py} +0 -0
  67. /package/registry/scripts/{replicate/scrape-site.py → scrape-site.py} +0 -0
@@ -1,47 +1,57 @@
1
- # Rule: Ephemeral Script Execution
1
+ # Rule: Direct Script Execution
2
2
 
3
- To maintain repository cleanliness, all automation scripts provided by FRAIM must be executed ephemerally.
3
+ FRAIM scripts are pre-synchronized to the user's local directory and executed directly from there.
4
4
 
5
5
  ## Policy
6
6
 
7
- 1. **No Persistence**: Do NOT save FRAIM scripts (e.g., `.sh`, `.ts`, `.py`) to the local repository or any directory tracked by version control.
8
- 2. **Temporary Storage**: Use the `.fraim/tmp` directory in the user's home folder for script execution.
9
- * Windows: `%USERPROFILE%\.fraim\tmp`
10
- * Linux/macOS: `~/.fraim/tmp`
11
- 3. **Execute and Delete**: Immediately delete the script file after execution, regardless of whether the script succeeded or failed.
7
+ 1. **Pre-Synchronized Scripts**: All FRAIM scripts are automatically synced to `~/.fraim/scripts/` during `fraim init` and `fraim sync`.
8
+ 2. **Direct Execution**: Execute scripts directly from the user scripts directory using standard shell commands.
9
+ 3. **No Fetching Required**: Scripts are already available locally - no need to fetch from MCP server.
12
10
 
13
- ## Directory Creation
11
+ ## Script Location
14
12
 
15
- If the `.fraim/tmp` directory does not exist, it should be created before saving the script.
13
+ Scripts are located in the user's home directory:
14
+ - **Windows**: `%USERPROFILE%\.fraim\scripts\`
15
+ - **Linux/macOS**: `~/.fraim/scripts/`
16
16
 
17
17
  ## Implementation Pattern
18
18
 
19
- When a script is retrieved from the FRAIM MCP:
19
+ When a script is needed:
20
20
 
21
- 1. **Identify**: Recognize the file as an executable script.
22
- 2. **Locate OS Temp**: Determine the appropriate temporary path.
23
- 3. **Transfer**: Write the script content to a file in the temporary path with a unique name (e.g., `fraim_task_123.sh`).
24
- 4. **Execute**: Run the script from that temporary location.
25
- 5. **Clean up**: Remove the temporary file.
21
+ 1. **Verify Sync**: Ensure scripts are up to date with `fraim sync` if needed
22
+ 2. **Execute Directly**: Run the script from its synced location
23
+ 3. **Working Directory**: Scripts operate on the current working directory
26
24
 
27
25
  ## Example (Bash)
28
26
 
29
27
  ```bash
30
- # Get script content from MCP (simulated)
31
- SCRIPT_CONTENT=$(mcp_call get_fraim_file path="scripts/setup.sh")
28
+ # Execute script directly from synced location
29
+ ~/.fraim/scripts/prep-issue.sh 123
32
30
 
33
- # Save to temp
34
- FRAIM_TMP="$HOME/.fraim/tmp"
35
- mkdir -p "$FRAIM_TMP"
36
- TEMP_FILE=$(mktemp "$FRAIM_TMP/fraim_script.XXXXXX.sh")
37
- echo "$SCRIPT_CONTENT" > "$TEMP_FILE"
31
+ # Or with full path on Windows
32
+ %USERPROFILE%\.fraim\scripts\prep-issue.sh 123
38
33
 
39
- # Execute
40
- bash "$TEMP_FILE"
34
+ # TypeScript scripts
35
+ npx tsx ~/.fraim/scripts/generate-engagement-emails.ts
36
+ ```
37
+
38
+ ## Example (Node.js/JavaScript)
39
+
40
+ ```javascript
41
+ // Execute script using child_process
42
+ const { execSync } = require('child_process');
43
+ const os = require('os');
44
+ const path = require('path');
45
+
46
+ const scriptsDir = path.join(os.homedir(), '.fraim', 'scripts');
47
+ const scriptPath = path.join(scriptsDir, 'prep-issue.sh');
41
48
 
42
- # Delete
43
- rm "$TEMP_FILE"
49
+ // Execute script
50
+ execSync(`"${scriptPath}" 123`, {
51
+ cwd: process.cwd(), // Current working directory
52
+ stdio: 'inherit'
53
+ });
44
54
  ```
45
55
 
46
56
  > [!IMPORTANT]
47
- > This rule is mandatory for all coding agents interacting with this repository.
57
+ > This rule replaces the previous ephemeral execution pattern. Scripts are now treated as pre-installed tools rather than dynamic content.
@@ -1,252 +1,254 @@
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 tmp/exec-with-timeout.ts --timeout 30 -- <your command>` (Retrieve script via `get_fraim_file({ path: "scripts/exec-with-timeout.ts" })`)
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 tmp/exec-with-timeout.ts --timeout 30 -- npm install
74
-
75
- # Extended timeout for long operations
76
- npx tsx tmp/exec-with-timeout.ts --timeout 300 -- npm run build
77
-
78
- # Very long operations (tests, servers)
79
- npx tsx tmp/exec-with-timeout.ts --timeout 1800 -- npm run test-all
80
- ```
81
-
82
- ### Timeout Guidelines
83
- - **Quick commands**: 30 seconds (npm install, git operations)
84
- - **Build operations**: 300 seconds (5 minutes)
85
- - **Test suites**: 1800 seconds (30 minutes)
86
- - **Development servers**: 3600 seconds (1 hour)
87
-
88
- ## DIRECTORY STRUCTURE RULES
89
-
90
- ### Correct Naming Convention:
91
- - **Main Workspace**: `{PROJECT_NAME}` (READ-ONLY)
92
- - **Local Clone**: `{PROJECT_NAME} - Issue {issue_number}` (WORK HERE)
93
-
94
- **The issue number in directory name is a visual reminder you're in the right place.**
95
-
96
- ### Directory Verification
97
- Before ANY file operation, verify you're in the correct directory:
98
-
99
- ```bash
100
- # Check current directory
101
- pwd
102
-
103
- # Verify you're in local clone (should contain issue number)
104
- basename "$(pwd)" | grep -q "Issue [0-9]"
105
- ```
106
-
107
- ## BRANCH MANAGEMENT
108
-
109
- ### Branch Naming Convention
110
- - Format: `feature/{issue_number}-{kebab-case-title}`
111
- - Example: `feature/123-fix-authentication-bug`
112
- - Always include issue number for traceability
113
-
114
- ### Branch Operations
115
- ```bash
116
- # Create and switch to feature branch
117
- git checkout -b feature/123-fix-authentication-bug
118
-
119
- # Push branch to origin
120
- git push -u origin feature/123-fix-authentication-bug
121
-
122
- # Never push to master
123
- git push origin master # ❌ FORBIDDEN
124
- ```
125
-
126
- ## COORDINATION PATTERNS
127
-
128
- ### Agent Communication
129
- - Use GitHub issues for task coordination
130
- - Use PR comments for code review feedback
131
- - Use issue labels for status tracking
132
- - Never directly modify another agent's work
133
-
134
- ### Status Updates
135
- - Update issue labels to reflect current phase
136
- - Add comments to issues with progress updates
137
- - Link PRs to issues for traceability
138
- - Use draft PRs for work-in-progress
139
-
140
- ## SAFETY CHECKS
141
-
142
- ### Pre-Operation Verification
143
- 1. **Directory Check**: Confirm you're in local clone
144
- 2. **Branch Check**: Confirm you're on feature branch
145
- 3. **File Path Check**: Confirm relative paths only
146
- 4. **Timeout Check**: Confirm command has timeout wrapper
147
-
148
- ### Example Verification Script
149
- ```bash
150
- # Verify safe working environment
151
- CURRENT_DIR=$(basename "$(pwd)")
152
- CURRENT_BRANCH=$(git branch --show-current)
153
-
154
- if [[ ! "$CURRENT_DIR" =~ "Issue [0-9]+" ]]; then
155
- echo "❌ Not in local clone directory"
156
- exit 1
157
- fi
158
-
159
- if [[ "$CURRENT_BRANCH" == "master" ]] || [[ "$CURRENT_BRANCH" == "main" ]]; then
160
- echo "❌ Working on main branch"
161
- exit 1
162
- fi
163
-
164
- echo "✅ Safe working environment confirmed"
165
- ```
166
-
167
- ## TESTING PATTERNS
168
-
169
- ### Mock Service Pattern
170
- **Use mocks to isolate components during testing**
171
-
172
- **Example**:
173
- ```typescript
174
- const mockApiService = {
175
- calls: [],
176
- updateResource: async (request) => {
177
- mockApiService.calls.push({ method: 'updateResource', request });
178
- return { success: true };
179
- }
180
- };
181
-
182
- // After running action, validate calls
183
- const updateCall = mockApiService.calls.find(call => call.method === 'updateResource');
184
- if (!updateCall) throw new Error('Expected updateResource to be called');
185
- if (updateCall.request.resourceId !== expectedId) throw new Error('Wrong resource ID');
186
- ```
187
-
188
- ## EXAMPLES
189
-
190
- ### Good: Proper Workspace Usage
191
- ```
192
- Working Directory: /path/to/{PROJECT_NAME} - Issue 84
193
- ✅ File Operation: edit_file("src/api-service.ts")
194
- Branch Check: feature/84-fix-api-sync
195
- Path Verification: Relative path, no "../" patterns
196
- Command: npx tsx scripts/exec-with-timeout.ts --timeout 30 -- npm test
197
- ```
198
-
199
- ### Bad: Workspace Violations
200
- ```
201
- Working Directory: /path/to/{PROJECT_NAME} (main workspace)
202
- ❌ File Operation: edit_file("src/api-service.ts")
203
- Branch Check: main
204
- Path Verification: Working in main workspace
205
- Command: npm test (no timeout wrapper)
206
- ```
207
-
208
- ### Good: Reference Operations
209
- ```
210
- Read from main workspace: read_file("../{PROJECT_NAME}/docs/README.md")
211
- ✅ Search main workspace: grep("api", "../{PROJECT_NAME}/src/")
212
- List main workspace: list_dir("../{PROJECT_NAME}/")
213
- Result: Safe reference without modification
214
- ```
215
-
216
- ### Bad: Modification in Main Workspace
217
- ```
218
- Edit main workspace: edit_file("../{PROJECT_NAME}/src/api-service.ts")
219
- ❌ Delete main workspace: delete_file("../{PROJECT_NAME}/test-file.ts")
220
- Search replace main: search_replace("../{PROJECT_NAME}/...")
221
- Result: Violates workspace separation
222
- ```
223
-
224
- ## CLEANUP
225
-
226
- ### End of Work Session
227
- When work is complete, clean up your local clone:
228
-
229
- ```bash
230
- # Navigate out of local clone
231
- cd ..
232
-
233
- # Remove your local clone folder
234
- rm -rf "{PROJECT_NAME} - Issue {issue_number}"
235
- ```
236
-
237
- ## TROUBLESHOOTING
238
-
239
- ### Common Issues
240
- 1. **Permission Denied**: Check if you're in the right directory
241
- 2. **Git Conflicts**: Ensure you're on feature branch, not master
242
- 3. **Command Hangs**: Always use timeout wrapper
243
- 4. **File Not Found**: Verify relative paths and working directory
244
-
245
- ### Recovery Steps
246
- 1. Stop all running processes
247
- 2. Navigate to correct local clone directory
248
- 3. Check git status and current branch
249
- 4. Verify file paths are relative
250
- 5. Use timeout wrapper for all commands
251
-
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
+
252
254
  Respect CODEOWNERS; don't modify auth/CI without approval.