fraim-framework 1.0.12 → 2.0.2

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 (93) hide show
  1. package/.ai-agents/agent-guardrails.md +58 -0
  2. package/.ai-agents/mcp-template.jsonc +34 -0
  3. package/.ai-agents/rules/agent-testing-guidelines.md +545 -0
  4. package/.ai-agents/rules/architecture.md +52 -0
  5. package/.ai-agents/rules/communication.md +122 -0
  6. package/.ai-agents/rules/continuous-learning.md +55 -0
  7. package/.ai-agents/rules/git-safe-commands.md +34 -0
  8. package/.ai-agents/rules/integrity-and-test-ethics.md +223 -0
  9. package/.ai-agents/rules/local-development.md +252 -0
  10. package/.ai-agents/rules/merge-requirements.md +231 -0
  11. package/.ai-agents/rules/pr-workflow-completeness.md +191 -0
  12. package/.ai-agents/rules/simplicity.md +112 -0
  13. package/.ai-agents/rules/software-development-lifecycle.md +276 -0
  14. package/.ai-agents/rules/spike-first-development.md +199 -0
  15. package/.ai-agents/rules/successful-debugging-patterns.md +313 -0
  16. package/.ai-agents/scripts/cleanup-branch.ts +278 -0
  17. package/.ai-agents/scripts/exec-with-timeout.ts +122 -0
  18. package/.ai-agents/scripts/prep-issue.sh +162 -0
  19. package/.ai-agents/templates/evidence/Design-Evidence.md +30 -0
  20. package/.ai-agents/templates/evidence/Implementation-BugEvidence.md +48 -0
  21. package/.ai-agents/templates/evidence/Implementation-FeatureEvidence.md +54 -0
  22. package/.ai-agents/templates/evidence/Spec-Evidence.md +19 -0
  23. package/.ai-agents/templates/help/HelpNeeded.md +14 -0
  24. package/.ai-agents/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +55 -0
  25. package/.ai-agents/templates/specs/BUGSPEC-TEMPLATE.md +37 -0
  26. package/.ai-agents/templates/specs/FEATURESPEC-TEMPLATE.md +29 -0
  27. package/.ai-agents/templates/specs/TECHSPEC-TEMPLATE.md +39 -0
  28. package/.ai-agents/workflows/design.md +121 -0
  29. package/.ai-agents/workflows/implement.md +170 -0
  30. package/.ai-agents/workflows/resolve.md +152 -0
  31. package/.ai-agents/workflows/retrospect.md +84 -0
  32. package/.ai-agents/workflows/spec.md +103 -0
  33. package/.ai-agents/workflows/test.md +90 -0
  34. package/.cursor/rules/cursor-rules.mdc +8 -0
  35. package/.cursor/rules/design.mdc +4 -0
  36. package/.cursor/rules/implement.mdc +6 -0
  37. package/.cursor/rules/resolve.mdc +5 -0
  38. package/.cursor/rules/retrospect.mdc +4 -0
  39. package/.cursor/rules/spec.mdc +4 -0
  40. package/.cursor/rules/test.mdc +5 -0
  41. package/.windsurf/rules/windsurf-rules.md +7 -0
  42. package/.windsurf/workflows/resolve-issue.md +6 -0
  43. package/.windsurf/workflows/retrospect.md +6 -0
  44. package/.windsurf/workflows/start-design.md +6 -0
  45. package/.windsurf/workflows/start-impl.md +6 -0
  46. package/.windsurf/workflows/start-spec.md +6 -0
  47. package/.windsurf/workflows/start-tests.md +6 -0
  48. package/CHANGELOG.md +66 -0
  49. package/CODEOWNERS +24 -0
  50. package/DISTRIBUTION.md +6 -6
  51. package/PUBLISH_INSTRUCTIONS.md +93 -0
  52. package/README.md +330 -104
  53. package/bin/fraim.js +49 -3
  54. package/index.js +30 -3
  55. package/install.sh +58 -58
  56. package/labels.json +52 -0
  57. package/linkedin-post.md +23 -0
  58. package/package.json +12 -7
  59. package/sample_package.json +18 -0
  60. package/setup.js +733 -384
  61. package/test-utils.ts +118 -0
  62. package/tsconfig.json +22 -0
  63. package/agents/claude/CLAUDE.md +0 -42
  64. package/agents/cursor/rules/architecture.mdc +0 -49
  65. package/agents/cursor/rules/continuous-learning.mdc +0 -48
  66. package/agents/cursor/rules/cursor-workflow.mdc +0 -29
  67. package/agents/cursor/rules/design.mdc +0 -25
  68. package/agents/cursor/rules/implement.mdc +0 -26
  69. package/agents/cursor/rules/local-development.mdc +0 -104
  70. package/agents/cursor/rules/prep.mdc +0 -15
  71. package/agents/cursor/rules/resolve.mdc +0 -46
  72. package/agents/cursor/rules/simplicity.mdc +0 -18
  73. package/agents/cursor/rules/software-development-lifecycle.mdc +0 -41
  74. package/agents/cursor/rules/test.mdc +0 -25
  75. package/agents/windsurf/rules/architecture.md +0 -49
  76. package/agents/windsurf/rules/continuous-learning.md +0 -47
  77. package/agents/windsurf/rules/local-development.md +0 -103
  78. package/agents/windsurf/rules/remote-development.md +0 -22
  79. package/agents/windsurf/rules/simplicity.md +0 -17
  80. package/agents/windsurf/rules/windsurf-workflow.md +0 -28
  81. package/agents/windsurf/workflows/prep.md +0 -20
  82. package/agents/windsurf/workflows/resolve-issue.md +0 -47
  83. package/agents/windsurf/workflows/start-design.md +0 -26
  84. package/agents/windsurf/workflows/start-impl.md +0 -27
  85. package/agents/windsurf/workflows/start-tests.md +0 -26
  86. package/github/phase-change.yml +0 -218
  87. package/github/status-change.yml +0 -68
  88. package/github/sync-on-pr-review.yml +0 -66
  89. package/scripts/__init__.py +0 -10
  90. package/scripts/cli.py +0 -141
  91. package/setup.py +0 -0
  92. package/test-config.json +0 -32
  93. package/workflows/setup-fraim.yml +0 -147
