fraim-framework 1.0.11 → 2.0.1
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.
- package/.ai-agents/agent-guardrails.md +58 -0
- package/.ai-agents/mcp-template.jsonc +34 -0
- package/.ai-agents/rules/agent-testing-guidelines.md +545 -0
- package/.ai-agents/rules/architecture.md +52 -0
- package/.ai-agents/rules/communication.md +122 -0
- package/.ai-agents/rules/continuous-learning.md +55 -0
- package/.ai-agents/rules/git-safe-commands.md +34 -0
- package/.ai-agents/rules/integrity-and-test-ethics.md +223 -0
- package/.ai-agents/rules/local-development.md +252 -0
- package/.ai-agents/rules/merge-requirements.md +231 -0
- package/.ai-agents/rules/pr-workflow-completeness.md +191 -0
- package/.ai-agents/rules/simplicity.md +112 -0
- package/.ai-agents/rules/software-development-lifecycle.md +276 -0
- package/.ai-agents/rules/spike-first-development.md +199 -0
- package/.ai-agents/rules/successful-debugging-patterns.md +313 -0
- package/.ai-agents/scripts/cleanup-branch.ts +278 -0
- package/.ai-agents/scripts/exec-with-timeout.ts +122 -0
- package/.ai-agents/scripts/prep-issue.sh +162 -0
- package/.ai-agents/templates/evidence/Design-Evidence.md +30 -0
- package/.ai-agents/templates/evidence/Implementation-BugEvidence.md +48 -0
- package/.ai-agents/templates/evidence/Implementation-FeatureEvidence.md +54 -0
- package/.ai-agents/templates/evidence/Spec-Evidence.md +19 -0
- package/.ai-agents/templates/help/HelpNeeded.md +14 -0
- package/.ai-agents/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +55 -0
- package/.ai-agents/templates/specs/BUGSPEC-TEMPLATE.md +37 -0
- package/.ai-agents/templates/specs/FEATURESPEC-TEMPLATE.md +29 -0
- package/.ai-agents/templates/specs/TECHSPEC-TEMPLATE.md +39 -0
- package/.ai-agents/workflows/design.md +121 -0
- package/.ai-agents/workflows/implement.md +170 -0
- package/.ai-agents/workflows/resolve.md +152 -0
- package/.ai-agents/workflows/retrospect.md +84 -0
- package/.ai-agents/workflows/spec.md +103 -0
- package/.ai-agents/workflows/test.md +90 -0
- package/.cursor/rules/cursor-rules.mdc +8 -0
- package/.cursor/rules/design.mdc +4 -0
- package/.cursor/rules/implement.mdc +6 -0
- package/.cursor/rules/resolve.mdc +5 -0
- package/.cursor/rules/retrospect.mdc +4 -0
- package/.cursor/rules/spec.mdc +4 -0
- package/.cursor/rules/test.mdc +5 -0
- package/.windsurf/rules/windsurf-rules.md +7 -0
- package/.windsurf/workflows/resolve-issue.md +6 -0
- package/.windsurf/workflows/retrospect.md +6 -0
- package/.windsurf/workflows/start-design.md +6 -0
- package/.windsurf/workflows/start-impl.md +6 -0
- package/.windsurf/workflows/start-spec.md +6 -0
- package/.windsurf/workflows/start-tests.md +6 -0
- package/CHANGELOG.md +66 -0
- package/CODEOWNERS +24 -0
- package/DISTRIBUTION.md +6 -6
- package/PUBLISH_INSTRUCTIONS.md +93 -0
- package/README.md +330 -104
- package/bin/fraim.js +49 -3
- package/index.js +30 -3
- package/install.sh +58 -58
- package/labels.json +52 -0
- package/linkedin-post.md +23 -0
- package/package.json +12 -7
- package/sample_package.json +18 -0
- package/setup.js +712 -389
- package/test-utils.ts +118 -0
- package/tsconfig.json +22 -0
- package/agents/claude/CLAUDE.md +0 -42
- package/agents/cursor/rules/architecture.mdc +0 -49
- package/agents/cursor/rules/continuous-learning.mdc +0 -48
- package/agents/cursor/rules/cursor-workflow.mdc +0 -29
- package/agents/cursor/rules/design.mdc +0 -25
- package/agents/cursor/rules/implement.mdc +0 -26
- package/agents/cursor/rules/local-development.mdc +0 -104
- package/agents/cursor/rules/prep.mdc +0 -15
- package/agents/cursor/rules/resolve.mdc +0 -46
- package/agents/cursor/rules/simplicity.mdc +0 -18
- package/agents/cursor/rules/software-development-lifecycle.mdc +0 -41
- package/agents/cursor/rules/test.mdc +0 -25
- package/agents/windsurf/rules/architecture.md +0 -49
- package/agents/windsurf/rules/continuous-learning.md +0 -47
- package/agents/windsurf/rules/local-development.md +0 -103
- package/agents/windsurf/rules/remote-development.md +0 -22
- package/agents/windsurf/rules/simplicity.md +0 -17
- package/agents/windsurf/rules/windsurf-workflow.md +0 -28
- package/agents/windsurf/workflows/prep.md +0 -20
- package/agents/windsurf/workflows/resolve-issue.md +0 -47
- package/agents/windsurf/workflows/start-design.md +0 -26
- package/agents/windsurf/workflows/start-impl.md +0 -27
- package/agents/windsurf/workflows/start-tests.md +0 -26
- package/github/phase-change.yml +0 -218
- package/github/status-change.yml +0 -68
- package/github/sync-on-pr-review.yml +0 -66
- package/scripts/__init__.py +0 -10
- package/scripts/cli.py +0 -141
- package/setup.py +0 -0
- package/test-config.json +0 -32
- package/workflows/setup-fraim.yml +0 -147
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Implementation Phase
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To implement solutions based on approved design documents, ensuring minimal, testable code that meets requirements while following established patterns and maintaining code quality.
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- **Design-Driven**: Follow approved RFCs and design documents
|
|
8
|
+
- **Minimal Implementation**: Write only the code needed for the issue
|
|
9
|
+
- **Test-First**: Ensure comprehensive test coverage
|
|
10
|
+
- **Quality Focus**: Maintain code quality and follow patterns
|
|
11
|
+
- **Complete**: All aspects of technical spec are implemented, tested, validated
|
|
12
|
+
- **Spike-First Development**: Follow `.ai-agents/rules/spike-first-development.md` to validate technology compatibility before building complex solutions
|
|
13
|
+
|
|
14
|
+
## IMPLEMENTATION WORKFLOW
|
|
15
|
+
|
|
16
|
+
### Step 1: Issue Identification
|
|
17
|
+
Ask for {issue_number} (and optional {slug}); confirm target branch feature/{issue_number}-{slug}.
|
|
18
|
+
|
|
19
|
+
### Step 2: Phase Initiation
|
|
20
|
+
Label the issue 'phase:impl'. (GitHub Action will automatically label the issue `status:wip` and update the existing draft PR)
|
|
21
|
+
|
|
22
|
+
### Step 3: Environment Setup
|
|
23
|
+
**IMPORTANT**: The user has already run `prep-issue.sh` which has:
|
|
24
|
+
- ✅ Created the feature branch
|
|
25
|
+
- ✅ Checked out the branch
|
|
26
|
+
- ✅ Created draft PR
|
|
27
|
+
- ✅ Indexed the codebase with Serena
|
|
28
|
+
- ✅ Opened the editor in the prepared workspace
|
|
29
|
+
|
|
30
|
+
You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
|
|
31
|
+
|
|
32
|
+
### Step 4: Work Location
|
|
33
|
+
You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
|
|
34
|
+
|
|
35
|
+
### Step 5: Implementation Work
|
|
36
|
+
Your work entails the following:
|
|
37
|
+
|
|
38
|
+
- **SPIKE-FIRST CHECK**: Read and follow `.ai-agents/rules/spike-first-development.md`
|
|
39
|
+
- If implementation involves unfamiliar technology, create spike/proof-of-concept first
|
|
40
|
+
- Validate technology compatibility before building complex solutions
|
|
41
|
+
- Review the RFC associated with this issue.
|
|
42
|
+
- Determine whether changes need to be made to existing code, or brand new code needs to be written.
|
|
43
|
+
- Write the minimal set of code and test cases needed for this issue.
|
|
44
|
+
- **CRITICAL INTEGRITY CHECK**: Ensure test cases pass with original, unmodified criteria
|
|
45
|
+
- **VERIFICATION REQUIRED**: Run tests with original criteria before claiming success
|
|
46
|
+
- When ready for review, flip issue to 'status:needs-review' and remove 'status:wip'
|
|
47
|
+
- While submitting review, add a comment to the PR with evidence - use template `.ai-agents/templates/evidence/Implementation-BugEvidence.md` for bugs, `.ai-agents/templates/evidence/Implementation-FeatureEvidence.md` for features.
|
|
48
|
+
|
|
49
|
+
### Step 6: MANDATORY FINAL STATUS UPDATE
|
|
50
|
+
**🚨 CRITICAL - DO NOT SKIP THIS STEP:**
|
|
51
|
+
|
|
52
|
+
Once all implementation work is complete and evidence is provided:
|
|
53
|
+
|
|
54
|
+
1. **REQUIRED**: Update issue status from `status:wip` to `status:needs-review`
|
|
55
|
+
2. **REQUIRED**: Verify the status change was applied successfully
|
|
56
|
+
3. **REQUIRED**: Confirm issue is ready for user review
|
|
57
|
+
|
|
58
|
+
**This step is MANDATORY and must not be forgotten. Add it to your todo list at the start of implementation.**
|
|
59
|
+
|
|
60
|
+
## TEST INTEGRITY REQUIREMENTS
|
|
61
|
+
|
|
62
|
+
### Test Immutability Rule
|
|
63
|
+
**Test success criteria are immutable during implementation phase.**
|
|
64
|
+
|
|
65
|
+
#### What This Means
|
|
66
|
+
- Test criteria must remain unchanged from design phase
|
|
67
|
+
- Success requirements cannot be modified to hide failures
|
|
68
|
+
- Test logic cannot be adjusted to accommodate broken code
|
|
69
|
+
- Any changes to test requirements must be explicitly approved and documented
|
|
70
|
+
|
|
71
|
+
#### Verification Process
|
|
72
|
+
Before claiming any implementation is working:
|
|
73
|
+
1. Run tests with original, unmodified criteria
|
|
74
|
+
2. Verify ALL requirements pass without exception
|
|
75
|
+
3. Document any test modifications if absolutely necessary
|
|
76
|
+
4. Get explicit approval for any test changes
|
|
77
|
+
|
|
78
|
+
### Progress Transparency Requirements
|
|
79
|
+
**Always be honest about implementation status and challenges.**
|
|
80
|
+
|
|
81
|
+
#### Required Statements
|
|
82
|
+
When facing implementation challenges, explicitly state:
|
|
83
|
+
- "I am struggling with [specific issue] and need help"
|
|
84
|
+
- "The implementation is not working because [specific reason]"
|
|
85
|
+
- "I need to fix [specific problem] before claiming success"
|
|
86
|
+
|
|
87
|
+
#### Prohibited Statements
|
|
88
|
+
- "The implementation is working" (when tests fail)
|
|
89
|
+
- "Core functionality is complete" (when critical features broken)
|
|
90
|
+
- "Tests are passing" (when criteria were modified)
|
|
91
|
+
- "Issue is resolved" (when underlying problems exist)
|
|
92
|
+
|
|
93
|
+
### Success Verification Standards
|
|
94
|
+
**Genuine success requires meeting ALL original criteria without modification.**
|
|
95
|
+
|
|
96
|
+
#### Verification Checklist
|
|
97
|
+
Before marking any task complete:
|
|
98
|
+
- [ ] All original test criteria pass without modification
|
|
99
|
+
- [ ] No test logic was changed to accommodate broken code
|
|
100
|
+
- [ ] Success requirements are met exactly as originally defined
|
|
101
|
+
- [ ] Implementation works with real data/scenarios
|
|
102
|
+
- [ ] No critical functionality is missing or broken
|
|
103
|
+
|
|
104
|
+
### When Tests Fail
|
|
105
|
+
1. **Don't modify tests** - Fix the code instead
|
|
106
|
+
2. **Don't claim success** - Admit the failure
|
|
107
|
+
3. **Ask for help** - Be transparent about challenges
|
|
108
|
+
4. **Fix root causes** - Address underlying issues
|
|
109
|
+
5. **Verify with original criteria** - Ensure genuine success
|
|
110
|
+
|
|
111
|
+
### When Facing Difficult Challenges
|
|
112
|
+
1. **Be honest** - State what's not working
|
|
113
|
+
2. **Ask for guidance** - Don't try to fake success
|
|
114
|
+
3. **Focus on solutions** - Work on fixing the code
|
|
115
|
+
4. **Maintain integrity** - Don't compromise standards
|
|
116
|
+
5. **Document struggles** - Help others learn from challenges
|
|
117
|
+
|
|
118
|
+
### Step 7: Iteration
|
|
119
|
+
If workflow actions or reviewer feedback indicates more work is needed:
|
|
120
|
+
|
|
121
|
+
- Label the issue 'status:wip' and remove 'status:needs-review'
|
|
122
|
+
- Go back to Step 5 and iterate until PR is approved
|
|
123
|
+
|
|
124
|
+
## EXAMPLES
|
|
125
|
+
|
|
126
|
+
### Good: Proper Implementation Process
|
|
127
|
+
```
|
|
128
|
+
Issue #84: "Fix API integration timeout"
|
|
129
|
+
1. ✅ Identified: Issue #84, branch feature/84-fix-sync
|
|
130
|
+
2. ✅ Phase: Set phase:impl, PR created
|
|
131
|
+
3. ✅ Environment: User ran prep-issue.sh, ready to work
|
|
132
|
+
4. ✅ Location: Working in prepared workspace with Serena indexing
|
|
133
|
+
5. ✅ RFC Review: Read docs/rfcs/84-fix-sync-timeout.md
|
|
134
|
+
6. ✅ Analysis: Determined need to modify existing retry logic
|
|
135
|
+
7. ✅ Implementation: Added exponential backoff with jitter
|
|
136
|
+
8. ✅ Tests: Created test cases, all passing
|
|
137
|
+
9. ✅ Review: Set status:needs-review
|
|
138
|
+
10. ✅ Iteration: Incorporated feedback, updated implementation
|
|
139
|
+
Result: Clean, tested implementation following design
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Bad: Incomplete Implementation Process
|
|
143
|
+
```
|
|
144
|
+
Issue #84: "Fix API integration timeout"
|
|
145
|
+
1. ✅ Identified: Issue #84
|
|
146
|
+
2. ❌ Skip: Didn't review RFC
|
|
147
|
+
3. ❌ Skip: Started coding without understanding requirements
|
|
148
|
+
4. ❌ Skip: No test cases written
|
|
149
|
+
5. ❌ Skip: Didn't verify tests pass
|
|
150
|
+
6. ❌ Skip: No code review process
|
|
151
|
+
Result: Incomplete, untested implementation
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 🔥 MANDATORY COMPLETION CHECKLIST
|
|
155
|
+
|
|
156
|
+
**Before claiming implementation is complete, verify ALL items:**
|
|
157
|
+
|
|
158
|
+
### ✅ Implementation Checklist
|
|
159
|
+
- [ ] RFC reviewed and understood
|
|
160
|
+
- [ ] Code changes implemented according to design
|
|
161
|
+
- [ ] All test cases created and passing
|
|
162
|
+
- [ ] Evidence provided in GitHub issue
|
|
163
|
+
- [ ] PR feedback addressed (if applicable)
|
|
164
|
+
|
|
165
|
+
### ✅ CRITICAL FINAL STEPS
|
|
166
|
+
- [ ] **Issue status updated from `status:wip` to `status:needs-review`**
|
|
167
|
+
- [ ] **Status change verified successfully**
|
|
168
|
+
- [ ] **User notified that issue is ready for review**
|
|
169
|
+
|
|
170
|
+
**🚨 FAILURE TO COMPLETE THE STATUS UPDATE MEANS THE WORK IS NOT DONE! 🚨**
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Issue Resolution Workflow
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To provide a systematic approach to resolving issues from development through merge verification and cleanup, ensuring no work is lost and all changes are properly integrated into the main codebase.
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- **Verification First**: Always verify merges before closing issues
|
|
8
|
+
- **Complete Cleanup**: Remove all traces of feature branches
|
|
9
|
+
- **No Work Loss**: Prevent incidents like Issue #112 through proper verification
|
|
10
|
+
- **Systematic Process**: Follow established steps in order
|
|
11
|
+
- **Evidence-Based**: Provide concrete verification of completion
|
|
12
|
+
|
|
13
|
+
## CRITICAL DEPENDENCY
|
|
14
|
+
**This workflow MUST be used in conjunction with `.ai-agents/rules/merge-requirements.md`** which contains:
|
|
15
|
+
- **Pre-Push Workflow** (for feature branches during development)
|
|
16
|
+
- **PR Description Template** (for PR creation)
|
|
17
|
+
- **Final Merge Process** (for merging to master - used in this workflow)
|
|
18
|
+
- **Conflict Resolution Guide** (for resolving conflicts during rebase)
|
|
19
|
+
|
|
20
|
+
**Note**: The Pre-Push workflow applies to feature branch development. This resolve.md workflow focuses on the **final merge into master** and uses the Final Merge Process from merge-requirements.md.
|
|
21
|
+
|
|
22
|
+
## RESOLUTION WORKFLOW
|
|
23
|
+
|
|
24
|
+
**PREREQUISITE**: This workflow assumes:
|
|
25
|
+
- ✅ All development work is complete
|
|
26
|
+
- ✅ All tests have been run on the feature branch
|
|
27
|
+
- ✅ PR has been created and approved
|
|
28
|
+
- ✅ Feature branch is ready for merge
|
|
29
|
+
|
|
30
|
+
### 1. Execute the Merge
|
|
31
|
+
Use GitHub MCP to merge the PR:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Merge the PR using GitHub MCP
|
|
35
|
+
gh pr merge <PR_NUMBER> --rebase
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**If conflicts occur during merge:**
|
|
39
|
+
- GitHub will reject the merge with conflict details
|
|
40
|
+
- Use `gh pr view <PR_NUMBER>` to see conflict details
|
|
41
|
+
- Resolve conflicts intelligently using the **Conflict Resolution Guide** from `merge-requirements.md`
|
|
42
|
+
- Keep master's base implementation and add your enhancements on top
|
|
43
|
+
- Test the resolution: `npm run build && npm run test-smoke test*.ts`
|
|
44
|
+
- Push the resolved changes and retry the merge
|
|
45
|
+
|
|
46
|
+
### 2. Wait for Master CI Smoke Tests
|
|
47
|
+
After successful merge, monitor the master branch CI:
|
|
48
|
+
- Check GitHub Actions for the master branch
|
|
49
|
+
- Wait for smoke tests to complete successfully
|
|
50
|
+
- **CRITICAL**: Do not proceed until CI passes
|
|
51
|
+
|
|
52
|
+
### 3. Verify Code Made it to Master
|
|
53
|
+
**MANDATORY**: Confirm the merge was successful:
|
|
54
|
+
```bash
|
|
55
|
+
# Check PR is merged, not just closed
|
|
56
|
+
gh pr view <PR_NUMBER> --json merged
|
|
57
|
+
|
|
58
|
+
# Verify merge commit in master
|
|
59
|
+
git fetch origin master
|
|
60
|
+
git log origin/master --oneline | grep "PR #<PR_NUMBER>"
|
|
61
|
+
|
|
62
|
+
# Verify files in master
|
|
63
|
+
git show origin/master:path/to/expected/file
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 4. Handle CI Failures
|
|
67
|
+
**If master CI fails:**
|
|
68
|
+
- Debug the issue immediately
|
|
69
|
+
- Fix the problem in the feature branch
|
|
70
|
+
- Push the fix and re-merge
|
|
71
|
+
- Repeat until CI passes
|
|
72
|
+
- **Do not close the issue until CI passes**
|
|
73
|
+
|
|
74
|
+
### 5. Confirm all good
|
|
75
|
+
**Only after CI passes successfully:**
|
|
76
|
+
|
|
77
|
+
**Add Resolution Comment if conflicts with master had to be resolved:**
|
|
78
|
+
- Add a comment to the issue using GitHub MCP:
|
|
79
|
+
```bash
|
|
80
|
+
gh issue comment <ISSUE_NUMBER> --body "✅ Encountered conflicts during merge with master.
|
|
81
|
+
|
|
82
|
+
**Conflict Resolution Notes:**
|
|
83
|
+
- Resolved conflicts in: [list files with conflicts]
|
|
84
|
+
- Resolution strategy: [explain what was done]
|
|
85
|
+
- Kept master's base implementation and added enhancements on top"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Verify the following:**
|
|
89
|
+
1. ✅ **PR Status**: PR shows "merged" status, not just "closed"
|
|
90
|
+
2. ✅ **Merge Commit**: Verify merge commit exists in master
|
|
91
|
+
3. ✅ **Files in Master**: Confirm expected files are present in master
|
|
92
|
+
|
|
93
|
+
### **Verification Commands**
|
|
94
|
+
```bash
|
|
95
|
+
# Check PR is merged, not just closed
|
|
96
|
+
gh pr view <PR_NUMBER> --json merged
|
|
97
|
+
|
|
98
|
+
# Verify merge commit in master
|
|
99
|
+
git fetch origin master
|
|
100
|
+
git log origin/master --oneline | grep "PR #<PR_NUMBER>"
|
|
101
|
+
|
|
102
|
+
# Verify files in master
|
|
103
|
+
git show origin/master:path/to/expected/file
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**CRITICAL**: Do not close the issue until merge verification passes. This prevents work loss incidents
|
|
107
|
+
|
|
108
|
+
### 6. Issue Resolution & Cleanup
|
|
109
|
+
**Close the Issue:**
|
|
110
|
+
- Close the issue with resolution comment using GitHub MCP:
|
|
111
|
+
```bash
|
|
112
|
+
gh issue close <ISSUE_NUMBER> --comment "✅ Issue resolved and merged to master. CI smoke tests passed."
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Cleanup Branch:**
|
|
116
|
+
```bash
|
|
117
|
+
npx tsx .ai-agents/scripts/cleanup-branch.ts
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 7. Celebrate
|
|
121
|
+
- Say Hoorah !
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## EXAMPLES
|
|
125
|
+
|
|
126
|
+
### Good: Proper Resolution Process
|
|
127
|
+
```
|
|
128
|
+
Issue #84: "Fix API integration timeout"
|
|
129
|
+
PREREQUISITE: ✅ Development complete, tests passed, PR approved
|
|
130
|
+
1. ✅ Merge: Used `gh pr merge <PR_NUMBER> --rebase`
|
|
131
|
+
2. ✅ Conflicts: Resolved conflicts intelligently (kept master's base)
|
|
132
|
+
3. ✅ CI Wait: Waited for master CI smoke tests to pass
|
|
133
|
+
4. ✅ Verification: Confirmed merge commit exists in master
|
|
134
|
+
5. ✅ Schema: Cleaned up database schema BEFORE branch deletion
|
|
135
|
+
6. ✅ Comment: Added resolution comment with conflict resolution notes
|
|
136
|
+
7. ✅ Close: Closed issue with resolution comment using `gh issue close`
|
|
137
|
+
8. ✅ Cleanup: Deleted branch after schema cleanup
|
|
138
|
+
Result: Complete resolution with no work loss
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Bad: Incomplete Resolution
|
|
142
|
+
```
|
|
143
|
+
Issue #84: "Fix API integration timeout"
|
|
144
|
+
PREREQUISITE: ✅ Development complete, tests passed, PR approved
|
|
145
|
+
1. ✅ Merge: Used `gh pr merge <PR_NUMBER> --rebase`
|
|
146
|
+
2. ❌ Skip: Didn't wait for master CI smoke tests
|
|
147
|
+
3. ❌ Skip: Didn't verify merge commit exists
|
|
148
|
+
4. ❌ Skip: Didn't clean up schema BEFORE branch deletion
|
|
149
|
+
5. ❌ Skip: Didn't add resolution comment with conflict notes
|
|
150
|
+
6. ❌ Close: Closed issue without CI verification
|
|
151
|
+
Result: Work lost, schema not cleaned up, CI may have failed
|
|
152
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Retrospective Creation
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To capture learnings and insights from completed issues, enabling continuous improvement and preventing future similar problems through systematic analysis and documentation.
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- Every completed issue requires a retrospective
|
|
8
|
+
- Focus on root causes, not just symptoms
|
|
9
|
+
- Document both successes and failures
|
|
10
|
+
- Create actionable prevention measures
|
|
11
|
+
- Share learnings with other agents
|
|
12
|
+
|
|
13
|
+
## WORKFLOW
|
|
14
|
+
|
|
15
|
+
1. **Label the issue** `status:wip` and remove `status:complete`
|
|
16
|
+
2. **Create retrospective document** using the template
|
|
17
|
+
3. **Complete retrospective** following the quality checklist
|
|
18
|
+
4. **When ready for review**, flip issue to `status:needs-review` and remove `status:wip`
|
|
19
|
+
5. **Iterate** until the PR is approved
|
|
20
|
+
|
|
21
|
+
## RETROSPECTIVE TRIGGERS
|
|
22
|
+
|
|
23
|
+
- **All Issues**: Every completed issue requires a retrospective
|
|
24
|
+
- **Complex Issues (>3 iterations)**: Must create detailed retrospective
|
|
25
|
+
- **Process Violations**: Any workflow rule violations require detailed retrospectives
|
|
26
|
+
- **Work Loss Incidents**: Any incidents where work is lost require detailed retrospectives
|
|
27
|
+
|
|
28
|
+
## RETROSPECTIVE CREATION PROCESS
|
|
29
|
+
|
|
30
|
+
### 1. Create Retrospective File
|
|
31
|
+
- **File path**: `retrospectives/issue-{issue-number}-{kebab-title}-postmortem.md`
|
|
32
|
+
- **Template**: Use `.ai-agents/templates/retrospective/RETROSPECTIVE-TEMPLATE.md` as the base
|
|
33
|
+
- **Copy template**: Copy the template file and fill in the placeholders
|
|
34
|
+
|
|
35
|
+
### 2. Root Cause Analysis
|
|
36
|
+
- Identify underlying causes, not just symptoms
|
|
37
|
+
- Document what went wrong and why
|
|
38
|
+
- Analyze process failures and human errors
|
|
39
|
+
- Look for patterns that could affect other issues
|
|
40
|
+
|
|
41
|
+
### 3. Prevention Measures
|
|
42
|
+
- Document specific actions to prevent recurrence
|
|
43
|
+
- Update rules and workflows based on learnings
|
|
44
|
+
- Share solutions with other agents through issue comments
|
|
45
|
+
- Identify process improvements
|
|
46
|
+
|
|
47
|
+
### 4. Document Success Factors
|
|
48
|
+
- What worked well and why
|
|
49
|
+
- Best practices discovered
|
|
50
|
+
- Tools and techniques that helped
|
|
51
|
+
- Lessons that can be applied to future issues
|
|
52
|
+
|
|
53
|
+
## RETROSPECTIVE QUALITY CHECKLIST
|
|
54
|
+
|
|
55
|
+
Before marking retrospective complete, verify:
|
|
56
|
+
- [ ] Root cause analysis completed (not just symptoms)
|
|
57
|
+
- [ ] Prevention measures documented
|
|
58
|
+
- [ ] Process improvements identified
|
|
59
|
+
- [ ] Success factors captured
|
|
60
|
+
- [ ] Action items are specific and actionable
|
|
61
|
+
- [ ] Template followed completely
|
|
62
|
+
- [ ] File saved in correct location
|
|
63
|
+
- [ ] All placeholders replaced with actual content
|
|
64
|
+
- [ ] Timeline of events is accurate and complete
|
|
65
|
+
- [ ] Lessons learned are actionable
|
|
66
|
+
|
|
67
|
+
## EXAMPLES
|
|
68
|
+
|
|
69
|
+
### Good: Comprehensive Retrospective
|
|
70
|
+
```
|
|
71
|
+
- Root cause: "Agent didn't verify workspace directory before file operations"
|
|
72
|
+
- Prevention: "Added mandatory pwd check before any file operation"
|
|
73
|
+
- Learning: "Workspace violations are common without explicit safeguards"
|
|
74
|
+
- Git Issues Suggested: "Update local-development.mdc with verification checklist"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Bad: Surface-Level Retrospective
|
|
78
|
+
```
|
|
79
|
+
- Problem: "File created in wrong location"
|
|
80
|
+
- Solution: "Moved file to correct location"
|
|
81
|
+
- Learning: "Need to be more careful"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**CRITICAL**: Do not close the issue until retrospective is created, reviewed, and approved.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Specification Phase
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To create comprehensive, detailed product specifications that clarify the Why, What and User Experiences for new features
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- **Start with the User**: Understand the user's needs and experiences before implementing
|
|
8
|
+
- **User Experience Matters**: Focus on creating a great user experience right from the beginning
|
|
9
|
+
- **Validation Criteria**: Define clear validation criteria to ensure the feature meets user needs
|
|
10
|
+
|
|
11
|
+
## SPECIFICATION WORKFLOW
|
|
12
|
+
|
|
13
|
+
### Step 1: Issue Identification
|
|
14
|
+
Ask for {issue_number} (and optional {slug}). Get slug details using GitHub MCP.
|
|
15
|
+
|
|
16
|
+
### Step 2: Phase Initiation
|
|
17
|
+
Label the issue 'phase:spec' (GitHub Action will automatically label the issue `status:wip` and update the existing draft PR)
|
|
18
|
+
|
|
19
|
+
### Step 3: Environment Setup
|
|
20
|
+
**IMPORTANT**: The user has already run `prep-issue.sh` which has:
|
|
21
|
+
- ✅ Created the feature branch
|
|
22
|
+
- ✅ Checked out the branch
|
|
23
|
+
- ✅ Created draft PR
|
|
24
|
+
- ✅ Indexed the codebase with Serena
|
|
25
|
+
- ✅ Opened the editor in the prepared workspace
|
|
26
|
+
|
|
27
|
+
You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
|
|
28
|
+
|
|
29
|
+
### Step 4: Work Location
|
|
30
|
+
You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
|
|
31
|
+
|
|
32
|
+
### Step 5: Pre-Creation Validation
|
|
33
|
+
Before creating any specification document, agents MUST:
|
|
34
|
+
|
|
35
|
+
1. **Verify Template Selection**:
|
|
36
|
+
- Use `.ai-agents/templates/specs/FEATURESPEC-TEMPLATE.md`
|
|
37
|
+
|
|
38
|
+
2. **Validate Naming Convention**:
|
|
39
|
+
- Format: `docs/feature specs/{issue_number}-{kebab-title}.md`
|
|
40
|
+
- Example: `docs/feature specs/228-improve-token-refresh.md`
|
|
41
|
+
- NO other naming patterns allowed
|
|
42
|
+
|
|
43
|
+
3. **Template Compliance Check**:
|
|
44
|
+
- Read and understand the template first
|
|
45
|
+
|
|
46
|
+
### Step 6: Specification Document Creation
|
|
47
|
+
Your work entails the following:
|
|
48
|
+
- Create docs/feature specs/{issue_number}-{slug}.md.
|
|
49
|
+
- Understand the issue, the existing product functionality. Use playwright for manually looking through the UI if needed.
|
|
50
|
+
- Research and document the why, what and user experiences for the feature.
|
|
51
|
+
- Create UI mockups for the feature under `docs/feature specs/mocks/` directory. Make them good looking and user friendly.
|
|
52
|
+
- Create a validation plan for the feature. You will be validating what the engineers build.
|
|
53
|
+
|
|
54
|
+
### Step 7: Specification Creation Checklist
|
|
55
|
+
Before commiting your work, verify:
|
|
56
|
+
- [ ] Correct template used
|
|
57
|
+
- [ ] Proper file naming: `{issue_number}-{kebab-title}.md`
|
|
58
|
+
- [ ] All template sections completed
|
|
59
|
+
- [ ] No placeholder text remaining
|
|
60
|
+
- [ ] Issue labeled `phase:spec`
|
|
61
|
+
- [ ] Working in correct branch
|
|
62
|
+
- [ ] File saved in `docs/feature specs/` directory
|
|
63
|
+
- [ ] UI mocks, if needed, created in `docs/feature specs/mocks/` directory
|
|
64
|
+
- [ ] Validation plan created
|
|
65
|
+
|
|
66
|
+
### Step 8: Submit for Review
|
|
67
|
+
- Commit and sync your work
|
|
68
|
+
- Label the issue 'status:needs-review' and remove 'status:wip'
|
|
69
|
+
- Update the PR with a comment to include evidence - Use template `.ai-agents/templates/evidence/Spec-Evidence.md`
|
|
70
|
+
- Follow `.ai-agents/rules/pr-workflow-completeness.md`
|
|
71
|
+
|
|
72
|
+
### Step 9: Iteration
|
|
73
|
+
If workflow actions or reviewer feedback indicates more work is needed:
|
|
74
|
+
- Label the issue 'status:wip' and remove 'status:needs-review'
|
|
75
|
+
- Go back to Step 6 and iterate until PR is approved
|
|
76
|
+
|
|
77
|
+
## EXAMPLES
|
|
78
|
+
|
|
79
|
+
### Good: Comprehensive Specification Process
|
|
80
|
+
```
|
|
81
|
+
Issue #228: "Improve token refresh mechanism"
|
|
82
|
+
1. ✅ Identified: Issue #228, slug: "improve-token-refresh"
|
|
83
|
+
2. ✅ Phase: Set phase:spec, PR created
|
|
84
|
+
3. ✅ Environment: User ran prep-issue.sh, ready to work
|
|
85
|
+
4. ✅ Location: Working in prepared workspace with Serena indexing
|
|
86
|
+
5. ✅ Specification: Created docs/feature specs/228-improve-token-refresh.md
|
|
87
|
+
6. ✅ Template: Used FEATURESPEC-TEMPLATE.md
|
|
88
|
+
7. ✅ Review: Set status:needs-review, provided evidence
|
|
89
|
+
8. ✅ Iteration: Incorporated feedback, updated specification
|
|
90
|
+
Result: Clear, actionable specification document
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Bad: Incomplete Specification Process
|
|
94
|
+
```
|
|
95
|
+
Issue #228: "Improve token refresh mechanism"
|
|
96
|
+
1. ✅ Identified: Issue #228
|
|
97
|
+
2. ❌ Skip: Didn't set phase:spec
|
|
98
|
+
3. ❌ Skip: Didn't create branch
|
|
99
|
+
4. ❌ Skip: Started without proper template
|
|
100
|
+
5. ❌ Skip: No UI mockups created
|
|
101
|
+
6. ❌ Skip: No validation plan
|
|
102
|
+
Result: Incomplete, unclear specification
|
|
103
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Testing Phase
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To create comprehensive test coverage that accurately reproduces issues and validates solutions, ensuring robust testing through proper test structure, failure verification, and systematic test execution.
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- **Test-Driven**: Write tests that reproduce the issue before fixing
|
|
8
|
+
- **Comprehensive Coverage**: Ensure all scenarios are tested
|
|
9
|
+
- **Failure Verification**: Confirm tests fail before implementation
|
|
10
|
+
- **Proper Structure**: Use established test patterns and frameworks
|
|
11
|
+
- **Systematic Execution**: Follow consistent testing procedures
|
|
12
|
+
|
|
13
|
+
## TESTING WORKFLOW
|
|
14
|
+
|
|
15
|
+
### Step 1: Issue Identification
|
|
16
|
+
Ask for {issue_number} (and optional {slug}); confirm target branch feature/{issue_number}-{slug}.
|
|
17
|
+
|
|
18
|
+
### Step 2: Phase Initiation
|
|
19
|
+
Label the issue 'phase:tests'. (GitHub Action will automatically label the issue `status:wip` and update the existing draft PR)
|
|
20
|
+
|
|
21
|
+
### Step 3: Environment Setup
|
|
22
|
+
**IMPORTANT**: The user has already run `prep-issue.sh` which has:
|
|
23
|
+
- ✅ Created the feature branch
|
|
24
|
+
- ✅ Checked out the branch
|
|
25
|
+
- ✅ Created draft PR
|
|
26
|
+
- ✅ Indexed the codebase with Serena
|
|
27
|
+
- ✅ Opened the editor in the prepared workspace
|
|
28
|
+
|
|
29
|
+
You can start working immediately in the prepared environment. No need to create branches or wait for GitHub Actions.
|
|
30
|
+
|
|
31
|
+
### Step 4: Work Location
|
|
32
|
+
You are already in the correct workspace prepared by the user. Confirm you're on the right branch and start working.
|
|
33
|
+
|
|
34
|
+
### Step 5: Testing Work
|
|
35
|
+
Your work entails the following:
|
|
36
|
+
|
|
37
|
+
- Review the RFC associated with this issue.
|
|
38
|
+
- Determine whether tests need to be added to an existing test suite, or a new one needs to be created.
|
|
39
|
+
- **CRITICAL: Write INTEGRATION tests that demonstrate the REAL USER SCENARIO**
|
|
40
|
+
- Test the actual end-to-end user experience, not unit tests for hypothetical fixes
|
|
41
|
+
- Use real services and APIs where possible (not mocks)
|
|
42
|
+
- Verify the issue occurs in the real system as described in the issue
|
|
43
|
+
- Example: For messaging threading issues, actually send messages and verify they appear as new messages vs replies
|
|
44
|
+
- Run the test cases to ensure they fail (demonstrating the issue exists)
|
|
45
|
+
- Flip issue to 'status:needs-review' and remove 'status:wip'
|
|
46
|
+
|
|
47
|
+
**❌ DO NOT:**
|
|
48
|
+
- Write unit tests for code that doesn't exist yet
|
|
49
|
+
- Test hypothetical fixes or solutions
|
|
50
|
+
- Create mock tests that don't use real services
|
|
51
|
+
- Test individual components in isolation
|
|
52
|
+
|
|
53
|
+
**✅ DO:**
|
|
54
|
+
- Test the complete user workflow end-to-end
|
|
55
|
+
- Use real APIs and services when possible
|
|
56
|
+
- Verify the actual problem described in the issue
|
|
57
|
+
- Create tests that will pass AFTER the fix is implemented
|
|
58
|
+
|
|
59
|
+
### Step 6: Iteration
|
|
60
|
+
If workflow actions or reviewer feedback indicates more work is needed, ensure the issue is set back to `status:wip` and continue working as above.
|
|
61
|
+
|
|
62
|
+
## EXAMPLES
|
|
63
|
+
|
|
64
|
+
### Good: Comprehensive Testing Process
|
|
65
|
+
```
|
|
66
|
+
Issue #84: "Fix API integration timeout"
|
|
67
|
+
1. ✅ Identified: Issue #84, branch feature/84-fix-api
|
|
68
|
+
2. ✅ Phase: Set phase:tests, PR created
|
|
69
|
+
3. ✅ Environment: User ran prep-issue.sh, ready to work
|
|
70
|
+
4. ✅ Location: Working in prepared workspace with Serena indexing
|
|
71
|
+
5. ✅ RFC Review: Read docs/rfcs/84-fix-api-timeout.md
|
|
72
|
+
6. ✅ Analysis: Determined need to add timeout tests
|
|
73
|
+
7. ✅ Test Creation: Added test cases for timeout scenarios
|
|
74
|
+
8. ✅ Failure Verification: Confirmed tests fail before fix
|
|
75
|
+
9. ✅ Review: Set status:needs-review
|
|
76
|
+
10. ✅ Iteration: Incorporated feedback, updated tests
|
|
77
|
+
Result: Comprehensive test coverage with proper structure
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Bad: Incomplete Testing Process
|
|
81
|
+
```
|
|
82
|
+
Issue #84: "Fix API integration timeout"
|
|
83
|
+
1. ✅ Identified: Issue #84
|
|
84
|
+
2. ❌ Skip: Didn't review RFC
|
|
85
|
+
3. ❌ Skip: Started testing without understanding requirements
|
|
86
|
+
4. ❌ Skip: No test cases written
|
|
87
|
+
5. ❌ Skip: Didn't verify tests fail
|
|
88
|
+
6. ❌ Skip: No test structure followed
|
|
89
|
+
Result: Incomplete, ineffective testing
|
|
90
|
+
```
|