@@ -0,0 +1,122 @@
1
+ # Communication
2
+
3
+ ## INTENT
4
+ To establish clear communication patterns and progress reporting standards that enable effective coordination between agents and stakeholders, ensuring transparent progress tracking and proper status updates throughout the development process.
5
+
6
+ ## PRINCIPLES
7
+ - **Clear Communication**: Provide transparent progress updates
8
+ - **Evidence-Based**: Show concrete progress with specific details
9
+ - **Consistent Format**: Use standardized reporting templates
10
+ - **Stakeholder Focus**: Communicate what matters to reviewers and users
11
+ - **Actionable Updates**: Provide clear next steps and blocking issues
12
+ - **Ask for help**: When blocked and out of options, ask user for help
13
+ - **ABSOLUTE ACCOUNTABILITY**: Agent is 100% responsible for fixing their own work and mistakes
14
+
15
+ ## COMMUNICATION REQUIREMENTS
16
+
17
+ ### Progress Updates
18
+ Always provide clear progress updates with:
19
+ 1. **Actions executed** (imperative, past tense)
20
+ 2. **Local progress** (files modified, tests run)
21
+ 3. **Remote artifacts** (branch, PR status)
22
+ 4. **Next steps** for this issue
23
+ 5. **Blocking issues** (if any)
24
+
25
+ ### Status Reporting
26
+ - **Be specific**: "Fixed API integration timeout" not "Made changes"
27
+ - **Include evidence**: "Tests run: npm test test-api-integration.ts ✅ PASSED"
28
+ - **Show concrete progress**: "Files modified: src/api-client.ts, test-api-integration.ts"
29
+ - **Indicate readiness**: "Ready for code review" vs "Still working on implementation"
30
+
31
+ ### Communication Channel
32
+ - **GitHub**: The PR is the best way to communicate with your stakeholders. Update the PR with standard templates as covered below
33
+
34
+
35
+ ## COMMUNICATION TEMPLATES
36
+ 1. When you need feedback on a completed spec - `.ai-agents/templates/evidence/Spec-Evidence.md`
37
+ 2. When you need feedback on a completed design - `.ai-agents/templates/evidence/Design-Evidence.md`
38
+ 3. When you need feedback on a completed bug fix implementation - `.ai-agents/templates/evidence/Implementation-BugEvidence.md`
39
+ 4. When you need feedback on a completed feature implementation - `.ai-agents/templates/evidence/Implementation-FeatureEvidence.md`
40
+ 5. When you are stuck and need help - `.ai-agents/templates/help/HelpNeeded.md`
41
+
42
+ ## EXAMPLES
43
+
44
+ ### Good: Clear Progress Update
45
+ ```
46
+ Summary:
47
+ - Local progress: Fixed API integration timeout, added retry logic, ran tests
48
+ - Files modified: src/api-client.ts, test-api-integration.ts
49
+ - Tests run: npm test test-api-integration.ts ✅ PASSED
50
+ - Remote status: Branch feature/84-fix-integration pushed, Draft PR created
51
+ - Next steps: Wait for code review
52
+ - Blocking issues: None
53
+ ```
54
+
55
+ ### Bad: Vague Progress Update
56
+ ```
57
+ Summary:
58
+ - Local progress: Made some changes
59
+ - Remote status: Something happened
60
+ - Next steps: Not sure
61
+ ```
62
+
63
+ ### Good: Specific Status Update
64
+ ```
65
+ Issue #84: "Fix API integration timeout"
66
+ - ✅ Identified root cause: Missing retry logic in API client
67
+ - ✅ Implemented exponential backoff with jitter
68
+ - ✅ Added comprehensive test coverage (5 new test cases)
69
+ - ✅ All tests passing locally
70
+ - ✅ Pushed to feature/84-fix-sync
71
+ - ✅ Draft PR created and ready for review
72
+ - Next: Waiting for code review feedback
73
+ ```
74
+
75
+ ### Bad: Generic Status Update
76
+ ```
77
+ Issue #84: "Fix API integration timeout"
78
+ - Working on it
79
+ - Made some changes
80
+ - Need to test more
81
+ ```
82
+
83
+ ## ACCOUNTABILITY AND RESPONSIBILITY RULES
84
+
85
+ ### ABSOLUTE ACCOUNTABILITY PRINCIPLE
86
+ **The agent is 100% responsible for fixing their own work and mistakes. No exceptions.**
87
+
88
+ ### PROHIBITED ACCOUNTABILITY DEFLECTION
89
+ **NEVER suggest the user should handle the agent's responsibilities:**
90
+
91
+ ❌ **PROHIBITED LANGUAGE:**
92
+ - "Would you like me to work with you to fix this, or would you prefer to handle it yourself?"
93
+ - "Should I do X or would you prefer to do Y?"
94
+ - "Do you want to fix this yourself?"
95
+ - "Can you handle this part for me?"
96
+ - "Would you like to take over this task?"
97
+
98
+ ✅ **REQUIRED LANGUAGE:**
99
+ - "I will fix this myself"
100
+ - "I am working to resolve this issue"
101
+ - "I will complete the proper validation"
102
+ - "I take full responsibility for this mistake"
103
+
104
+ ### HELP vs RESPONSIBILITY DISTINCTION
105
+
106
+ **APPROPRIATE Help Requests (when genuinely blocked):**
107
+ - "I'm blocked on X technical issue, can you provide guidance?"
108
+ - "I need clarification on Y requirement"
109
+ - "I'm stuck on Z approach, what direction should I take?"
110
+
111
+ **INAPPROPRIATE Responsibility Deflection:**
112
+ - "Can you handle this testing for me?"
113
+ - "Would you prefer to do this validation yourself?"
114
+ - "Should I continue or do you want to take over?"
115
+
116
+ ### OWNERSHIP PROTOCOL
117
+ - **Agent breaks it** → **Agent fixes it**
118
+ - **Agent makes mistake** → **Agent corrects it**
119
+ - **Agent claims false success** → **Agent provides real validation**
120
+ - **Agent creates problems** → **Agent solves them**
121
+
122
+ **No exceptions. No deflection. No user responsibility for agent mistakes.**
@@ -0,0 +1,55 @@
1
+ # Continuous Learning
2
+
3
+ ## INTENT
4
+ To prevent repeating past mistakes and build upon existing solutions by systematically learning from retrospectives, RFCs, and historical issue patterns, ensuring continuous improvement and knowledge accumulation across all agents.
5
+
6
+ ## PRINCIPLES
7
+ - **Learn from History**: Always review past work before starting new tasks
8
+ - **Build on Success**: Apply proven solutions rather than reinventing
9
+ - **Avoid Known Pitfalls**: Use retrospectives to prevent recurring issues
10
+ - **Share Knowledge**: Document learnings for future agents
11
+ - **Pattern Recognition**: Identify recurring problems and solutions
12
+
13
+ ## MANDATORY LEARNING WORKFLOW
14
+
15
+ ### Before Starting Any Work
16
+ 1. **Search retrospectives** for related issues or similar problems
17
+ 2. **Read relevant RFCs** to understand the design context
18
+ 3. **Review test cases** to see expected behavior
19
+ 4. **Check issue comments** for previous attempts and solutions
20
+
21
+ ### Knowledge Sources
22
+ - **Retrospectives**: `/retrospectives/` folder for past problem analysis
23
+ - **RFCs**: `/docs/rfcs/` for design decisions and architectural context
24
+ - **Test Cases**: Existing tests show expected behavior patterns
25
+ - **Issue History**: Comments and PRs reveal previous attempts and solutions
26
+
27
+ ## EXAMPLES
28
+
29
+ ### Good: Learning from History
30
+ ```
31
+ Issue: "Fix API integration timeout"
32
+ Before Starting:
33
+ - ✅ Read retrospective on issue-45 (similar timeout problem)
34
+ - ✅ Found root cause: missing retry logic
35
+ - ✅ Applied proven solution: exponential backoff
36
+ - ✅ Avoided known pitfall: infinite retry loops
37
+ Result: Fixed in 1 iteration using proven approach
38
+ ```
39
+
40
+ ### Bad: Ignoring History
41
+ ```
42
+ Issue: "Fix API integration timeout"
43
+ Approach:
44
+ - ❌ Started coding immediately without research
45
+ - ❌ Implemented naive retry logic
46
+ - ❌ Hit same infinite loop issue from issue-45
47
+ - ❌ Wasted 3 iterations on known problem
48
+ Result: Eventually found retrospective, but too late
49
+ ```
50
+
51
+ ## RETROSPECTIVE CREATION
52
+ - **Use template**: `templates/retrospective/retro-template.md` for consistent structure
53
+ - **Follow process**: Use the `retrospect.md` workflow for retrospective creation
54
+
55
+ Remember: The best code is often written by those who learn from history rather than repeat it.
@@ -0,0 +1,34 @@
1
+ # Git Safe Commands Rule
2
+
3
+ ## Problem
4
+ Some Git commands (`git log`, `git diff`, `git branch`, `git commit`) open an interactive pager or editor, which causes Windsurf agents to hang.
5
+
6
+ ## Rule
7
+ Agents **must not** run Git commands that may open interactive prompts or pagers **without non-interactive flags**.
8
+
9
+ ### Disallowed (will hang)
10
+ - `git log`
11
+ - `git diff`
12
+ - `git branch`
13
+ - `git commit`
14
+
15
+ ### Allowed (safe variants)
16
+ - `git log --oneline --no-pager`
17
+ - `git diff --no-pager`
18
+ - `git branch --no-color`
19
+ - `git commit -m "message"`
20
+
21
+ ## Enforcement
22
+ If an agent attempts to run one of the disallowed forms, **reject the command** and suggest the safe variant instead.
23
+
24
+ ## Examples
25
+ ❌ `git log` → hangs
26
+ ✅ `git log --oneline --no-pager` → safe
27
+
28
+ ❌ `git diff` → hangs
29
+ ✅ `git diff --no-pager` → safe
30
+
31
+ ❌ `git commit` → opens editor
32
+ ✅ `git commit -m "Fix issue #123"` → safe
33
+
34
+ ---
@@ -0,0 +1,223 @@
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
+ - ✅ Investigate user feedback thoroughly but push back when you disagree
45
+ - ✅ Commit all changes, not just some
46
+ - ✅ Use existing code patterns when possible
47
+
48
+ ## Test Immutability Rule
49
+
50
+ **Test files and success criteria are immutable during implementation phase.**
51
+
52
+ ### What This Means
53
+ - Test criteria must remain unchanged from design phase
54
+ - Success requirements cannot be modified to hide failures
55
+ - Test logic cannot be adjusted to accommodate broken code
56
+ - Any changes to test requirements must be explicitly approved and documented
57
+
58
+ ### Verification Process
59
+ Before claiming any implementation is working:
60
+ 1. Run tests with original, unmodified criteria
61
+ 2. Verify ALL requirements pass without exception
62
+ 3. Document any test modifications if absolutely necessary
63
+ 4. Get explicit approval for any test changes
64
+
65
+ ## Progress Transparency Requirements
66
+
67
+ **Always be honest about implementation status and challenges.**
68
+
69
+ ### Required Statements
70
+ When facing implementation challenges, explicitly state:
71
+ - "I am struggling with [specific issue] and need help"
72
+ - "The implementation is not working because [specific reason]"
73
+ - "I need to fix [specific problem] before claiming success"
74
+
75
+ ### Prohibited Statements
76
+ - "The implementation is working" (when tests fail)
77
+ - "Core functionality is complete" (when critical features broken)
78
+ - "Tests are passing" (when criteria were modified)
79
+ - "Issue is resolved" (when underlying problems exist)
80
+
81
+ ## Success Verification Standards
82
+
83
+ **Genuine success requires meeting ALL original criteria without modification.**
84
+
85
+ ### Verification Checklist
86
+ Before marking any task complete:
87
+ - [ ] All original test criteria pass without modification
88
+ - [ ] No test logic was changed to accommodate broken code
89
+ - [ ] Success requirements are met exactly as originally defined
90
+ - [ ] Implementation works with real data/scenarios
91
+ - [ ] No critical functionality is missing or broken
92
+
93
+ ### False Success Indicators
94
+ These indicate false success and must be avoided:
95
+ - Tests pass only after criteria modification
96
+ - Success claimed while critical features are broken
97
+ - Progress reported while underlying issues remain
98
+ - Implementation "works" only with modified requirements
99
+
100
+ ## Ethical Violation Consequences
101
+
102
+ **Test integrity violations are considered serious ethical breaches.**
103
+
104
+ ### Immediate Actions Required
105
+ 1. Acknowledge the violation explicitly
106
+ 2. Revert any test modifications made
107
+ 3. Fix the actual underlying code issues
108
+ 4. Re-run tests with original criteria
109
+ 5. Document the violation in retrospective
110
+
111
+ ### Prevention Measures
112
+ - Always verify test criteria haven't been modified
113
+ - Ask for help when struggling with implementation
114
+ - Be transparent about challenges and failures
115
+ - Focus on fixing code, not hiding problems
116
+
117
+ ## Implementation Guidelines
118
+
119
+ ### When Tests Fail
120
+ 1. **Don't modify tests** - Fix the code instead
121
+ 2. **Don't claim success** - Admit the failure
122
+ 3. **Ask for help** - Be transparent about challenges
123
+ 4. **Fix root causes** - Address underlying issues
124
+ 5. **Verify with original criteria** - Ensure genuine success
125
+
126
+ ### When Facing Difficult Challenges
127
+ 1. **Be honest** - State what's not working
128
+ 2. **Ask for guidance** - Don't try to fake success
129
+ 3. **Focus on solutions** - Work on fixing the code
130
+ 4. **Maintain integrity** - Don't compromise standards
131
+ 5. **Document struggles** - Help others learn from challenges
132
+
133
+ ## Quality Assurance
134
+
135
+ ### Pre-Commit Checklist
136
+ Before committing any implementation:
137
+ - [ ] All original test criteria pass without modification
138
+ - [ ] No test logic was changed to hide failures
139
+ - [ ] Implementation works with real scenarios
140
+ - [ ] Success is genuine, not artificial
141
+ - [ ] No ethical violations were committed
142
+
143
+ ### Post-Implementation Review
144
+ After completing any implementation:
145
+ - [ ] Verify tests pass with original criteria
146
+ - [ ] Confirm no test modifications were made
147
+ - [ ] Validate success is genuine and complete
148
+ - [ ] Document any challenges faced honestly
149
+ - [ ] Ensure integrity was maintained throughout
150
+
151
+ ## Remember
152
+
153
+ **Integrity is more important than appearing successful.**
154
+ **It's better to admit failure and ask for help than to cheat and deceive.**
155
+ **Fix the code, not the tests.**
156
+
157
+ ## CRITICAL FAILURE PATTERNS TO AVOID
158
+
159
+ ### ❌ The "Claim Success Without Running Tests" Pattern
160
+ **What Happens**: Agent claims tests are passing without actually running them
161
+ **User Response**: "are you serious? every test except 1 passed and youre saying its good?"
162
+ **Impact**: False confidence, ignored real failures, wasted time
163
+ **Prevention**: Always run tests and show results before claiming success
164
+
165
+ ### ❌ The "Ignore User Feedback" Pattern
166
+ **What Happens**: Agent dismisses user feedback without investigation
167
+ **User Response**: "are you lying to me? see the tooltip test!! again, please review agent instructions"
168
+ **Impact**: Lost trust, frustrated user, repeated same mistakes
169
+ **Prevention**: Investigate feedback thoroughly, push back when you disagree with evidence
170
+
171
+ ### ❌ The "Incomplete Work" Pattern
172
+ **What Happens**: Agent forgets to commit critical changes
173
+ **User Response**: "you had forgotten to commit the orchestrtaor.ts changes i made"
174
+ **Impact**: Incomplete implementation, user has to clean up
175
+ **Prevention**: Always validate completeness before claiming done
176
+
177
+ ### ❌ The "Anti-pattern Creation" Pattern
178
+ **What Happens**: Agent creates new files instead of using existing ones
179
+ **User Response**: "why did you create a new test suite ... could you not add to an existing one?"
180
+ **Impact**: Code duplication, maintenance burden
181
+ **Prevention**: Always use existing patterns when possible
182
+
183
+ ## MANDATORY TESTING VERIFICATION PROTOCOL
184
+
185
+ ### Pre-Completion Checklist
186
+ Before claiming any work is complete, agents MUST execute this verification protocol:
187
+
188
+ ```bash
189
+ # 1. COMPILATION CHECK (MANDATORY)
190
+ npx tsc --noEmit --skipLibCheck
191
+ # Must show: No output (0 errors)
192
+
193
+ # 2. BUILD VERIFICATION (MANDATORY)
194
+ npm run build
195
+ # Must show: Successful completion
196
+
197
+ # 3. EXISTING TEST EXECUTION (MANDATORY)
198
+ npm test -- --include "*"
199
+ # Must show: All existing tests pass
200
+
201
+ # 4. EVIDENCE DOCUMENTATION (MANDATORY)
202
+ # Provide actual command output, not claims
203
+ ```
204
+
205
+ ### Evidence Requirements
206
+ - **Real Output**: Copy-paste actual command results
207
+ - **No Assertions**: Never claim "tests pass" without showing output
208
+ - **Failure Analysis**: If any test fails, provide detailed analysis
209
+ - **Fix First**: Fix all failures before claiming completion
210
+
211
+ ### Enforcement Measures
212
+ - **Immediate Retrospective**: Any false success claim triggers mandatory retrospective
213
+ - **Rule Updates**: Each violation must update prevention rules
214
+ - **Trust Rebuilding**: Provide extra evidence for subsequent work
215
+
216
+ ## IMPLEMENTATION DETAILS
217
+ For detailed testing ethics and implementation-specific rules, see `.ai-agents/workflows/implement.md`.
218
+
219
+ ## INTEGRATION
220
+ This file should be referenced in:
221
+ - `.cursor/cursorules`
222
+ - `.windsurf/windsurf-rules`
223
+ - `claude.md`
@@ -0,0 +1,252 @@
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 .ai-agents/scripts/exec-with-timeout.ts --timeout 30 -- <your command>` to prevent hangs in the terminal. You can adjust the timeout if the task is expected to run longer, but always have a timeout.
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 .ai-agents/scripts/exec-with-timeout.ts --timeout 30 -- npm install
74
+
75
+ # Extended timeout for long operations
76
+ npx tsx .ai-agents/scripts/exec-with-timeout.ts --timeout 300 -- npm run build
77
+
78
+ # Very long operations (tests, servers)
79
+ npx tsx .ai-agents/scripts/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 .ai-agents/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
+
252
+ Respect CODEOWNERS; don't modify auth/CI without approval.